Skip to content

feat(audit): per-round namespacing for multi-phase Charters (fw-4.35.0 / cli-3.33.0, closes #341)#353

Merged
montfort merged 1 commit into
mainfrom
feat/fw-4.35.0-cli-3.33.0-audit-rounds
Jul 13, 2026
Merged

feat(audit): per-round namespacing for multi-phase Charters (fw-4.35.0 / cli-3.33.0, closes #341)#353
montfort merged 1 commit into
mainfrom
feat/fw-4.35.0-cli-3.33.0-audit-rounds

Conversation

@montfort

Copy link
Copy Markdown
Contributor

Release B2 — fw-4.35.0 / cli-3.33.0

The dedicated round for the sensitive piece of the audit-hardening work: multi-round external audits (#341). Combined framework + CLI PR because the two surfaces are coupled (the skills document the CLI's new --round flag).

The problem (#341)

The external-audit subsystem assumed one round per Charter. Multi-phase Charters that need a phase-scoped audit round each broke two ways:

  1. Flat paths overwrite — every round wrote audit-prompt.md / report-*.md / review.md to the same dir.
  2. Cross-round glob pollution (latent correctness bug) — the non-recursive report-*.md glob pulled a prior round's flat reports into the current round's consolidated review.md + telemetry.

CLI — straymark charter audit --round <label>

  • Namespaces the whole triad under .straymark/audits/<CHARTER-ID>/<label>/ → rounds never overwrite, and the glob scopes to exactly the current round (fixes both symptoms).
  • Label validated as a filesystem-safe slug ([A-Za-z0-9._-], alphanumeric start, no separators) — no path traversal.
  • Each external_audit telemetry entry carries a round: field.
  • --merge-into appends a new round to an already-populated block instead of bailing (the decision you picked: append seguro con guard). Same-round guard rejects duplicating a round; merging into a populated block without a round label is still rejected (rounds must stay distinguishable).
  • --prepare next-step guidance threads --round into the /straymark-audit-execute and /straymark-audit-review hints.
  • Back-compat: omit --round → flat layout, byte-for-byte prior behavior.

Framework

Tests

  • Unit: sanitize_round_label (accepts slugs, rejects ../spaces/slashes/leading-dash/over-long), render_external_audit_yaml round tagging, external_audit_has_round, append_to_external_audit_block (inserts after last entry, rejects inline flow), merge_external_audit_into (append second round, reject same round twice, reject populated-without-round).
  • Integration (e2e via binary): --round namespaces the prompt under the subfolder (and does not write the flat path); unsafe label is rejected.
  • Full workspace suite green.

Closes #341.

🤖 Generated with Claude Code

Release B2 (fw-4.35.0 / cli-3.33.0) — the dedicated, sensitive round for the
external-audit multi-round support.

#341 — a Charter that needs more than one external-audit round (e.g. one per
code-heavy phase) previously collided on flat paths and, worse, the flat
non-recursive `report-*.md` glob pulled a prior round's reports into the current
round's consolidated review.md + telemetry (latent correctness bug).

CLI (`straymark charter audit --round <label>`):
  - namespaces the whole triad under .straymark/audits/<CHARTER-ID>/<label>/,
    so rounds never overwrite and the glob scopes to exactly the current round;
  - validates the label as a filesystem-safe slug (no path traversal);
  - tags each external_audit telemetry entry with `round:`;
  - --merge-into now APPENDS a new round to an already-populated block (instead
    of bailing) when the round label is new, with a same-round guard that still
    rejects duplicating a round and still rejects a no-round merge into a
    populated block;
  - threads --round through the --prepare next-step guidance;
  - fully back-compatible: omit --round → flat layout, unchanged.

Framework:
  - AUDIT-ROUNDS-PATTERN.md (EN/es/zh-CN), sibling of FOLLOW-UPS-BACKLOG-PATTERN,
    listed in QUICK-REFERENCE;
  - the 3 audit skills (× 4 shipped copies = 12 files) document the per-round
    subfolder and thread --round; audit-review's stale "CLI rejects re-audit"
    note is corrected to the new append behavior;
  - AGENT-RULES §12 gains "Audit a stable state" (#345 doc note) + "Multi-round
    audits" bullets (EN/es/zh-CN).

Tests: unit (sanitize_round_label, render round tag, external_audit_has_round,
append_to_external_audit_block, merge append/same-round-guard/no-round-bail) +
integration (round namespaces the prompt path; unsafe label rejected). Full
workspace suite green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@montfort montfort merged commit 9ee1ee2 into main Jul 13, 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.

[adopter] charter audit assumes one round per Charter — multi-phase audit rounds collide on flat paths + report-*.md glob

1 participant