6 Commits

Author SHA1 Message Date
Yeachan-Heo 21d823f597 test: add integration tests for worker boot, lane events, hooks
Add five runtime integration tests that exercise worker boot readiness, lane event emission, hook merging, task packet roundtrips, and config validation through the public crate surface.

Constraint: Keep coverage in rust/crates/runtime/tests without adding dependencies
Rejected: Fold the cases into existing integration_tests.rs | harder to isolate the requested workflow coverage
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: Keep these tests focused on cross-module wiring; leave unit-level edge cases in module-local test suites
Tested: cargo test --workspace (from rust)
Not-tested: Push result on remote CI
2026-04-04 16:08:32 +00:00
Yeachan-Heo c195113265 test: add integration tests for worker boot, lane events, hooks
Add a focused runtime integration test file that exercises worker boot state,
lane event emission, hook config merging and execution, task packet roundtrips,
and config validation through the public runtime APIs.

Constraint: Keep the change scoped to integration coverage without touching runtime behavior
Rejected: Reusing broader untracked workspace changes | would mix unrelated work into this request
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: Keep these tests aligned with the public runtime re-exports and cross-module wiring paths
Tested: cargo test -p runtime --test runtime_workflows; cargo test --workspace
Not-tested: No additional lint-only pass beyond rustfmt
2026-04-04 16:07:53 +00:00
Yeachan-Heo eea7651dab test: add integration tests for branch freshness, MCP, policy
Add focused integration coverage for real git branch freshness checks, degraded MCP startup reporting, policy routing, prompt misdelivery recovery, and telemetry JSONL roundtrips.

Constraint: Keep coverage isolated to new integration test files so existing in-progress workspace edits stay untouched
Rejected: Expand existing unit tests instead | user requested integration coverage across runtime and telemetry boundaries
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: Keep these scenarios in integration tests because they depend on cross-module behavior and serialized output contracts
Tested: cargo test --workspace
Not-tested: Remote push hooks or CI-only environment differences
2026-04-04 16:07:18 +00:00
Jobdori 8b2f959a98 test(runtime): add worker→recovery→policy integration test
Adds worker_provider_failure_flows_through_recovery_to_policy():
- Worker boots, sends prompt, encounters provider failure
- observe_completion() classifies as WorkerFailureKind::Provider
- from_worker_failure_kind() bridges to FailureScenario
- attempt_recovery() executes RestartWorker recipe
- Post-recovery context evaluates to merge-ready via PolicyEngine

Completes the P2.8/P2.13 wiring verification with a full cross-module
integration test. 660 tests pass.
2026-04-04 21:27:44 +09:00
Jobdori 736069f1ab feat(worker_boot): classify session completion failures (P2.13)
Add WorkerFailureKind::Provider variant and observe_completion() method
to classify degraded session completions as structured failures.

- Detects finish='unknown' + zero tokens as provider failure
- Detects finish='error' as provider failure
- Normal completions transition to Finished state
- 2 new tests verify classification behavior

This closes the gap where sessions complete but produce no output,
and the failure mode wasn't machine-readable for recovery policy.

ROADMAP P2.13 backlog item added.
2026-04-04 19:37:57 +09:00
Jobdori 69b9232acf test(runtime): add cross-module integration tests (P1.2)
Add integration_tests.rs with 11 tests covering:

- stale_branch + policy_engine: stale detection flows into policy,
  fresh branches don't trigger stale rules, end-to-end stale lane
  merge-forward action
- green_contract + policy_engine: satisfied/unsatisfied contract
  evaluation, green level comparison for merge decisions
- reconciliation + policy_engine: reconciled lanes match reconcile
  condition, reconciled context has correct defaults, non-reconciled
  lanes don't trigger reconcile rules
- stale_branch module: apply_policy generates correct actions for
  rebase, merge-forward, warn-only, and fresh noop cases

These tests verify that adjacent modules actually connect correctly
— catching wiring gaps that unit tests miss.

Addresses ROADMAP P1.2: cross-module integration tests.
2026-04-04 17:05:03 +09:00