Repository navigation
Lane 1 Stage 1a: L1.5 tail + CostLens L-8 + banked-dissolutions ratchet #495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
3f341e4
Lane 1 Stage 1a: L1.5 tail + CostLens L-8 + banked-dissolutions ratchet
briansrls 4312704
Address #495 review: L-8 regex, banked-dissolutions authority, bind_c…
briansrls 4519002
Address #495 round 3: banked-dissolutions coverage + L-8 prose/ratche…
briansrls File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| #!/usr/bin/env bash | ||
| # Banked-dissolutions ratchet (Lane 1 Stage 1a). | ||
| # | ||
| # Scans lane and phase docs for shapes that the design-blocker set | ||
| # (DB-1…DB-10) has formally rejected. The single authority is the | ||
| # `FORBIDDEN=(...)` array in docs/post-l15-phase-plan.md § "Banked | ||
| # dissolutions — rejected shapes" — this script PARSES that block | ||
| # directly instead of hardcoding a second list. | ||
| # | ||
| # Exempt from the scan: | ||
| # docs/design-*.md — DB docs record the rejections | ||
| # docs/post-l15-phase-plan.md — master plan carries the ratchet itself | ||
| # | ||
| # Usage: scripts/check-banked-dissolutions.sh | ||
| # Exits 0 when clean; exits 1 with a report on any match. | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)" | ||
| cd "$REPO_ROOT" | ||
|
|
||
| MASTER_PLAN="docs/post-l15-phase-plan.md" | ||
|
|
||
| if [ ! -f "$MASTER_PLAN" ]; then | ||
| echo "banked-dissolutions: missing master plan $MASTER_PLAN" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Parse the authoritative FORBIDDEN array from the master plan. awk | ||
| # isolates the lines between `FORBIDDEN=(` and `)`; grep extracts each | ||
| # quoted string, sed strips the surrounding quotes. The master plan's | ||
| # block is the single source of truth — see the plan's § Banked | ||
| # dissolutions for rationale. | ||
| # | ||
| # Implementation note: using grep -oE + sed instead of a pure-bash | ||
| # regex loop because entries like `"#[deprecated]"` contain characters | ||
| # (`#`, `[`, `]`) that bash's `${var/pattern/}` treats as glob | ||
| # metacharacters, leading to infinite loops in the naive version. | ||
| FORBIDDEN=() | ||
| while IFS= read -r entry; do | ||
| [ -n "$entry" ] && FORBIDDEN+=("$entry") | ||
| done < <( | ||
| awk '/^FORBIDDEN=\($/,/^\)$/' "$MASTER_PLAN" \ | ||
| | grep -oE '"[^"]+"' \ | ||
| | sed 's/^"//; s/"$//' | ||
| ) | ||
|
|
||
| if [ "${#FORBIDDEN[@]}" -eq 0 ]; then | ||
| echo "banked-dissolutions: could not extract FORBIDDEN array from $MASTER_PLAN" >&2 | ||
| echo "The master plan's § Banked dissolutions block must contain a bash-style \`FORBIDDEN=(...)\` array." >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| shopt -s nullglob | ||
| FILES=() | ||
| for pattern in docs/lane*.md docs/phase*.md; do | ||
| for file in $pattern; do | ||
| case "$file" in | ||
| docs/post-l15-phase-plan.md) ;; | ||
| docs/design-*.md) ;; | ||
| *) FILES+=("$file") ;; | ||
| esac | ||
| done | ||
| done | ||
| shopt -u nullglob | ||
|
|
||
| if [ ${#FILES[@]} -eq 0 ]; then | ||
| echo "banked-dissolutions: no lane/phase docs to scan" | ||
| exit 0 | ||
| fi | ||
|
|
||
| violations=0 | ||
| for pat in "${FORBIDDEN[@]}"; do | ||
| hits=$(grep -nHF -- "$pat" "${FILES[@]}" 2>/dev/null || true) | ||
| if [ -n "$hits" ]; then | ||
| if [ "$violations" -eq 0 ]; then | ||
| echo "banked-dissolutions ratchet: forbidden shapes found in lane/phase docs." | ||
| echo "Authority: $MASTER_PLAN § Banked dissolutions." | ||
| echo | ||
| fi | ||
| echo "--- forbidden: $pat ---" | ||
| echo "$hits" | ||
| echo | ||
| violations=$((violations + 1)) | ||
| fi | ||
| done | ||
|
|
||
| if [ "$violations" -gt 0 ]; then | ||
| echo "banked-dissolutions ratchet: $violations forbidden shape(s) found." | ||
| echo "Fix: delete the restatement and reference the DB doc instead." | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "banked-dissolutions ratchet: clean (${#FILES[@]} docs scanned, ${#FORBIDDEN[@]} forbidden shapes from $MASTER_PLAN)" |
This file was deleted.
Oops, something went wrong.
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BLOCKING: L-8's mechanical gate only scans
src/v3/compiler/src/lens_*.rs, so the migrated publiclens_costsurface insrc/v3/compiler/src/lib.rsis outside the ratchet the PR claims installs (modeling-discipline §6 / INVARIANTS L-8).