Skip to content

chore(#5056): gate evidence is typed and the exit code follows the verdict — Phase 8 #5170

Closed

Description

@trek-e

Pre-submission checklist

  • This does not change user-facing behavior (commands, output, file formats, config)
  • I have searched existing issues — this has not already been filed

Scope note on the first checkbox: gate payloads stay byte-identical. The one class of behavior change is stated in ADR-5057 §4 and #4686: a gate verb's exit status is now a function of its verdict, so a failing verdict no longer exits 0. It ships with a Fixed changeset.

What is the maintenance task?

Phase 8 of epic #5056 (ADR-5057 §4, third and fourth bullets): gate evidence is a typed result read through the document seams, and a gate verb's exit code is derived from its GateVerdict through the process exit contract (src/cli-exit.cts, ADR-3889). Depends on Phase 6 (merged in #5144).

Type of maintenance

Refactoring / code quality

Current state

  • Evidence<T> = found | none | unreadable does not exist. Gate return paths cannot tell "nothing there" from "could not read", so an unreadable input can produce a passing verdict.
  • Gates parse structured plan and document content with per-gate regexes instead of the Frontmatter Module, markdown-sectionizer, markdown-table and PlanningDoc.
  • emitGateResult in src/check-command-router.cts prints a verdict's payload and never sets an exit status; phase uat-passed and verify artifacts exit 0 while their JSON reports failure (bug(cli): phase uat-passed and verify.artifacts exit 0 while their JSON reports failure #4686).

Proposed work

Done when

  • Census published in the PR and driven to zero
  • Evidence<T> exists and does not admit a passing verdict on unreadable (type or property test, with a positive control)
  • Gates read structured content only through the document seams; per-gate regex parsers deleted
  • Gate verbs obtain their exit code only through cli-exit; a shell caller of phase uat-passed --require-verification and verify.artifacts gets a non-zero status whenever the verdict fails
  • A drift guard fails on a gate verb choosing its own exit code, with a positive control
  • Tests pass under gsd-test

Area affected

Multiple areas

Additional context

Epic: #5056. Design lock: ADR-5057 §4 and Phase 8. Evidence (Refs, all closed): #4562, #4541, #4259, #4686, #4031, #4176.

Activity

  1. added
    area: corePROJECT.md, REQUIREMENTS.md, templates
    type: choreMaintenance, refactoring
    on Oct 1, 2026
  2. github-actions commented on Oct 1, 2026

    @github-actions
    Contributor

    Branch chore/5170-chore-5056-gate-evidence-is-typed-and-th created.

    git fetch origin && git checkout chore/5170-chore-5056-gate-evidence-is-typed-and-th
  3. added 10 commits that reference this issue on Oct 2, 2026
  4. 93 remaining items

  5. added 14 commits that reference this issue on Oct 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: corePROJECT.md, REQUIREMENTS.md, templatestype: choreMaintenance, refactoring

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions