Skip to content

Record second-door-to-a-gated-answer in the ledger, with the gate inventory test that holds it - #23

Open
sumerjohal wants to merge 2 commits into
mainfrom
harness/second-door-lesson
Open

sumerjohal wants to merge 2 commits into
mainfrom
harness/second-door-lesson

Conversation

@sumerjohal

Copy link
Copy Markdown
Contributor

What

Four of the six findings in the 2026-10-08 review are one defect wearing different clothes: a route is gated carefully, and then a second route, a header, a flag or a self-typed claim answers the same question with no credential. #19, #20, #22 and ar2-hub#9 each close one door. This PR records the pattern in the lessons ledger and adds the check that holds it, per the harness's own rule that a lesson at or above the threshold must name a test that exists.

Ledger

second-door-to-a-gated-answer, four occurrences dated 2026-10-08, kind mechanized, enforced by app/tests/test_gate_inventory.py::test_every_door_to_a_gated_answer_carries_the_gate. AGENTS.md briefing regenerated with stomata brief --write.

Two incidental corrections to the ledger file, both from re-saving through the CLI:

  • hashed-identifier-inverted-over-a-small-domain had enforced_by stored as a bare string; the loader split it into one-character list items on every save (visible as a, p, p, /, t, … in stomata lesson list on main). Restored as a one-element list. Below threshold, so no check was affected.
  • The top-level seed note is kept alongside the updated_at the CLI adds.

The check

test_gate_inventory.py walks the mounted routes, selects the ones whose path answers a gated question (field L1 reads, lot members, both trace directions), and reads each handler's source: it must call authorize_artifact or verify_field_grant, and must not read os.environ/os.getenv, the idiom every flag-shaped bypass has used. An empty inventory fails outright; a leaky stub proves the two findings fire.

Five doors are open on main today and listed in OPEN_DOORS with the PR that closes each. Those entries are xfail and required to still fail: once #19 or #22 merges, this test goes red until the waiver is removed, so a waiver cannot outlive its door. Verified by checking out #22's fetch_field.py onto this branch: four waivers flipped to FAILED with the message "the PR has merged: remove it from OPEN_DOORS".

The secret-header door (#20) is not caught by this check, since the members route still uses the secret legitimately and the gate there is the ledger write; test_internal_secret.py in #20 holds that one directly.

harness/bin/stomata run: 12/12, check K now 7/7 recurring lessons mechanized.

Merge order

Any. After #19 or #22 merges, remove their entries from OPEN_DOORS in the same change or the next one; the test will say so.

sumerjohal and others added 2 commits October 11, 2026 09:24
…s it

Four of the six findings in the 2026-10-08 review are one defect: a
route is gated carefully, and then a second route, a header, a flag or a
self-typed claim answers the same question with no credential. The
reverse lot index (#19), the shared secret (#20), AR_ACCOUNT_L1 (#22)
and the hub's role-derived capability (ar2-hub#9).

Ledger: four occurrences, kind mechanized, enforced by
app/tests/test_gate_inventory.py. The test walks the mounted routes,
selects the ones whose answer is gated, and requires each handler to call
a gate function and read no environment variable. An empty inventory
fails. Five doors open on this tree are listed with the PR that closes
each, xfail, and required to still fail: when the PR merges the test goes
red until the waiver is removed. Verified by checking out #22's router
onto this branch: four waivers flipped to FAILED.

Two corrections from re-saving the ledger through the CLI: one lesson's
enforced_by was a bare string the loader split into characters on every
save, restored as a one-element list; the seed note is kept.

AGENTS.md briefing regenerated. stomata run: 12/12, K now 7/7.

Co-authored-by: Cursor <cursoragent@cursor.com>
… not 2a9a3ea

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

1 participant