Repository navigation
feat: add the contribution-state record and gate G-14 - #3
Conversation
records/CONTRIB-STATE.md.tmpl carries the fixed header and the eleven fixed columns of the continual-contribution state. scripts/protean-ops/check-contrib-state.py answers whether the recorded state is legal and whether a queried write may happen now: toggle enum, the always-on internal assertion, the lane cap, the per-window rate table, the per-thread write limit, the quiet-hours window, the per-repository burst detector, and the grant rules, all recomputed from timestamps. Fail closed: an absent or unreadable record reads as external off, so a remote write is refused while a local branch, commit, test run, and rendered draft stay allowed. The gate refuses external_contrib: on without a switch row citing the operator reference, and internal_contrib: off without a cited decision id. Ships the record template, four fixtures (one valid, three invalid), the focused test file, and the declared gate. Bumps the ingredient to 1.1.0.
ahrazzle
left a comment
There was a problem hiding this comment.
QA COMMENT REVIEW
Scope: exact head 8665c27.
Shaka's independent gate receipt reports PASS. The append-only contribution-state schema, fail-closed toggle, G-14 checker, lane/rate/thread/burst/quiet-hour/grant enforcement, fixtures, and focused tests were verified. The live state read-back is internal on and external off.
Evidence: shaka-qa.md §2–§4 and shaka-receipt.md; 19 checker cases, 14 focused tests, 59 repository tests, redaction checks, and CI on Python 3.9 and 3.11 passed. Scope limit: the live idle evaluator is outside this repository and remains a separate runtime verification item.
Decision: PASS for merge at this exact head. Merge lane may proceed only after the current head and checks are read back again.
Adds the contribution-state record and its gate, G-14.
What
records/CONTRIB-STATE.md.tmplcarries the fixed header and the eleven fixed columns of the continual-contribution state: the two toggle values, the append-only row kinds, and the counters and grants the gate recomputes from timestamps.scripts/protean-ops/check-contrib-state.pyanswers two questions from that one record: whether the recorded state is legal, and whether a queried write may happen now.tests/fixtures/as the sibling gates are.tests/test_contrib_state.pygives every rule a green case and a red case;--self-testruns 19 focused cases.Enforced from the record: the toggle enum; the always-on internal assertion (
offrefused without a citeddecision: <id>);external_contrib: onrefused without aswitchrow citing the operator reference; the lane cap (2 live, at most 1 external); the per-window rate table for pull requests, issues, comments, and reviews; the per-thread write limit; the per-repository burst detector; the quiet-hours window; and the grant rules (scope, expiry within 14 days,max_actionsat most 3, consumption rows).Fail closed. An absent record reads as
external_contrib: offandinternal_contrib: on: a state query passes and a remote-write query is refused. An unreadable or malformed record is a violation, never a silentoff. A missing quiet-hours timezone database refuses an external write.Evidence
python3 scripts/protean-ops/check-contrib-state.py records/examples/valid/CONTRIB-STATE.mdpython3 scripts/protean-ops/check-contrib-state.py records/examples/invalid/CONTRIB-STATE-*.mdpython3 scripts/protean-ops/check-contrib-state.py --self-testpython3 -m unittest discover -s testspython3 gates/protean-ops/check-internal-names.py .records/examples/valid/Limits, stated rather than hidden. Live repository backlog counts and thread attention metrics are not derivable from a local record, so this gate does not claim them: a lane reads them live and records the raw output in its own evidence file. The quiet-hours rule needs a timezone database for
America/New_Yorkand refuses an external write without one. The bounded values are constants of this gate, tunable only by amending the rule they come from.Version — descriptor, installer banner, and the declared-gate list all move to 1.1.0.