3333// owner" shape as R7's SessionState ownership, applied to bin.ts's `--help` fast path.
3434// - Over PLATFORM PACKAGE COMPOSITION: six private metadata façades meet at the exact root
3535// composition file; premature implementation loading and forbidden cross-boundary edges fail (R13).
36- // - Over the DEVICES COMMAND CUTOVER: the handler calls the neutral inventory gateway and no
37- // superseded inventory module, import, or identifier remains in production (R13).
38- // - Over COMMAND-ATOMIC RUNTIME CUTOVERS: retired logs, network, and record routes/admission cannot
39- // coexist with their operation-fact-derived descriptor and handler paths (R14-R16) .
36+ // - Over COMMAND-ATOMIC RUNTIME CUTOVERS: one parametrized gate reads the migrated-command
37+ // table (devices R13, logs R14, network R15, record R16) and proves each command keeps
38+ // exactly one platform-execution path — retired routes, admission, modules, and widened
39+ // runtime access cannot coexist with its operation-fact-derived descriptor and handler.
4040// Only `(root)` is unranked among src/ zones (see `UNRANKED_ZONES` in model.ts):
4141// it holds entrypoints and composition roots. Extracted workspace package zones
4242// are classified separately and held behind R11 instead of the src folder spine.
@@ -87,32 +87,15 @@ import {
8787 platformPackagePolicySummary ,
8888} from './platform-package-policy.ts' ;
8989import {
90- checkDeviceInventoryCutover ,
91- deviceInventoryCutoverSummary ,
92- } from './device-inventory -cutover-policy.ts' ;
90+ checkRuntimeCommandCutover ,
91+ runtimeCommandCutoverSummary ,
92+ } from './runtime-command -cutover-policy.ts' ;
9393import {
9494 listUntrackedProductionTypeScriptFiles ,
9595 readTrackedPlatformPackageDeclarations ,
9696} from './platform-package-repository.ts' ;
9797import { policyLead , policyViolation , ZONE_POLICIES } from './zone-policy.ts' ;
98- import {
99- logsLegacyRouteViolations ,
100- logsRuntimeNarrowingViolations ,
101- logsSessionStateOwnershipViolations ,
102- sourceExecutedUsingDeclarationViolations ,
103- } from './logs-runtime-cutover-policy.ts' ;
10498import { contractsImplementationAuthorityViolations } from './contracts-implementation-policy.ts' ;
105- import {
106- networkLegacyRouteViolations ,
107- networkRuntimeNarrowingViolations ,
108- networkRuntimeRouteViolations ,
109- } from './network-runtime-cutover-policy.ts' ;
110- import {
111- recordLegacyRouteViolations ,
112- recordRuntimeNarrowingViolations ,
113- recordRuntimeRouteViolations ,
114- } from './record-runtime-cutover-policy.ts' ;
115- import { recordRuntimeDaemonMechanicsViolations } from './record-runtime-mechanics-policy.ts' ;
11699import { recordRuntimeRegistryJoinViolations } from './record-runtime-registry-policy.ts' ;
117100
118101const repoRoot = execFileSync ( 'git' , [ 'rev-parse' , '--show-toplevel' ] , {
@@ -191,16 +174,6 @@ function checkCycles(edges: readonly ResolvedImportEdge[]): LayeringViolation[]
191174 } ) ) ;
192175}
193176
194- function checkLogsRuntimeCutover ( sources : ReadonlyMap < string , string > ) : LayeringViolation [ ] {
195- const production = [ ...sources ] . map ( ( [ file , source ] ) => ( { path : file , source } ) ) ;
196- return [
197- ...logsLegacyRouteViolations ( production ) ,
198- ...logsRuntimeNarrowingViolations ( production ) ,
199- ...logsSessionStateOwnershipViolations ( production ) ,
200- ...sourceExecutedUsingDeclarationViolations ( production ) ,
201- ] ;
202- }
203-
204177function checkContractsImplementationAuthority (
205178 sources : ReadonlyMap < string , string > ,
206179) : LayeringViolation [ ] {
@@ -209,32 +182,14 @@ function checkContractsImplementationAuthority(
209182 ) ;
210183}
211184
212- function checkNetworkRuntimeCutover ( sources : ReadonlyMap < string , string > ) : LayeringViolation [ ] {
213- const production = [ ...sources ] . map ( ( [ file , source ] ) => ( { path : file , source } ) ) ;
214- return [
215- ...networkLegacyRouteViolations ( production ) ,
216- ...networkRuntimeNarrowingViolations ( production ) ,
217- ...networkRuntimeRouteViolations ( production ) ,
218- ] . map ( ( violation ) => {
219- const separator = violation . indexOf ( ': ' ) ;
220- return {
221- rule : 'R15 network-runtime-cutover' ,
222- file : separator < 0 ? '(network runtime)' : violation . slice ( 0 , separator ) ,
223- line : 1 ,
224- message : separator < 0 ? violation : violation . slice ( separator + 2 ) ,
225- } ;
226- } ) ;
227- }
228-
229- function checkRecordRuntimeCutover ( sources : ReadonlyMap < string , string > ) : LayeringViolation [ ] {
185+ /**
186+ * The record registry-join scan is a descriptor-shape check, not a cutover claim, so it
187+ * stays its own module. Record's daemon-mechanics scan is the row's lifecycle proof and
188+ * runs from the cutover table. Both report under R16.
189+ */
190+ function checkRecordRuntimeRegistryJoin ( sources : ReadonlyMap < string , string > ) : LayeringViolation [ ] {
230191 const production = [ ...sources ] . map ( ( [ file , source ] ) => ( { path : file , source } ) ) ;
231- return [
232- ...recordLegacyRouteViolations ( production ) ,
233- ...recordRuntimeDaemonMechanicsViolations ( production ) ,
234- ...recordRuntimeNarrowingViolations ( production ) ,
235- ...recordRuntimeRegistryJoinViolations ( production ) ,
236- ...recordRuntimeRouteViolations ( production ) ,
237- ] . map ( ( violation ) => {
192+ return recordRuntimeRegistryJoinViolations ( production ) . map ( ( violation ) => {
238193 const separator = violation . indexOf ( ': ' ) ;
239194 return {
240195 rule : 'R16 record-runtime-cutover' ,
@@ -618,7 +573,7 @@ function report(
618573 `inside its declared owner (R7); every zero-dep CI job resolves without ` +
619574 `node_modules (R8); ${ typeCycleNote ( typeCycle ) } ; ${ daemonModularitySummary ( ) } ; ` +
620575 `${ packageBoundariesSummary ( repoRoot ) } ; ${ platformPackagePolicySummary ( ) } ; ` +
621- `${ deviceInventoryCutoverSummary ( ) } ; and bin.ts imports normalizeCliCommandAlias, ` +
576+ `${ runtimeCommandCutoverSummary ( ) } ; and bin.ts imports normalizeCliCommandAlias, ` +
622577 `actually passes it into buildCommandUsageText, and holds no local alias literals ` +
623578 `(R12).\n` ,
624579 ) ;
@@ -657,10 +612,9 @@ export function main(): number {
657612 const violations = [
658613 ...checkLayeringRules ( edges ) ,
659614 ...checkCycles ( edges ) ,
660- ...checkLogsRuntimeCutover ( sources ) ,
615+ ...checkRuntimeCommandCutover ( sources ) ,
616+ ...checkRecordRuntimeRegistryJoin ( sources ) ,
661617 ...checkContractsImplementationAuthority ( sources ) ,
662- ...checkNetworkRuntimeCutover ( sources ) ,
663- ...checkRecordRuntimeCutover ( sources ) ,
664618 ...checkContractsImplementationAuthority ( sources ) ,
665619 ...checkBackEdges ( edges ) ,
666620 ...checkTypeInversions ( edges ) ,
@@ -677,7 +631,6 @@ export function main(): number {
677631 readTrackedPlatformPackageDeclarations ( repoRoot ) ,
678632 { untrackedProductionFiles : listUntrackedProductionTypeScriptFiles ( repoRoot ) } ,
679633 ) ,
680- ...checkDeviceInventoryCutover ( sources ) ,
681634 ] ;
682635 return report ( sourceFiles , violations , typeCycle ) ;
683636}
0 commit comments