Skip to content

feat(engine): discovery-map add-batch + cache purge at close (D7 one-call)#495

Closed
leeovery wants to merge 1 commit into
feat/render-continuationsfrom
feat/render-one-call
Closed

feat(engine): discovery-map add-batch + cache purge at close (D7 one-call)#495
leeovery wants to merge 1 commit into
feat/render-continuationsfrom
feat/render-one-call

Conversation

@leeovery

@leeovery leeovery commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Stage 5a of the render-surfaces programme (design log: #489; base: #493) — the first two D7 deliveries.

discovery-map add-batch

engine discovery-map add-batch <wu> --file <topics.json> — the whole harvest in one transaction. Entries {name, routing, summary, description?, brief_path?, force_dismissed?}; all validation runs before anything applies (illegal name, unknown routing, collision, dismissed-without-force, in-batch duplicate → loud error, zero writes — never a partial map). brief_path rides on the entry, so the per-topic manifest set follow-up dies with the loop: the fumi harvest's 48 sequential calls (24 adds + 24 sets, the run that produced the $E aliasing incident) become one call. confirm-and-persist.md swaps to payload + single call, and its zsh-quoting caveats leave with the argv.

Cache purge at work-unit close

workunit complete / cancel / absorb remove .workflows/.cache/{wu}/ wholesale — cache is work-unit-lifetime scratch (survives context refresh during active work, garbage at close). Disk-only (gitignored), and reactivation-safe: purging is what protects reopened gates from stale tracking files.

Test plan

  • add-batch: happy path (brief_path recorded, source pinned to discovery, map_total), atomicity under mid-batch collision (state byte-compared before/after), per-entry force_dismissed + refusal, six loud validation cases, payload-read failure.
  • purge: complete purges own cache and leaves siblings; cancel purges; absorb purges the absorbed feature's cache.
  • npm test — 1508/1508. Typecheck + conventions lint clean.

The two call-chain audit reports (15 further repeated-call sites; the shell-construction cluster) are recorded in the design log for stage 5b scoping.

🤖 Generated with Claude Code

Stack

  1. feat(engine): render surface catalogue — resume-gate and task-list pilots #490
  2. feat(engine): finding + findings-summary surfaces — review-findings loop unified #491
  3. feat(engine): task-gate surfaces — proposed-task, tasks-overview, author-task-gate, phase-tree #492
  4. feat(engine): selection projection + bridge continuation surfaces #493
  5. feat(engine): discovery-map add-batch + cache purge at close (D7 one-call) #495 👈 current

…e (D7)

The harvest persists in one atomic transaction: add-batch takes the
whole topic set as a payload file — every entry validated before
anything applies (a failing entry means nothing persisted, never a
partial map), brief_path riding on each entry (killing the per-topic
follow-up set), one lock, one save. confirm-and-persist.md drops its
2×N call loop (fumi: 48 calls → 1) and its zsh-quoting caveats with it.

Work-unit close purges the cache wholesale: complete, cancel, and
absorb remove .workflows/.cache/{wu}/ — disk-only (cache is
gitignored), reactivation-safe (stale tracking would poison reopened
gates; every flow treats missing tracking as fresh start).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@leeovery

Copy link
Copy Markdown
Owner Author

Closed per review: built backwards — the batch contract must be designed census-first from the full audit (16 sites, two reports — recorded in design/render-surfaces.md) before any instance is implemented, and the cache purge was an unrelated change conflated in. Both return after the render stack lands: batching as its own census-first programme, the purge as a standalone PR.

@leeovery leeovery closed this Jul 21, 2026
@leeovery
leeovery deleted the feat/render-one-call branch July 21, 2026 21:19
leeovery added a commit that referenced this pull request Jul 23, 2026
…all (D7)

The batching programme pilot, recovered from the closed #495 tip and
re-landed census-first. The fumi incident site: the harvest prescribed
2×N sequential calls (add + brief_path set per topic) and the model's
coping alias killed all 24.

- discovery-map add-batch <wu> --file <topics.json>: every entry
  validated (name legality, routing, summary, description/brief_path
  shape, in-batch duplicates) and checked against current map state
  (existing items, dismissed names needing force_dismissed) BEFORE any
  mutation — a failing entry persists nothing. One lock, one load, one
  save. brief_path rides each entry, replacing the per-topic follow-up
  set. Response carries added[] with computed lifecycles, undismissed[],
  and map_total, so the flow needs no re-read.
- Harvest prose swap: write topics.json with the Write tool, one
  add-batch call — no shell-quoting hazards, atomic by construction.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
leeovery added a commit that referenced this pull request Jul 23, 2026
…all (D7) (#505)

The batching programme pilot, recovered from the closed #495 tip and
re-landed census-first. The fumi incident site: the harvest prescribed
2×N sequential calls (add + brief_path set per topic) and the model's
coping alias killed all 24.

- discovery-map add-batch <wu> --file <topics.json>: every entry
  validated (name legality, routing, summary, description/brief_path
  shape, in-batch duplicates) and checked against current map state
  (existing items, dismissed names needing force_dismissed) BEFORE any
  mutation — a failing entry persists nothing. One lock, one load, one
  save. brief_path rides each entry, replacing the per-topic follow-up
  set. Response carries added[] with computed lifecycles, undismissed[],
  and map_total, so the flow needs no re-read.
- Harvest prose swap: write topics.json with the Write tool, one
  add-batch call — no shell-quoting hazards, atomic by construction.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant