Conversation
added 10 commits
July 10, 2026 02:14
…eeded; status output formatting fix
…Removed); self-coherence.md
…d-drift silently reported as unknown Adversarial review of the P2/P3 diff surfaced two real bugs: 1. canWriteLedger used os.Stat(dispatchWorkflowPath) as a proxy for 'did this run's render happen', but that file can be a leftover from a PRIOR successful run. A failed identity-gate rerun (different --agent, no --workflow-pat-secret) would then rewrite the ledger's workflow render-contract fields using the new run's opts, corrupting the record for a file nothing this run touched. Fixed by threading runDispatchCds's own rendered bool through instead of re-deriving it from file presence. 2. When the live workflow's sha256 was confirmed to differ from the ledger, but the fresh-render comparison that classifies user_edit vs renderer_moved itself failed, the code fell back to DriftUnknown -- which is excluded from the top-level Drift bool, so a confirmed mismatch could be silently reported as no drift. Introduced DriftUnclassified (counts as drift) distinct from DriftUnknown (nothing to compare against at all).
…ing into internal/repostatus
…ad SHA; disclose CI-caught T-002 fix
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.
Refs #656 (Phase 1 of the #655
cn repolifecycle wave).Summary
schemas/repo_state.cue(checked-in, closed CUE schema forcn.repo.state.v1) + fixtures + a new CI job (repo-state-schema-check) — timestamp-freeness and no-lock-duplication are enforced structurally via CUE closedness.internal/repostate— pure types + deterministicMarshal().cn repo installnow writes/updates.cn/repo.state.jsonidempotently, including dispatch-workflow render-contract metadata (P2). Survives an orthogonal label-doctor failure when the render itself succeeded; does not write a stale/corrupted ledger when the render didn't happen this run.internal/dispatchrender(extracted fromrepoinstall.runDispatchCds) — single renderer-invocation authority shared by install and the new status command's drift comparison.cn repo status(+--json,--check) — read-only report of packages/lock/vendor sync, dispatch-workflow drift (matches_ledger / user_edit / renderer_moved / removed / unclassified), canonical label drift, orphan vendored packages, locally-edited managed files, and best-effort update-available.docs/development/design/cn-repo-status-MOCKS.md— mock-first design doc (A6), authored before implementation.Review
Adversarial review (independent subagent, not primed with the implementation narrative) found two real bugs during this cycle, both fixed with regression tests before this PR was opened — see
.cdd/unreleased/656/beta-review.mdfor full writeups:Test plan
go build ./... && go vet ./... && go test ./...(src/go)go build ./... && go vet ./... && go test ./...(label-doctor module)./scripts/ci/validate-repo-state.sh --self-testcn build→ real local index → realcn repo install→ realcn repo status(clean, drifted via hand-edit,--checkexit codes, zero-write verification)cn repo installoutput validated againstschemas/repo_state.cueviacue vet(not just hand-written fixtures)🤖 Generated with cds-dispatch (interactive session acting as the
cds-dispatchwake)