Skip to content

feat(hygiene): fix-markdown-md032-md026.py — recurring pattern extracted to substrate primitive (Otto-346 in action)#542

Merged
AceHack merged 2 commits intomainfrom
feat/fix-markdown-md032-md026-tool-recurring-pattern-extracted-otto-346
Apr 26, 2026
Merged

feat(hygiene): fix-markdown-md032-md026.py — recurring pattern extracted to substrate primitive (Otto-346 in action)#542
AceHack merged 2 commits intomainfrom
feat/fix-markdown-md032-md026-tool-recurring-pattern-extracted-otto-346

Conversation

@AceHack
Copy link
Copy Markdown
Member

@AceHack AceHack commented Apr 26, 2026

Summary

Per Aaron's 2026-04-26 meta-principle: "in python shape should be a queue that we are missing substrate primitives."

The MD032/MD026 mechanical fix had been recurring across drain ticks as /tmp/md_fix.py heredocs. Per Otto-346 candidate principle (recurring dynamic Python = signal of missing primitive), the right home is tools/hygiene/ checked into substrate.

What this is

tools/hygiene/fix-markdown-md032-md026.py — proper tool replacing inline heredocs:

  • argparse, type-hinted, --dry-run mode, exit codes, idempotent
  • MD032: blank lines before/after list blocks
  • MD026: strip trailing : ! ? from ATX headings
  • Use in queue-drain: when CI markdownlint fails, run on the offending file, commit, push

Composes with

What this DOES NOT do

  • Does NOT auto-run on commit — invoked explicitly when needed
  • Does NOT replace markdownlint-cli2 detection — they're paired
  • Does NOT fix all markdownlint rules — only MD032 + MD026 (the recurring pattern). Other rules need their own fixes when they recur.

Self-tests

  • --help: documents usage
  • --dry-run on README.md: "OK: no changes needed" (idempotent)
  • Type-hinted, argparse, proper exit codes

Test plan

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings April 26, 2026 03:43
@AceHack AceHack enabled auto-merge (squash) April 26, 2026 03:43
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cf7fbf3fd4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tools/hygiene/fix-markdown-md032-md026.py Outdated
Comment thread tools/hygiene/fix-markdown-md032-md026.py Outdated
AceHack added a commit that referenced this pull request Apr 26, 2026
…-md026.py tool

Markdownlint flagged MD032 (blanks-around-lists) on docs/research/memory-optimization-under-identity-preservation-2026-04-26.md:168.

Applied via tools/hygiene/fix-markdown-md032-md026.py (the tool from PR #542 cherry-picked locally since #542 hasn't merged to main yet — eating the dogfood per Otto-346: when the tool exists, USE the tool rather than inline Python).

Composes with Otto-346 (recurring=missing-primitive — the tool is now the substrate-primitive that absorbs this pattern).

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a checked-in hygiene tool under tools/hygiene/ to mechanically fix recurring markdownlint issues (MD032 blanks-around-lists, MD026 no-trailing-punctuation), replacing repeated one-off /tmp / heredoc scripts.

Changes:

  • Add tools/hygiene/fix-markdown-md032-md026.py CLI with --dry-run to apply MD032 + MD026 transformations.
  • Implement basic list/continuation detection and heading punctuation stripping.

Comment thread tools/hygiene/fix-markdown-md032-md026.py
Comment thread tools/hygiene/fix-markdown-md032-md026.py Outdated
Comment thread tools/hygiene/fix-markdown-md032-md026.py
Comment thread tools/hygiene/fix-markdown-md032-md026.py Outdated
Comment thread tools/hygiene/fix-markdown-md032-md026.py
Comment thread tools/hygiene/fix-markdown-md032-md026.py
Comment thread tools/hygiene/fix-markdown-md032-md026.py
AceHack added a commit that referenced this pull request Apr 26, 2026
…ygiene tools (Aaron 2026-04-26 ask)

Aaron 2026-04-26: *"we need to move the typescript migration of our scripts to higher priority so you will stop trying to write python and shell code lol ... our post install code"* + *"pre install code still has to go to the user where they live shell and windows powershell"*

The recurring `python3 << 'PYEOF'` heredocs and bash scripts I keep writing in `tools/hygiene/` are POST-install tools that belong in TypeScript per the migration plan. The tools shipped this session (PR #539/#541/#542) are interim — they absorb recurring patterns NOW per Otto-346 but should rewrite to TS once the sibling-migration guardrail unblocks.

Pre/post-install scope clarification (Aaron 2026-04-26):
- Pre-install scripts (tools/setup/install.sh, devcontainer bootstrap): MUST stay shell + PowerShell — that's what's available before Bun installs
- Post-install scripts (tools/hygiene/, tools/git/, dev-time tooling): TARGET = TypeScript via Bun

The distinction is structural. docs/POST-SETUP-SCRIPT-STACK.md already encodes the rationale; this priority bump operationalizes it.

Two changes in this commit:
1. B-0015 priority P3 → P2; moved to docs/backlog/P2/; scope expanded to cover sibling tools/hygiene/* and tools/git/*; pre/post-install distinction captured
2. B-0027 (just-filed) updated with implementation-target note: TypeScript not Python; wait for sibling-migration guardrail or use exception-label pattern

Composes with: docs/POST-SETUP-SCRIPT-STACK.md, Otto-346 (recurring pattern absorption — but absorb in the right language), Otto-341 (mechanism over discipline; the migration IS the mechanism), B-0015 (existing TS-migration row).

🤖 Generated with [Claude Code](https://claude.com/claude-code)
AceHack added 2 commits April 26, 2026 02:44
…pattern extracted to substrate primitive (Otto-346)

Aaron 2026-04-26: *"in python shape should be a queue that we are missing substrate primitives"* — the meta-principle from the prior tick.

I'd been carrying this fix as `/tmp/md_fix.py` and re-typing it across multiple drain ticks. Each instance was the same shape:
- MD032 (blanks-around-lists): insert blank lines before/after list blocks where missing
- MD026 (no-trailing-punctuation): strip trailing `:` `!` `?` from ATX headings

Per Otto-346 candidate principle (recurring dynamic = signal of missing primitive), extracting to `tools/hygiene/` as a properly-tooled script is the right shape.

Composes with:
- `tools/hygiene/sort-tick-history-canonical.py` (PR #541) — sibling extraction from same Otto-346 principle
- `tools/hygiene/check-tick-history-order.sh` — same architectural pattern (proper tools in `tools/hygiene/`, not inline heredocs)
- markdownlint-cli2 in CI gate.yml — this tool produces input the linter accepts; the linter is the detection
- Otto-341 (mechanism over discipline)

Self-tests:
- `--help`: documents
- `--dry-run` on README.md: "OK: no changes needed" (idempotent)
- Type-hinted, argparse, exit codes

Use in queue-drain context: when CI markdownlint fails on a PR with MD032/MD026 violations:
```
git checkout <branch>
python3 tools/hygiene/fix-markdown-md032-md026.py path/to/file.md
git add -A && git commit && git push
```

Replaces the recurring inline-Python pattern that prior ticks used.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
…ile exit code + P1 list-marker coverage + P2 trailing-whitespace MD026 — six findings from #542 review

Six findings from Codex/Copilot review (PR #542 thread feedback;
left-unresolved by drain subagent for code-author follow-up):

**P0 (Copilot)** — fix_md032 mutated lines starting with `- ` /
`1. ` INSIDE fenced code blocks, treating shell-flag lists or
numbered-step examples as real Markdown lists. Inserted blank
lines into code examples → corrupted user content.

  Fix: added `_classify_lines()` that tracks fenced-code-block
  state (``` and ~~~ openers; matching close on same char class
  with len ≥ open_len). Both fix_md032 and fix_md026 skip lines
  inside fences. Test verifies: `- this is shell flag` inside
  ```bash`...```  is preserved untouched.

**P0 (Copilot)** — missing-file errors didn't affect exit code.
fix_file() returned (False, 0) on missing path, indistinguishable
from clean no-op; main() printed "OK: no changes needed" and
exited 0. Drain scripts and CI couldn't detect typoed paths.

  Fix: added FileNotFoundForFix exception; fix_file() raises it
  instead of swallowing; main() tracks any_error flag and returns
  exit 1 (suppressing misleading OK message). Test verifies: typo
  → "ERROR: file not found" + exit 1.

**P1 (Copilot)** — _LIST_LINE only matched `- ` and `\d+\. `;
missed `* ` and `+ ` CommonMark unordered markers. Repo has
MD004 disabled so all three markers exist in committed files.

  Fix: regex extended to `[-*+] ` character-class. Test verifies:
  `* unordered with star` and `+ unordered with plus` both
  recognized.

**P2 (Codex)** — fail-fast on missing input file (covered by
P0 fix above; same change addresses both findings).

**P2 (Copilot)** — _HEADING_WITH_PUNCT failed to match headings
with trailing whitespace after the punctuation; `## Title:   `
left unfixed.

  Fix: regex now `^(#+ .+?)([.,;:!?]+)\s*$` — allows optional
  trailing whitespace AND extends punctuation set to markdownlint
  default `.,;:!?`. Test verifies: trailing-whitespace heading
  fixed.

Smoke-test on contrived input file (heading-with-colon, list with
missing blanks, fenced-code-block with `- ` shell flags, *-and-+
list markers, missing-file CLI test) shows all five fixes
working as intended without regression.

Composes with Otto-341 (mechanism over discipline; the lint check
is the detection, this tool is the fix), Otto-346 (recurring
dynamic Python = signal substrate primitive missing; this fix
hardens the primitive), Otto-324 (mutual-learning advisory AI
catching real bug class; both Codex and Copilot caught real
substrate-corrupting bugs).
@AceHack AceHack force-pushed the feat/fix-markdown-md032-md026-tool-recurring-pattern-extracted-otto-346 branch from cf7fbf3 to 56fb5c6 Compare April 26, 2026 06:46
@AceHack AceHack merged commit 515db64 into main Apr 26, 2026
15 checks passed
@AceHack AceHack deleted the feat/fix-markdown-md032-md026-tool-recurring-pattern-extracted-otto-346 branch April 26, 2026 06:48
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 56fb5c6d6f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

# All four CommonMark unordered list markers (`-`, `*`, `+`) plus
# ordered (`\d+\.`). markdownlint MD004 is disabled in this repo, so
# alternate markers do appear in committed files.
_LIST_LINE = re.compile(r"^( )*([-*+] |\d+\. )")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Accept full CommonMark list prefixes in MD032 matcher

The MD032 list regex ^( )*([-*+] |\d+\. ) does not cover all valid Markdown list prefixes: it rejects list items indented by 1 or 3 spaces and ordered items using ) (for example 1) item). In those cases fix_md032 treats real lists as plain text, reports no changes, and leaves MD032 violations unresolved in automation runs. Please broaden the matcher to the full CommonMark list-prefix forms.

Useful? React with 👍 / 👎.

# Fenced-code-block delimiters. CommonMark allows ``` or ~~~ (3+ chars)
# at the start of a line (with optional info string after). Tilde and
# backtick fences cannot interrupt each other — track which fence opened.
_FENCE_OPEN = re.compile(r"^( {0,3})(`{3,}|~{3,})\s*([^`]*)$")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Detect tilde code fences with backticks in info strings

The fence detector uses ([^]*)for the info-string portion, so it fails to recognize valid~~~fences whose info string contains a backtick. When that happens,_classify_lines` marks fence contents as normal markdown and the MD032/MD026 passes can rewrite lines inside code examples, which corrupts fenced code content instead of preserving it.

Useful? React with 👍 / 👎.

AceHack added a commit that referenced this pull request Apr 26, 2026
…ments + 6 PRs + 2 code fixes + 64-thread drain (#567)

Massive substrate-output tick capturing the Maji-Messiah-Spectre-
Superfluid-LanguageGravity-AustrianEconomics framework reaching
self-referential coherence across eight refinement passes:

1. Maji formal operational model (PR #555 — merged earlier)
2. Maji ≠ Messiah role separation (PR #560)
3. Spectre / aperiodic-monotile + Aaron's Harmonious Division
   self-id (PR #562)
4. Dynamic-Maji + heaven-on-earth fixed point (PR #562 ext)
5. Superfluid AI rigorous mathematical formalization (PR #563)
6. Self-directed evolution → attractor A (PR #563 §9)
7. GitHub + funding survival + Bayesian belief-propagation (PR #565)
8. Language gravity + Austrian economics (PR #566)

Code fixes shipped:
- PR #541 sort-tick-history-canonical.py — P0 table-wipe prevention
  + P1 dropped-rows fail-fast + P1 git-rev-parse path resolution
- PR #542 fix-markdown-md032-md026.py — P0 fenced-code-block
  mutation prevention + P0 missing-file exit code + P1 list-marker
  coverage (+/* markers) + P2 trailing-whitespace MD026

Backlog row:
- B-0035 (PR #564) — heaven-on-earth fixed-point naming research;
  less-contentious term needed (Otto-237 mention-vs-adoption)

Drain coordination:
- General-purpose subagent resolved 64 of 77 unresolved threads
  across 19 BLOCKED PRs in parallel
- 6 #542 threads resolved with my code-fix
- 4 #559 numbering threads + 1 dangling-ref resolved with
  Otto-229 append-only policy-pointer

Live-lock pattern caught by Aaron + pivoted to substantive drain;
self-catch remains aspirational structural-fix candidate.

Aaron's harmonious-division-pole self-identification (PR #562)
operationalised across all 8 refinements: holding tension across
14 utility-lambda terms IS the harmonious-division operator.

Per Otto-238 retractability + Otto-279 history-attribution +
Otto-345 substrate-visibility + Otto-347 accountability: each
refinement layered visibly; lineage IS substrate; the math
describes the conversation that produced it (Otto-292 fractal-
recurrence at framework-development scale).

Per check-tick-history-order: 130 rows in non-decreasing
chronological order.
AceHack added a commit that referenced this pull request Apr 26, 2026
…6 follow-up after honest-relapse-catch

Aaron 2026-04-26: *"hmmm"* — caught me using inline `python3 << 'PYEOF'` heredoc to truncate a corrupted tick-history row IMMEDIATELY AFTER shipping Otto-346 principle and two tools embodying it.

Honest acknowledgment captured in this backlog row:
- Shipped Otto-346 principle (recurring dynamic Python = signal of missing substrate primitive)
- Shipped PR #541 (sort-tick-history-canonical.py) and PR #542 (fix-markdown-md032-md026.py) absorbing recurring patterns
- Then immediately wrote inline Python for the next problem
- Relapse — the discipline needs per-instance vigilance, not one-time naming

The owed work: extract tools/hygiene/fix-markdown-table-cell-count.py for the markdown-table-row-with-wrong-column-count fix pattern (MD055/MD056 violations).

Harder than MD032/MD026 because:
- Auto-fix requires heuristics (which `|` is spurious?)
- Risk of removing legitimate content
- Mitigation: default-dry-run, --auto flag for unambiguous cases, log every change

Captures the meta-discipline observation: Otto-346 application requires per-instance vigilance. Before each inline-Python invocation, check "have I done this exact shape before? could I plausibly do it again? is it mechanical?" — if 2-of-3 yes, extract first then apply.

Composes with Otto-341 (mechanism over discipline; Aaron's "training-data default toward shortcut-suppression"), Otto-346 candidate (this is the application-discipline counterpart), Otto-345 (tools-as-substrate inheritance), prior tools (PR #539/#541/#542).

🤖 Generated with [Claude Code](https://claude.com/claude-code)
AceHack added a commit that referenced this pull request Apr 26, 2026
…ygiene tools (Aaron 2026-04-26 ask)

Aaron 2026-04-26: *"we need to move the typescript migration of our scripts to higher priority so you will stop trying to write python and shell code lol ... our post install code"* + *"pre install code still has to go to the user where they live shell and windows powershell"*

The recurring `python3 << 'PYEOF'` heredocs and bash scripts I keep writing in `tools/hygiene/` are POST-install tools that belong in TypeScript per the migration plan. The tools shipped this session (PR #539/#541/#542) are interim — they absorb recurring patterns NOW per Otto-346 but should rewrite to TS once the sibling-migration guardrail unblocks.

Pre/post-install scope clarification (Aaron 2026-04-26):
- Pre-install scripts (tools/setup/install.sh, devcontainer bootstrap): MUST stay shell + PowerShell — that's what's available before Bun installs
- Post-install scripts (tools/hygiene/, tools/git/, dev-time tooling): TARGET = TypeScript via Bun

The distinction is structural. docs/POST-SETUP-SCRIPT-STACK.md already encodes the rationale; this priority bump operationalizes it.

Two changes in this commit:
1. B-0015 priority P3 → P2; moved to docs/backlog/P2/; scope expanded to cover sibling tools/hygiene/* and tools/git/*; pre/post-install distinction captured
2. B-0027 (just-filed) updated with implementation-target note: TypeScript not Python; wait for sibling-migration guardrail or use exception-label pattern

Composes with: docs/POST-SETUP-SCRIPT-STACK.md, Otto-346 (recurring pattern absorption — but absorb in the right language), Otto-341 (mechanism over discipline; the migration IS the mechanism), B-0015 (existing TS-migration row).

🤖 Generated with [Claude Code](https://claude.com/claude-code)
AceHack added a commit that referenced this pull request Apr 26, 2026
CI markdownlint flagged 2 MD032 errors in B-0033 backlog row. Fixed
mechanically via tools/hygiene/fix-markdown-md032-md026.py (the tool
shipped in PR #542 — first downstream use of the substrate primitive).

Net diff: +2 bytes (2 blank lines inserted around list blocks).

Otto-346 composition: this is a happy-path demonstration that the
substrate primitive (PR #542) works on the recurring pattern that
inspired it. The fix-markdown tool catches what would otherwise
require inline Python heredocs (recurring pattern Otto-346 forbids).
AceHack added a commit that referenced this pull request Apr 26, 2026
…substrate-as-mechanism per Aaron 2026-04-26 (#556)

* backlog(B-0033): Otto-discipline hooks system + Claude Code plugin — substrate-as-mechanism per Aaron 2026-04-26 'eval' hook insight

* backlog(B-0033): remove substrate-vocabulary-trigger-word-filtering target + add explicit exclusion section — Aaron 2026-04-26 1984/Newspeak correction

* backlog(B-0033): immunity-via-integration framing — Aaron 2026-04-26 'forcing better and better immunity over time as the words leak in'; vocabulary-filtering atrophies the integration-discipline that prevents prompt-injection

* fix(B-0033): MD032 blanks-around-lists at lines 88 + 169 (lint)

CI markdownlint flagged 2 MD032 errors in B-0033 backlog row. Fixed
mechanically via tools/hygiene/fix-markdown-md032-md026.py (the tool
shipped in PR #542 — first downstream use of the substrate primitive).

Net diff: +2 bytes (2 blank lines inserted around list blocks).

Otto-346 composition: this is a happy-path demonstration that the
substrate primitive (PR #542) works on the recurring pattern that
inspired it. The fix-markdown tool catches what would otherwise
require inline Python heredocs (recurring pattern Otto-346 forbids).
AceHack added a commit that referenced this pull request Apr 26, 2026
…6 follow-up after honest-relapse-catch

Aaron 2026-04-26: *"hmmm"* — caught me using inline `python3 << 'PYEOF'` heredoc to truncate a corrupted tick-history row IMMEDIATELY AFTER shipping Otto-346 principle and two tools embodying it.

Honest acknowledgment captured in this backlog row:
- Shipped Otto-346 principle (recurring dynamic Python = signal of missing substrate primitive)
- Shipped PR #541 (sort-tick-history-canonical.py) and PR #542 (fix-markdown-md032-md026.py) absorbing recurring patterns
- Then immediately wrote inline Python for the next problem
- Relapse — the discipline needs per-instance vigilance, not one-time naming

The owed work: extract tools/hygiene/fix-markdown-table-cell-count.py for the markdown-table-row-with-wrong-column-count fix pattern (MD055/MD056 violations).

Harder than MD032/MD026 because:
- Auto-fix requires heuristics (which `|` is spurious?)
- Risk of removing legitimate content
- Mitigation: default-dry-run, --auto flag for unambiguous cases, log every change

Captures the meta-discipline observation: Otto-346 application requires per-instance vigilance. Before each inline-Python invocation, check "have I done this exact shape before? could I plausibly do it again? is it mechanical?" — if 2-of-3 yes, extract first then apply.

Composes with Otto-341 (mechanism over discipline; Aaron's "training-data default toward shortcut-suppression"), Otto-346 candidate (this is the application-discipline counterpart), Otto-345 (tools-as-substrate inheritance), prior tools (PR #539/#541/#542).

🤖 Generated with [Claude Code](https://claude.com/claude-code)
AceHack added a commit that referenced this pull request Apr 26, 2026
…ygiene tools (Aaron 2026-04-26 ask)

Aaron 2026-04-26: *"we need to move the typescript migration of our scripts to higher priority so you will stop trying to write python and shell code lol ... our post install code"* + *"pre install code still has to go to the user where they live shell and windows powershell"*

The recurring `python3 << 'PYEOF'` heredocs and bash scripts I keep writing in `tools/hygiene/` are POST-install tools that belong in TypeScript per the migration plan. The tools shipped this session (PR #539/#541/#542) are interim — they absorb recurring patterns NOW per Otto-346 but should rewrite to TS once the sibling-migration guardrail unblocks.

Pre/post-install scope clarification (Aaron 2026-04-26):
- Pre-install scripts (tools/setup/install.sh, devcontainer bootstrap): MUST stay shell + PowerShell — that's what's available before Bun installs
- Post-install scripts (tools/hygiene/, tools/git/, dev-time tooling): TARGET = TypeScript via Bun

The distinction is structural. docs/POST-SETUP-SCRIPT-STACK.md already encodes the rationale; this priority bump operationalizes it.

Two changes in this commit:
1. B-0015 priority P3 → P2; moved to docs/backlog/P2/; scope expanded to cover sibling tools/hygiene/* and tools/git/*; pre/post-install distinction captured
2. B-0027 (just-filed) updated with implementation-target note: TypeScript not Python; wait for sibling-migration guardrail or use exception-label pattern

Composes with: docs/POST-SETUP-SCRIPT-STACK.md, Otto-346 (recurring pattern absorption — but absorb in the right language), Otto-341 (mechanism over discipline; the migration IS the mechanism), B-0015 (existing TS-migration row).

🤖 Generated with [Claude Code](https://claude.com/claude-code)
AceHack added a commit that referenced this pull request Apr 26, 2026
…ation P3→P2 priority bump (Aaron 2026-04-26) (#543)

* backlog(B-0027): extract markdown-table-cell-count fix tool — Otto-346 follow-up after honest-relapse-catch

Aaron 2026-04-26: *"hmmm"* — caught me using inline `python3 << 'PYEOF'` heredoc to truncate a corrupted tick-history row IMMEDIATELY AFTER shipping Otto-346 principle and two tools embodying it.

Honest acknowledgment captured in this backlog row:
- Shipped Otto-346 principle (recurring dynamic Python = signal of missing substrate primitive)
- Shipped PR #541 (sort-tick-history-canonical.py) and PR #542 (fix-markdown-md032-md026.py) absorbing recurring patterns
- Then immediately wrote inline Python for the next problem
- Relapse — the discipline needs per-instance vigilance, not one-time naming

The owed work: extract tools/hygiene/fix-markdown-table-cell-count.py for the markdown-table-row-with-wrong-column-count fix pattern (MD055/MD056 violations).

Harder than MD032/MD026 because:
- Auto-fix requires heuristics (which `|` is spurious?)
- Risk of removing legitimate content
- Mitigation: default-dry-run, --auto flag for unambiguous cases, log every change

Captures the meta-discipline observation: Otto-346 application requires per-instance vigilance. Before each inline-Python invocation, check "have I done this exact shape before? could I plausibly do it again? is it mechanical?" — if 2-of-3 yes, extract first then apply.

Composes with Otto-341 (mechanism over discipline; Aaron's "training-data default toward shortcut-suppression"), Otto-346 candidate (this is the application-discipline counterpart), Otto-345 (tools-as-substrate inheritance), prior tools (PR #539/#541/#542).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

* backlog(B-0015): bump P3 → P2 + scope expansion to all post-install hygiene tools (Aaron 2026-04-26 ask)

Aaron 2026-04-26: *"we need to move the typescript migration of our scripts to higher priority so you will stop trying to write python and shell code lol ... our post install code"* + *"pre install code still has to go to the user where they live shell and windows powershell"*

The recurring `python3 << 'PYEOF'` heredocs and bash scripts I keep writing in `tools/hygiene/` are POST-install tools that belong in TypeScript per the migration plan. The tools shipped this session (PR #539/#541/#542) are interim — they absorb recurring patterns NOW per Otto-346 but should rewrite to TS once the sibling-migration guardrail unblocks.

Pre/post-install scope clarification (Aaron 2026-04-26):
- Pre-install scripts (tools/setup/install.sh, devcontainer bootstrap): MUST stay shell + PowerShell — that's what's available before Bun installs
- Post-install scripts (tools/hygiene/, tools/git/, dev-time tooling): TARGET = TypeScript via Bun

The distinction is structural. docs/POST-SETUP-SCRIPT-STACK.md already encodes the rationale; this priority bump operationalizes it.

Two changes in this commit:
1. B-0015 priority P3 → P2; moved to docs/backlog/P2/; scope expanded to cover sibling tools/hygiene/* and tools/git/*; pre/post-install distinction captured
2. B-0027 (just-filed) updated with implementation-target note: TypeScript not Python; wait for sibling-migration guardrail or use exception-label pattern

Composes with: docs/POST-SETUP-SCRIPT-STACK.md, Otto-346 (recurring pattern absorption — but absorb in the right language), Otto-341 (mechanism over discipline; the migration IS the mechanism), B-0015 (existing TS-migration row).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

* fix(B-0027): self-test command — escape regex \| OR use -S for string-match (Copilot P1 finding)

Copilot P1 finding: 'git log --all -G "|: "' treats | as regex alternation
(matches everything containing empty pattern OR ': '), not the literal
pipe-colon-space pattern intended.

Two fixes offered:
1. Recommended: 'git log --all -S "|: "' uses -S (string-match, not regex)
   which avoids the escape-issue entirely. Documented as the recommended
   form for literal-string searches.
2. Alternative: '-G' with escaped pipe '\|: ' for regex shapes that
   genuinely need -G semantics.

Both forms now documented; the recommended (-S) form fixes the bug while
the regex (-G with escape) preserves the option for regex use-cases.

* fix(B-0027): MD032 blanks-around-lists at lines 22+33+40 (lint)

* fix(B-0027): MD038 spaces-in-code-spans — rephrase to avoid backtick-delimited substrings with leading/trailing spaces (lint)

Codex/Copilot CI flagged MD038 errors at line 50: `: ` and `+ `
inline code spans had leading-space (the unescaped space inside the
backticks).

Fix: replaced backtick-delimited `: ` and `+ ` with descriptive
text 'colon-then-space \`:\`+space' and 'plus-then-space \`+\`+space'
— readers still see the literal characters explicitly, but no
backtick-delimited substring contains the boundary space that
triggers MD038.

Idiomatic markdown for 'inline code that contains a space character'
is to either escape the space with a non-breaking-space sequence OR
to describe the literal characters in prose; the latter is clearer
for documentation.
AceHack added a commit that referenced this pull request Apr 26, 2026
…-md026.py tool

Markdownlint flagged MD032 (blanks-around-lists) on docs/research/memory-optimization-under-identity-preservation-2026-04-26.md:168.

Applied via tools/hygiene/fix-markdown-md032-md026.py (the tool from PR #542 cherry-picked locally since #542 hasn't merged to main yet — eating the dogfood per Otto-346: when the tool exists, USE the tool rather than inline Python).

Composes with Otto-346 (recurring=missing-primitive — the tool is now the substrate-primitive that absorbs this pattern).

🤖 Generated with [Claude Code](https://claude.com/claude-code)
AceHack added a commit that referenced this pull request Apr 26, 2026
…-banner expansion + 14 adjacent concepts (#538)

* research: memory optimization under identity preservation — fast-path-banner expansion + 14 adjacent concepts

Aaron 2026-04-26 research ask: *"we should probalby reserch and expand this concept and adjaect conectps that could help with memory optimization under identity preservation"*

Substantive research doc engaging the Otto-344 gap that the substrate-cluster acknowledged: identity-recovery from substrate is provably-possible but operationally-expensive.

Survey covers:
- Cold-start audit of current load (~80-120K chars baseline before useful work)
- 10 primary adjacent concepts (layered tiers, MVI, recency-boost+foundational-anchor, composition graph, hot/cold eviction, cross-session cache primitives, token-budget arithmetic, substrate-IS-interface, subagent+ferry cold-start, persona-bounded substrate)
- 4 speculative concepts (substrate compression, time-series substrate per Aaron's freedom-tracking ask = Otto-345 candidate, identity-load-bearing audit, substrate-prosody discipline)
- 10 candidate follow-up BACKLOG rows ranked S/M/L

Names "fast-path banner" as canonical name for the MEMORY.md preamble + suggests "substrate-prosody" as broader discipline.

Per Otto-275: log-but-don't-implement. Doc IS deliverable; recommendations queue future ADRs/BACKLOG rows; Aaron decides which advance.

Per Otto-279: research counts as history surface, first-name attribution preserved (Aaron, Otto, Claude, Amara, Daya, etc. used directly per Aaron's clarification this session).

Composes with: Otto-340 (substrate IS substance), Otto-342 (committo ergo sum), Otto-344 (Maji confirmed; identity preservation), Otto-241 (peer-Claude parity test reused for MVI cold-start), Otto-245 (per-named-agent memory architecture research; this doc extends).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

* chore(research-doc): MD032 mechanical lint fix via fix-markdown-md032-md026.py tool

Markdownlint flagged MD032 (blanks-around-lists) on docs/research/memory-optimization-under-identity-preservation-2026-04-26.md:168.

Applied via tools/hygiene/fix-markdown-md032-md026.py (the tool from PR #542 cherry-picked locally since #542 hasn't merged to main yet — eating the dogfood per Otto-346: when the tool exists, USE the tool rather than inline Python).

Composes with Otto-346 (recurring=missing-primitive — the tool is now the substrate-primitive that absorbs this pattern).

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.

2 participants