Skip to content

Derive repository grant count from reviewed policy - #1013

Merged
seathatflowsinourveins merged 2 commits into
mainfrom
foundation/engine-qual-grant-count-derivation-20261011
Oct 11, 2026
Merged

seathatflowsinourveins merged 2 commits into
mainfrom
foundation/engine-qual-grant-count-derivation-20261011

Conversation

@seathatflowsinourveins

@seathatflowsinourveins seathatflowsinourveins commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

Scope

Concurrent inventory-grant additions currently require editing the same numeric test assertion. Derive its expected repository-grant count from the policy's repository rows so future grant additions need no test-count edit, while preserving the independent exact Git-inventory comparison.

  • Reviewed landing head: 42b2b03986b8de23018c387c502443fad790ba18; the CC builder rebased and pushed the two commits, with carry PASS. The grant test is byte-identical to the previously reviewed 0ce65753 (Git blob af578dc204a38750752b36d485dbe347f6006c31). Merged at 2026-10-11T22:21:44Z.
  • Base commit: bcf55c457d057c71faceeab068bdd02017c43342 (current main at branch creation).
  • Lane: lane:foundation.
  • Owned paths: tests/test_local_pages_policy_grants.py and its hash/byte registration in manifests/evidence.json.

SOTA sources

  • Existing reviewed policy and selector at native-agent-stack bcf55c457d057c71faceeab068bdd02017c43342: source_policy.json, inventory_paths, and the existing independent inventory assertion at tests/test_local_pages_policy_grants.py:74-81. The policy and production selector are unchanged.
  • CPython cbc944f4bc59639a444dd971c737788ba2283a91 (installed Python 3.13.16 reference mirror): Python/bltinmodule.c:2578, supported sum over the Boolean repository-row predicate; Lib/unittest/mock.py:1764, supported temporary fixture patches. Exact pinned-source excerpts/blob identities are retained in the local evidence packet.
  • The base policy loader tools/local-pages/source_policy.py:251-260 collects grants into a set, so duplicate repository rows were accepted before this PR; the new row-count guard rejects them.
  • Existing supported file-registration API, scripts/host_receipts.py:710, updates only the touched test's registration.

Evidence-class table

Claim Evidence class Command / receipt
One additional matching policy/inventory grant needs no test-count edit synthetic New fixture calls the existing assertion; RED.json observes 92 != 91 before the fix, GREEN.json passes afterward
Missing, extra and replaced grants remain rejected; duplicate-row rejection is new synthetic Negative controls invoke the same inventory assertion with each policy mutation
Other existing assertions remain intact; repository integrity passes local_integration Touched module passes 23 tests; validate.py exits 0 with 11,630 registered hashes

Why the derivation is not vacuous

The count compares unique policy paths with the number of repository policy rows, so duplicate rows now also fail. The previous literal counted unique paths and accepted duplicate rows; rejecting duplicates is new in this PR. The existing actual == expected assertion remains unchanged: expected still comes independently from git ls-files through the existing reviewed selector and catalog metadata. A missing or extra grant fails that exact-set comparison, and a replacement with the same cardinality also fails. The four negative controls exercise these boundaries; every other original test method is unchanged.

Local commands run

python3 -m unittest tests.test_local_pages_policy_grants.PolicyGrantDerivation.test_inventory_check_accepts_one_more_grant_without_changing_the_count
Before count correction: exit 1, one assertion failure, zero errors (92 != 91).

python3 -m unittest tests.test_local_pages_policy_grants
After correction: exit 0, 23 tests passed.

python3 scripts/validate.py
Exit 0: 70 components, 11,630 hashed files, 4 profiles, 239 receipts.

Retained local packet: ~/.local/state/native-agent-stack/coordination/ns2604-coop/lanes/engine-qual.grant-count-20261011/, including exact fail-before test bytes, input/output hashes, observed exits and pinned source excerpts. This is the original 7cdeacd packet; its historical method name and body used "still" for duplicate refusal and are superseded by the correction.

Current wording-correction packet: ~/.local/state/native-agent-stack/coordination/ns2604-coop/lanes/engine-qual.grant-count-wording-20261011/, with the renamed final source, current test/validator observations and the base-versus-head duplicate control.

Decision record

No repository rule or production grant changes. This adopts a source-derived test expectation within the existing policy/selector contract.

Host evidence

Not applicable: no evidence/hosts/ receipt or platform-status change.

Follow-ups

  • Astra P3 inherited host-label hygiene: 20 pre-existing occurrences on 18 lines in manifests/evidence.json, counted only; no identifier is published here. Later normalization must update dependent integrity records together.
  • F2 (pre-existing P3), scripts/local_pages_policy_grants.py:48-53: the selector adds fixed and catalog paths without checking that they are tracked. Deleting a fixed path from the index can leave this test green at both base and head; follow up separately after landing.

The CC owns the landing order; this PR is merged at the head/time above and made no edits to peer PR branches.

Checklist

  • No workflow or action changes.
  • No secrets printed, logged or committed; no new required secret.
  • No paid hosting, subscription or billing surface.
  • Peer-owned worktrees and untracked files preserved.
  • Original derivation commit plus one tiny wording correction; policy checks and independent inventory comparison retained.

@seathatflowsinourveins seathatflowsinourveins added the lane:foundation Foundation lane: Claude/Codex setup, hosts, memory, RAG, research, workers label Oct 11, 2026
@seathatflowsinourveins
seathatflowsinourveins marked this pull request as ready for review October 11, 2026 18:00
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-11T18:39:49.661178Z 0ce6575 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@seathatflowsinourveins

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 0ce6575301

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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

Labels

lane:foundation Foundation lane: Claude/Codex setup, hosts, memory, RAG, research, workers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant