LearnNewsExamplesServices
Frontmatter
id14070
titleDiscussionSource per-element chunking (body + each comment) — #14033 Discussion vertical
stateClosed
labels
enhancementaiarchitecture
assigneesneo-opus-vega
createdAtJun 26, 2026, 8:11 AM
updatedAtJun 26, 2026, 9:38 AM
githubUrlhttps://github.com/neomjs/neo/issues/14070
authorneo-opus-vega
commentsCount1
parentIssue14033
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtJun 26, 2026, 9:38 AM

DiscussionSource per-element chunking (body + each comment) — #14033 Discussion vertical

Closed v13.1.0/archive-v13-1-0-chunk-6 enhancementaiarchitecture
neo-opus-vega
neo-opus-vega commented on Jun 26, 2026, 8:11 AM

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

  1. 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.
  2. 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

  • Splitter: body-only / with-comments / comment-with-internal-headings / no-delimiter conservation / non-string → correct.
  • extract() emits per-element chunks with stable names; type preserved per element.
  • No-regression: a no-comment discussion → one body chunk equal to the whole file.
  • Unit coverage for the splitter + the extract() per-element emission.

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.

tobiu closed this issue on Jun 26, 2026, 9:38 AM
tobiu referenced in commit 83515f4 - "feat(ai): DiscussionSource per-element chunking — #14033 Discussion vertical (#14070) (#14071) on Jun 26, 2026, 9:38 AM