f683f1aec8
Gate-first TDD: widened design_index_pin.rs clause-3 to a hand-rolled
FAITHFUL Sweep-1 superset (case-sensitive digit-anchored line anchors
+ Sweep-1's ^[^/]* path-excluded date + the audit-named
decision-record phrases, case-insensitive); no regex dep; the blanket
iter-detector rejected as unworkable. Sentence-level strip of
faithfully-migrated history/decision-record prose out of 5 contract
files (the audit's 3 spot-checked + roundtrip-invariant.md +
data-model.md the exhaustive scan found) into the decision-record
journal, each replaced by its present-tense contract equivalent;
float-semantics.md stale 'see Str ABI below' -> str-abi.md;
architect_sweeps honesty sweeps re-scoped to design/contracts only
(models/ is the narrative tier) + ailang-architect.md lockstep.
Invariant: clause-3 GREEN => Sweep-1 clean in contracts/.
The prior dispatch correctly BLOCKED on a real plan defect (iso_date
lacked Sweep-1's path-exclusion, over-firing on legit
docs/specs/2026-.. citations); per the two+-defects-in-one-iteration
discipline the audit Resolution mechanism+scope were corrected
upstream in lockstep (f2cdd67) before re-dispatch, not patched a
third time.
Boss-verified independently: cargo test --workspace 646/0,
design_index_pin 4/4 (clause-3 RED->GREEN), architect_sweeps.sh exit
0 'All five sweeps clean' (acceptance criterion 9 met), acceptance
grep CLEAN, 3 docs_honesty_pin pinned runs each exactly 1 contiguous
match. Zero spec/quality re-loops. FINAL design-md-rolesplit
iteration — milestone functionally complete, audited, drift-resolved,
hard gate enforces the honesty spirit.
66 lines
2.9 KiB
Bash
Executable File
66 lines
2.9 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# bench/architect_sweeps.sh
|
|
#
|
|
# Run the five honesty/anchor sweep-invariant greps against the
|
|
# design/contracts (the honesty-bound contract surface; design/models
|
|
# is the narrative tier, out of honesty-sweep scope); the spine is
|
|
# design/INDEX.md. Output: matched lines, prefixed by sweep name.
|
|
# Exit 0 if all five sweeps are clean, 1 if any anchor was found,
|
|
# 2 if the spine (design/INDEX.md) is not found. Sweeps 1-4 are the
|
|
# history-anchor invariants; Sweep 5 is the docs-honesty-lint
|
|
# Wunschdenken / post-mortem invariant.
|
|
#
|
|
# Companion to skills/audit/agents/ailang-architect.md "What you check
|
|
# / design/ history-anchor regrowth". See JOURNAL 2026-05-10
|
|
# ("Milestone close: design-md-consolidation") for the rationale of
|
|
# each sweep regex; the regexes here are copied verbatim from JOURNAL
|
|
# entries 12487 (Sweep 1), 12619 (Sweep 2), 12718-12720 (Sweep 3),
|
|
# and 12840 (Sweep 4).
|
|
#
|
|
# A non-zero exit is advisory, not authoritative: the architect agent
|
|
# reviews each match and decides whether it is a legitimate quote
|
|
# (e.g. a JOURNAL citation inside a block-quote) or fresh drift.
|
|
|
|
set -u
|
|
INDEX="design/INDEX.md"
|
|
DESIGN_GLOB="design/contracts" # contracts only — design/models is the narrative tier; "as of milestone N" context is legitimate there
|
|
HITS=0
|
|
|
|
if [[ ! -f "$INDEX" ]]; then
|
|
echo "architect_sweeps: $INDEX not found (run from repo root)" >&2
|
|
exit 2
|
|
fi
|
|
|
|
run_sweep() {
|
|
local name="$1"
|
|
local pattern="$2"
|
|
local matches
|
|
matches=$(grep -rnE "$pattern" $DESIGN_GLOB || true)
|
|
if [[ -n "$matches" ]]; then
|
|
echo "=== Sweep: $name ==="
|
|
echo "$matches"
|
|
echo
|
|
HITS=1
|
|
fi
|
|
}
|
|
|
|
run_sweep "1 (history anchors)" \
|
|
'Iter [0-9]+[a-z]?(\.[0-9]+)?|Family [0-9]+|^[^/]*2026-[0-9]{2}-[0-9]{2}|\*\*Status: |pre-[0-9]+[a-z]?|[0-9]+[a-z]? sketch|21\.g'
|
|
|
|
run_sweep "2 (REVERTED + migration)" \
|
|
'REVERTED|preserved for the audit trail|Migration plan|[Oo]riginally framed|original rationale|empirically-grounded version|A future (iter|iteration|milestone|Prelude) may|A future iter that|a (later|future) iter(ation)? \(deferred\)|Concrete design deferred'
|
|
|
|
run_sweep "3 (schema SoT)" \
|
|
'^\s*(struct |enum |pub (struct|enum|fn))|whenever the two disagree|ast\.rs is the source of truth'
|
|
|
|
run_sweep "4 (workflow + stale cross-references)" \
|
|
'agents/README\.md|ailang-docwriter|Recently lifted|see the JOURNAL queue|later the same day|Sharpened later|closure conversion in JOURNAL'
|
|
|
|
run_sweep "5 (honesty: wunschdenken + non-citation post-mortem)" \
|
|
'on the path to|may land in a future|ships in a future iter|[Ww]ill back `Show|[Ww]ill eventually (be|support|back)|[Ii]f/?when [a-z]+ (arrives|lands)|[Aa]n earlier draft of this|previously all diagnostics were|[Ww]hat did change in 20|were retired 20[0-9]{2}-|retired in iter [a-z]|originally listed|\bwas deferred\b|foundation for [a-z]'
|
|
|
|
if [[ $HITS -eq 0 ]]; then
|
|
echo "All five sweeps clean."
|
|
fi
|
|
exit $HITS
|