inception(phase-8): imports — copy + manifest + KB index, blank feature research#273
Open
leeovery wants to merge 22 commits into
Open
inception(phase-8): imports — copy + manifest + KB index, blank feature research#273leeovery wants to merge 22 commits into
leeovery wants to merge 22 commits into
Conversation
leeovery
added a commit
that referenced
this pull request
May 10, 2026
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…d deriveIdentity branch and imports.json chunking config Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ith imports phase support Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…t is indexed list Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…copy + manifest push + KB index Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
….md with shared reference knowledge.cjs already declared in SKILL.md allowed-tools; the shared import-files reference inherits that whitelist when invoked. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…t-import.md with shared reference knowledge.cjs already declared in SKILL.md allowed-tools; the shared import-files reference inherits that whitelist when invoked. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…in initialize-research.md Feature research now starts from the standard template with a blank Starting Point. Imports stay under imports/ as the source of truth and surface via the contextual KB query at session start. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…both feature and epic flow through standard initialize path Drop the special epic exploration filename mapping and trim the import handoff to drop the verbatim file list (manifest tracks it now). Source field stays informational; the invoke handoff still surfaces 'Source: import' for visibility. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…render N imported seed(s) line in epic-display-and-menu Imports callout sits under the Discovery Map summary line, above the convergence callout. format() also surfaces imports_count when non-zero for parity with other detail fields. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…dge-store, knowledge-chunker; add imports_count to continue-epic discovery tests knowledge-cli: index/query/remove round-trip on imports, idempotent re-index check. knowledge-store: identity round-trip with phase: imports. knowledge-chunker: imports.json present in phases array, low confidence tier, multi-section seed file produces per-section chunks. continue-epic discovery: imports_count returns zero when missing, positive when manifest.imports[] has entries; format() includes imports_count line only when non-zero. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…cover in-batch collision epic-display-and-menu.md: replace nested @if pluralisation with two explicit @if blocks (one for count==1, one for count>1) — clearer and matches the if/else style used by the convergence callout. import-files.md: extend collision check in B. Normalise Filenames to include destinations chosen earlier in the same batch. Without it, the user providing the same source path twice in one prompt would cause the second copy to silently overwrite the first. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…o rebuild and bulk index process them
discoverArtifacts() iterated INDEXED_PHASES against wu.phases[phase].items,
which works for the four phase items but skips imports — those live at
top-level wu.imports[]. Without this branch, knowledge rebuild would
permanently drop imports chunks (the rebuild wipes the store and re-
indexes only what discoverArtifacts returns). Bulk index (no args) and
status's unindexed-artifact check were similarly blind to imports.
Add a separate traversal: read wu.imports[], resolve each path relative
to .workflows/{work_unit}/, derive topic from basename (mirroring
deriveIdentity), and emit { file, workUnit, phase: imports, topic }.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…imports branch Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… tighten SKILL.md description reindex-work-unit.md is loaded by feature-to-epic pivot (to refresh work_type metadata on chunks) and by cancelled-work-unit reactivation (to restore chunks). It iterated four phase items only — without an imports pass, a feature with imports pivoted to epic would leave its imports chunks tagged work_type=feature, and a reactivated cancelled work unit would never restore its imports chunks. Add a B section that reads wu.imports[] and re-indexes each entry. SKILL.md description: mention imports alongside the four completed- artifact phases so the high-level paragraph matches the What is indexed list below it. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…tries Pairs with the discoverArtifacts imports branch — confirms a no-args bulk index picks up imports tracked on the manifest and writes their chunks (queryable with [imports | wu/topic] provenance afterwards). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…— path validation + topic dedup
Previously trusted manifest.imports[] entry.path as-is. A tampered or
malformed entry (path-traversal "..", subdirectory, dotfile basename)
would have been resolved relative to .workflows/{wu}/ and indexed —
poisoning the store with chunks pointing outside the imports/ tree.
Now require entry.path to match imports/{filename}.md exactly: no
subdirectories, no .. segments, no dotfile basenames. Mirrors the
checks deriveIdentity already performs for the per-file index path.
Also dedupe by topic identity (work_unit + imports + basename) within
the loop. Re-imports legitimately push duplicate manifest entries (the
plan accepts this as minor noise), but bulk index should still process
each identity once.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ning Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ion + clarify SKILL.md
reindex-work-unit.md Section B now uses the exists-then-get pattern
(exists exits 0/false vs get exits 2 when the field is absent — the
caller-blocking failure-mode footgun). Documents the imports/{filename}.md
shape requirement so the model skips malformed entries inline rather
than letting them flow to the index call.
SKILL.md confidence-tier table: low row now lists Research OR Imports
(disambiguated by phase field on the provenance line) — previously read
as Research-only, which was wrong post-Phase-8.
SKILL.md rebuild description: replaces "all completed artifacts" with
the explicit list (the four phase artefacts plus imports[]) so users
understand imports survive rebuild.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…not "later phase" workflow-inception-entry/gather-context.md: comment said KB indexing of imports lands in a later phase. Phase 8 IS that phase — files were already copied + indexed at start-epic. Comment now describes the read as a handoff-surface concern, not a placeholder. start-feature/research-gating.md: import option said "Import existing research files verbatim". Post-Phase-8, imports stay under imports/ as seed material — they don't become research files. Updated to reflect the new behaviour (research starts blank; imports surface via KB retrieval). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…it-level removal 87b — bulk index ignores tampered manifest.imports[] entries (path- traversal, dotfile, subdirectory). Confirms the new validation in discoverArtifacts rejects malformed paths before reading the file. 87c — bulk index dedupes duplicate manifest entries (re-import pushes the same path twice; should still produce one index call). 87d — work-unit-level remove (--work-unit alone, no --phase) clears imports chunks alongside phase-artefact chunks. Pairs with the cancellation flow that uses this same shape. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…e 8 review
Captures four items surfaced during Phase 8 audit that didn't fit the
parent phase's scope:
1. Feature absorption silently deletes imports/. Pre-Phase-8 there was
nothing to delete; post-Phase-8 the absorb flow needs to either
carry imports forward or warn before deleting.
2. continue-feature lacks the imported-seed callout (Phase 8 doc
explicitly limited the display surface to continue-epic).
3. cmdRebuild error message wording references "completed artifacts"
but rebuild now also pulls in imports[] entries.
4. Inception subsequent sessions and refinement entry don't query the
knowledge base at session start. Design says they should ("KB
retrieval, no auto-read") — pre-existing gap from Phase 4 that
Phase 8's KB indexing of imports makes more visible.
INDEX.md updated: Phase 14 row, dependency arrow Phase 13 → Phase 14,
branch table entry. None of the four items have ordering dependencies
on each other — implementer can pick them off independently.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
43b8c59 to
bfc8062
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Phase 8 of the inception/discovery-map initiative. Unifies and completes the imports machinery so that imports become a first-class indexed phase that surfaces via the existing contextual KB query at session start, instead of being dumped verbatim into research files.
/start-epicand/start-featurei/importflows now share a singleworkflow-shared/references/import-files.mdreference: validate paths, normalise filenames, copy to.workflows/{wu}/imports/, push manifest entry, KB-index. The asymmetry of "epic uses imports/, feature merges into research" goes away.source=importdump branch inworkflow-research-process/initialize-research.mdis gone.importsis now inINDEXED_PHASES. New chunking config atskills/workflow-knowledge/chunking/imports.json(low confidence, mirrors research).deriveIdentityparses.workflows/{wu}/imports/{filename}.md→topic = filename. Bundle rebuilt and committed.continue-epicshows· N imported seed(s)under the Discovery Map summary line whenmanifest.imports[]is non-empty.discovery.cjsexposesimports_count.discovery-map/phase-08-imports.md): auto-split imports at import time (rejected); refinement-driven import removal (deferred —knowledge.cjs remove --phase imports --topic Xworks, no UI yet); legacy merged-import migration (legacy stays); continue-feature display of imports.Stacked on PR #272 (Phase 7) — base branch
idea/inception-pr-7-self-healing. No merge to main until the initiative completes.Test plan
bash tests/scripts/test-knowledge-cli.sh— 186 pass (added 4 imports tests: index, query provenance, remove, re-index idempotency)node --test tests/scripts/test-knowledge-store.cjs— 50 pass (added phase=imports identity round-trip)node --test tests/scripts/test-knowledge-chunker.cjs— 49 pass (imports.json in phases array, low tier, multi-section chunking)node --test tests/scripts/test-discovery-for-continue-epic.cjs— 76 pass (added imports_count: zero / missing / positive / format-output)bash tests/scripts/test-knowledge-build.sh— 5 pass (bundle still rebuilds cleanly)bash tests/scripts/test-workflow-manifest.sh— 214 pass (no schema changes)node --test tests/scripts/test-knowledge-{retry,integration,config,embeddings,openai}.cjs— all greennode --test tests/scripts/test-discovery-{utils,...all variants}.cjs— 315 passVerification follow-ups (manual smoke)
/start-epic→i/import→ file copies toimports/, manifest tracks, KB indexes; inception reads imports as launchpad;/continue-epicshows· 1 imported seed./start-feature→i/import→ file copies, manifest tracks, KB indexes; research session opens with blank Starting Point (regression check); contextual-query surfaces imported chunks.knowledge.cjs query "<topic>" --boost:work-unit {wu}returns chunks with[imports | wu/filename | low | <date>]provenance line.🤖 Generated with Claude Code