Skip to main content

Lifecycle Fault-Injection Matrix

Issue: service-lasso/service-lasso#881
Spec binding: AC-4BN in .governance/specs/SPEC-002-core-standalone-runtime.md

This matrix defines the deterministic fault-injection coverage required before the runtime lifecycle tranche can be closed. Fault hooks are test-only fixtures or harness controls. They must not be reachable from production runtime APIs, CLI commands, manifests, service environment, or packaged release builds.

Invariants​

IDInvariant
INV-1no unrelated or unverified process is terminated
INV-2no two committed endpoints overlap
INV-3one workspace has at most one authoritative active generation
INV-4durable state either describes reality or reports an explicit blocked/recovery state
INV-5rerunning the same command converges
INV-6temporary files, locks, reservations, and runtime resources do not remain indefinitely
INV-7final diagnosis is stable and machine-readable

Scenario Matrix​

IDScenarioLifecycle phasePlatform expectationAutomation mappingRequired invariantsStatus
FI-001crash before every atomic state writeinstall/config/start/stop/restartLinux CI direct; Windows and macOS contract coverage acceptable until native CI is availableplanned tests/lifecycle-fault-injection.test.js atomic write interruption fixturesINV-1, INV-3, INV-4, INV-5, INV-6, INV-7planned
FI-002crash after every atomic state writeinstall/config/start/stop/restartLinux CI direct; Windows and macOS contract coverage acceptable until native CI is availableplanned tests/lifecycle-fault-injection.test.js post-write interruption fixturesINV-1, INV-3, INV-4, INV-5, INV-6, INV-7planned
FI-003crash after reservation, materialisation, spawn, ownership persistence, and readinessstartup transactionUbuntu and Windows CI direct for every formal phasetests/startup-hard-crash-matrix*.test.js, shared protected bodies in tests/startup-hard-crash-matrix.js, tests/fixtures/startup-crash-runner.mjs, and .github/workflows/startup-hard-crash-matrix.yml; see docs/reference/startup-hard-crash-matrix.mdINV-1, INV-2, INV-3, INV-4, INV-5, INV-6, INV-7implemented
FI-004truncated registry or journalstartup/resumeCross-platform contract testexisting tests/process-ownership.test.js corrupt registry recovery plus planned journal fixtureINV-1, INV-3, INV-4, INV-5, INV-7partial
FI-005corrupt registry or journalstartup/resumeCross-platform contract testexisting tests/process-ownership.test.js corrupt registry recovery plus planned journal fixtureINV-1, INV-3, INV-4, INV-5, INV-7partial
FI-006unsupported-version registry or journalstartup/resume/migrationCross-platform contract testexisting tests/health-state.test.js unsupported future lifecycle state plus planned registry/journal version fixtureINV-1, INV-3, INV-4, INV-5, INV-7partial
FI-007stale PIDresume/stop/restartCross-platform direct where process identity is inspectableexisting tests/process-ownership.test.js exited owner and not-running identity proofINV-1, INV-3, INV-4, INV-5, INV-7partial
FI-008live PID owned by this workspacestartup/stopCross-platform directexisting tests/process-ownership.test.js owned process identity and confirmed stop proofINV-1, INV-3, INV-4, INV-5, INV-6, INV-7partial
FI-009reused PID or unverifiable PIDstartup/rehydrate/stopLinux CI direct for reused process; Windows adapter contract for identity evidenceexisting tests/process-ownership.test.js reused PID and Windows evidence testsINV-1, INV-3, INV-4, INV-5, INV-7partial
FI-010stale lifecycle or allocation lockstartup/resumeCross-platform contract testexisting tests/process-ownership.test.js abandoned lifecycle lock recovery plus planned allocation-lock fixtureINV-1, INV-2, INV-3, INV-4, INV-5, INV-6, INV-7partial
FI-011concurrently contested lifecycle or allocation lockstartup/concurrent startLinux CI direct; Windows contract coverage until process CI is availableplanned concurrent workspace harnessINV-1, INV-2, INV-3, INV-4, INV-5, INV-6, INV-7planned
FI-012preferred-port collisionconfig/startCross-platform directtests/endpoint-allocation.test.js plans the API and services together, retains the free API preference, and materialises the renegotiated service selectorINV-2, INV-4, INV-5, INV-6, INV-7implemented
FI-013fixed conflict and bind race after reservationconfig/startCross-platform directtests/endpoint-allocation.test.js proves fixed preflight failure before start and bounded post-reservation API EADDRINUSE replanning through an explicitly gated test hookINV-2, INV-4, INV-5, INV-6, INV-7implemented
FI-014wildcard versus loopback overlapconfig/startCross-platform directplanned endpoint allocator overlap fixtureINV-2, INV-4, INV-5, INV-6, INV-7planned
FI-015two workspaces and two generations starting concurrentlystartup/concurrent startLinux CI direct; Windows contract coverage until process CI is availableexisting npm run verify:multi-instance-ports plus planned generation concurrency fixtureINV-1, INV-2, INV-3, INV-4, INV-5, INV-6, INV-7partial
FI-016service with child and grandchild processesstop/restartWindows CI direct for job/process-tree identity; Linux CI direct for process group cleanupplanned process-tree fixtureINV-1, INV-3, INV-4, INV-5, INV-6, INV-7planned
FI-017failure midway through dependent rematerialisation or restartendpoint renegotiationCross-platform contract testplanned dependency cutover rollback fixtureINV-1, INV-2, INV-3, INV-4, INV-5, INV-6, INV-7planned
FI-018stop/restart when runtime API is unavailableCLI/offline recoveryCross-platform directplanned offline lifecycle command fixtureINV-1, INV-3, INV-4, INV-5, INV-6, INV-7planned
FI-019canonical checkout versus worktree wrong-lane verificationdemo/release gateCross-platform contract testplanned canonical demo verifier wrong-lane fixtureINV-1, INV-2, INV-3, INV-4, INV-5, INV-7planned

Closure Rule​

#881 can close only when each row is either direct automated proof in normal CI, Windows CI, or a documented platform-unavailable contract test with explicit confidence limits. Planned and partial rows are allowed during early slices, but final closure requires every row to map to a stable automated gate with bounded timeout and cleanup evidence.