Skip to content

v0.17.6 feat: governance prose clarity (EXP-0001) - #7

Merged
chinmaygit merged 4 commits into
mainfrom
bold-elion-c856b3
Jul 7, 2026
Merged

v0.17.6 feat: governance prose clarity (EXP-0001)#7
chinmaygit merged 4 commits into
mainfrom
bold-elion-c856b3

Conversation

@chinmaygit

Copy link
Copy Markdown
Owner

Summary

Governance engine — new WARN-ONLY checks (EXP-0001)

  • Adds PROSE-SENTENCE-LEN, PROSE-STACKED-QUALIFIER, and LEDGER-LENGTH findings to constitution audit — all severity: warn, never blocking. Extends LedgerEntry/Adr to capture body text (previously metadata-only) and adds a self-initializing baseline-snapshot mechanism (.constitution/prose-baseline.json) so pre-existing dense text doesn't contaminate the false-positive-rate tracking during the WARN-ONLY window.
  • Fixes two pre-existing bugs found while calibrating against real repo text: parseExperiment's section parser silently truncated multi-line sections (an m-flag regex bug), and the baseline-write path produced duplicate keys when 2+ fields shared a location.

Governance docs

  • New templates/ledger-entry.md (150-word cap, points narrative to BUILDLOG.md); tightened templates/article.md/templates/adr.md with plain-prose guidance.
  • Pre-registers experiments/EXP-0001-governance-prose-clarity.md (F-III: hypothesis, WARN-ONLY enforcement, 15-commit window, <20% false-positive threshold, frozen decision rule) — this framework's first real experiment file.
  • README.md/AGENTS.md updated to surface the new experiments/ directory and ledger-entry.md template in their indices.

Release bookkeeping

  • Version bumped 0.17.5 → 0.17.6 (cli/package.json, CONSTITUTION.md header + new Amendments Ledger entry [0.17.6], dogfooding the new ledger-entry template in the same change that introduces it).
  • Fixed .gitignore's blanket .constitution/ exclusion (git can't un-ignore a file whose parent directory is itself excluded) so the baseline snapshot can actually be committed.
  • Reorganized TODOS.md into the canonical format; recorded two deferred items (a delta-based ratification gate fast-follow, and a pre-existing parseBoldBullets truncation bug found but out of scope here).

Test Coverage

Tests: 23 → 41 (+18 new), all passing. Coverage of the new code: 78% → 100% after closing 6 gaps found by the ship coverage audit (Article Fitness/Why, Statute rule/Why, and ADR-body checkProse call sites were previously only exercised via Article Principle).

Pre-Landing Review

7 issues found (4 testing gaps, 3 maintainability notes) — all addressed: 4 coverage-closing tests added, 2 mechanical fixes applied ([NEW] tag in CLI text output for non-baseline findings; a code comment linking the tunable thresholds to the experiment doc), 1 design judgment resolved per your choice (strengthened audit()'s doc-comment rather than a rename/split, given the churn cost outweighed the risk today).

Design Review

No frontend files changed — design review skipped.

Eval Results

No prompt-related files changed — evals skipped.

Scope Drift

Scope Check: CLEAN. Delivered exactly what was reviewed (T1-T10), plus two legitimately-discovered bug fixes that were necessary prerequisites, not scope creep.

Plan Completion

10/10 plan-eng-review items (T1-T10) DONE. T11 (delta-based ratification gate, Approach C) correctly deferred to TODOS.md by design — not part of this PR.

TODOS

TODOS.md reorganized into the canonical component/priority format. 0 items completed by this PR (both recorded items are explicitly deferred future work). 2 items remaining.

Documentation

  • README.md's Repo map and AGENTS.md's governance map both omitted the new experiments/ top-level directory (this repo's own WARN-ONLY EXP-0001 governance-prose-clarity experiment, dogfooding process/experiment-lifecycle.md). Added a line to each.
  • README.md's template parenthetical was missing ledger-entry.md (the new template added in this branch); also filled in two pre-existing omissions (governance-map.md, constitution.md) while there.
  • No CHANGELOG.md/VERSION file exists in this repo by design — the Amendments Ledger in CONSTITUTION.md ([0.17.6]) and cli/package.json's version field are this repo's changelog equivalent and were already updated and in sync; left untouched.
  • cli/README.md, docs/architecture.md, and templates/AGENTS.md were audited but need no changes.

Adversarial Review

Claude adversarial subagent (Codex not installed) caught one real, concrete bug before its connection dropped mid-response: the baseline-snapshot write path produced duplicate keys (39 written, 35 unique on the real repo) whenever 2+ fields shared a location. Fixed, tested, and the baseline regenerated cleanly (35/35 unique).

Test plan

  • All Vitest tests pass (41 tests)

🤖 Generated with Claude Code

chinmaygit and others added 4 commits July 7, 2026 23:18
Adds PROSE-SENTENCE-LEN, PROSE-STACKED-QUALIFIER, and LEDGER-LENGTH findings to
`constitution audit` -- all severity:warn, never blocking. Extends LedgerEntry
and Adr to capture body text (previously metadata-only: version/date/title,
id/status/serves), adds a self-initializing baseline-snapshot mechanism
(.constitution/prose-baseline.json) to isolate new findings from pre-existing
dense text for false-positive-rate tracking during the WARN-ONLY window.

Also fixes two pre-existing bugs found while calibrating against real text:
- parseExperiment's section() regex used the 'm' flag, which makes `$` match
  end-of-line rather than end-of-file -- silently truncated any multi-line
  Hypothesis/Metric/Decision-rule section to its first physical line. Went
  unnoticed since every prior experiment fixture used single-line sections.
- The baseline-snapshot write path produced duplicate array entries whenever
  2+ fields (e.g. Article Principle and Fitness) shared the same (code,
  where) key -- deduped with a Set before writing.

41 new/updated tests in cli/test/engine.test.ts and cli/test/experiments.test.ts,
including regression guards against the real repo's known-bad calibration
examples (Article F-II's current text, Ledger entry [0.17.0]).
…ce, EXP-0001

Adds templates/ledger-entry.md (150-word cap, points narrative to BUILDLOG.md
instead of the ledger) and tightens templates/article.md and templates/adr.md
with plain-prose guidance -- one idea per sentence, no stacking a second
qualifier onto a first.

Pre-registers experiments/EXP-0001-governance-prose-clarity.md per F-III:
hypothesis, WARN-ONLY enforcement, false-positive-rate metric, a frozen
decision rule (15-commit window, <20% threshold), and the guardrail catch-rate
check against the two real calibration cases.

process/amendment-lifecycle.md gets one line pointing at the new ledger-entry
template.
Adds Amendments Ledger entry [0.17.6] (82 words, no narrative -- dogfoods the
new ledger-entry template in the same change that introduces it). Bumps
cli/package.json and package-lock.json to 0.17.6 to match, per this
self-hosted repo's F-II pin/ledger axis collapse.

Fixes .gitignore's blanket `.constitution/` exclusion: git can't un-ignore a
file whose parent directory is itself excluded, so the directory-level
pattern is now `.constitution/*` with a negation for prose-baseline.json --
the EXP-0001 evidence file needs to be committed so the WARN-ONLY window's
false-positive-rate tracking is consistent across commits and CI, not
re-seeded from scratch on every fresh checkout. Includes the regenerated,
duplicate-free baseline snapshot.

Reorganizes TODOS.md into the canonical component/priority format and records
two items found during this work: the delta-based ratification gate
(Approach C, deferred fast-follow) and a pre-existing parseBoldBullets
truncation bug (out of scope for this change).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ices

README.md's Repo map and AGENTS.md's governance map both enumerated
top-level directories but omitted the new experiments/ dir (EXP-0001,
this repo's own WARN-ONLY governance-prose-clarity experiment), and
README's template parenthetical was missing ledger-entry.md (plus two
pre-existing omissions: governance-map.md, constitution.md).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@chinmaygit
chinmaygit merged commit d5a50db into main Jul 7, 2026
2 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