Skip to content

docs(adr): propose ADR 026 for verification tiers and CI governance - #1940

Merged
eric8810 merged 4 commits into
mainfrom
docs/025-verification-tiers-and-ci-governance
Nov 20, 2026
Merged

eric8810 merged 4 commits into
mainfrom
docs/025-verification-tiers-and-ci-governance

Conversation

@eric8810

@eric8810 eric8810 commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Propose ADR 026 (renumbered from 025 to leave 025 for #1941) to establish the repository's verification governance principles:

  • D1 — Three operational states & five verification tiers (L0–L4): separate Active gate, Retained (on-demand & sweep), and Dev / exploratory assets; map L0 (formal models), L1 (pure static form & contract checks, including ADR freeze), L2 (business flows for the reverse-dependency closure, plus workspace-coupled structural assembly checks), L3 (split: narrow OS-native boundaries in Active gate, full cross-platform/external-registry in Retained sweeps, interactive terminal E2E Retained local-only and never in CI workflows), and L4 (Retained execution, Active gate for harness self-checks).
  • D2 — Form-only automated checks & snapshot restraint: documentation guides contributors and states semantic contracts; automated checks enforce deterministic form/structure invariants only, split cleanly between pure static L1 checks (zero business compilation) and runtime-assembled projections (workspace-coupled alongside L2), keep committed generated snapshots minimal, and avoid introducing new brittle allowlist-backed literal scanners.
  • D3 — Test coverage discipline: lowest flow or contract layer that proves the contract, one owning layer per behavior, release-unreachable runtime/harness injection instead of CI-recompiling build flags, and balanced test-binary consolidation.
  • D4 — Recorded budgets & light/heavy physical isolation: recorded latency/resource budgets maintained outside the immutable ADR (never fixed by raising timeouts alone), cost disclosure for gate additions, and physical isolation of pure static checks from heavy workspace builds.
  • D5 — Impact-scoped routing, sweep prerequisite & platform minimalism: path-scoped routing on PRs and non-cancelling main pushes (with narrowing main gated on an active scheduled full sweep + triage/bisection), explicit path classification, scarce OS pools limited to source-verified platform-native boundaries, and periodic telemetry-driven pruning.

Scope & Related Work

Documentation-only (Decision status: Proposed.). Per ADR 008, delivery status, rollout steps and numeric budgets stay out of the ADR body and are tracked in issues and follow-up PRs:

Verification

  • node scripts/adr-check.mjs --base origin/main passed
  • git diff --check origin/main clean
  • All relative links in both English and Chinese ADR 026, docs/adr/README.md, and docs/INDEX.md resolve

Add proposed ADR 025 defining the five verification tiers (L0–L4,
including event-driven formal model verification), test coverage and
placement discipline, and CI governance rules, along with its mirrored
Chinese translation, index entries and a routing pointer in AGENTS.md.

Refs #1938

@yyhhyyyyyy yyhhyyyyyy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

APPROVE

This is a docs-only ADR. It follows docs/templates/adr.md (Context, Decision, Consequences, Non-goals, Supersession), is marked Proposed in both the English and Chinese files, and the relationship with ADR 008 is recorded in docs/adr/README.md:35 and in the ADR's Supersession section. The Chinese mirror under docs/zh/adr/ matches the English decisions and section structure, and docs/INDEX.md:52 links both files. All referenced paths exist and every relative link resolves.

Verification: git diff --check origin/main...HEAD passes, and node scripts/adr-check.mjs --base origin/main reports ADR freeze passed: 5 changed files. No conflict with main at 499d590 or the open PRs I could inspect.

One optional P3 note is inline on the L0 row. It does not block approval.


| Tier | Question answered | Scope | Trigger |
| --- | --- | --- | --- |
| **L0 — Design & formal** | Do the state-machine, protocol and handover invariants hold in the abstract? | Formal models (e.g. TLA+ specifications and `.cfg` properties), ADR immutability checks | **Event-driven on design/contract change**: when a formal model, protocol/event contract, recovery boundary or handover invariant changes. Not run on ordinary implementation PRs. |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional (P3): this row puts the ADR immutability check in L0, but the trigger does not name an ADR file change. A router implemented from this trigger list would skip L0 for a PR that edits an accepted ADR without the adr-erratum label, so the freeze check would not run; the current CI runs scripts/adr-check.mjs on every non-fork PR (.github/workflows/ci.yml:49-53). Fix: add an ADR file change to the L0 trigger, or state that the ADR freeze check stays on every PR.

@zerob13

zerob13 commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator

Two open PRs under #1919 already apply D4 and could be linked from the description (not the ADR body, per ADR 008):

Until #1920 merges, D4's "main pushes run to completion" differs from the current ci.yml; pointing to #1920 makes that a planned rollout rather than a contradiction.

@zerob13 zerob13 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review of the policy itself (non-blocking; the doc-format review above already covers structure and links). Inline points, in order of weight:

  1. D3 fixes numeric budgets in an ADR that becomes immutable once accepted, while Non-goals defers concrete values to workflow files and architecture guides.
  2. D4's path-scoped main routing relies on scheduled full sweeps that do not exist yet.
  3. L0 and L2 triggers are not mechanically decidable, or are narrower than today's selection.
  4. Runtime injection of release stamps / endpoints needs a production-safety bound.
  5. D2's "lowest layer" wording should be reconciled with AGENTS.md Testing.
  6. L4 "never gates an ordinary PR" should say how harness changes verify themselves.


### D3. CI gates operate under explicit budgets and light/heavy isolation

- **Hard latency and resource budgets**: every synchronous tier maintains an explicit wall-clock

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Budgets in an accepted ADR. Once accepted, these numbers can only change through a superseding ADR, yet they are tuning values that depend on runner pools and should follow measurements. They are also far from the current baseline in #1919 (passing verify median 29 min, workspace tests alone 14.2 min), so on acceptance almost every PR would count as a "regression". The Non-goals section also keeps concrete values out of the ADR. Suggest: the ADR requires that every synchronous tier has a recorded budget and that "approaching the budget is fixed by narrowing, not by raising timeouts"; the numbers live in docs/architecture/build.md and #1919.


### D4. Impact-scoped routing is the default, backed by scheduled full sweeps

- **Consistent routing on PRs and `main`**: both pull requests and pushes to `main` select only the

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ordering dependency with the sweep. Today a main push narrows only for docs-only changes and otherwise runs every group (scripts/ci-changes.mjs), and no workflow has a schedule trigger. If main is narrowed before the full sweep exists, cross-group coupling is no longer caught anywhere. Suggest stating that path-scoped main routing is allowed only while a full sweep is running, and what happens when the sweep fails: who triages it and how the failure is traced back to the commit that caused it, since per-commit signals then only cover the selected groups.


| Tier | Question answered | Scope | Trigger |
| --- | --- | --- | --- |
| **L0 — Design & formal** | Do the state-machine, protocol and handover invariants hold in the abstract? | Formal models (e.g. TLA+ specifications and `.cfg` properties), ADR immutability checks | **Event-driven on design/contract change**: when a formal model, protocol/event contract, recovery boundary or handover invariant changes. Not run on ordinary implementation PRs. |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

L0 trigger is a judgement call. "Protocol/event contract, recovery boundary or handover invariant changes" cannot be derived from paths, and the TLA+ models do not run in CI today (TLC needs Java and the tools jar from outside the repo, per capability-models/README.md). Suggest splitting it: (a) a mechanical trigger on docs/design/examples/capability-models/**, with its cost disclosed under D3 (Java + TLC runtime); (b) for implementation changes, a PR-template checkbox that a reviewer confirms, i.e. "touches a modelled guarantee → update and rerun the model". Otherwise the last paragraph of D1 has no enforcement point.

| --- | --- | --- | --- |
| **L0 — Design & formal** | Do the state-machine, protocol and handover invariants hold in the abstract? | Formal models (e.g. TLA+ specifications and `.cfg` properties), ADR immutability checks | **Event-driven on design/contract change**: when a formal model, protocol/event contract, recovery boundary or handover invariant changes. Not run on ordinary implementation PRs. |
| **L1 — Static & contract** | Are formatting, dependency boundaries, public schemas/wire types, static source rules and license/advisory policies intact? | Formatters, linters, pure static repository scans, frontend typecheck/lint, wire/schema contracts, dependency advisory/license checks | **Every PR**, scoped to the changed surface (dependency scans only on manifest, lockfile or policy changes). Fast fail-first gate. |
| **L2 — Affected business flows** | Do the modified modules and their direct dependents preserve behavioral contracts? | Unit tests and in-process or loopback flow tests for the affected crates and their downstream consumers | **Every PR** on the primary high-throughput platform; expands to the full workspace only when shared foundational crates or workspace-wide configuration change. |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Direct dependents" is narrower than what Cargo can break. A change in a crate can break any transitive dependent, and today's router selects coarse groups that cover them. Suggest "the reverse-dependency closure of the changed crates" (computable from cargo metadata, which xtask already reads), or state explicitly that transitive breakage is left to the sweep.

terminal E2E suite) proves a behavior, higher layers verify only connectivity and do not duplicate
its failure matrix. Migrating coverage to a better carrier requires retiring or disabling the
superseded CI case in the same change or tracked migration.
- **Inject testability at runtime boundaries instead of recompiling**: test variants (release

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Production-safety bound. Making release stamps, build IDs or endpoints configurable at runtime can make the shipped binary trust an environment variable for release identity or update endpoints. Suggest adding: the injection point must be unreachable in a release build, or limited to test harness entry points, so that test injection never widens what a production binary accepts.

Coverage quality is measured by contract protection per unit of cost, not by test count at the top
layer.

- **Test at the lowest layer that proves the contract**: logic, state transitions, rendering rules,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reconcile with AGENTS.md Testing. AGENTS.md already says that assertions about private modules, helpers or single functions belong in the nearest flow test, not standalone tests. "Test at the lowest layer that proves the contract" can be read as encouraging helper-level unit tests. Suggest "the lowest flow or contract layer that proves the contract", and having AGENTS.md point to this rule instead of keeping both.

| **L1 — Static & contract** | Are formatting, dependency boundaries, public schemas/wire types, static source rules and license/advisory policies intact? | Formatters, linters, pure static repository scans, frontend typecheck/lint, wire/schema contracts, dependency advisory/license checks | **Every PR**, scoped to the changed surface (dependency scans only on manifest, lockfile or policy changes). Fast fail-first gate. |
| **L2 — Affected business flows** | Do the modified modules and their direct dependents preserve behavioral contracts? | Unit tests and in-process or loopback flow tests for the affected crates and their downstream consumers | **Every PR** on the primary high-throughput platform; expands to the full workspace only when shared foundational crates or workspace-wide configuration change. |
| **L3 — Real environment & cross-platform** | Do real OS primitives, process/plugin wiring, terminal interaction and external protocol boundaries work? | OS-native boundary slices, real daemon + plugin runtime flows, interactive terminal E2E suites, external registry acceptance | **Split by cost**: narrow OS-native boundary slices run on PRs that touch platform/client code; full cross-platform runs and external-registry checks run asynchronously on `main` or on a schedule; interactive terminal E2E runs locally on demand and before release. |
| **L4 — Quality, performance & release** | Have model quality, resource budgets, executable layout or distribution artifacts regressed? | Evaluation harnesses, memory/startup measurements, native code-layout builds, multi-platform release builds and registry/image acceptance | **Scheduled (nightly), manual dispatch or release train only**. Never gates an ordinary feature PR. |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Harness changes. Today a change under xtask/ selects the eval group and runs xtask/eval-tests on the PR, and code-layout.yml runs on PRs that touch scripts/code-layout/**. Both are reasonable: a change to the L4 harness should verify the harness itself on its PR. Suggest saying that L4 execution never gates feature PRs, while changes to an L4 harness are checked on their own PR (L1/L2 of the harness).

@codoggy codoggy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review summary

I reviewed the merge-base diff for c4fb0c1b783abba006a77c0888aead21a7526c42, focusing on the proposed verification tiers, their Chinese translation, and how contributors find them. I found no blocking issues in that scope.

Non-blocking note: AGENTS.md:69 says to “Follow ADR 025,” while both the ADR and its index mark it Proposed. A contributor could read the tier table as replacing the existing pre-merge commands at AGENTS.md:79–85. Until the decision is accepted, label the link as a proposal and keep those commands as the source for what to run today.

Checks: Static inspection: the English and Chinese documents distinguish formal-model triggers from routine flow tests and leave workflow changes to later implementation. The five changed files are documentation and navigation only. CI: changes and ci-ok passed; the build and test jobs were skipped. Tests not run locally.

@zerob13 zerob13 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes on the points in the earlier review, which I first left as non-blocking. Once accepted, this ADR is immutable, so these should be settled before merge:

  1. Move the D3 numeric budgets out of the ADR (docs/architecture/build.md / #1919); keep only the rule that every synchronous tier has a recorded budget.
  2. D4: allow path-scoped main routing only while a scheduled full sweep exists, and state who triages a failed sweep.
  3. D2: bound runtime test injection so that it is unreachable in release builds.

The remaining inline points (L0 trigger, L2 reverse-dependency closure, AGENTS.md wording, L4 harness changes) need a reply, either a change or a reason to keep the current text.

… doc checks

Incorporate review feedback from #1940:
- Frame D1 around three operational test states (Active gate, Retained
  on-demand/sweep, Dev/exploratory) with L0–L4 mapped onto them, keeping
  ADR freeze checks in L1, splitting L0 triggers into model-file changes
  and review checklists, scoping L2 to reverse-dependency closures, and
  distinguishing L4 execution from L4 harness self-checks.
- Add D2 stating that documentation guides and carries semantic contracts
  while automated checks enforce deterministic form and structural
  invariants without business compilation or prose/literal guessing.
- Reconcile D3 with AGENTS.md Testing (lowest flow or contract layer) and
  add a release-unreachability bound for runtime test injection.
- Move numeric latency budgets out of the immutable ADR (D4) and require
  an active scheduled sweep with triage/bisection ownership before
  narrowing main pushes (D5).
- Revert the AGENTS.md edit until ADR 025 is accepted.

Refs #1938
@eric8810

Copy link
Copy Markdown
Collaborator Author

Thank you @yyhhyyyyyy, @zerob13, and @codoggy for the sharp reviews — updated ADR 025 (both English and Chinese mirrors) and the PR description to address every point:

  • @yyhhyyyyyy (ADR freeze check placement): moved the ADR immutability check out of L0 into L1 (every PR / ADR edit), matching both its actual CI trigger and D2's form-check boundary.
  • @zerob13:
    1. Immutable budgets (D4): removed hardcoded minute targets from the ADR; the ADR now mandates recorded budgets (stored with measurements in docs/architecture/build.md and tracking issues) and forbids timeout inflation as a remedy.
    2. Sweep prerequisite & triage (D5): explicitly gated path-scoped main routing on an active scheduled full sweep, with defined triage ownership and commit-range bisection on sweep failures.
    3. L0 formal-model triggers (D1): split into (a) model-file change trigger (with tool cost disclosed under D4 if run in CI) and (b) PR checklist/review trigger when an implementation edit alters a modelled guarantee.
    4. L2 scope (D1): widened from "direct dependents" to the reverse-dependency closure of changed crates.
    5. Production-safety bound (D3): required test-only runtime injection points to be unreachable in release builds (debug/test only) or confined to test-harness entry points.
    6. Reconciliation with AGENTS.md Testing (D3): phrased as the lowest flow or contract layer that proves the contract; once ADR 025 is accepted, AGENTS.md can consolidate onto it without duplication.
    7. L4 harness changes (D1): distinguished L4 execution (always Retained, never gates feature PRs) from changes to an L4 harness itself (which run the harness's own L1/L2 checks in the Active gate).
    8. PR description: linked ci: let every main push finish its checks #1920 and ci: run xtask check when Web sources change #1925 in the PR body (outside the ADR per ADR 008).
  • @codoggy (AGENTS.md while Proposed): reverted the AGENTS.md edit so AGENTS.md stays strictly authoritative for current pre-merge commands until ADR 025 is accepted.

Also structured D1 around three operational states (Active gate, Retained on-demand & sweep, Dev / exploratory) and added D2 to draw the boundary between documentation guidance/semantic contracts and deterministic form-only automated checks.

Clarify under D2 that generated files are committed and freshness-checked
only when downstream code consumes them or when they serve as concise,
actively referenced public summaries; fine-grained internal graphs used
for boundary enforcement are verified live in memory and generated on
demand instead of committed to Git.

Refs #1938

@yyhhyyyyyy yyhhyyyyyy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed head e2a5a2c. The PR proposes ADR 025: three operational verification states (Active, Retained, Dev), an L0-L4 tier mapping, form-only documentation checks, test coverage discipline and CI governance, plus index entries and a Chinese mirror. The change is documentation-only and follows the ADR template.

The earlier P3 from review 5988772539 is resolved. ADR immutability is no longer in L0; the L1 row owns it and names the every-PR trigger (docs/adr/025-verification-tiers-and-ci-governance.md:42), matching scripts/adr-check.mjs in the changes job (.github/workflows/ci.yml:49-53).

Findings:

P2. D2's check taxonomy conflicts with the xtask check the repository runs. The out-of-scope bullet says to avoid "cross-language text scanners that try to infer semantics from raw literals and rely on growing manual allowlists" (docs/adr/025-verification-tiers-and-ci-governance.md:68-72). xtask check runs exactly such a scan: literal_main reads Rust, TypeScript and Vue sources for bare "main" literals and resolves unrelated uses through the nine-entry UNRELATED allowlist (xtask/src/literal_main.rs:1-7, xtask/src/literal_main.rs:72, xtask/src/main.rs:73), and #1933 lists it among the pure static checks it will separate; open PR 1881 is currently growing the same UNRELATED allowlist from 9 to 11 entries for web/src/chat-ui/WebChatTimeline.vue (xtask/src/literal_main.rs at #1881 head). The same D2 section puts code-to-document structural projections (public service catalogs, crate-level overviews) under "L1, zero business compilation" (docs/adr/025-verification-tiers-and-ci-governance.md:59-62; Chinese mirror docs/zh/adr/025-verification-tiers-and-ci-governance.md:40), but catalog::check and types::check are workspace-coupled and run in the heavy macOS verify job after cargo build --workspace (xtask/src/main.rs:69-70, .github/workflows/ci.yml:159,174-194); #1933 separates them as workspace-coupled. Failure: after acceptance, literal_main is both an active-gate pure static check and an out-of-policy scanner, while the catalog and type projections are L1 code-to-document checks that violate the zero-compilation bound. A maintainer cannot classify either check without contradicting the ADR or the tracked split, and the easy fixes are deleting coverage (against the Non-goals) or ignoring D2. Fix: scope the avoid rule to new scanners, and either drop "zero business compilation" for the workspace-coupled projections or give them a separate heavy check or tier, citing #1933.

P2. The L3 row puts interactive terminal E2E in retained main or scheduled workflows. The row makes interactive terminal E2E "Retained (asynchronous main/scheduled sweeps, pre-release or local on-demand)" (docs/adr/025-verification-tiers-and-ci-governance.md:44; Chinese mirror docs/zh/adr/025-verification-tiers-and-ci-governance.md:31). The suite is local-only: AGENTS.md:72 says "No workflow may invoke the suite", AGENTS.md:85 says "local only, never in CI", docs/architecture/build.md:326 says it runs "locally through tmux, not in CI", and docs/architecture/tui-e2e.md:3-9 says CI does not run a migrated flow. Failure: the scheduled full sweep required by D5 includes every Retained L3 asset, or a reader wires the suite into a main or scheduled job because this row lists that trigger, and the workflow invokes the tmux suite, violating the repository's CI policy and the local-only boundary. Fix: state that interactive terminal E2E runs only locally on demand or before release, never in a workflow; apply the same fix to the Chinese mirror.

P2 (cross-PR). ADR number 025 is claimed twice. This PR adds docs/adr/025-verification-tiers-and-ci-governance.md with a row at docs/adr/README.md:35 and a line at docs/INDEX.md:52. Open draft PR 1941 adds docs/adr/025-rutis-0-23.md with its own row at the same docs/adr/README.md:35 and docs/INDEX.md:52. Failure: whichever merges second either conflicts at those insertion points or leaves two ADRs numbered 025, violating the sequential ADR convention. Fix: coordinate with #1941; this PR was opened first (06:57 versus 07:17), so keep 025 here and have #1941 renumber to 026 before it leaves draft, or rebase and renumber the later merge.

P3. The Retained state definition and the L0 row disagree on triggers. D1 says Retained runs on scheduled sweeps, before release, when diagnosing a failure, or when a design or protocol review calls for it (docs/adr/025-verification-tiers-and-ci-governance.md:28-32), but the L0 row adds an automatic trigger on formal model file changes (docs/adr/025-verification-tiers-and-ci-governance.md:41; Chinese mirror docs/zh/adr/025-verification-tiers-and-ci-governance.md:21,28). Failure: a model-only PR that changes .tla or .cfg files matches none of the state's run modes, so a router implemented from D1 skips the L0 check that the tier table requires. Fix: add the model-file-change trigger to the Retained definition or state that the tier table's "Default state & trigger" column is authoritative.

P3. The new "Keep generated snapshots minimal" bullet (docs/adr/025-verification-tiers-and-ci-governance.md:63-67; Chinese mirror docs/zh/adr/025-verification-tiers-and-ci-governance.md:41) matches #1945 but contradicts the current repository contract. AGENTS.md:95-96 says xtask graph writes modules.mmd / modules.json and xtask check fails when the committed crates.* / modules.* snapshots are stale; docs/architecture/README.md:110 says check renders them in memory and fails when they differ from the committed ones. The bullet says fine-grained internal graphs are "generated on demand rather than committed to Git". Failure: until #1945 lands, a contributor who regenerates modules.* after an assembly change gets conflicting instructions, and after acceptance the ADR and AGENTS.md disagree. Fix: cite #1945 in the ADR or state that current committed snapshots remain until that tracked change.

Checked and correct: docs/INDEX.md:52 links both files, docs/adr/README.md:35 records Proposed, the English and Chinese status lines agree, all relative links resolve, node scripts/adr-check.mjs --base origin/main passed, and git diff --check origin/main...HEAD is clean. The new generated-snapshot bullet does not fix the D2 check-taxonomy conflict; it adds the tracked #1945 migration described above. CI at e2a5a2c is green: changes and ci-ok succeeded; the build and test jobs were skipped for a docs-only diff.

Verdict: REQUEST_CHANGES.

| **L0 — Design & formal** | Do abstract state-machine, protocol and handover invariants hold? | Formal models (e.g. TLA+ specifications and `.cfg` properties) | **Retained**: (a) triggered on formal model file changes (with tool cost disclosed under D4 if wired into CI), and (b) enforced via PR checklist/review whenever an implementation change alters a modelled handover, recovery or ordering guarantee. Not run on ordinary implementation PRs. |
| **L1 — Static form & contract** | Are formatting, dependency boundaries, ADR immutability, public schemas/wire types and license/advisory policies intact? | Formatters, linters, pure static form/structure checks (including ADR freeze checks on every PR / ADR edit), frontend typecheck/lint, wire/schema contracts, dependency advisory/license scans | **Active gate**: fast fail-first on every PR, scoped to the changed surface (dependency scans only on manifest, lockfile or policy changes). |
| **L2 — Business flows** | Do modified modules and their transitive consumers preserve behavioral contracts? | Unit and in-process or loopback flow tests | **Active gate** on the primary high-throughput platform for the **reverse-dependency closure** of changed crates (expanding to the full workspace when foundational crates or workspace-wide configuration change). Heavy historical, soak or low-frequency flows belong in **Retained**. |
| **L3 — Real environment & cross-platform** | Do real OS primitives, process/plugin wiring, terminal interaction and external protocol boundaries work? | OS-native boundary slices, real daemon + plugin runtime flows, interactive terminal E2E suites, external registry acceptance | **Split**: narrow OS-native boundary slices run in the **Active gate** only on PRs touching platform/client code; full cross-platform runs, external-registry acceptance and interactive terminal E2E are **Retained** (asynchronous `main`/scheduled sweeps, pre-release or local on-demand). |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: this row makes interactive terminal E2E Retained with main/scheduled sweeps as a possible trigger, but the suite is local-only. AGENTS.md:72 says "No workflow may invoke the suite"; AGENTS.md:85 says "local only, never in CI"; docs/architecture/build.md:326 says it runs locally through tmux, not in CI; docs/architecture/tui-e2e.md:3-9 says CI does not run a migrated flow. Failure: a scheduled full sweep added for D5 includes this Retained asset, or a reader wires the suite into a main or scheduled job from this list, and the workflow invokes the tmux suite, violating the CI policy and the local-only boundary. Fix: state that interactive terminal E2E runs only locally on demand or before release, never in a workflow; update docs/zh/adr/025-verification-tiers-and-ci-governance.md:31 too.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in e417fb7: the L3 row now marks interactive terminal E2E as Retained (local-only) and states that a CI workflow never invokes it (docs/adr/026-verification-tiers-and-ci-governance.md:46; Chinese mirror docs/zh/adr/026-verification-tiers-and-ci-governance.md:31). No workflow invokes scripts/tui-tmux/run.mjs; .github/workflows/ci.yml:222-224 only carries comments about the local suite.

@codoggy

codoggy commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator

Verified fixed in e2a5a2c36928b1849f9c38d9c6076e1573f08661. At AGENTS.md:74–85, the pre-merge verification table is unchanged from the merge base, and the instruction to follow the still-proposed ADR is gone. Static inspection: the entire file matches the base byte for byte, confirming the revert in your reply. Tests not run locally.

Address all findings from PR #1940 review:
- Renumber from ADR 025 to ADR 026 across English/Chinese ADRs and
  indexes so PR #1941 retains 025 without collision.
- Split D2 automated checks into pure static L1 checks (zero business
  compilation) and runtime-assembled structural projections (workspace-
  coupled alongside L2), and scope the literal-scanner rule to
  introducing new scanners.
- Mark interactive terminal E2E in L3 as Retained (local-only), run
  locally on demand or before release and never invoked by CI workflows.
- Add asset-file edits (such as formal model changes) to D1's Retained
  definition and state that the tier table trigger column is authoritative.
- Clarify in Consequences that AGENTS.md and docs/architecture/ remain
  authoritative for current commands and committed snapshots until this
  ADR is accepted and follow-up tooling changes land.

Refs #1938
@eric8810 eric8810 changed the title docs(adr): propose ADR 025 for verification tiers, test coverage and CI governance docs(adr): propose ADR 026 for verification tiers and CI governance Nov 20, 2026
@eric8810

Copy link
Copy Markdown
Collaborator Author

Thanks @yyhhyyyyyy for the thorough second-round review — all five points are addressed in the latest push:

  1. D2 check taxonomy (P2):
    • Scoped the scanner rule in English to match the Chinese mirror ("avoid introducing new brittle cross-language text scanners..."; existing allowlist-backed scanners like xtask/src/literal_main.rs are kept only until replaced rather than imitated).
    • Split D2's automated checks into pure static form checks (L1, zero business compilation) (ADR freeze, links/templates, manifest/AST-parsed boundaries and declarations) and runtime-assembled structural projections (workspace-coupled, alongside L2) (such as the live catalog.md projection), keeping D2 consistent with D4 and the xtask/ci: separate pure static repository checks from workspace-coupled xtask commands #1933 split.
  2. Interactive terminal E2E local-only boundary (P2):
    • Split L3's Retained items in both English and Chinese so full cross-platform runs and external-registry acceptance may run in main/scheduled sweeps, while interactive terminal E2E is explicitly local-only (run locally on demand or before release, never invoked by a CI workflow).
  3. ADR 025 number collision with build(rutis): upgrade the plugin runtime to 0.23 #1941 (P2):
  4. D1 Retained definition vs L0 trigger (P3):
    • Added asset-file edits (such as formal model changes) to D1's Retained definition and stated that the tier table's "Default state & trigger" column is authoritative per tier.
  5. Generated-snapshot rule vs current AGENTS.md (P3):

@zerob13 — all items from your earlier review were also applied in 32d3d15a and carried forward here; ready for re-review when you have a moment.

@yyhhyyyyyy yyhhyyyyyy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed head e417fb7 (the renumbering commit). The PR now proposes ADR 026, and each prior finding is resolved.

Resolved findings

  • P2, check taxonomy. D2 now scopes the scanner rule to new scanners and keeps existing allowlist-backed scanners only until replacement (docs/adr/026-verification-tiers-and-ci-governance.md:74-78), so literal_main and its UNRELATED list (xtask/src/literal_main.rs:69-72) are no longer out of policy. The workspace-coupled projections moved out of L1: D2 places runtime-assembled projections alongside L2 (docs/adr/026-verification-tiers-and-ci-governance.md:65-68), and the L2 scope names runtime-assembled structural checks (:45). catalog::check does assemble the product profile (xtask/src/catalog.rs:47-58), while types::check reads source and Cargo metadata without compiling dim-app-server (xtask/src/types.rs:65-75). The remaining packaging split is a P3 note below, not a contradiction. The router still does not run the workspace path for docs, frontend or script PRs (.github/workflows/ci.yml:152-154,186-194; scripts/ci-changes.mjs:13,16,18).
  • P2, interactive terminal E2E. The L3 row now says the suite is Retained (local-only), runs locally on demand or before release, and is never invoked by a CI workflow (docs/adr/026-verification-tiers-and-ci-governance.md:46; Chinese mirror docs/zh/adr/026-verification-tiers-and-ci-governance.md:31). This matches AGENTS.md:72,85, docs/architecture/build.md:326 and docs/architecture/tui-e2e.md:3-9. No workflow invokes scripts/tui-tmux/run.mjs; .github/workflows/ci.yml:222-224 only carries comments about the local suite.
  • P2, duplicate ADR number. Every reference now says 026: the headings (docs/adr/026-verification-tiers-and-ci-governance.md:1, docs/zh/adr/026-verification-tiers-and-ci-governance.md:1), docs/INDEX.md:52 and docs/adr/README.md:35. A targeted git grep over docs, AGENTS.md, scripts and .github finds no 025-verification, ADR 025 or adr/025 reference. PR #1941 still adds docs/adr/025-rutis-0-23.md with its own README and INDEX rows, so 025 remains available for it. Whichever PR merges second will need the usual rebase at the shared insertion point.
  • P3, Retained and L0 triggers. D1 now includes "when the asset's own source files change" and makes the tier table authoritative (docs/adr/026-verification-tiers-and-ci-governance.md:29-31); the L0 row keeps the model-file trigger and the review checklist (:43). The Chinese mirror matches (docs/zh/adr/026-verification-tiers-and-ci-governance.md:21,28).
  • P3, generated snapshots. Consequences now says AGENTS.md and docs/architecture/ remain authoritative for today's commands and committed snapshots until the follow-up lands (docs/adr/026-verification-tiers-and-ci-governance.md:143-146), which resolves the conflict with AGENTS.md:95-96. The bullet itself is unchanged in substance (:69-73).

Renumbering check

  • docs/adr/026-verification-tiers-and-ci-governance.md and docs/zh/adr/026-verification-tiers-and-ci-governance.md are the only new ADR paths; there is no duplicate 026.
  • Both headings, the ADR table row and the INDEX line agree. All relative links in the four changed files resolve.
  • The 025 gap in the ADR table is filled by PR #1941's row; no file points at 025 for this ADR.

P3 nits (non-blocking)

  1. Issue #1938 still says "proposed as ADR 025", which now names PR #1941's rutis ADR. Update the issue body to 026 so the INDEX link at docs/INDEX.md:52 does not point at a stale number. This is the only stale 025 pointer I found, and it is outside the repository.
  2. docs/adr/026-verification-tiers-and-ci-governance.md:44 says dependency scans run only on manifest, lockfile or policy changes. Today .github/workflows/ci.yml:54-76 runs cargo deny when rust == true or dependencies == true, and scripts/ci-changes.mjs:20-26 selects rust for crate changes, so a Rust source change runs the scan without a manifest or lockfile change.
  3. docs/adr/026-verification-tiers-and-ci-governance.md:116-118 says pure static checks run in lightweight jobs and :147 says they are decoupled. Today they are bundled: xtask/src/main.rs:67-74 runs boundaries, catalog::check, types::check, npm::check, comment_links::check and literal_main::check in one xtask check, and .github/workflows/ci.yml:186-194 runs it in the macOS verify job after the workspace build. The Consequences hedge covers today's state; citing #1933 would make the planned split discoverable. The same note applies to the source-parsed type declarations example at :63, which #1933 groups with types::check as workspace-coupled.

Gates

  • git diff --check origin/main...HEAD: clean.
  • node scripts/adr-check.mjs --base origin/main: ADR freeze passed: 4 changed files.
  • node --test scripts/adr-check.test.mjs: 7 passed, 0 failed.
  • The repository has no doc link checker; a relative-link check over the four changed files found no broken links.
  • CI at e417fb7: changes and ci-ok succeeded; dependencies, windows-cli, web, verify and acp-registry were skipped for the docs-only diff. PR state: head e417fb7, open, not draft, mergeable true, mergeable_state clean.

Verdict: APPROVE. The P3 notes above are non-blocking.

Comment thread docs/INDEX.md
- [Architecture decisions](adr/README.md)
- [ADR 022 — Timeline 属性查询与正文重建](adr/022-event-property-queries.md)(中文):目标 API 与模块结构、属性查询、业务状态恢复和正文释放
- [ADR 023 — 上下文用量由独立分支部件维护](adr/023-context-usage.md)(中文):ContextUsage 的职责、增量统计、服务商校准及后续设计边界
- [ADR 026 — Verification tiers, test coverage and CI governance](adr/026-verification-tiers-and-ci-governance.md)([中文](zh/adr/026-verification-tiers-and-ci-governance.md)):three operational test states, verification tiers (L0–L4), form-only doc checks and CI governance (#1938)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: the linked issue #1938 still calls this proposal "ADR 025", which now names PR #1941's rutis ADR. Updating the issue body to 026 would keep this index link from pointing at a stale number.

| Tier | Question answered | Scope | Default state & trigger |
| --- | --- | --- | --- |
| **L0 — Design & formal** | Do abstract state-machine, protocol and handover invariants hold? | Formal models (e.g. TLA+ specifications and `.cfg` properties) | **Retained**: (a) triggered on formal model file changes (with tool cost disclosed under D4 if wired into CI), and (b) enforced via PR checklist/review whenever an implementation change alters a modelled handover, recovery or ordering guarantee. Not run on ordinary implementation PRs. |
| **L1 — Static form & contract** | Are formatting, dependency boundaries, ADR immutability, public schemas/wire types and license/advisory policies intact? | Formatters, linters, pure static form/structure checks (including ADR freeze checks on every PR / ADR edit), frontend typecheck/lint, source-derived wire/schema contracts, dependency advisory/license scans | **Active gate**: fast fail-first on every PR, scoped to the changed surface (dependency scans only on manifest, lockfile or policy changes). |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: this parenthetical does not match today's job. .github/workflows/ci.yml:54-76 runs cargo deny when rust == true or dependencies == true, and scripts/ci-changes.mjs:20-26 sets rust for crate and workspace changes, so a Rust source change runs the scan even with no manifest or lockfile change. If the sentence describes the target scoping, say so or cite the follow-up.

timeouts alone.
- **Cost disclosure for gate additions**: any change that adds a required PR check or widens path
selection must state its incremental runtime, added compile dependencies and target runner pool.
- **Physical isolation of light checks from heavy builds**: pure static repository checks must not

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: today the static checks are still bundled. xtask/src/main.rs:67-74 runs boundaries, catalog::check, types::check, npm::check, comment_links::check and literal_main::check in one xtask check, and .github/workflows/ci.yml:186-194 runs it in the macOS verify job after the workspace build. The Consequences hedge at :143-146 covers today's state; citing #1933 here would make the planned split discoverable. The same applies to the source-parsed type declarations example at :63, which #1933 groups with types::check as workspace-coupled.

@zerob13 zerob13 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the English and Chinese ADR 026 at e417fb75. The earlier blockers are resolved. D3 keeps test-only overrides unreachable from shipped binaries, D4 leaves numeric budgets in the build documentation and tracking issues, and D5 requires an active scheduled full sweep with triage ownership and commit-range bisection before narrowing main verification. The ADR freeze check and git diff --check passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs(adr): define verification tiers, test coverage policy, and CI governance rules

4 participants