fix(ingest-cli): admit-source stays idempotent after the raw source moves - #432
Merged
Merged
Conversation
…oves findRaw() only looked in _intake/inbox/, so a retry of admit-source on the same converted markdown after the first successful admit had already moved the raw file out (field: into processed/; codex: renamed into the artefact's sources/) found nothing to hash and silently skipped the source_hash duplicate check, minting a fresh DRAFT-* (or other TYPE) artefact on every re-run. findRaw now also checks the post-move location for both routes, and the move/snapshot step is skipped (or, under --force, copied rather than re-moved) when the raw is already there. Signed-off-by: transitrix <279946036+transitrix@users.noreply.github.com>
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
findRaw()in bothfield-artefact.mjsandcodex-artefact.mjsonly searched_intake/inbox/for the raw source. The first successfuladmit-sourcemoves that raw file out of inbox (field: into_intake/processed/; codex: renamed into the artefact's ownsources/folder), so a later retry on the same converted markdown found nothing to hash — thesource_hashduplicate check was silently skipped and a fresh artefact was minted on every re-run.findRaw()now also checks the post-move location for both routes. The subsequent move/snapshot step is skipped when the raw is already there, or (under--force) copied rather than re-moved, so a--forcere-admit still produces a genuine second artefact without disturbing the one that already cites the first copy.snapshot_<id>_<date>_<stem><ext>, still prefixedsnapshot_for the existingIG-2assertion) so the fallback lookup has something to match on.SKILL.mdnext to the existingsource_hashdedup note.Test plan
transitrix/skills/ingest/tests/test_ingest_integrity.py— retriesadmit-sourceon the same converted markdown without re-dropping the raw file, for both the field (DRAFT) and codex (LAW) routes; asserts the retry is skipped (not a second artefact) and that--forcestill mints a genuine duplicate.--forcemints a second artefact while the first snapshot/processed file is left untouched.node scripts/check-notations.mjs— clean (findings present are all under gitignored.claude/worktrees/, unrelated to this change)