Skip to content

JVNAUTOSCI-2592: harden idempotent spreadsheet KR writes - #300

Merged
witbrock merged 1 commit into
mainfrom
jvnautosci-2592-create-timeout-hardening
Jul 24, 2026
Merged

witbrock merged 1 commit into
mainfrom
jvnautosci-2592-create-timeout-hardening

Conversation

@witbrock

Copy link
Copy Markdown
Member

Outcome

Makes the represented spreadsheet-to-KR materialisation path recover safely and efficiently after create timeouts.

Changes

  • adds an opt-in canonical_id_only duplicate-resolution mode for stable represented identities while preserving the existing semantic fallback by default
  • adds cooperative cancellation points before post-deadline creates and later batch items
  • makes guarded KR concept iteration sequential and fail-fast
  • suppresses redundant event-workflow fan-out and discovery-cache invalidation only around five workflow-owned mutation states, after normal actor/write/target guardrails
  • regenerates KR seed v4, spreadsheet seed v17, the dependent authority fingerprint, and the deterministic MCP manifest
  • documents the reserved VWL control and its constraints

Validation

  • 142 changed-surface tests pass
  • KR bundle validation and seed-version checks pass
  • deterministic generator and MCP manifest parity pass
  • Ruff check/format and git diff checks pass
  • privacy review found no workbook names, paths, hashes, cell values, or personal data in the change

Three unrelated stale tests in the broader workflow MCP file fail identically on untouched origin/main; none intersects this delta.

Live acceptance

After merge, restart the exact merged build, publish/read back both represented workflow bundles, then run a fresh one-record create/reuse probe followed by the 28-record unchanged-replay campaign.

Copilot AI review requested due to automatic review settings July 24, 2026 00:10
@witbrock
witbrock marked this pull request as ready for review July 24, 2026 00:10
@witbrock
witbrock merged commit 582e36e into main Jul 24, 2026
5 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens the represented spreadsheet→KR materialisation pipeline so that create-time timeouts can recover safely (idempotently) and more efficiently, while avoiding recursive event/workflow fan-out from workflow-owned mutation phases.

Changes:

  • Introduces an opt-in duplicate_resolution_mode="canonical_id_only" for create_concepts, preserving exact canonical-id reuse while skipping semantic fallback after an exact miss, plus adds cooperative cancellation checkpoints to prevent post-deadline creates.
  • Adds request-local event-workflow launch suppression (ContextVar-backed) and threads that suppression through the workflow MCP invoke action, including explicit telemetry output.
  • Regenerates/bumps the KR + spreadsheet workflow seed bundles (and dependent fingerprints), and documents the reserved VWL control; adds focused regression tests for the new behaviours.

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/backend/test_workflow_mcp_tool_actions.py Adds coverage ensuring event-launch suppression is applied to the invocation context without forwarding the control flag into tool payloads.
tests/backend/test_workflow_event_integration_service.py Adds tests for nested/thread-local suppression and verifies suppressed launches return early without binding reads; validates local cache-invalidation suppression.
tests/backend/test_spreadsheet_programme_workflow_vontology_service.py Updates assertions for regenerated spreadsheet seed v17 + KR dependency seed v4 and related fingerprints.
tests/backend/test_mcp_create_concepts_duplicate_resolution_mode.py New focused tests for canonical_id_only mode and cooperative cancellation behaviour in create_concepts.
tests/backend/test_kr_materialisation_workflow_vontology_service.py Updates for KR seed v4, guard output mapping of duplicate resolution mode, sequential fail-fast iteration, and owned-mutation event fan-out suppression assertions.
tests/backend/test_kr_materialisation_guard_service.py Verifies the guard returns/propagates duplicate_resolution_mode consistently (None when unguarded/rejected, canonical when guarded/pass).
src/backend/workflows/workflow_mcp_tool_actions.py Adds suppress_event_workflow_launches control input, prevents payload forwarding, applies suppression scope around gateway invoke, and emits event_workflow_launch_suppression_requested.
src/backend/workflows/repo_seed_bundles/spreadsheet_programme_representation_workflow_seed_bundle.json Updates spreadsheet seed bundle to v17 and refreshes KR dependency identity + authority fingerprint values.
src/backend/workflows/repo_seed_bundles/kr_materialisation_workflow_seed_bundle.json Bumps KR seed bundle to v4; wires duplicate resolution mode mapping, suppression flag on owned mutation steps, and sequential/stop-on-error iteration.
src/backend/services/workflow_event_integration_service.py Implements ContextVar-based suppression API and short-circuits launch_event_workflow when suppressed.
src/backend/services/text_value_service.py Gates workflow discovery cache invalidation behind the new suppression-aware feature flag.
src/backend/services/relationship_write_service.py Gates workflow discovery cache invalidation behind the new suppression-aware feature flag.
src/backend/services/kr_materialisation_guard_service.py Adds GUARDED_CREATE_DUPLICATE_RESOLUTION_MODE and includes duplicate_resolution_mode in pass/reject guard responses.
src/backend/services/feature_flags.py Makes discovery-cache invalidation suppression-aware via lazy import of the workflow-event suppression state.
src/backend/services/create_concepts_duplicate_guard_service.py Adds duplicate_resolution_mode support to skip semantic resolution after exact miss for deterministic identities.
src/backend/mcp_server/vontology_mcp.json Documents and schemas duplicate_resolution_mode for create_concepts in the published MCP manifest; includes additional schema/doc tweaks in other tool entries.
src/backend/integrations/internal_mcp/catalogue.py Implements duplicate_resolution_mode validation + schema enum, and adds cooperative cancellation points before/after key phases in create_concepts.
scripts/generate_spreadsheet_programme_workflow_seed.py Updates spreadsheet seed version to v17 and keeps deterministic fingerprint generation aligned with updated dependencies.
docs/engineering/von_workflow_language_manual.md Documents the reserved suppress_event_workflow_launches control and its constraints; notes emitted telemetry output.

@witbrock
witbrock deleted the jvnautosci-2592-create-timeout-hardening branch July 28, 2026 12:09
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.

2 participants