Repository navigation
JVNAUTOSCI-2592: Bound KR endpoint checks and evidence assignment - #304
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR tightens KR materialisation authority and evidence handling by (1) bounding relationship endpoint resolution to exact, low-cost reads and (2) making description-evidence ownership a deterministic, guard-enforced contract (with seed/versioned migrations and accompanying tests) so spreadsheet-row evidence is attached to the correct owning artefact slots before writes.
Changes:
- Updated the KR workflow seed + prompt assets to use bounded
concept_exists/ narrowfetch_conceptfor endpoint resolution and to forbid lexical-search fallback. - Extended KR/spreadsheet materialisation guards to require slot-owned
required_description_fragmentsand added tests for exact-once, wrong-slot, duplicate, and overlap rejection. - Added digest-gated, non-forced prompt migration and bumped KR seed (7→8) and spreadsheet authority seed (20→21) with regenerated fingerprints and coverage.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/backend/test_spreadsheet_record_ingestion_service.py | Adds coverage ensuring spreadsheet row evidence statements are compiled into the correct artefact slot fragments. |
| tests/backend/test_spreadsheet_programme_workflow_vontology_service.py | Updates seed-version assertions and validates legacy authority digest mapping for the spreadsheet programme seed. |
| tests/backend/test_spreadsheet_cross_record_entity_identity.py | Updates synthetic fixtures to include guard-required description fragments in generated descriptions. |
| tests/backend/test_kr_materialisation_workflow_vontology_service.py | Adds/updates tests for seed v8 policies, bounded endpoint resolution, and digest-gated prompt migration behaviour. |
| tests/backend/test_kr_materialisation_guard_service.py | Adds focused tests for required-description-fragment ownership validation and overlap/duplication rejection. |
| src/backend/workflows/repo_seed_bundles/spreadsheet_programme_representation_workflow_seed_bundle.json | Bumps seed to v21, updates KR dependency to seed v8, and records reviewed legacy authority digests + new fingerprint. |
| src/backend/workflows/repo_seed_bundles/prompt_kr_relationship_endpoint_resolution_seed.md | Tightens resolver instructions to exact-ID bounded checks and blocks lexical-search fallback. |
| src/backend/workflows/repo_seed_bundles/prompt_kr_design_materialisation_plan_seed.md | Requires verbatim, exact-once placement of required_description_fragments into the owning slot’s description_text. |
| src/backend/workflows/repo_seed_bundles/kr_materialisation_workflow_seed_bundle.json | Bumps seed to v8 and updates resolve-relationship-specs tool policy defaults + context fields. |
| src/backend/services/spreadsheet_materialisation_guard_service.py | Derives required_description_fragments from row field evidence statements and attaches them to generated artefact slots. |
| src/backend/services/kr_materialisation_workflow_vontology_service.py | Implements digest-gated prompt migration/readback enforcement and blocks publication on unreviewed drift. |
| src/backend/services/kr_materialisation_guard_service.py | Adds deterministic validation for fragment ownership (exact-once, wrong-slot, overlap/duplication) during plan validation. |
| scripts/generate_spreadsheet_programme_workflow_seed.py | Bumps seed version to v21 and emits reviewed legacy authority digest mapping into generated bundle. |
Comment on lines
+371
to
+372
| for key, description in description_by_key.items(): | ||
| for match in fragment_pattern.finditer(description): |
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.
What changed
concept_exists/ narrowfetch_conceptreads and removed broad lexical-search fallback from that resolver.Why
The exact-worker replay completed all concept and relationship writes but exposed two acceptance defects: a resolver existence check expanded incoming relationships and timed out after scanning Atlas, and the model placed all field-level evidence on the immutable record version instead of each owning typed artefact. The completion checker correctly refused to write a processing marker. This change removes the wasteful affordance and makes evidence ownership a deterministic pre-write contract while preserving model-driven planning.
Validation
git diff --checkpassed.validate-allpassed (local Mongo availability warning only).Live authority publication and exact-worker replay will follow this merge so the evidence remains bound to the merged commit.