Skip to content

[bench] constitution: split rule from commentary, send the models the rule only (v7) - #50

Merged
dburks-svg merged 2 commits into
mainfrom
bench/constitution-v6
Sep 5, 2026
Merged

[bench] constitution: split rule from commentary, send the models the rule only (v7)#50
dburks-svg merged 2 commits into
mainfrom
bench/constitution-v6

Conversation

@dburks-svg

@dburks-svg dburks-svg commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Roadmap v2.1 item 2.1. Every stage prompt carried the whole of bench.json, so each byte was paid for three times per governed edit.

What changes

  • pipeline.constitution.prompt_view() renders a constraint as id, name, scope, rule, severity, and the raised-severity marker. rationale and the new optional commentary field never reach a model. The view is derived: the ledger's constitution_hash still covers the authored file.
  • All three stage builders send prompt_view(constitution). A test asserts the Challenger, Defender, and Oracle see identical constitutional text.
  • python -m cli constitution prints the rule and, when present, the commentary on a line labeled "not sent to models" (release check R2).
  • bench.json v6 to v7. C-004 and C-008 move auditor procedure and explanatory prose from rule into commentary. Every (a) through (d) requirement in C-008 stays in the rule word for word. Nothing a constraint forbids changes. The roadmap card says 5 to 6; the constitution was already at 6 since the 2026-08-22 sanitation amendment.
  • Budget gate. tests/test_constitution_prompt_view.py asserts Bench's own constitution renders under 6,000 characters (1,500 tokens at four chars per token, no tokenizer dependency). It failed at v6 and passes at v7:
prompt view chars approx tokens
v6, full file (before) 8,584 2,146
v6, rules only 6,522 1,630
v7, rules only (this PR) 5,522 1,380

Median tokens per edit on the ledger before this PR: 36,146 (p90 47,696). The dashboard will show the after figure once entries accrue on v7.

Receipts

Ten governed edits, all PASS. Ruff and strict mypy clean. Targeted suites green (constitution, layers, challenger, defender, oracle, commands, runner, input validation, readme claims, ledger hygiene). python -m cli verify VALID.

… rule only (v7)

Every stage prompt carried the whole of bench.json, so each byte was paid
for three times per governed edit and C-008's 3,067-character rule was the
largest single item. Roadmap v2.1 item 2.1.

- pipeline/constitution.py: optional per-constraint `commentary` field
  (string when present) and prompt_view(), which renders a constraint as
  id, name, scope, rule, severity, and the raised-severity marker.
  Rationale and commentary never reach a model. The view is derived; the
  ledger's constitution_hash still covers the authored file.
- challenger, defender, oracle: _build_user_content sends
  prompt_view(constitution). All three stages see identical text.
- cli constitution: prints the rule and, when present, the commentary
  on a line labeled "not sent to models".
- bench.json v6 -> v7: C-004 and C-008 move auditor procedure and
  explanatory prose from `rule` into `commentary`. Every (a)-(d)
  requirement in C-008 stays in the rule. Nothing a constraint forbids
  changes.
- tests/test_constitution_prompt_view.py: field selection, verbatim rule
  passthrough, commentary schema, each builder omits rationale and
  commentary, and a budget gate on Bench's own constitution (6,000 chars,
  1,500 tokens at 4 chars/token). The gate failed at v6 (6,522 chars)
  and passes at v7 (5,522).
- README: constitution section, per-project schema, cost paragraph.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WVBooRMkd73P8J3PPLt1Uu

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 940a081129

ℹ️ 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".

Comment thread cli/commands.py Outdated
… address review

Codex: the README says `cli constitution` shows rationale and commentary
apart from the rule, but the command printed commentary only. Both now
print on lines labeled "not sent to models", and a test asserts it.

Sonar S3776: cmd_constitution's per-constraint block moves to
_print_constraint, with _preview replacing three copies of the truncation.
Sonar S5778: the commentary rejection test builds its path outside the
assertRaises block so only one call can throw.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WVBooRMkd73P8J3PPLt1Uu
@dburks-svg

Copy link
Copy Markdown
Contributor Author

@codex review

@sonarqubecloud

sonarqubecloud Bot commented Sep 5, 2026

Copy link
Copy Markdown

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: ec4efd0637

ℹ️ 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".

@dburks-svg
dburks-svg merged commit cb7be35 into main Sep 5, 2026
9 checks passed
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