p0-1: wire-schema stubs, doc/spec stubs, V001 migration, fixtures

- docs/wire-schema/v1/ ships 7 schema stubs (citation, search_hit,
  answer, ingest_report, doc_summary, chunk_inspection, doctor) that
  pin schema_version + required fields per design §2. Full property
  validation lands in later phases.
- docs/spec/ ships 7 markdown stubs each linking to the canonical
  frozen design (domain-model, ids, canonical-document, chunk-policy,
  citation-policy, module-boundaries, ai-generation-guidelines).
- migrations/V001__init.sql contains only schema_meta + migrations
  tables per design §5.1; data tables ship in P1-6/P2-1/P3-3.
- fixtures/ has the 11 subdirectories every downstream task references
  (markdown, source-fs, search/{lexical,hybrid}, embed, vector, rag,
  eval, image, pdf, audio). Empty subdirs use .gitkeep so they track.
  fixtures/markdown/ ships the 3 phase-0 fixtures: simple-note.md,
  nested-headings.md, code-and-table.md.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-30 05:17:32 +00:00
parent ec8a4ddb1b
commit a166b7051c
28 changed files with 311 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
# AI generation guidelines
When implementing tasks against this codebase:
- Treat the frozen design doc as the single source of truth. Do not invent
new fields, traits, or enum variants.
- Prefer editing existing files to creating new ones; reuse types from
`kb-core` instead of duplicating shapes.
- For each task, follow the task spec under `tasks/p<N>/p<N>-<i>.md`.
Canonical source:
[docs/superpowers/specs/2026-04-27-kb-final-form-design.md](../superpowers/specs/2026-04-27-kb-final-form-design.md), §11 + §12.

View File

@@ -0,0 +1,7 @@
# CanonicalDocument
Medium-agnostic representation of a document with `Block`s, `SourceSpan`s,
and provenance.
Canonical source:
[docs/superpowers/specs/2026-04-27-kb-final-form-design.md](../superpowers/specs/2026-04-27-kb-final-form-design.md), §3.4 + §3.7a.

View File

@@ -0,0 +1,8 @@
# Chunk policy
`ChunkPolicy` carries `target_tokens`, `overlap_tokens`,
`respect_markdown_headings`, and `chunker_version`. Chunkers expose a
`policy_hash` so chunk IDs include the policy.
Canonical source:
[docs/superpowers/specs/2026-04-27-kb-final-form-design.md](../superpowers/specs/2026-04-27-kb-final-form-design.md), §3.5 + §7.1 + §7.2.

View File

@@ -0,0 +1,7 @@
# Citation policy
Citations use W3C Media Fragments URIs to locate evidence inside a
document. Five variants: `Line`, `Page`, `Region`, `Caption`, `Time`.
Canonical source:
[docs/superpowers/specs/2026-04-27-kb-final-form-design.md](../superpowers/specs/2026-04-27-kb-final-form-design.md), §3.5 + §0 Q3.

View File

@@ -0,0 +1,6 @@
# Domain model
The domain types live in `kb-core` and mirror the frozen design exactly.
Canonical source:
[docs/superpowers/specs/2026-04-27-kb-final-form-design.md](../superpowers/specs/2026-04-27-kb-final-form-design.md), §3.

6
docs/spec/ids.md Normal file
View File

@@ -0,0 +1,6 @@
# ID recipe
All `kb-*` IDs are 32 hex chars: the first 32 of `blake3(canonical_json(tuple))`.
Canonical source:
[docs/superpowers/specs/2026-04-27-kb-final-form-design.md](../superpowers/specs/2026-04-27-kb-final-form-design.md), §4.

View File

@@ -0,0 +1,8 @@
# Module boundaries
`kb-core` is leaf — every other crate depends on it. Parsers depend on
`kb-parse-types` (not on `kb-normalize`); `kb-normalize` depends on
`kb-parse-types` (not on parsers). UI crates depend only on `kb-app`.
Canonical source:
[docs/superpowers/specs/2026-04-27-kb-final-form-design.md](../superpowers/specs/2026-04-27-kb-final-form-design.md), §8.