Skip to content

feat(engine): discovery-map add-batch — the harvest persists in one call (D7)#505

Merged
leeovery merged 1 commit into
mainfrom
feat/batch-discovery-map-add
Jul 23, 2026
Merged

feat(engine): discovery-map add-batch — the harvest persists in one call (D7)#505
leeovery merged 1 commit into
mainfrom
feat/batch-discovery-map-add

Conversation

@leeovery

@leeovery leeovery commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Stack root of the batching programme (design log: #504). The pilot: the fumi-incident site.

Why

The discovery harvest prescribed 2×N sequential engine calls (per-topic add + brief_path set). At N=24 the model aliased the engine path into $E to cope; zsh does not word-split unquoted parameters, and every call died with exit 127 — plus a sequential run can die halfway, leaving a partial map. Contract C1–C3 from the design log: per-verb batch form, payload by file, validated loudly before any mutation, one lock/write/commit-scope.

What

  • discovery-map add-batch <wu> --file <topics.json> — entries {name, routing, summary, description?, brief_path?, force_dismissed?}. Validation is exhaustive and pre-mutation: per-entry shape with the entry named in the error, in-batch duplicate names, existing-map collisions, dismissed names lacking force_dismissed. A failing entry means nothing persisted. One lock, one load, one save; brief_path lands with the entry (the old follow-up manifest set per topic is gone). The response carries added[] (with computed lifecycles), undismissed[], and map_total — no re-read.
  • Harvest swap (confirm-and-persist.md A): write the topic set as JSON with the Write tool, one call. The zsh-quoting guidance is deleted because the hazard no longer exists.
  • Recovered from the closed feat(engine): discovery-map add-batch + cache purge at close (D7 one-call) #495 tip (b683fea7), re-cut to just this change per the census-first re-plan.

Test plan

  • Batch happy path (items, brief_path, dismissed-clearing with force flag, map_total), atomicity (bad entry N leaves entries 1..N-1 unpersisted), per-entry loud validation, duplicate-in-batch, collision and dismissed refusals.
  • npm test 1547/1547 · typecheck · conventions lint 27/27.

🤖 Generated with Claude Code

Stack

  1. feat(engine): discovery-map add-batch — the harvest persists in one call (D7) #505 👈 current
  2. feat(engine): manifest apply — batched set/delete across one work unit (D7) #506
  3. refactor(prose): task-map family folds onto existing batch forms (D7, stage 3) #507
  4. feat(engine): manifest set — two grammars, never mixed #508
  5. refactor(prose): dump/read folds — subtree gets replace per-topic loops (D7, stage 5) #509
  6. feat(engine): commit --plan — plan storage stages from recorded state (D7, stage 6) #510
  7. fix: batching-stack review round — re-resolve rewired, guards symmetric, hardening pinned #512
  8. fix: deep-dive round 2 — backbone rule flipped, pre-upgrade paths routed, flow bugs closed #513
  9. fix(review-r3): engine hardening + crash-resume seams #514
  10. feat(scoping): promotion routes through first-phase choice + bridge #515
  11. fix(spec): pin the bugfix source name to the topic #516
  12. fix(skills): gate-skip sentence accurate in gate-less phases #517
  13. fix(review-entry): name the real upstream — specification and plan #518
  14. fix(shared): strip triage-landing's unreachable superseded-research arm #519
  15. feat(engine): refuse work-unit-level fields that shadow the phases tree #520
  16. fix(discovery): first-written briefs join the full brief lifecycle #521
  17. test(sim): pipeline simulation — engine driven end-to-end as a black box #522
  18. fix(round-4): review findings — backfill keying, ratchet evasion, pull guard #523

…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>
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