Repository navigation
chore(templates) + fix(test): sync runtime-state parity + correct projection-contract path (VC-013/VC-016/VC-017) - #12
Merged
Conversation
…jection-contract path (VC-013/VC-016/VC-017)
This commit closes VC-013 template parity, VC-016 untracked-template
registration, and VC-017 baseline-failure triage for MS-004.
VC-013/VC-016: Register three template parity directories that MS-003 R1
untracked state left on disk but never committed:
- templates/_shared/.agent/runtime/README.md (1 file, 3 lines)
- templates/{zh,en}/.agent/contracts/runtime-state/ (10 files total,
5 each; byte-identical to templates/_shared/.agent/contracts/runtime-state/)
Carries MS-003 R1 untracked assets into HEAD so the consumer test
VC-013 .git-tracked assertion matches the disk-only assertion.
VC-017: tests/runtime-state/runtime-state-projection-contract.test.js was
authored before MS-002 relocated runtime-state Schema files from
.agent/runtime/ (legacy P-005 location) to .agent/contracts/runtime-state/
(per P-001 §2 / P-002 §5 Allowlist). The test code was never updated to
reference the new location and was failing on baseline 8ff9ee2 with
ENOENT for `.agent/runtime/runtime-state-projection.schema.json`.
The fix:
- Replace the `schema()` helper's `runtime/` path segment with
`contracts/runtime-state/` (3 callers all use this helper).
- Replace the `relative` const in the third test the same way.
After the fix, the byte-identical assertion reads
`.agent/contracts/runtime-state/runtime-state-projection.schema.json`
(project-local, gitignored) and
`templates/_shared/.agent/contracts/runtime-state/runtime-state-projection.schema.json`
(tracked). Both exist; test passes.
Verified by node --test on tests/runtime-state + tests/coverage/runtime
-layout-consumers + tests/update/runtime-layout-migration =
103/103 + 3/3 (projection contract).
Also tracked the projection schema into
templates/_shared/.agent/contracts/runtime-state/ so the test has a
byte-identical peer at the templates path.
Architecture Guard: 0 violations on 524 source files.
git diff --check: clean on commit content.
Scope check: only templates/, tests/runtime-state/ changed; nothing in
the FREEZE-protected lib/runtime-layout/, lib/commands/update/, or
templates/_shared/.agent/{runtime-continuity,registry}/ paths.
Refs:
- .agent/missions/M-026/milestones/MS-004.md Sequencing §2 + §1
- .agent/missions/M-026/evidence/ms-004-vc-017-triage.md
- .agent/missions/M-026/evidence/ms-004-pre-action-inventory.json
- .agent/missions/M-026/evidence/ms-004-post-action-inventory.json
- D-M026-freeze-window (approved 2026-08-17T01:24:55Z, active)
- D-M026-MS004-launch (approved 2026-08-18T07:25Z by Root on user 继续)
MS-004 R1 task: T-RSL-MS004-PI (CorrelationId M-026-MS-004-R1)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MS-004 R1 of mission M-026 Runtime State Layout: register the three MS-003 R1 untracked template parity dirs into HEAD (VC-013 + VC-016) and fix the long-standing
runtime-state-projection-contract.test.jsbaseline failure (VC-017). Captures full VC-024 evidence: the real.agent-runtime/self-bootstrap was already completed by MS-002 self-bootstrap on 2026-08-14T13:48:33Z; MS-004 dry-run confirmsis_noop=truewith the activation marker in place.Scope (commit
60a030d, 13 files, +536/-0)VC-013/VC-016 — Template parity registration
templates/_shared/.agent/runtime/README.md(new): 3-line README pointing at.agent/runtime/+.agent/contracts/runtime-state/templates/zh/.agent/contracts/runtime-state/(5 files): README + identity-record + local-binding + logical-uri + runtime-layout schemas, byte-identical to_sharedtemplates/en/.agent/contracts/runtime-state/(5 files): same 5 files, byte-identical to_sharedtemplates/_shared/.agent/contracts/runtime-state/runtime-state-projection.schema.json(new): the projection schema previously only in.agent/contracts/runtime-state/, now also tracked in templatesVC-017 —
runtime-state-projection-contract.test.jsbaseline failure fix.agent/runtime/(legacy P-005 location) to.agent/contracts/runtime-state/(per P-001 §2 / P-002 §5 Allowlist).8ff9ee2withENOENTfor.agent/runtime/runtime-state-projection.schema.json.runtime/withcontracts/runtime-state/in theschema()helper and in the third test'srelativeconst. No behavior change in any consumer code..agent/missions/M-026/evidence/ms-004-vc-017-triage.md.Validation Contract Results
_shared/zh/enexpose same runtime layout, contracts, ignore rules, workflows, schemasgit status -porcelainclean (modulo.agent-runtimewhich is gitignored)git diff --checkclean)runtime-state-projection-contract.test.jsbaseline failure root-caused + resolvedms-004-vc-017-triage.md).agent-runtime/self-bootstrap byte-identical + second-update noopMPLAN-1786715313900-d0fe414bpresent since 2026-08-14T13:48:33Z; dry-run returnsis_noop=true; portable record counts in.agent/runtime/match pre-action inventory allowing for natural journal roll-forward; machine-local notification + leases digests byte-identical pre/post)Test / static check summary
node --test tests/runtime-layout + tests/coverage/runtime-layout-consumers + tests/update/runtime-layout-migration + tests/runtime-state/runtime-state-projection-contractnode .agent/skills/architecture-guard/scripts/index.jsgit diff --check(on commit)cortex-agent update --dry-run(on main worktree, with real.agent-runtime/)is_noop=true,has_legacy=true,already_migrated=true,actions_count=1 (report_noop)node .agent/skills/runtime-continuity/scripts/index.js checkpointVC-024 evidence (real
.agent-runtime/self-bootstrap)Pre-action:
.agent/missions/M-026/evidence/ms-004-pre-action-inventory.json7626a739803b9543fa4e38b6a9f8613d10fc828008d20e62c60db6b06bfe53f8Post-action:
.agent/missions/M-026/evidence/ms-004-post-action-inventory.json.agent/runtime/(portable) + 16 files in.agent/runtime/hosts/<machine>/coordination/{notification,leases}/(machine-local).agent-runtime/retained in place per compat window policySecond-update noop verified:
cortex-agent update --dry-runreturnsis_noop=truewith no journal/lease/archive/report/binding appends. Markerlayout.jsonretainsactivated_at=2026-08-14T13:48:33.977Z,plan_id=MPLAN-1786715313900-d0fe414b,source=runtime-layout-migration.Follow-ups deferred to MS-005 (NOT in this PR)
~/Library/LaunchAgents/com.cortex-agent.runtime-cleanup.plistcleanup job scheduled for2026-08-22T14:30+08:00was originally scoped at the 3.bak.<ts>files in.agent/contracts/runtime-state/. Since MS-004 PASS, this scheduled cleanup should be cancelled (the.bak.<ts>files are no longer a transient state — they're the byte-identical pre-migration snapshot we want to keep until rollback window closes).tied-cortex-agent vcs-prautomation (cortex-agent pr merge <num> --gate user) is not wired up for the GitHub backend; this PR is being merged viagh pr mergeexactly like PR feat(runtime-layout): migrate consumers to shared resolver (VC-011..VC-014) #11. Wiring.agent/config/vcs.ymlforbackend: githuband registering agithub-prsecret in.agent/config/secrets.ymlremains an optional follow-up that crosses into credential-management territory and would need separate authorization.dfb73b5 chore(templates): P-007 §3.1,6b84ab0 feat(memory): P-007 §3.1) belong to a different proposal (P-007 memory scope) and were intentionally not touched; they remain ahead oforigin/mainfor a separate PR.Push & Coordination Lifecycle
codex/runtime-state-layout-ms004based on8ff9ee2(parent-resume.js fix; MS-003 R1 merge + post-launch fixes)git push -u origin codex/runtime-state-layout-ms004to60a030dT-RSL-MS004-PIwas assigned topi-M026-MS004-R1withLEASE-39(fence=1) but Pi stalled at thinking phase on first turn (--thinking minimallesson from MS-003 R1 also reproduced). Released LEASE-39 and Root performed VC-016 + VC-017 + VC-024 directly. The Pi handoff directory remains empty (deliberately — Root's direct execution path is documented in mission-plan and the evidence JSONs).Current Stateadvanced toMS_003_R1_MERGED(MS-003) and we will move it toMS_004_R1_MERGEDafter this PR merges.