Skip to content

Materialise optional KR workflow outputs - #298

Merged
witbrock merged 1 commit into
mainfrom
jvnautosci-2592-kr-optional-context-outputs
Jul 23, 2026
Merged

witbrock merged 1 commit into
mainfrom
jvnautosci-2592-kr-optional-context-outputs

Conversation

@witbrock

Copy link
Copy Markdown
Member

Outcome

Make the generic KR concept and relationship initialisers compatible with enforced writes_context_keys metadata by materialising inactive optional outputs as null rather than omitting them.

Root cause

The guarded plan produced valid reuse_existing concept specs, but every concept-item child failed immediately after workflow_control.context_set: optional create/blocker fields used skip_if_unresolved while also being declared as mandatory writes. Metadata enforcement rejected the absent keys before routing or any Vontology tool call.

Authority propagation

  • Bump the KR workflow seed to integer version 2 (normalising the previous labelled version for the repository version gate).
  • Bump spreadsheet programme workflow seed 14 -> 15.
  • Regenerate the spreadsheet bundle so its exact KR dependency SHA and processing-authority fingerprint change together.

Safety

Null-aware route predicates remain unchanged: inactive branch values exist as null, and context_is_null continues to prevent the wrong branch.

Validation

  • 64 focused KR/spreadsheet/control-flow/metadata/guard tests pass.
  • Regression directly executes the represented context_set assignments and enforced post-action metadata validation for reuse, create, and relationship paths.
  • Exact generator-output and dependency-fingerprint tests pass.
  • Seed version bump guard, Ruff, and diff-check pass.
  • Independent review found no blocker.

Jira: JVNAUTOSCI-2592

Copilot AI review requested due to automatic review settings July 23, 2026 22:26

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 updates the represented KR materialisation workflows so that optional initialiser outputs are always materialised into workflow context (as null) when writes_context_keys enforcement is enabled, preventing metadata validation from failing due to missing keys. It also propagates the resulting authority/seed updates into the spreadsheet programme workflow seed bundle and adds a targeted regression test around workflow_control.context_set + post-action metadata validation.

Changes:

  • Materialise previously-omitted optional KR initialiser outputs by removing skip_if_unresolved so unresolved values are written as null.
  • Bump KR workflow seed version to "2" and propagate updated dependency SHA/fingerprint and seed version "15" in the spreadsheet programme seed bundle.
  • Add a regression test that executes the represented context_set assignments and validates enforced writes_context_keys post-action metadata.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
tests/backend/test_kr_materialisation_workflow_vontology_service.py Adds regression test coverage ensuring optional initialiser fields satisfy enforced writes_context_keys via context_set + post-action validation.
src/backend/workflows/repo_seed_bundles/kr_materialisation_workflow_seed_bundle.json Removes skip_if_unresolved from optional initialiser assignments so inactive optional outputs are written as null; bumps seed version to "2".
src/backend/workflows/repo_seed_bundles/spreadsheet_programme_representation_workflow_seed_bundle.json Updates KR dependency payload SHA/seed version and regenerates authority fingerprint; bumps spreadsheet seed version to "15".
scripts/generate_spreadsheet_programme_workflow_seed.py Updates generator seed version to "15" to match the regenerated spreadsheet seed bundle.

Comment on lines +69 to +81
workflow = next(
row
for row in bundle.get("workflows") or []
if isinstance(row, Mapping) and row.get("workflow_id") == workflow_id
)
publication_spec = workflow.get("publication_spec")
assert isinstance(publication_spec, Mapping)
return next(
row
for row in publication_spec.get("steps") or []
if isinstance(row, Mapping) and row.get("state_id") == state_id
)

@witbrock
witbrock merged commit 45fa814 into main Jul 23, 2026
5 checks passed
@witbrock
witbrock deleted the jvnautosci-2592-kr-optional-context-outputs 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