The current governance runtime often owns the evidence needed to explain a
failure but its text renderer emits only code, message, paths and
remediation. Structured evidence such as firstImplementationCommit,
acceptedBaseSha, observedBaseSha, currentTargetSha, targetRef,
pathOwners and budget counters remains visible only in JSON.
The local and hosted entry points also answer different questions:
| Entry point | What it currently sees | Failure mode |
|---|---|---|
make governance |
primarily the working-tree diff | can pass before commit-history ordering is testable |
| push governance | the pushed ref without PR approval context | can pass while the PR-specific job later fails |
| PR governance | exact base/head commit range and approval boundary | finds history/order failures late |
| GitHub mergeability | the moving target branch | reports DIRTY without an intent-aware explanation |
Observed examples:
GOV-INTENT-003 knew the first implementation commit but text output did
not print its SHA or the required parent containing intent.json;main moved repeatedly while a PR was prepared, but no local report
presented accepted base, current target, merge base, ahead/behind counts and
conflicting paths together;delivery.requiredForImplementation is currently false in the target
manifest, so an acceptedBaseSha can be documented without activating the
deterministic GOV-BASE-001 gate.Do not create a second governance DSL. Add a diagnostic projection to the
planned discriminated t2c.branch/v1 contract:
{
"schemaVersion": "t2c.branch/v1",
"kind": "validation",
"repository": "semcod/todo2code",
"ticket": "ticket-021",
"base": {
"acceptedSha": "<40-hex>",
"currentTargetSha": "<40-hex>",
"mergeBaseSha": "<40-hex>"
},
"head": {
"sha": "<40-hex>",
"branch": "refs/heads/ticket/example",
"ahead": 2,
"behind": 1
},
"commitOrder": {
"intentCommit": "<40-hex-or-null>",
"firstImplementationCommit": "<40-hex-or-null>",
"valid": false
},
"findings": [
{
"code": "GOV-INTENT-003",
"expected": "intent committed in an ancestor of implementation",
"observed": "intent and implementation first appear together",
"evidence": {
"firstImplementationCommit": "<40-hex>",
"requiredParent": "<40-hex>"
},
"nextActions": [
"create a clean branch from the exact target SHA",
"commit the approved intent",
"commit implementation separately"
]
}
],
"verdict": "BLOCKED",
"fingerprint": "<sha256>"
}
The JSON artifact is canonical. Text and Markdown are deterministic views over the same fields and must never hide evidence carried by JSON.
todo2code governance explain \
--target-ref origin/main \
--head HEAD \
--ticket ticket-021 \
--format text|json|markdown
The command is read-only. Before push it should report:
READY, REVIEW_REQUIRED, REBASE_REQUIRED or BLOCKED verdict.Offline Git and governance facts remain available without GitHub or an LLM.
Unavailable remote evidence must be UNKNOWN, never silently treated as pass.
pre-push and displays
the same fingerprint. It must not duplicate policy evaluation.GOV-* rule semantics. Its
text renderer should expose structured evidence already present in findings;
todo2code must not fork those rules.t2c.branch/v1 and the existing governance JSON output.governance explain CLI view and tests.Each step is a separate ticket/workstream and must remain independently revertible. No step may automatically rebase, force-push, merge, close or delete a branch.