Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
6e66803
Record T1/T2 tension decisions from the consolidation review queue
luisalima Jul 6, 2026
ca91bf5
T21 (sheal review: apply consolidation change-set dispositions): appl…
luisalima Jul 7, 2026
ea140eb
T21: decisions on the same file compose — execute re-reads at apply time
luisalima Jul 7, 2026
bc2ebbd
T21: execute the 2026-07-06 consolidation dispositions; file T22
luisalima Jul 7, 2026
586025d
T21: decisions file references are fenced to plain store filenames
luisalima Jul 7, 2026
7629444
T21 (sheal review: apply consolidation change-set dispositions) — done
luisalima Jul 7, 2026
47af8b7
T21: close tutor-found validation gaps; idempotent supersede/retire
luisalima Jul 7, 2026
c847040
File T23 (preserve unknown frontmatter) and Q7 (frozen evidence vs li…
luisalima Jul 7, 2026
9711903
T21: close the qa-personas deterministic breach — symlink write-through
luisalima Jul 7, 2026
5b83745
T23 (Preserve unknown frontmatter through learnings-store round-trips)
luisalima Jul 9, 2026
360c0c2
Mark T20 and T22 autonomy:auto for the ship-backlog driver
luisalima Jul 9, 2026
15fe46d
Block T20 (Harden the T14 gates against the qa-personas bypasses) on …
luisalima Jul 17, 2026
646ed34
T22 (Validate checkpoint completeness inside sheal retro) — done via …
luisalima Jul 17, 2026
c91268e
File T24 (retro product-feedback branch) and T25 (shared file-tools c…
luisalima Jul 17, 2026
62507ca
File T26 (Reject path traversal in session-id file resolution) from t…
luisalima Jul 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,18 @@ sheal learn lint --format json
sheal consolidate # Writes .sheal/consolidation/<date>-change-set.md
sheal consolidate --format json # Mechanical change set to stdout
sheal consolidate --prompt # LLM judgment-stage prompt — pipe to any agent CLI

# Apply stage: execute reviewed dispositions against the store
sheal consolidate --decisions decisions.json # Dry run — prints the plan
sheal consolidate --decisions decisions.json --apply # Executes it
```

The decisions file is JSON with a `decisions` array; each entry names a store
file and one action: `renumber` (`toId`), `supersede` (`by`), `retire`
(`reason`), or `rewrite` (`title` + `body`). Every decision is validated
before anything is written; supersede and retire append a provenance line to
the learning body. List status changes before a renumber of the same file.

#### Git-based backup & sync

Back up `~/.sheal/` to a git repo for cross-machine sync and team sharing. By default backs up learnings, digests, and config. Optionally includes retros from all projects.
Expand Down
18 changes: 18 additions & 0 deletions docs/adr/0001-validation/2026-07-06-change-set.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,14 @@ milestone; producing it is the contract for `sheal consolidate`
compaction") and LEARN-012S ("re-read after 3+ edits"). Proposed precedence:
trust context _by default_; re-read only on the two named triggers
(compaction occurred, or file touched 3+ times). No file states this today.
**Decided 2026-07-06 (Luisa): adopted as proposed.** Precedence now stated
in [working-session-cadence](working-session-cadence.md) rule 4.
- **T2 — verify-per-edit vs. batch-into-one-edit.** LEARN-016/007S ("compile
after each file, never batch") pulls against LEARN-023/010S/027 ("collect
changes into a single edit pass"). Proposed resolution: batch all changes
_to one file_ into one edit; verify after each _file_.
**Decided 2026-07-06 (Luisa): adopted as proposed.** Stated in
[working-session-cadence](working-session-cadence.md) rule 3.
- **T3 (soft) — incrementalism vs. batching in UI work.** LEARN-014L ("one
screen before adding more") vs. LEARN-010S ("all UI states in one edit").
Compatible if scoped: increment at screen level, batch at state level.
Expand Down Expand Up @@ -60,6 +64,20 @@ milestone; producing it is the contract for `sheal consolidate`
**LEARN-041** (user says "no, it was X" → pivot, don't defend): a coherent
conversational-repair pair. A page materializes if a third arrives.

## No-trigger dispositions (decided 2026-07-07, Luisa)

Both flagged rewrite-or-retire by `sheal consolidate`; both **rewritten with
a checkable trigger** rather than retired:

- **LEARN-031** → "When adding filter/search/sort over a collection in UI
code, apply it in the data/query layer, not in the render path." Trigger:
adding filtering logic to a component.
- **LEARN-043** → "When a command fails due to environment state (blocked
host, missing tool, sandbox quirk) and the workaround isn't derivable from
the repo, record it (memory / `.self-heal.local.json`) before moving on."
Trigger: environment-caused failure with a non-obvious workaround. Holds
the slot until the `sheal capture` crisis verb (mechanical table) lands.

## Mechanical compilation targets (12)

Learnings that should become hooks/checkers/config, not prose — per the
Expand Down
154 changes: 154 additions & 0 deletions docs/adr/0001-validation/2026-07-07-decisions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
{
"$comment": "Apply-stage decisions for the 2026-07-06 consolidation change set (ADR 0001). Executes the merge/retire table, the T1/T2 tension decisions (2026-07-06), the LEARN-031/043 rewrites (2026-07-07), and renumbers one member of each of the 12 ID collisions (long-titled AGENTS.md-era items keep their number). Status changes precede renumbers of the same file. Apply: sheal consolidate --decisions docs/adr/0001-validation/2026-07-07-decisions.json --apply",
"decisions": [
{
"action": "supersede",
"file": "LEARN-001-inspect-real-data-before-writing-parsers.md",
"by": "ground-truth-before-action rule 1 (docs/adr/0001-validation/ground-truth-before-action.md); LEARN-001 remains the store representative"
},
{
"action": "supersede",
"file": "LEARN-003-after-creating-test-fixtures-verify-they-match-the.md",
"by": "ground-truth-before-action rule 1 (docs/adr/0001-validation/ground-truth-before-action.md), folded"
},
{
"action": "supersede",
"file": "LEARN-006-before-parsing-any-external-data-format-entire-io-.md",
"by": "ground-truth-before-action rule 1 (docs/adr/0001-validation/ground-truth-before-action.md)"
},
{
"action": "supersede",
"file": "LEARN-002-run-help-before-using-unfamiliar-cli.md",
"by": "ground-truth-before-action rule 2 (docs/adr/0001-validation/ground-truth-before-action.md); LEARN-002 remains the store representative"
},
{
"action": "supersede",
"file": "LEARN-012-when-adding-support-for-a-new-agent-runtime-amp-co.md",
"by": "ground-truth-before-action rule 2 (docs/adr/0001-validation/ground-truth-before-action.md), folded"
},
{
"action": "supersede",
"file": "LEARN-028-when-the-user-reports-a-ui-bug-via-screenshot-repr.md",
"by": "ground-truth-before-action rule 3 (docs/adr/0001-validation/ground-truth-before-action.md); LEARN-025 remains the store representative"
},
{
"action": "supersede",
"file": "LEARN-010-when-a-session-hits-context-compaction-stop-adding.md",
"by": "working-session-cadence rule 1 (docs/adr/0001-validation/working-session-cadence.md); the merged compaction protocol adopts LEARN-003 (on-context-compaction) text"
},
{
"action": "supersede",
"file": "LEARN-013-after-context-compaction-re-read-the-3-most-recent.md",
"by": "working-session-cadence rule 1 (docs/adr/0001-validation/working-session-cadence.md); the re-read clause survives as a T1 precedence trigger in rule 4"
},
{
"action": "supersede",
"file": "LEARN-021-after-implementing-each-user-requested-feature-run.md",
"by": "working-session-cadence rule 2 (docs/adr/0001-validation/working-session-cadence.md); LEARN-022 remains the store representative"
},
{
"action": "supersede",
"file": "LEARN-007-compile-after-each-file-not-in-batch.md",
"by": "working-session-cadence rule 3 (docs/adr/0001-validation/working-session-cadence.md), T2 decision 2026-07-06: batch per file, verify per file; LEARN-016 remains the store representative"
},
{
"action": "supersede",
"file": "LEARN-008-after-npm-link-or-global-cli-installation-always-r.md",
"by": "working-session-cadence rule 3 (docs/adr/0001-validation/working-session-cadence.md), folded (rebuild + smoke-test clause)"
},
{
"action": "supersede",
"file": "LEARN-009-dont-retry-same-failing-call.md",
"by": "working-session-cadence rule 4 (docs/adr/0001-validation/working-session-cadence.md); LEARN-018 remains the store representative"
},
{
"action": "supersede",
"file": "LEARN-040-before-re-reading-a-file-in-the-same-session-check.md",
"by": "working-session-cadence rule 4 (docs/adr/0001-validation/working-session-cadence.md), T1 decision 2026-07-06: trust context by default; re-read only on compaction or 3+ touches"
},
{
"action": "supersede",
"file": "LEARN-004-plan-multi-file-changes-before-coding.md",
"by": "plan-before-you-edit rule 1 (docs/adr/0001-validation/plan-before-you-edit.md); LEARN-011 remains the store representative"
},
{
"action": "supersede",
"file": "LEARN-005-when-bootstrapping-a-new-typescript-cli-project-de.md",
"by": "plan-before-you-edit rule 1 (docs/adr/0001-validation/plan-before-you-edit.md), demoted to an example instance"
},
{
"action": "supersede",
"file": "LEARN-009-when-a-session-involves-both-infrastructure-setup-.md",
"by": "plan-before-you-edit rule 1 (docs/adr/0001-validation/plan-before-you-edit.md), demoted to an example instance"
},
{
"action": "supersede",
"file": "LEARN-011-clarify-multi-step-flows-before-coding.md",
"by": "plan-before-you-edit rule 2 (docs/adr/0001-validation/plan-before-you-edit.md), folded; LEARN-024 remains the store representative"
},
{
"action": "supersede",
"file": "LEARN-010-implement-full-ui-state-in-one-edit.md",
"by": "plan-before-you-edit rule 2 (docs/adr/0001-validation/plan-before-you-edit.md), folded"
},
{
"action": "supersede",
"file": "LEARN-027-when-a-tui-component-has-been-edited-5-times-in-a-.md",
"by": "plan-before-you-edit rule 2 crisis clause (docs/adr/0001-validation/plan-before-you-edit.md)"
},
{
"action": "supersede",
"file": "LEARN-005-get-one-screen-working-before-adding-navigation.md",
"by": "plan-before-you-edit rule 3 (docs/adr/0001-validation/plan-before-you-edit.md); LEARN-014 remains the store representative"
},
{
"action": "supersede",
"file": "LEARN-008-inventory-environment-before-assuming-tools-exist.md",
"by": "environment-and-sandbox-diagnostics rule 1 (docs/adr/0001-validation/environment-and-sandbox-diagnostics.md); LEARN-017 remains the store representative"
},
{
"action": "supersede",
"file": "LEARN-006-check-build-tags-and-cross-compilation-for-os-errors.md",
"by": "environment-and-sandbox-diagnostics rule 4 (docs/adr/0001-validation/environment-and-sandbox-diagnostics.md); LEARN-015 remains the store representative"
},
{
"action": "supersede",
"file": "LEARN-004-when-a-background-server-process-dolt-postgres-red.md",
"by": "`.self-heal.json` requiredServices (compiled mechanically — ADR 0001 validation mechanical targets table; the rule is now config, not prose)"
},
{
"action": "retire",
"file": "LEARN-019-when-a-retro-session-s-input-data-is-incomplete-e-.md",
"reason": "product feedback against sheal's retro pipeline, not an agent-behavior rule — filed as T22 (Validate checkpoint completeness inside sheal retro)"
},
{
"action": "retire",
"file": "LEARN-020-when-running-retro-on-a-prior-session-verify-the-c.md",
"reason": "product feedback against sheal's retro pipeline, not an agent-behavior rule — filed as T22 (Validate checkpoint completeness inside sheal retro)"
},
{
"action": "rewrite",
"file": "LEARN-031-filter-collections-at-the-data-layer-not-in-the-pr.md",
"title": "Apply collection filters in the data layer, not the render path",
"body": "When adding filter/search/sort over a collection in UI code, apply it in the data/query layer, not in the render path."
},
{
"action": "rewrite",
"file": "LEARN-043-save-non-obvious-environmental-gotchas-blocked-hos.md",
"title": "Record environment gotchas the moment they are identified",
"body": "When a command fails due to environment state (blocked host, missing tool, sandbox quirk) and the workaround isn't derivable from the repo, record it (memory or `.self-heal.local.json`) before moving on. Slot for the planned `sheal capture` crisis verb."
},
{ "action": "renumber", "file": "LEARN-001-inspect-real-data-before-writing-parsers.md", "toId": "LEARN-045" },
{ "action": "renumber", "file": "LEARN-002-run-help-before-using-unfamiliar-cli.md", "toId": "LEARN-046" },
{ "action": "renumber", "file": "LEARN-003-on-context-compaction-commit-and-restart.md", "toId": "LEARN-047" },
{ "action": "renumber", "file": "LEARN-004-plan-multi-file-changes-before-coding.md", "toId": "LEARN-048" },
{ "action": "renumber", "file": "LEARN-005-get-one-screen-working-before-adding-navigation.md", "toId": "LEARN-049" },
{ "action": "renumber", "file": "LEARN-006-check-build-tags-and-cross-compilation-for-os-errors.md", "toId": "LEARN-050" },
{ "action": "renumber", "file": "LEARN-007-compile-after-each-file-not-in-batch.md", "toId": "LEARN-051" },
{ "action": "renumber", "file": "LEARN-008-inventory-environment-before-assuming-tools-exist.md", "toId": "LEARN-052" },
{ "action": "renumber", "file": "LEARN-009-dont-retry-same-failing-call.md", "toId": "LEARN-053" },
{ "action": "renumber", "file": "LEARN-010-implement-full-ui-state-in-one-edit.md", "toId": "LEARN-054" },
{ "action": "renumber", "file": "LEARN-011-clarify-multi-step-flows-before-coding.md", "toId": "LEARN-055" },
{ "action": "renumber", "file": "LEARN-012-reread-file-after-3-plus-edits.md", "toId": "LEARN-056" }
]
}
18 changes: 12 additions & 6 deletions docs/adr/0001-validation/working-session-cadence.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,18 @@ compaction protocol.
2. **Commit rhythm:** commit per completed feature; at 5+ touched files,
refuse new features until current work is committed and the next feature's
file list is written. _(absorbs 021 into 022)_
3. **Verify per file:** run the toolchain check (`npx tsc`, `go build`) after
each file edit, never batch compiles; after `npm link`/global install,
rebuild and smoke-test before using new commands. _(absorbs 007S, 008L)_
3. **Batch per file, verify per file:** collect all changes _to one file_
into a single edit pass, then run the toolchain check (`npx tsc`,
`go build`) after each file — never batch compiles across files; after
`npm link`/global install, rebuild and smoke-test before using new
commands. _(absorbs 007S, 008L; T2 precedence decided 2026-07-06 —
batching granularity and verification granularity are both the file)_
4. **Retry discipline:** the same tool call failing twice identically means
change approach, not retry. Extension: re-reading content already in
context is retry-waste too — but see contradictions T1 for precedence
against rule 1's re-read clause. _(absorbs 009S, 040)_
change approach, not retry. Extension: trust content already in context by
default — re-reading it is retry-waste — with exactly two exceptions:
context compaction occurred (rule 1's re-read clause), or the file has
been touched 3+ times this session (LEARN-012S). _(absorbs 009S, 040; T1
precedence decided 2026-07-06)_

## Trigger table

Expand All @@ -46,6 +51,7 @@ compaction protocol.
| Feature complete / 5+ files touched | 2 |
| Any file edit (toolchain projects) | 3 |
| Identical tool failure ×2 | 4 |
| Same file touched 3+ times | 4 (re-read exception) |

## Mechanical candidates

Expand Down
13 changes: 12 additions & 1 deletion docs/tasks/TASK_INDEX.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,21 @@
- [x] [T17. Reconcile --strict's warning definition with the check report summary](t17-reconcile-strict-warning-definition.md) — `done` → src/output/json.ts, src/commands/check.ts
- [x] [T18. Unify the pretty summary line with the shared warning predicate](t18-unify-pretty-summary-warnings.md) — `done` → src/output/pretty.ts, test/check-summary.test.ts
- [ ] [T19. Make supersede provenance git-visible](t19-git-visible-supersede-provenance.md) — `todo`
- [ ] [T20. Harden the T14 gates against the qa-personas bypasses](t20-harden-gates-against-qa-bypasses.md) — `todo`
- [ ] [T20. Harden the T14 gates against the qa-personas bypasses](t20-harden-gates-against-qa-bypasses.md) — `blocked` (waiting on Q8 strict-mode semantics)
- [x] [T21. `sheal review`: apply consolidation change-set dispositions to the store](t21-sheal-review-apply-dispositions.md) — `done` → src/consolidate/apply.ts, docs/adr/0001-validation/2026-07-07-decisions.json
- [x] [T22. Validate checkpoint completeness inside `sheal retro`](t22-validate-checkpoint-completeness-in-retro.md) — `done` → src/retro/completeness.ts (PR #49)
- [x] [T23. Preserve unknown frontmatter through learnings-store round-trips](t23-preserve-unknown-frontmatter-in-store.md) — `done` → src/learn/store.ts, test/store-frontmatter.test.ts
- [ ] [T24. Retro extractor: branch "product feedback vs. learning"](t24-retro-extractor-product-feedback-branch.md) — `todo`
- [ ] [T25. Share the file-modifying-tools list between agent-sessions and retro completeness](t25-shared-file-modifying-tools-constant.md) — `todo`
- [ ] [T26. Reject path traversal in session-id → file resolution (native loaders)](t26-session-id-path-traversal-in-native-loaders.md) — `todo`

## Open questions

**For luisa:**

- [ ] [Q7. Is `docs/adr/0001-validation/` frozen evidence or the living successor-rule surface?](q7-frozen-validation-evidence-vs-living-successor-rules.md) — `todo`
- [ ] [Q8. Strict-mode semantics: how should `--strict` treat skipped checkers, and should the JSON summary expose a `strictOk` field?](q8-strict-mode-skip-and-summary-semantics.md) — `todo`

**Answered (history):**

- [x] [Q6. Where does the project-tier wiki live long-term — in git or in `.sheal/`?](q6-where-does-the-wiki-layer-live.md) — `done`
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
status: todo
type: question
owner: luisa
created: 2026-07-07
---

# Q7. Is `docs/adr/0001-validation/` frozen evidence or the living successor-rule surface?

**Why it matters:** the folder's README declares it frozen milestone
evidence ("never updated"), yet PR #48 edits two files there (recording the
T1/T2 and LEARN-031/043 decisions) and 26 store learnings now carry
`**Superseded by:**` pointers into its topic pages as their *living*
successor rules. Q6 decided the wiki layer lives in `.sheal/wiki/` with
snapshots published to git on promotion — so the validation folder has
become a de facto wiki layer ahead of that decision. Raised by the pr-tutor
pass on PR #48.

- Branch A — keep it frozen: move the merged rules + trigger tables into the
Q6 wiki layer when it lands (P1); repoint store provenance there; the
validation folder reverts to evidence-only. Costs a migration of 26
pointers (mechanical — a decisions file can do it).
- Branch B — declare the topic pages living: amend the folder README (and
ADR 0001) to say the merged rules are maintained here until the wiki layer
exists; accept decision annotations in frozen evidence.
- Related loose end either way: AGENTS.md's "Session Learnings" section
still injects the old LEARN-001…030 prose, including superseded rules —
decide whether it regenerates from the live store or trims to the
successor pages.

**Still open:** which branch; and whether the wiki-layer ADR (which ratifies
Q6) should resolve this in the same stroke.
Loading
Loading