feat(distillery-sync): ingest docs via distillery_ingest_doc, not distillery_store - #323
Conversation
…tillery_store distillery_store is built for single ad-hoc entries with fuzzy cosine dedup — the wrong fit for a re-running document sync. Switch the document pass to distillery_ingest_doc (norrietaylor/distillery#627): external_id defaults to sha256(text) for content-idempotent re-sync (unchanged -> dedup_action skipped), a doctype facet (doctype/<v> tag + metadata.doctype, inferred from the doc path), chunking of long docs into chunk-linked entries, and metadata.source/title for provenance. Drops the srcpath/<slug> tag + the distillery_store/update/list/ find_similar lookup-then-write dance; one ingest_doc call per file subsumes create/update/skip. Recompiled lock; allowlist updated. Closes #322 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0143kv2BRrRqGxmVwwHskQtS
|
Important Review skippedNo new commits to review since the last review. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe ChangesSwitch to
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0143kv2BRrRqGxmVwwHskQtS
|
@codereabbit review |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/distillery-sync.md:
- Around line 239-248: The documentation has conflicting descriptions of the
identity invariant for document ingestion. It states idempotency is based on
content hash (sha256), yet also describes source as an idempotency anchor and
references path-keyed identity elsewhere. Clarify the primary identity invariant
by explicitly stating that idempotency is determined by content hash
(sha256(text)), and that metadata.source tracks provenance but is not the
idempotency key. Ensure this invariant is consistently described throughout the
document, including the sections noted at lines 325-327, and remove or clarify
any statements that could be interpreted as path-based identity or source-based
deduplication being the primary mechanism.
- Around line 311-316: The doctype classification taxonomy is missing support
for the `feedback` doctype, which causes feedback documents to incorrectly
default to `doc` and breaks downstream facet filters. Update the doctype
enumeration from `adr|spec|decision|doc` to include `feedback`, and add a path
pattern rule (similar to the existing rules for `specs/**`, `decisions/*.md`,
and `adr/**`) that identifies which document paths should be classified as
`feedback` type. This ensures feedback documents are properly categorized rather
than collapsing into the generic `doc` classification.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 2ed47eb2-9e28-4de1-b8c6-5c477e996b15
📒 Files selected for processing (2)
.github/workflows/distillery-sync.lock.yml.github/workflows/distillery-sync.md
…nce; add feedback doctype CodeRabbit (#323): (1) identity/dedup is solely the content-hash external_id; metadata.source is provenance only, not an identity key — removes the rename/same-content ambiguity. (2) add feedback to the doctype taxonomy (adr|spec|decision|feedback|doc) with feedback/** path mapping, matching #322. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0143kv2BRrRqGxmVwwHskQtS
|
@coderabbitai review |
✅ Action performedReview finished.
|
Closes #322.
What
Switch the
distillery-syncdocument pass fromdistillery_store(single ad-hoc entries, fuzzy cosine dedup) todistillery_ingest_doc(norrietaylor/distillery#627), which is purpose-built for a re-running doc sync:external_iddefaults tosha256(text): an unchanged file is adedup_action: "skipped"no-op; changed content re-ingests under the samesource.doctype/<v>tag +metadata.doctype(spec/adr/decision/doc), inferred from the doc path.chunk-linked entries.metadata.source(repo-relative path) +metadata.title.Changes (prompt-only, recompiled lock)
+distillery_ingest_doc,-distillery_store/-distillery_update/-distillery_find_similar.distillery_ingest_doccall withproject/text/source/title/doctype;external_iddefaults to the content hash).srcpath/<slug>identity section with the content-hash idempotency model; updated steps 3/5/6 + the verification/idempotency prose.Acceptance (#322)
dedup_action: "skipped").doctype/<v>+metadata.doctype+metadata.source+metadata.title.chunk-linked entries.distillery_ingest_doc(present post-#627; gominimal's instance has it).After merge: retag
v0.3.0to deploy.🤖 Generated with Claude Code