JVNAUTOSCI-2512: scope capability-index invalidation to authoritative workflow concepts#284
Merged
witbrock merged 1 commit intoJun 13, 2026
Conversation
…workflow concepts The text-relation routing-projection invalidation filtered only on the predicate (hasDescription/hasContent/hasDefinition), so a description write to ANY concept invalidated the whole workflow capability index. Background workflows (paper_recommendation/episode storm, JVNAUTOSCI-2507) continually rewrite task/episode concept descriptions, churning the index so it never reached ready=true and live workflow discovery returned zero candidates - which prevented the represented selector fast path from firing. Gate the text-relation path on is_authoritative_workflow_concept_id(subject) (new, fails open), mirroring the already-narrow relationship path. New workflows still invalidate via the registration path. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
| def test_is_authoritative_workflow_concept_id( | ||
| monkeypatch: pytest.MonkeyPatch, | ||
| ) -> None: | ||
| import src.backend.services.workflow_capability_service as capability_service |
| def test_is_authoritative_workflow_concept_id_fails_open( | ||
| monkeypatch: pytest.MonkeyPatch, | ||
| ) -> None: | ||
| import src.backend.services.workflow_capability_service as capability_service |
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.
Problem (JVNAUTOSCI-2512)
_invalidate_workflow_routing_projection_for_text_relation_change(src/backend/services/text_value_service.py) invalidated the entire workflow capability index whenever a text relation with a routing-relevant predicate (hasDescription/hasContent/hasDefinition) was written — filtering only on the predicate, with no check that the subject is an authoritative workflow concept.The sibling relationship path (
relationship_write_service.py) is already correctly narrow (is_a_type_of/is_an_instance_of+ workflow graph aliases). The text-relation path was the leaky one.Consequence: the background paper-recommendation / episode-evaluation storm (JVNAUTOSCI-2507) continually rewrites task/episode concept descriptions, so the routing index was invalidated every ~2-3s and never reached
ready=true. Live workflow discovery returned 0 candidates (match_absence_reason=capability_index_wait_timed_out_build_in_progress), which is why the represented selector fast path (JVNAUTOSCI-2406/2501) could not fire end-to-end despite the code being correct — blocking JVNAUTOSCI-2511.Fix
is_authoritative_workflow_concept_id()helper inworkflow_capability_service.py(consults the shared registry's authoritative workflow ids; fails open if the registry can't be resolved, preserving the prior always-invalidate behaviour on lookup failure).registry_factory.py, so nothing legitimate is lost.Tests
tests/backend/test_workflow_capability_service.py: updated the existing invalidation test to be deterministic, plus new tests for the non-workflow-subject skip path and the helper (including fail-open). Full file: 54 pass.Verified live
With this deployed (server build
d5d4cadde924), the index stayed ready and the represented fast path fired withapplied=true:live-kb-prompt-27fac620-34db-4be1-8060-0276a03cf00a, prompt "Show me the last 5 email messages"selector_source: represented_fast_path; single covered candidate#V#general_mail_review_workflow(contract[gmail_list_messages])gmail_list_messagesran 3× ok. Evidence captured under JVNAUTOSCI-2511 (now Done, along with 2406/2501).Related: JVNAUTOSCI-2507 (the storm that supplies the write volume) is still open and independently warranted.
🤖 Generated with Claude Code