Skip to content

JVNAUTOSCI-2512: scope capability-index invalidation to authoritative workflow concepts#284

Merged
witbrock merged 1 commit into
mainfrom
JVNAUTOSCI-2511-capability-index-invalidation-scope
Jun 13, 2026
Merged

JVNAUTOSCI-2512: scope capability-index invalidation to authoritative workflow concepts#284
witbrock merged 1 commit into
mainfrom
JVNAUTOSCI-2511-capability-index-invalidation-scope

Conversation

@witbrock

Copy link
Copy Markdown
Member

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

  • New is_authoritative_workflow_concept_id() helper in workflow_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).
  • Gate the text-relation invalidation path on it: description/content writes on non-workflow concepts (tasks, episodes) no longer churn the routing index. New workflows still invalidate via the registration path in 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 with applied=true:

  • request_id 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])
  • turn completed successfully; gmail_list_messages ran 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

…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
@witbrock witbrock merged commit e320822 into main Jun 13, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant