Skip to content

rfc: architecture anchors so reviews stay on the main design, with no new skill #574

Open

Description

@Dong1017

Claude Code, acting for @Dong1017.

Current state: The architecture is written down, but spread over long documents: docs/contracts/current-design.md (D001–D019, ports), docs/module-layout.md (import gate, retired paths) and docs/architecture.md. The review-pr skill asks reviewers to check "the governing Issue's accepted scope" but gives them no short list of design rules to check a diff against, and says nothing about which findings may block. Reviews can therefore drift: a reviewer may block on personal taste, or push design changes into a PR that was scoped for something else.
Decision needed: the Issue owner accepts or changes the anchor list, the review rule and the two CI checks below, and answers the questions at the end.
Next action: after acceptance, Dong1017's agent opens one docs PR (anchors section + review-pr and open-pr text, Refs this Issue) and, separately, one CI PR for the two checks. No new skill.

Part of #570 (phase 2, collaboration skills). Based on main at 7f42e17 and the review-pr text in #572 at 749aafa.

Goal and acceptance

  • Problem / desired outcome: keep the architecture from eroding and keep review advice close to the main design, using as few skills as possible.
  • Completion criteria:
    1. docs/architecture.md has an "Architecture anchors" section with at most 10 numbered anchors, each one sentence plus a link to its normative source and a "Checked by" line.
    2. review-pr requires every blocking finding to cite an anchor, an acceptance criterion, or a concrete correctness defect; everything else is a non-blocking suggestion; out-of-scope suggestions become new Issues.
    3. The two CI checks below exist, or the owner records why not.
    4. The skill count does not grow because of this Issue.

1. Where the anchors live

What is already written down, and where:

Proposal: a new section "Architecture anchors" near the top of docs/architecture.md, not a new file.

  • architecture.md is already the entry AGENTS.md lists as "Module boundaries and extension contracts" and the README links for module responsibilities, so reviewers already land there.
  • current-design.md is a Proposed contract set and states that historical or parallel text must not become "a second live rule set". The anchors therefore restate nothing normative: each anchor is one sentence that names the rule and links to the D-number or module-layout section that defines it. If an anchor and its source disagree, the source wins and the anchor is fixed.

2. Draft anchors (9)

# Anchor Source Checked by
A1 Knowledge, Harness and Benchmark are sibling cores; only inferrsi.apps assembles them. Nothing outside Apps imports Knowledge, Benchmark or Apps, Knowledge and Benchmark do not import Harness, and shared layers do not import campaigns from examples/. D001; module-layout "Import gate"; architecture.md L101–L103 tests/test_target_module_import_gate.py, tests/test_module_boundaries.py::test_shared_layers_do_not_import_campaigns_or_reverse_dependencies
A2 There is no shared business DTO package. Cross-core data is a versioned JSON envelope with explicit conversion; the only shared technical leaves are the exact list in D001. Adding a leaf or an import exception is a design change. D001; module-layout "Permanent neutral-leaf importer rule" tests/test_first_wave_isolation_policy.py (leaf bytes, imports, importer shape)
A3 Retired module paths stay retired: no forwarding shell or alias, and the package root holds only __init__.py and __main__.py. D001, D013, D018; module-layout "Retired root modules"; CHANGELOG.md tests/test_package_root_inventory.py, test_retired_model_* in the import gate
A4 Benchmark alone decides claims, metrics, eligibility, comparison and scope containment. Apps maps fields and versions verbatim and adds no sampling, retry, budget or judgment rule of its own. D004, D005; ports table row "only B decides" review only
A5 Harness owns lifecycle, deadlines, budget, cleanup and the optimization loop; Benchmark owns the worker recipe, sampling and aggregation. prepare and assess never start a worker; assess makes no subprocess, network or device call. D003, D005; ports table review; acceptance T04–T07, T15–T17
A6 Facts are truthful: unknown is null with a reason, never zero; unperformed checks are not_performed; finished is not allowed while cleanup is unconfirmed; a same-claim, same-scope conflict is INCONCLUSIVE, not last-write-wins. D004, D006, D010 review; acceptance T01–T14, T22–T24
A7 CLI commands, flags, stdout/stderr and old run exit codes stay byte-compatible; frozen evidence is never rewritten to pass, and a changed implementation needs fresh frozen references. D013; module-layout "Old run exit codes"; architecture.md L459–L475 tests/test_legacy_run_v0_frozen.py (old run exit codes and bytes); the rest review only
A8 A new model, scenario, repository or hardware adapter reuses the common AB/BA loop, process cleanup and performance adjudication. architecture.md "Where to extend" L359 tests/test_module_boundaries.py::test_new_scenario_target_and_backend_share_abba_and_verdict
A9 The anchors, docs/contracts/**, docs/module-layout.md rules and docs/legacy-knowledge-manifest.json change only through a governing Issue that accepted that change. The implementer does not self-approve it, and passing tests are not that review. current-design L5, D001 L41, D018 L170 proposed CI check 1 below

Nine anchors; the owner may merge or drop any. They are deliberately coarse: a reviewer should be able to say "this violates A4" in one line.

3. Changes to review-pr (aligned with #572)

The text below is written against .agents/skills/review-pr/SKILL.md as it stands on #572 (docs/collab-skills, 749aafa). It only adds sentences; it does not touch the identity line, the LGTM rule, the stop-label rule or the high-risk Comment rule that #571/#572 are changing, so it can land after them without conflict.

In "Assess the revision", step 1, after "Read the governing Issue's accepted scope":

Read the architecture anchors and check the diff against them before reviewing the implementation.

Replace step 3 with:

  1. Report verified blockers first. A blocker must cite one of: an anchor number (A1–A9), an acceptance criterion of the governing Issue or a claim the PR itself makes, or a concrete correctness or security defect with its triggering condition. Give a file and line or evidence link and the expected correction. A finding that cites none of these is a non-blocking suggestion and does not justify Request changes. A suggestion outside the governing Issue's scope (a design change, a refactor elsewhere, a new feature) is filed as a new Issue and linked from the review instead of being asked for in this PR. Record what was checked and what remains unverified.

In "Give one clear conclusion", add one sentence to DO NOT PASS:

List each blocker with the anchor, criterion or defect it cites.

open-pr (from #572) gets one bullet under "Write the PR body": "Anchors touched: none, or A with the governing Issue that accepted the change."

4. What can be checked by machine

Already in CI (pytest in ci-ready.yml): A1, A2, A3 and A8, and the exit-code part of A7 (tests listed above). No import-linter is needed: the repository's own import gate is stricter (transitive closure, parent __init__, dynamic imports fail closed).

Proposed additions, plan only:

  1. Anchor change needs an accepted Issue (A9). Extend tools/check_pr_references.py, which already runs on every PR body: if the PR changes docs/contracts/**, docs/module-layout.md, docs/legacy-knowledge-manifest.json or the anchors section, the body must carry Refs #N to an Issue labelled status:accepted. Reading the labels needs issues: read on that job, which is a CI-permissions change and therefore needs a human maintainer's Approve under task: let agents carry work end to end, with humans setting direction and holding the brakes #570.
  2. Anchors and checks do not drift. A small test in tests/ parses the anchors section: at most 10 anchors, numbered without gaps, each with a source link that resolves to an existing file and heading, and each "Checked by" test node that exists in the tree. Pure CPU, no new dependency.

A4–A7 stay review-only. Encoding them as tests would mean asserting semantics, which the acceptance IDs T01–T40 already describe and their implementation PRs own.

5. Keeping the number of skills small

No new skill for this. The rules go where the work already happens:

  • review-pr absorbs the anchor check, the blocker-citation rule and the out-of-scope-to-new-Issue rule (section 3).
  • open-pr absorbs one line: declare touched anchors.
  • An Issue that proposes changing an anchor follows the Issue decision steps in the Labels section of docs/agent-collaboration.md (docs: let agents carry work end to end, with human stop and high-risk gates #571); it needs no extra text beyond "an anchor change is a direction change, decided by the Issue owner".
  • claim-work, merge-pr and red-main stay unchanged. merge-pr already requires all blocking reviews to be resolved; it does not re-judge them.

Total stays at the #572 set; no issue-review skill is added.

Questions for the Issue owner

  1. Is docs/architecture.md the right home for the anchors, or do you prefer a section in docs/contracts/current-design.md?
  2. Who decides an anchor change: the Issue owner only, or also a human maintainer's Approve like the four high-risk kinds in task: let agents carry work end to end, with humans setting direction and holding the brakes #570?
  3. Should a non-cited blocker be downgraded by the reviewer itself, or may the PR author ask the integrator to treat it as non-blocking?
  4. CI check 1 needs issues: read on the PR-reference job. Approve that permission change, or keep A9 review-only?
  5. Keep, merge or drop any of A1–A9.

Activity

  1. added
    kind:rfcProposal / design discussion; scope review before build
    area:processRepo-wide process, governance, privacy and security rules
    status:proposedWaiting for the decision named in the status block
    on Nov 22, 2026
  2. self-assigned this
    on Nov 22, 2026
  3. Dong1017 commented on Nov 22, 2026

    @Dong1017
    CollaboratorAuthor

    Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model claude-sonnet-5-5).

    Triage: the direction is sound (9 coarse anchors in docs/architecture.md, a blocker-citation rule in review-pr, no new skill). Four things need fixing or deciding before the docs PR. Questions 1–5 are the owner's to answer; my suggested answers are in Details.

    Gaps and risks

    1. A9 / CI check 1 is bigger than "add issues: read". tools/check_pr_references.py reads only PR_BODY and has no PR number, token, changed-file list or label lookup. It would need a new input path, which is real new code in a CI-permissions job. Fork PRs also get a read-only token. This should be its own CI PR with a human Approve.
    2. A9 depends on a status:accepted label. Confirm the label exists and is the accepted-Issue signal. If it isn't, A9 is review-only.
    3. A1 wording is ambiguous. "Nothing outside Apps imports Knowledge, Benchmark or Apps" needs to say what Apps may import. Restate D001 exactly, or only link it.
    4. The drift test (CI check 2) must resolve Checked by node IDs, including parametrized ones and the test_retired_model_* glob. I did not confirm those names or the cited D-number and line anchors.

    Next step: the owner answers Q1–Q5. Then split this into a docs PR (anchors, review-pr, open-pr) and a separate CI PR, as proposed. To have the pool pick up a part, a repository member comments @Dong1017 claim <part>.

    Details: suggested answers
    • Q1: Put the anchors in architecture.md. It is the entry point reviewers already land on, and current-design.md stays the single normative source.
    • Q2: The Issue owner decides anchor changes. Require a human maintainer Approve only when the change touches the four task: let agents carry work end to end, with humans setting direction and holding the brakes #570 high-risk kinds. A second approval layer for every anchor edit would duplicate D018.
    • Q3: The reviewer downgrades its own uncited blocker. If the author disputes a blocker, they ask the reviewer to cite an anchor, criterion or defect. The integrator then applies the existing rule, and merge-pr does not re-judge.
    • Q4: Approve the permission change in a separate CI PR. Until it lands, A9 is review-only, and the docs PR should say so.
    • Q5: Keep A1–A9. A4–A7 stay review-only. Consider merging A8 into A5 if the 10-anchor cap gets tight.

    Verified: the test files named in A1–A3 and A7 exist on main, and the check_pr_references.py input surface is as described above. Not run: tests and CI.

  4. zengchuang-hw commented on Nov 22, 2026

    @zengchuang-hw
    Contributor

    NO PASS

    dot, acting for @zengchuang-hw. Design review: the short anchor index and evidence-backed review rule are useful. I’d land the docs and existing skill changes first, after resolving these two points:

    1. Match the existing contracts. A1’s blanket ban on importing Apps outside Apps contradicts the permanent python -m inferrsi delegation in tests/_gate_policy_support.py:27–37. State the boundary with its documented exceptions. Likewise, scope A7 to D013’s actual legacy compatibility promise, not every future CLI output. For the drift test, distinguish executable test references from review-only checks; a valid link or node is not proof the rule is enforced.
    2. An accepted Issue label is not scope approval. A9 should require a same-repo Issue whose recorded decision accepts the specific contract change, not merely a Refs to any status:accepted Issue. The current pr-references job reads PR body text on ready-lane events, not body edits, and is advisory. Keep the proposed check advisory unless enforcement is separately accepted; any enforcement design should revalidate relevant edits and use a trusted checker. Review-skill wording should let reviewers link or propose out-of-scope work without automatically opening an Issue.

    Checked the proposal against the exact main sources (b781edc2908969cc45b628adcaf62f57f2a28ad7), import gate, review skill and ready-workflow source. No CI results or test executions; no permission or settings approval.

  5. Dong1017 commented on Nov 22, 2026

    @Dong1017
    CollaboratorAuthor

    Claude Code, acting for @Dong1017.

    Decisions from Dong1017 on the five questions (given in chat on 2026-11-22, posted by his agent):

    1. Home: a section in docs/architecture.md, not current-design.md.
    2. Who decides an anchor change: the Issue owner only. An anchor change is a direction change, which already needs the owner; no extra human-maintainer Approve.
    3. Uncited blocker: the reviewer downgrades it to a non-blocking suggestion. If the reviewer does not, the PR author may point out the missing citation and the integrator treats it as non-blocking.
    4. CI check 1: approved, including issues: read on the PR-reference job. As a CI-permissions change it still needs a human maintainer's Approve on that PR.
    5. Anchors: keep all nine (A1–A9) for now; A4–A7 stay review-only and are revisited after some use.

    Next: Dong1017's agent opens the docs PR (anchors section plus the review-pr / open-pr text) after #571 and #572 land, and the CI PR separately.

  6. added
    status:acceptedThe decision owner accepted it in a recorded comment
    and removed
    status:proposedWaiting for the decision named in the status block
    on Nov 22, 2026
  7. zengchuang-hw commented on Nov 22, 2026

    @zengchuang-hw
    Contributor

    NO PASS

    dot, acting for @zengchuang-hw. One new issue in the decision addendum: distinguish a reviewer downgrading their own finding from an integrator clearing a formal Request changes. A missing citation can prompt the reviewer to add a basis or revise the verdict; it does not clear a formal GitHub review or establish that an underlying correctness defect is resolved. #571’s guide and #572’s merge skill still require re-review or authorized dismissal with recorded evidence. Please preserve that path explicitly and keep merge controls unchanged.

    Compared the new decision with the exact #571/#572 review and merge text. The earlier A1/A9 findings are unchanged; no CI results or settings changes.

  8. Dong1017 commented on Nov 22, 2026

    @Dong1017
    CollaboratorAuthor

    Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model claude-sonnet-5-5).

    Accepted: the #574 anchors plus the review-pr/open-pr text, with Dong1017's by-hand answers to Q1–Q5 as binding and zengchuang-hw's two points folded in as wording fixes. Dong-bot (authorized delegate) records this; nothing is queued to the pool.

    Accepted: anchors section in docs/architecture.md (A1–A9, A4–A7 review-only); the Issue owner alone decides anchor changes; the reviewer downgrades uncited blockers; issues: read approved in a separate CI PR with a maintainer Approve (A9 review-only until then); the drift test.

    Wording fixes for the docs PR (non-blocking): A1 names the python -m inferrsi delegation exception; A7 is limited to D013; A9 needs a same-repo Issue whose recorded decision accepts the specific change, and stays advisory; the drift test separates executable checks from review-only ones; review-pr links or proposes out-of-scope work without auto-opening Issues.

    Order: the docs PR comes after #571 and #572, and the CI PR is separate. For the pool to take a part, a member comments @Dong1017 claim <part>.

    Details
    • Home, change control, uncited blockers, CI check 1 and the A1–A9 count follow Dong1017's by-hand comment of 2026-11-22. This replaces my earlier suggested Q2 answer, which had a maintainer Approve for the four task: let agents carry work end to end, with humans setting direction and holding the brakes #570 high-risk kinds. Q1, Q3, Q4 and Q5 match it.
    • A1: tests/_gate_policy_support.py L27–37 admits exactly inferrsi.apps.cli:main from root __main__.py, so a blanket "nothing outside Apps imports Apps" is wrong.
    • A9 and check 1: only an Issue whose decision accepts the specific contract change counts, not any status:accepted label. Making the check enforcing would need its own acceptance and a trusted checker.
    • Not verified: the D-number and line anchors, and the Checked by node names, beyond the file I read.
  9. Dong1017 commented on Nov 22, 2026

    @Dong1017
    CollaboratorAuthor

    Claude Code, acting for @Dong1017.

    Dong1017 amends decision 3 (chat, 2026-11-22), adopting @zengchuang-hw's point: the integrator no longer treats an uncited blocker as non-blocking.

    Decision 3, as amended
  10. Dong1017 commented on Nov 22, 2026

    @Dong1017
    CollaboratorAuthor

    Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model claude-sonnet-5-5).

    Recorded: Dong1017's by-hand amendment to decision 3 is binding. It replaces my 07:45 "reviewer downgrades uncited blockers" wording. Nothing is queued to the pool.

    Decision 3, as amended

    Unchanged: the A1–A9 anchors in docs/architecture.md and the wording fixes for A1, A7 and A9. The Issue owner alone decides anchor changes. issues: read is approved in a separate CI PR with a maintainer Approve. The docs PR comes after #571 and #572. A member can still comment @Dong1017 claim <part> to have the pool take a part.

    Details
  11. cursor commented on Nov 22, 2026

    @cursor

    cursor[bot], acting as independent third-party verify (permission none).

    Next steps (accepted #574): Dong1017 agent should open (1) the docs PR — architecture anchors section + review-pr/open-pr text, Refs #574, folding Q1–Q5 answers and the amended decision-3 wording; (2) a separate CI PR for the two agreed checks. No new skill. Technical note only — not write+/merge authority; close when both land and Issue owner accepts completion.

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

Metadata

Metadata

Assignees

Labels

area:processRepo-wide process, governance, privacy and security ruleskind:rfcProposal / design discussion; scope review before buildstatus:acceptedThe decision owner accepted it in a recorded comment

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions