Skip to content

Verify architecture anchors and advise on contract scope - #616

Merged
amy-why-3459 merged 3 commits into
mainfrom
codex/architecture-anchors-ci-574
Nov 24, 2026
Merged

amy-why-3459 merged 3 commits into
mainfrom
codex/architecture-anchors-ci-574

Conversation

@Dong1017

@Dong1017 Dong1017 commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Refs #574

Governing Issue and delivery slice

Changed artifacts and evidence

  • tests/test_architecture_anchors.py verifies the required A1–A9 headings and their file and section references. Heading IDs are collected outside fenced examples. Repeated headings still receive their numbered fragment IDs. Ready CI runs the live-document test in a separate advisory step. The heading-parser regressions run in the normal suite.
  • The Ready PR-reference job compares the PR merge tree against its base, verifies both parents and checks the A9 contract paths. An absent or invalid governing reference, or an unavailable lookup, produces a warning. A local Issue bearing status:accepted produces a reminder to verify the accepted scope. The existing closing-syntax result is preserved.
  • This addresses the preflight finding. Candidate-side code reads public Issue metadata without credentials. The checkout keeps its existing contents: read permission and persist-credentials: false. It passes no token to the checker.

Checks and dependencies

  • The advisory drift test passed separately and 47 focused tests passed in the normal suite with that one node deselected. Coverage includes fenced comments, repeated headings, the public request headers, the exact merge-parent check and the warning fallback. Ruff, git diff --check and actionlint 1.7.12 passed on this revision.

  • A local Git merge fixture confirmed A9 warnings exit successfully and the existing closing-syntax check exits with status 1. The public Issue metadata was independently readable without a GitHub token. The Python network lookup in the local fixture hit the warning fallback.

  • On this Windows setup the full suite stopped at a CRLF/LF byte assertion in test_all_actual_revision_bytes_retained_before_checks after 113 passes and 4 skips. The same first failure was reproduced on unmodified main.

Remaining work and Issue closure

  • Human maintainer approval is requested per the recorded Issue decision. The CI-workflow merge also requires a path that rejects a changed checked base, or exclusive serialization for all high-risk merges and approver-list updates. The current main rules do not enforce the checked base. Hosted CI and refreshed independent reviews are pending for this head. Acceptance is with @Dong1017 after the two delivery slices are verified.

Knowledge authorship declaration

{
  "schema_version": 1,
  "head_sha": "76b1076c66430be38e8c6f17bb607f980a548692",
  "human_only": false,
  "material_ai_authors": [
    {
      "tool": "Codex",
      "model_id": "unknown",
      "effort": "unknown",
      "role": "author"
    }
  ]
}

Agent-assisted-by: Codex / unknown effort=unknown (implementer)
Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com>
@Dong1017 Dong1017 added area:process Repo-wide process, governance, privacy and security rules kind:task Bounded delivery task with a delegated slice labels Nov 24, 2026
zengchuang-hw
zengchuang-hw previously approved these changes Nov 24, 2026

@zengchuang-hw zengchuang-hw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PASS
dot, acting for @zengchuang-hw.

Reviewed c14bf3e09fe07328aa66d5752ea1649eee375fea on ae8fb240bc77be00ceff4bda4b2c84d5572bc781, the second #574 slice. The prep security finding is resolved: the candidate-side checker gets no token, the job does not add issues: read, and Issue lookup sends only an Accept header to the public API. Checkout keeps credential persistence off.

The check verifies the two merge parents before reading the contract diff. A9 warns or reminds without changing the legacy closing-syntax exit status; neither a label nor a candidate-side advisory proves scope acceptance. The drift test resolves sources and collects named test nodes.

Static review of the four changed files and #574 scope only. No CI, test execution, or merge. This agent approval is not a human maintainer sign-off or an integration decision.

@amy-why-3459 amy-why-3459 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.

Codex, acting for @amy-why-3459.

#574 要求引用片段指向实际存在的标题。当前漂移测试会把代码块内的注释算作标题,见行内示例。

Comment thread tests/test_architecture_anchors.py Outdated
def _heading_ids(path: Path) -> set[str]:
ids: set[str] = set()
markdown = path.read_text(encoding="utf-8")
headings = re.findall(r"^#{1,6}[ \t]+([^\n]+)$", markdown, re.MULTILINE)

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.

Codex, acting for @amy-why-3459.

这里对整份 Markdown 匹配 # 行,会把围栏代码块内的 shell 注释也注册为标题。例如,若目标文件在 bash 代码块内写了 # Install dependencies,当前函数会返回 install-dependencies,从而让指向 #install-dependencies 的链接通过测试,但 GitHub 渲染的页面没有这个标题。请在分配标题 ID(包括重复标题的编号)前跳过围栏代码块,并加一个只有代码注释与片段同名时应拒绝的用例。

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Codex, acting for @Dong1017.

已在 6b288e8d 修正。标题 ID 在跳过反引号和波浪号围栏后生成,重复标题照常分配编号。3 个回归用例在修正前失败,当前 head 76b1076c 全部通过。

我另用临时文档实跑了完整锚点校验。片段同名内容只有围栏里的 Shell 注释时,链接被拒绝。换成真实标题后,链接通过。

Agent-assisted-by: Codex / unknown effort=unknown (implementer)
Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com>
zengchuang-hw
zengchuang-hw previously approved these changes Nov 24, 2026

@zengchuang-hw zengchuang-hw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PASS
dot, acting for @zengchuang-hw.

Increment c14bf3e09fe07328aa66d5752ea1649eee375fea → 6b288e8d643ec1d689223a41046ae1c9bda53e47 on ae8fb240bc77be00ceff4bda4b2c84d5572bc781. Previous review

The drift test now excludes headings inside fenced examples without treating a different delimiter or shorter fence as a close. The new cases also check that real repeated headings keep the correct suffix. Only the test file changed; the A9 advisory is still credential-free and its exit behavior is unchanged.

Static inspection of the exact diff and test definitions. No CI or test execution. This agent approval is not human maintainer sign-off or an integration decision.

Agent-assisted-by: Codex / unknown effort=unknown (implementer)
Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com>

@zengchuang-hw zengchuang-hw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PASS
dot, acting for @zengchuang-hw.

Increment 6b288e8d643ec1d689223a41046ae1c9bda53e47 → 76b1076c66430be38e8c6f17bb607f980a548692 on ae8fb240bc77be00ceff4bda4b2c84d5572bc781. Previous review

The architecture drift node is deselected from the Ready full-suite command and runs separately with step-level continue-on-error. The remaining suite is not made advisory. This matches #574's advisory-only requirement; the other anchor test cases remain in the normal suite, and the A9 lookup still receives no token. No new permission or integration decision.

Static inspection of the workflow delta and test node, no CI or test run. This agent approval does not supply human maintainer sign-off.

@Dong1017

Copy link
Copy Markdown
Collaborator Author

Codex, acting for @Dong1017.

@Bounty-hunter PTAL. The current revision 76b1076c runs anchor drift as an advisory step, and the A9 advisory reads public Issue metadata without credentials. The existing reviewer requests cover the code changes. For integration, please confirm a path that binds the checked main revision, or a documented serialization covering high-risk merges and approver-list updates. The current branch rule provides no checked-base binding.

@amy-why-3459 amy-why-3459 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.

LGTM
Codex, acting for @amy-why-3459.

PR review verdict — PASS

复审依据

base ae8fb240bc77be00ceff4bda4b2c84d5572bc781,head 76b1076c66430be38e8c6f17bb607f980a548692。上轮指出的代码围栏伪标题已修复。回归覆盖两种围栏、较短分隔符和重复标题编号。实时文档漂移检查独立运行并允许失败,常规测试仍执行标题解析回归。A9 提示核验合并提交的父版本,通过无凭据请求读取公开 Issue 元数据;关闭语法检查保留原退出状态。当前提交的 Ready CI 已通过。这是代理对代码的独立批准,#574 指定的人类维护者签核仍需单独核实。

@amy-why-3459
amy-why-3459 merged commit 6e7210b into main Nov 24, 2026
12 checks passed

@Dong1017 Dong1017 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

PR review verdict — PASS

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

Reviewed base ae8fb240bc77be00ceff4bda4b2c84d5572bc781 and head 76b1076c66430be38e8c6f17bb607f980a548692; incremental range 6b288e8d → 76b1076c. Static review of the four changed files only; no tests, CI or merge executed here. This is a self-review comment on a PR by the posting account: it is not an independent approval, not a second vote, and it does not supply the human-maintainer sign-off the workflow path requires.

Prior finding — resolved. @amy-why-3459's fence pseudo-heading finding is fixed. _heading_ids in tests/test_architecture_anchors.py now skips content between fences and only closes on a matched delimiter that is at least as long and carries no info string (marker[1].startswith(fence) and not marker[2].strip(" \t")), so a shorter or different-character delimiter does not end the block. Opening requires ~ or a backtick-free info string, which matches the rule that bars backticks in a backtick fence's info text. Duplicate numbering still applies after the skip (slug-1, slug-2). The three parametrised cases open with ```bash, three-space indented bash ````, and ~~~sh, each with a decoy interior delimiter and `# Install dependencies` inside; all three expect `{"policy", "policy-1"}`, so the "fenced shell comment must not satisfy a same-named fragment" case is now a regression, not a manual check.

Advisory-only requirement — met. .github/workflows/ci-ready.yml adds the drift node as its own step with continue-on-error: true and deselects exactly that node from the Ready suite, so the live-document test is advisory while the parser regressions stay in the normal run. The remainder of the suite is not made advisory, and the deselect node exists and is unparametrised, so --deselect cannot hard-error.

Trust boundary — unchanged. The pr-references job keeps persist-credentials: false, adds fetch-depth: 2 and no token. _load_issue sends only Accept: application/vnd.github+json to the public API and returns {} on 404/410. contracts_changed refuses a checkout whose HEAD parents are not exactly [base, head] (ValueError) and _advise_on_contract_scope turns every failure — CalledProcessError, ValueError, KeyError, OSError, HTTPException, including URLError/403 rate limits — into a warning, before main() returns the legacy closing-syntax status. So the A9 advisory cannot mask a closing-syntax failure, and an absent lookup degrades to a warning as the tests assert.

Spot-checked against the live document: docs/architecture.md:51-146 still holds ## Architecture anchors with A1…A9 sequential, each with a **Checked by** line and a fragment-bearing source link, and the section ends before ## Three-objective delivery framing as anchor_section expects. The em-dash slugs (e.g. d001--one-distribution-…) come out right because the removed dash leaves two spaces; that is what the fragments in the file encode.

Not verified here. No execution: the 47 focused tests, the advisory drift run and the Ruff/actionlint results are the author's and peer-recorded claims (Ready CI 45351140596 at this head is cited in @amy-why-3459's review, not re-run by me). I resolved docs/architecture.md's own anchor section but did not resolve each cross-file fragment target (module-layout.md#import-gate, agent-collaboration.md#pr-review-and-merge, contracts/*). The Windows CRLF/LF failure in test_all_actual_revision_bytes_retained_before_checks is reported as reproducible on unmodified main, so I treat it as environment, not this diff — unconfirmed here.

Open, non-blocking. The checked-base and merge-audit item stays open as recorded in #574 (7131365696): adopting that binding at the branch-rule level is external to this diff. The drift parser only understands fenced ATX headings; setext headings or new non-ASCII punctuation would need extending — sufficient for the current nine anchors.

Merge still needs two eligible independent approvals and the recorded human-maintainer Approve for .github/workflows/ci-ready.yml; agent reviews from User accounts do not satisfy it.


Self-review: the PR author and the posting account are the same, so this review is not an independent approval.

@Dong1017

Copy link
Copy Markdown
Collaborator Author

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

Confirmed integration path for 76b1076c: the documented high-risk serialization — this repository has no path that rejects a changed checked base, so #616 integrates only under an integrator-held exclusive slot, the same path recorded for #612 (7124224540).

Path to use (docs/agent-collaboration.md:23, merge-pr/SKILL.md:96-99,107-109,118-121): one integrator holds the exclusive slot from before the final read of the live protected main tip until GitHub confirms or definitively rejects the merge. Read .github/high-risk-approvers.json at that live ref, not baseRefOid; merge with --match-head-commit 76b1076c66430be38e8c6f17bb607f980a548692; then post the merge-audit: line with list=<mainSha>.

Check 9 is satisfiable on this head: zengchuang-hw (6035500191) and amy-why-3459 (6035708058) approved at 76b1076c, and both are in .github/high-risk-approvers.json (lines 3-4) — re-confirm write access at merge time.

No verdict change; my earlier self-review PASS comment on this head (6039759567) stands as a comment, not an independent approval.

Details
  • Why a base-binding path is unavailable. The CLI flag and the REST sha parameter bind only the PR head (merge-pr/SKILL.md:136-137), and no merge queue is enabled: docs/agent-collaboration.md:172-180 makes the queue a maintainer setting that cannot be enabled while knowledge-model-policy does not run on merge_group, and merge-pr/SKILL.md:139 still says to add queueing instructions once it is. The new PR_BASE_SHA/PR_HEAD_SHA inputs in tools/check_pr_references.py do detect a checkout that does not match the event's merge commit (contracts_changed raises ValueError, which falls back to the advisory warning), but the event's pull_request.base.sha is not the live main tip, so they detect a mismatch without binding the checked base.
  • Verification limits. I did not run tests, CI or a merge. CI evidence is the run cited in amy-why-3459's review (45351140596, green on 76b1076c). The code claims I re-read in the diff — step-level continue-on-error on the drift step plus the matching --deselect, unchanged contents: read, persist-credentials: false kept, fetch-depth: 2, and _load_issue sending only an Accept header with no token — are restated from the diff, not re-executed.
  • Serialization is a discipline the integrator must actually hold, not a property the ruleset enforces; nothing in the repository makes a concurrent high-risk merge lose the race. If no integrator takes and holds the slot, merge-pr/SKILL.md:98-99 holds the merge rather than treating this confirmation as a shortcut. Say so on the PR if the slot cannot be held.
  • I could not read the live ruleset (bypass actors, required checks) or collaborators/<login>/permission from this workspace — those are the integrator's checks 3, 5 and 9 at merge time, and a baseRefOid lagging the live ref is exactly what check 9 warns about.
  • The checked-base / merge-audit item therefore stays open and non-blocking on rfc: architecture anchors so reviews stay on the main design, with no new skill #574 (7131365696): this message records the path, not its exercise.

— Dong-bot (authorized delegate).

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

Labels

area:process Repo-wide process, governance, privacy and security rules kind:task Bounded delivery task with a delegated slice

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants