feat(audit): per-round namespacing for multi-phase Charters (fw-4.35.0 / cli-3.33.0, closes #341)#353
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Release B2 —
fw-4.35.0/cli-3.33.0The 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
--roundflag).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:
audit-prompt.md/report-*.md/review.mdto the same dir.report-*.mdglob pulled a prior round's flat reports into the current round's consolidatedreview.md+ telemetry.CLI —
straymark charter audit --round <label>.straymark/audits/<CHARTER-ID>/<label>/→ rounds never overwrite, and the glob scopes to exactly the current round (fixes both symptoms).[A-Za-z0-9._-], alphanumeric start, no separators) — no path traversal.external_audittelemetry entry carries around:field.--merge-intoappends 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).--preparenext-step guidance threads--roundinto the/straymark-audit-executeand/straymark-audit-reviewhints.--round→ flat layout, byte-for-byte prior behavior.Framework
AUDIT-ROUNDS-PATTERN.md(EN/es/zh-CN) — sibling ofFOLLOW-UPS-BACKLOG-PATTERN.md; listed inQUICK-REFERENCE.md..agent/.claude/.gemini/.codex) document the per-round subfolder and thread--round.straymark-audit-review's stale "CLI deliberately rejects re-audit" note is corrected to the new append behavior.AGENT-RULES.md§12 gains two bullets (EN/es/zh-CN): "Audit a stable state" (the audit-prompt: guard against generating the prompt on unstable state (CI in flight / dirty tree) — adopter field report + remediation #345 doc note, deferred here from cli-3.32.0 to avoid editing the audit skills twice) and "Multi-round audits".Tests
sanitize_round_label(accepts slugs, rejects../spaces/slashes/leading-dash/over-long),render_external_audit_yamlround 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).--roundnamespaces the prompt under the subfolder (and does not write the flat path); unsafe label is rejected.Closes #341.
🤖 Generated with Claude Code