Skip to content

feat: add the contribution-state record and gate G-14 - #3

Merged
ahrazzle merged 1 commit into
mainfrom
contrib/continual-contribution-mode
Sep 17, 2026
Merged

ahrazzle merged 1 commit into
mainfrom
contrib/continual-contribution-mode

Conversation

@ahrazzle

Copy link
Copy Markdown
Contributor

Adds the contribution-state record and its gate, G-14.

What

  • records/CONTRIB-STATE.md.tmpl carries 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.py answers two questions from that one record: whether the recorded state is legal, and whether a queried write may happen now.
  • Fixtures: one valid record and three invalid ones (internal mode off with no cited decision, three live lanes, an expired grant with an over-cap action count), mirrored under tests/fixtures/ as the sibling gates are.
  • tests/test_contrib_state.py gives every rule a green case and a red case; --self-test runs 19 focused cases.

Enforced from the record: the toggle enum; the always-on internal assertion (off refused without a cited decision: <id>); external_contrib: on refused without a switch row 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_actions at most 3, consumption rows).

Fail closed. An absent record reads as external_contrib: off and internal_contrib: on: a state query passes and a remote-write query is refused. An unreadable or malformed record is a violation, never a silent off. A missing quiet-hours timezone database refuses an external write.

Evidence

command result
python3 scripts/protean-ops/check-contrib-state.py records/examples/valid/CONTRIB-STATE.md PASS, 5 rows, 0 violations
python3 scripts/protean-ops/check-contrib-state.py records/examples/invalid/CONTRIB-STATE-*.md exit 1 on each
python3 scripts/protean-ops/check-contrib-state.py --self-test PASS, 19 cases, 0 failed
python3 -m unittest discover -s tests Ran 59 tests, OK
python3 gates/protean-ops/check-internal-names.py . clean: 57 files scanned, 0 findings
the five sibling gates on records/examples/valid/ exit 0 each

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_York and 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.

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 ahrazzle left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

@ahrazzle
ahrazzle merged commit 0b78ff7 into main Sep 17, 2026
2 checks passed
@ahrazzle
ahrazzle deleted the contrib/continual-contribution-mode branch September 17, 2026 15:55
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