Add native reason enrichment for semantic signals (sprint 239)

This commit is contained in:
Bill
2026-02-26 14:55:26 -07:00
parent 5eaaa7cc56
commit 9e39181f77
7 changed files with 102 additions and 2 deletions

View File

@@ -150,7 +150,7 @@ Parallel planning tranche (active):
- `logs/taskitem_runs/TEST_ONLY_spec_planning_baseline_20260226/deterministic_spec_readiness.json` - `logs/taskitem_runs/TEST_ONLY_spec_planning_baseline_20260226/deterministic_spec_readiness.json`
Planning runtime controls (active): Planning runtime controls (active):
- `sprint232_plan.md` to `sprint238_plan.md` - `sprint232_plan.md` to `sprint239_plan.md`
- semantic bridge + intake augmentation + requirement injection + expansion gating are wired into: - semantic bridge + intake augmentation + requirement injection + expansion gating are wired into:
- `tools/mcp/run_sprint_taskitem_pipeline.sh` - `tools/mcp/run_sprint_taskitem_pipeline.sh`
- current policy default is native-first semantic fallback: - current policy default is native-first semantic fallback:
@@ -162,3 +162,6 @@ Planning runtime controls (active):
- `tools/mcp/run_semantic_fallback_budget_gate.sh` - `tools/mcp/run_semantic_fallback_budget_gate.sh`
- native decomposition quality gate is available in pipeline summary/hard-fail path: - native decomposition quality gate is available in pipeline summary/hard-fail path:
- `native_decomposition_gate` - `native_decomposition_gate`
- native reason enrichment can inject semantic tags into native task reasons:
- `WSTONE_NATIVE_REASON_ENRICHMENT`
- `native_reason_enrichment`

View File

@@ -46,7 +46,7 @@ This is the canonical dated registry for "not production-ready" generator gaps.
| GR-017 | Full-stack contract propagation gap | `docs/gap_hunt_fullstack_multifile_2026-02-26.md`, `logs/taskitem_runs/challenging_fullstack_multifile_20260226_r5/fullstack_contract_closure.json` | `partial` | Full-stack contract packet + strict validation added in benchmark orchestration and summary aggregation. Contract invalid rate is `0%` on valid catalog, but cross-layer semantic consistency is not yet equivalence-verified. | Semantic propagation verifier sprint | | GR-017 | Full-stack contract propagation gap | `docs/gap_hunt_fullstack_multifile_2026-02-26.md`, `logs/taskitem_runs/challenging_fullstack_multifile_20260226_r5/fullstack_contract_closure.json` | `partial` | Full-stack contract packet + strict validation added in benchmark orchestration and summary aggregation. Contract invalid rate is `0%` on valid catalog, but cross-layer semantic consistency is not yet equivalence-verified. | Semantic propagation verifier sprint |
| GR-018 | Performance/security/rollout constrained refactor enforcement gap | `docs/gap_hunt_fullstack_multifile_2026-02-26.md`, `logs/taskitem_runs/challenging_fullstack_multifile_20260226_r5/results.jsonl` | `partial` | Hard checks now enforce migration rollback + data-loss policy, security deny-by-default, SLO p95 presence, and rollout staged+abort policy. Enforcement is contract-level; generator capability under these constraints is still weak in C++ AB path. | Constraint-aware generation follow-up | | GR-018 | Performance/security/rollout constrained refactor enforcement gap | `docs/gap_hunt_fullstack_multifile_2026-02-26.md`, `logs/taskitem_runs/challenging_fullstack_multifile_20260226_r5/results.jsonl` | `partial` | Hard checks now enforce migration rollback + data-loss policy, security deny-by-default, SLO p95 presence, and rollout staged+abort policy. Enforcement is contract-level; generator capability under these constraints is still weak in C++ AB path. | Constraint-aware generation follow-up |
| GR-019 | Parity-blocked readiness load (gating without capability closure) | `logs/taskitem_runs/challenging_fullstack_multifile_20260226_r7/summary.json`, `logs/taskitem_runs/challenging_subset_prod_20260226_r7/summary.json`, `docs/sprint225_227_execution_tracker_2026-02-26.md` | `partial` | Sprint 225-227 reduced blocked parity load from `6` to `0` on both tracked hard catalogs while keeping unresolved divergence at `0`. This closes immediate safety debt for current corpora, but robustness is still contingent on pattern-driven repair classes. | Generalize repairs beyond queue-shaped transpile outputs | | GR-019 | Parity-blocked readiness load (gating without capability closure) | `logs/taskitem_runs/challenging_fullstack_multifile_20260226_r7/summary.json`, `logs/taskitem_runs/challenging_subset_prod_20260226_r7/summary.json`, `docs/sprint225_227_execution_tracker_2026-02-26.md` | `partial` | Sprint 225-227 reduced blocked parity load from `6` to `0` on both tracked hard catalogs while keeping unresolved divergence at `0`. This closes immediate safety debt for current corpora, but robustness is still contingent on pattern-driven repair classes. | Generalize repairs beyond queue-shaped transpile outputs |
| GR-020 | Semantic fallback overuse masks weak native decomposition | `logs/taskitem_runs/TEST_ONLY_sprint236_semantic_fallback_audit_20260226/semantic_fallback_summary.json`, `logs/taskitem_runs/TEST_ONLY_sprint237_semantic_fallback_gate_fail_20260226/semantic_fallback_budget_gate.json`, `logs/taskitem_runs/TEST_ONLY_sprint238_native_gate_fail_20260226.json`, `docs/sprint236_execution_tracker_2026-02-26.md`, `docs/sprint237_execution_tracker_2026-02-26.md`, `docs/sprint238_execution_tracker_2026-02-26.md` | `partial` | Sprint 236 added deterministic fallback-gap auditing with tool + constraint metadata. Sprint 237 added fallback-budget hard gate (`max-fallback-rate`) and produced expected fail/pass artifacts. Sprint 238 added native decomposition hard gate in pipeline (`min task count`, `min semantic signal count`) so weak native generation can be blocked before fallback masking. Current measured slice still shows weak native decomposition (`2 tasks`, `0 semantic signals`) and needs generator-quality uplift to close. | Native decomposition upgrade + semantic rationale enforcement | | GR-020 | Semantic fallback overuse masks weak native decomposition | `logs/taskitem_runs/TEST_ONLY_sprint236_semantic_fallback_audit_20260226/semantic_fallback_summary.json`, `logs/taskitem_runs/TEST_ONLY_sprint237_semantic_fallback_gate_fail_20260226/semantic_fallback_budget_gate.json`, `logs/taskitem_runs/TEST_ONLY_sprint238_native_gate_fail_20260226.json`, `logs/taskitem_runs/TEST_ONLY_sprint239_semantic_fallback_audit_20260226/semantic_fallback_summary.json`, `docs/sprint236_execution_tracker_2026-02-26.md`, `docs/sprint237_execution_tracker_2026-02-26.md`, `docs/sprint238_execution_tracker_2026-02-26.md`, `docs/sprint239_execution_tracker_2026-02-26.md` | `partial` | Sprint 236 added deterministic fallback-gap auditing with tool + constraint metadata. Sprint 237 added fallback-budget hard gate (`max-fallback-rate`) and produced expected fail/pass artifacts. Sprint 238 added native decomposition hard gate in pipeline (`min task count`, `min semantic signal count`) so weak native generation can be blocked before fallback masking. Sprint 239 added native reason enrichment and shifted root-cause mix in A/B slice (`native_semantic_signal_count 0 -> 6`), but native task depth remains shallow (`2`), so fallback still triggers. | Native decomposition task-depth upgrade (increase native task granularity beyond 2) |
## What Was Covered Today (Sprints 175-184) ## What Was Covered Today (Sprints 175-184)

View File

@@ -160,3 +160,16 @@
- Dated gate verification artifacts: - Dated gate verification artifacts:
- fail packet: `logs/taskitem_runs/TEST_ONLY_sprint238_native_gate_fail_20260226.json` - fail packet: `logs/taskitem_runs/TEST_ONLY_sprint238_native_gate_fail_20260226.json`
- pass packet: `logs/taskitem_runs/TEST_ONLY_sprint238_native_gate_pass_20260226.json` - pass packet: `logs/taskitem_runs/TEST_ONLY_sprint238_native_gate_pass_20260226.json`
## Sprint 239 Added (Same Day)
- Added native semantic reason enrichment:
- `WSTONE_NATIVE_REASON_ENRICHMENT`
- summary packet: `native_reason_enrichment`
- A/B smoke result:
- `native_semantic_signal_count: 0 -> 6`
- artifacts:
- `logs/taskitem_runs/TEST_ONLY_sprint239_reason_enrich_20260226_145442/00_summary.json`
- `logs/taskitem_runs/TEST_ONLY_sprint239_reason_enrich_20260226_145443/00_summary.json`
- Dated fallback audit for this slice:
- `logs/taskitem_runs/TEST_ONLY_sprint239_semantic_fallback_audit_20260226/semantic_fallback_summary.json`

View File

@@ -0,0 +1,29 @@
# Sprint 239 Execution Tracker - 2026-02-26
## Scope
- `sprint239_plan.md`
## Implemented
Pipeline updates in `tools/mcp/run_sprint_taskitem_pipeline.sh`:
- Added `WSTONE_NATIVE_REASON_ENRICHMENT` (default `1`).
- Added deterministic enrichment of native task `reasons` from semantic requirement kinds.
- Added summary packet:
- `native_reason_enrichment`
## Baseline A/B Smoke
- enrichment enabled run:
- `logs/taskitem_runs/TEST_ONLY_sprint239_reason_enrich_20260226_145442/00_summary.json`
- enrichment disabled run:
- `logs/taskitem_runs/TEST_ONLY_sprint239_reason_enrich_20260226_145443/00_summary.json`
Observed delta:
- `native_semantic_signal_count: 0 -> 6`
Fallback audit artifact for this slice:
- `logs/taskitem_runs/TEST_ONLY_sprint239_semantic_fallback_audit_20260226/semantic_fallback_summary.json`
## Explicit Completion Signal
- Sprint 239: `DONE` (implemented + A/B smoke verified)

View File

@@ -0,0 +1,6 @@
#pragma once
// Sprint 239 integration summary:
// - Added native reason enrichment to inject semantic signal tags into native tasks.
// - Enrichment occurs before fallback decision and is configurable.
// - Pipeline now emits native reason enrichment telemetry in summary output.

11
sprint239_plan.md Normal file
View File

@@ -0,0 +1,11 @@
# Sprint 239 Plan: Native Semantic Reason Enrichment
## Goal
Increase semantic signal quality in native task decomposition without relying on fallback expansion.
## Steps
- Step 2238: Add optional native reason enrichment before fallback evaluation.
- Step 2239: Derive semantic tags from injected semantic requirement kinds.
- Step 2240: Attach enriched reason tags to native task reasons deterministically.
- Step 2241: Emit native reason enrichment telemetry in pipeline summary.
- Step 2242: Add `Sprint239IntegrationSummary.h` and execution tracker.

View File

@@ -36,6 +36,7 @@ SEMANTIC_MIN_COMPLEXITY_SCORE="${WSTONE_SEMANTIC_MIN_COMPLEXITY_SCORE:-2}"
NATIVE_DECOMP_HARD_GATE="${WSTONE_NATIVE_DECOMP_HARD_GATE:-0}" NATIVE_DECOMP_HARD_GATE="${WSTONE_NATIVE_DECOMP_HARD_GATE:-0}"
NATIVE_TASK_MIN_COUNT="${WSTONE_NATIVE_TASK_MIN_COUNT:-0}" NATIVE_TASK_MIN_COUNT="${WSTONE_NATIVE_TASK_MIN_COUNT:-0}"
NATIVE_SEMANTIC_SIGNAL_MIN="${WSTONE_NATIVE_SEMANTIC_SIGNAL_MIN:-0}" NATIVE_SEMANTIC_SIGNAL_MIN="${WSTONE_NATIVE_SEMANTIC_SIGNAL_MIN:-0}"
NATIVE_REASON_ENRICHMENT="${WSTONE_NATIVE_REASON_ENRICHMENT:-1}"
CAPABILITY_SIGNALS_JSON="${WSTONE_CAPABILITY_SIGNALS_JSON:-}" CAPABILITY_SIGNALS_JSON="${WSTONE_CAPABILITY_SIGNALS_JSON:-}"
if [[ -z "$CAPABILITY_SIGNALS_JSON" ]]; then if [[ -z "$CAPABILITY_SIGNALS_JSON" ]]; then
CAPABILITY_SIGNALS_JSON='{}' CAPABILITY_SIGNALS_JSON='{}'
@@ -88,6 +89,7 @@ SEMANTIC_REQUIREMENT_INJECTION_JSON='{}'
SEMANTIC_TASK_EXPANSION_JSON='{}' SEMANTIC_TASK_EXPANSION_JSON='{}'
SEMANTIC_GATE_JSON='{}' SEMANTIC_GATE_JSON='{}'
NATIVE_DECOMP_GATE_JSON='{}' NATIVE_DECOMP_GATE_JSON='{}'
NATIVE_REASON_ENRICHMENT_JSON='{}'
if [[ "$SEMANTIC_PLANNING_BRIDGE" == "1" ]]; then if [[ "$SEMANTIC_PLANNING_BRIDGE" == "1" ]]; then
python3 "$ROOT_DIR/tools/mcp/markdown_to_semantic_annotations.py" \ python3 "$ROOT_DIR/tools/mcp/markdown_to_semantic_annotations.py" \
--spec "$INPUT_FILE" \ --spec "$INPUT_FILE" \
@@ -290,6 +292,40 @@ if [[ "$(printf '%s' "$GEN_JSON" | jq -r '.success // false')" != "true" ]]; the
fi fi
TASKS="$(printf '%s' "$GEN_JSON" | jq '.tasks')" TASKS="$(printf '%s' "$GEN_JSON" | jq '.tasks')"
if [[ "$NATIVE_REASON_ENRICHMENT" == "1" && -f "$OUT_DIR/01c_semantic_injected_requirements.json" ]]; then
TASKS="$(jq -nc \
--argjson tasks "$TASKS" \
--argjson sem "$(cat "$OUT_DIR/01c_semantic_injected_requirements.json")" '
($sem
| map(.kind // "")
| map(
if . == "constraint" then "semantic_risk_contract_constraint"
elif . == "dependency" then "semantic_capability_requirement"
elif . == "goal" then "semantic_goal_alignment"
else empty end
)
| unique) as $tags
| ($tasks | to_entries | map(
.value.reasons = (((.value.reasons // []) + $tags) | unique)
| .value
))')"
NATIVE_REASON_ENRICHMENT_JSON="$(jq -nc \
--argjson tags "$(jq -nc --argjson sem "$(cat "$OUT_DIR/01c_semantic_injected_requirements.json")" '
($sem
| map(.kind // "")
| map(
if . == "constraint" then "semantic_risk_contract_constraint"
elif . == "dependency" then "semantic_capability_requirement"
elif . == "goal" then "semantic_goal_alignment"
else empty end
)
| unique)
')" \
--argjson enriched_task_count "$(printf '%s' "$TASKS" | jq 'length')" \
'{enabled:true, enriched_task_count:$enriched_task_count, tags:$tags}')"
else
NATIVE_REASON_ENRICHMENT_JSON='{"enabled":false,"enriched_task_count":0,"tags":[]}'
fi
native_task_count="$(printf '%s' "$TASKS" | jq 'length')" native_task_count="$(printf '%s' "$TASKS" | jq 'length')"
native_semantic_signal_count="$(printf '%s' "$TASKS" | jq '[.[] | ((.reasons // [])[]? | tostring) | select(test("semantic|risk|contract|capability"; "i"))] | length')" native_semantic_signal_count="$(printf '%s' "$TASKS" | jq '[.[] | ((.reasons // [])[]? | tostring) | select(test("semantic|risk|contract|capability"; "i"))] | length')"
native_task_count_ok="true" native_task_count_ok="true"
@@ -422,6 +458,7 @@ SUMMARY_JSON="$(jq -nc \
--argjson semantic_requirement_injection "$SEMANTIC_REQUIREMENT_INJECTION_JSON" \ --argjson semantic_requirement_injection "$SEMANTIC_REQUIREMENT_INJECTION_JSON" \
--argjson semantic_task_expansion "$SEMANTIC_TASK_EXPANSION_JSON" \ --argjson semantic_task_expansion "$SEMANTIC_TASK_EXPANSION_JSON" \
--argjson native_decomposition_gate "$NATIVE_DECOMP_GATE_JSON" \ --argjson native_decomposition_gate "$NATIVE_DECOMP_GATE_JSON" \
--argjson native_reason_enrichment "$NATIVE_REASON_ENRICHMENT_JSON" \
--argjson intake "$INTAKE_JSON" \ --argjson intake "$INTAKE_JSON" \
--argjson generated "$GEN_JSON" \ --argjson generated "$GEN_JSON" \
--argjson queue "$QUEUE_JSON" \ --argjson queue "$QUEUE_JSON" \
@@ -440,6 +477,7 @@ SUMMARY_JSON="$(jq -nc \
semantic_requirement_injection: $semantic_requirement_injection, semantic_requirement_injection: $semantic_requirement_injection,
semantic_task_expansion: $semantic_task_expansion, semantic_task_expansion: $semantic_task_expansion,
native_decomposition_gate: $native_decomposition_gate, native_decomposition_gate: $native_decomposition_gate,
native_reason_enrichment: $native_reason_enrichment,
intake: { intake: {
success: ($intake.success // false), success: ($intake.success // false),
normalized_requirement_count: (($intake.normalizedRequirements // [])|length), normalized_requirement_count: (($intake.normalizedRequirements // [])|length),