feat(TASK-D): single-source stage contracts #321

Merged
conductor merged 1 commits from task-d-stage-contracts into master 2026-09-10 02:09:23 +01:00
Owner

TASK D: single-source stage contracts (epic #284)

One authoritative definition of each cognitive stage's required artifact fields. Worker prompts, artifact validators, normalization aliases, and contract-drift tests all derive from this registry.

  • scripts/stage_contracts.py: STAGE_CONTRACTS dict (required_fields + optional_fields per stage), COMPATIBILITY_ALIASES (bounded, versioned), get_prompt_field_description(), get_aliases()
  • INWARD contract added (claims)
  • SYNTHESIS data_flow promoted to required (contract-drift test caught it)
  • 8 contract-drift tests: all stages have contracts, disposition in ADVERSARIAL contract, conclusion in INNOVATION, route in APPLICABILITY, validator-vs-contract drift, aliases bounded, prompt derives from contract

First direct application of Process Learning: fix the mechanism that caused the class of failure (duplicate stage-contract authority between templates and inline prompts), not just the observed output.

8 tests; full suite 1179 passed; ruff clean.

## TASK D: single-source stage contracts (epic #284) One authoritative definition of each cognitive stage's required artifact fields. Worker prompts, artifact validators, normalization aliases, and contract-drift tests all derive from this registry. - scripts/stage_contracts.py: STAGE_CONTRACTS dict (required_fields + optional_fields per stage), COMPATIBILITY_ALIASES (bounded, versioned), get_prompt_field_description(), get_aliases() - INWARD contract added (claims) - SYNTHESIS data_flow promoted to required (contract-drift test caught it) - 8 contract-drift tests: all stages have contracts, disposition in ADVERSARIAL contract, conclusion in INNOVATION, route in APPLICABILITY, validator-vs-contract drift, aliases bounded, prompt derives from contract **First direct application of Process Learning:** fix the mechanism that caused the class of failure (duplicate stage-contract authority between templates and inline prompts), not just the observed output. 8 tests; full suite 1179 passed; ruff clean.
conductor added 1 commit 2026-09-10 02:07:18 +01:00
feat(TASK-D): single-source stage contracts — one authority for required fields, prompts, validators, aliases (epic #284 TASK D)
Auto-label / priority-gate (pull_request) Skipped
Auto-label / auto-label (pull_request) Successful in 3s
CI Pipeline / best-practices (push) Successful in 5s
CI Pipeline / documentation (push) Successful in 4s
CI Pipeline / canary (push) Successful in 33s
CI Pipeline / lint (push) Successful in 41s
CI Pipeline / type-check (push) Successful in 32s
CI Pipeline / gitea-offline (push) Successful in 16s
CI Pipeline / unit-tests (push) Successful in 1m0s
CI Pipeline / best-practices (pull_request) Successful in 4s
CI Pipeline / documentation (pull_request) Successful in 4s
CI Pipeline / lint (pull_request) Successful in 38s
CI Pipeline / canary (pull_request) Successful in 33s
CI Pipeline / gitea-offline (pull_request) Successful in 16s
Spec gate (headless) / spec-gate (pull_request) Successful in 7s
CI Pipeline / required-checks (push) Successful in 1s
CI Pipeline / unit-tests (pull_request) Successful in 54s
CI Pipeline / type-check (pull_request) Successful in 31s
CI Pipeline / required-checks (pull_request) Successful in 1s
Auto-version and Release / release (pull_request) Successful in 39s
6f58ba3f94
scripts/stage_contracts.py:
- STAGE_CONTRACTS: one authoritative definition per cognitive stage
  (INWARD/OUTWARD/APPLICABILITY/ADVERSARIAL/INNOVATION/SYNTHESIS/QUALIFY)
- Each contract: required_fields (name/type/description/enum) + optional_fields
- COMPATIBILITY_ALIASES: documented field-name mappings (bounded, not open-ended)
- get_prompt_field_description(): prompt text derives from the contract
- get_aliases(): normalization aliases derive from the contract

Contract-drift tests (test_stage_contracts.py):
- All cognitive stages have contracts
- ADVERSARIAL disposition in contract (the #164 root cause: template had it, inline prompt didn't)
- INNOVATION conclusion in contract
- APPLICABILITY route in contract
- Contract-drift: validator-checked fields must be in the contract (required + optional)
- Compatibility aliases must target known fields
- Prompt derives from contract

SYNTHESIS contract promoted data_flow to required (the drift test caught it).

8 tests; full suite 1171 passed; ruff clean.
gitea-actions Bot added the buggovernancegrowthperception labels 2026-09-10 02:07:28 +01:00

🤖 Headless spec gate (non-blocking, #204 first slice)

Spec-gate agent produced no text output — check runner logs.

Deterministic floors still govern the merge

This comment is advisory. Required checks (lint, tests, canaries, type-check, coverage, dependency lock, impact gate) remain the merge authority per docs/adversarial-review.md proportionality.

🤖 **Headless spec gate (non-blocking, #204 first slice)** Spec-gate agent produced no text output — check runner logs. <details><summary>Deterministic floors still govern the merge</summary> This comment is advisory. Required checks (lint, tests, canaries, type-check, coverage, dependency lock, impact gate) remain the merge authority per docs/adversarial-review.md proportionality.</details>
conductor merged commit 1850ca5d3e into master 2026-09-10 02:09:23 +01:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: conductor/rune#321