Context
#14033's 3rd + final slice (after tickets #14065, PRs #14069). DiscussionSource.extract() writes ONE whole-file chunk per discussion-*.md. The big converged Discussions (#10137 / #10119 / #11026 class — the most-referenced architectural docs in the KB) accumulate a converged-model body + many maintainer comments → trend toward the embedding cap → dropped / blind-byte-split (the #13999 metadata-without-vector class). Per-element chunks keep every element small AND make each maintainer's architectural reasoning separately retrievable. Frequency is low (176 files, 84 with comments) but per-artifact value is the highest of the three sources.
The Fix
- Pure
splitDiscussionArchiveMarkdown(content) → [{kind:'body'|'comment', ordinal, content}]. V-B-A'd (sampled discussion-13594.md; 84/176 files carry comments): the body (frontmatter + the converged-model doc with its OWN ## Converged Model / ## Decision Record / ## Signal Ledger / etc. sections) runs until the FIRST ### `@<author>` commented on <ISO> delimiter — the SAME delimiter as PR comments; comments split on it. Conservation invariant (per the #14065 RC): split ONLY on the delimiter, body = before the first one, so non-delimiter content (section headings, pre-comment content) is never dropped.
- Wire
DiscussionSource.extract() to emit discussion-<id>#body + discussion-<id>#comment-<n> (stable names → idempotent re-ingestion), preserving type/kind/source + a per-element hash.
Acceptance Criteria
Out of Scope
- None — this completes #14033's three sources (tickets / PRs / discussions).
Contract Ledger Matrix
| Consumed surface |
Field |
Change |
Consumer impact |
Fallback / semantics |
DiscussionSource.extract() emitted KB chunks |
name |
per-element discussion-<id>#body / #comment-<n> (was discussion-<id>) |
KB re-ingestion: one discussion → N element chunks. name is metadata + the embedding-prefix, NOT a lookup/join key (verified for identical consumers at #14063) → retrieval granularity improves, no name-keyed breakage. |
stable names → idempotent; old whole-file hash drops on re-ingest, per-element hashes added |
| same |
hash |
per-element content hash (was whole-file) |
re-ingestion replaces the one whole-file chunk with N element chunks |
content-fingerprint per element |
Related
- #14033 (parent — completes the trilogy); #14065 / #14069 (sibling verticals, same pattern + conservation invariant); #14039 (v13.1 epic); #14000 (over-cap drop class).
Authored-by: @neo-opus-vega (Vega, Claude Opus 4.8). Session ef66cbd0-3770-466c-9df1-f93c141eb1d3.
Context
#14033's 3rd + final slice (after tickets #14065, PRs #14069).
DiscussionSource.extract()writes ONE whole-file chunk perdiscussion-*.md. The big converged Discussions (#10137 / #10119 / #11026 class — the most-referenced architectural docs in the KB) accumulate a converged-model body + many maintainer comments → trend toward the embedding cap → dropped / blind-byte-split (the #13999 metadata-without-vector class). Per-element chunks keep every element small AND make each maintainer's architectural reasoning separately retrievable. Frequency is low (176 files, 84 with comments) but per-artifact value is the highest of the three sources.The Fix
splitDiscussionArchiveMarkdown(content)→[{kind:'body'|'comment', ordinal, content}]. V-B-A'd (sampleddiscussion-13594.md; 84/176 files carry comments): the body (frontmatter + the converged-model doc with its OWN## Converged Model/## Decision Record/## Signal Ledger/ etc. sections) runs until the FIRST### `@<author>` commented on <ISO>delimiter — the SAME delimiter as PR comments; comments split on it. Conservation invariant (per the #14065 RC): split ONLY on the delimiter, body = before the first one, so non-delimiter content (section headings, pre-comment content) is never dropped.DiscussionSource.extract()to emitdiscussion-<id>#body+discussion-<id>#comment-<n>(stable names → idempotent re-ingestion), preservingtype/kind/source+ a per-element hash.Acceptance Criteria
extract()emits per-element chunks with stable names;typepreserved per element.extract()per-element emission.Out of Scope
Contract Ledger Matrix
DiscussionSource.extract()emitted KB chunksnamediscussion-<id>#body/#comment-<n>(wasdiscussion-<id>)nameis metadata + the embedding-prefix, NOT a lookup/join key (verified for identical consumers at #14063) → retrieval granularity improves, no name-keyed breakage.hashRelated
Authored-by: @neo-opus-vega (Vega, Claude Opus 4.8). Session ef66cbd0-3770-466c-9df1-f93c141eb1d3.