Skip to content

feat(context,orchestration): wire PAACE lookahead from DAG into ContextAssemblyInput#4633

Merged
bug-ops merged 3 commits into
mainfrom
4549-paace-lookahead-dag
May 29, 2026
Merged

feat(context,orchestration): wire PAACE lookahead from DAG into ContextAssemblyInput#4633
bug-ops merged 3 commits into
mainfrom
4549-paace-lookahead-dag

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented May 29, 2026

Summary

CAM Phase 2-A (#4549): wires the live orchestration DAG into ContextAssemblyInput::planned_next_tools, activating the FidelityScorer w_plan relevance signal that was introduced in Phase 1 but always received &[].

  • zeph-orchestration: lookahead_tools(graph, depth) -> Vec<PlannedToolHint> — BFS from Running/Ready frontier (not emitted), returns downstream tool hints at distance 1..depth; full tool_name included as first keyword; depth=0 = disabled fast-path; tracing::debug_span! instrumented
  • zeph-config: FidelityConfig.lookahead_depth (default 3, range 0..=5)
  • zeph-core: OrchestrationState.cached_lookahead updated after each scheduler.tick(), cleared on loop exit; assembly.rs reads cache instead of &[]
  • zeph-agent-context: second hardcoded &[] in service.rs replaced with live hints
  • zeph-context: test fixtures updated (lookahead_depth: 3), w_plan scoring test added

Test plan

  • cargo nextest run -p zeph-orchestration -p zeph-context -p zeph-agent-context -p zeph-config -p zeph-core --lib — 2626 pass
  • Full workspace: 10248 pass
  • cargo clippy ... -- -D warnings clean
  • cargo +nightly fmt --check clean
  • Acceptance criteria verified: lookahead_tools(depth=0)vec![], frontier not emitted, w_plan produces non-zero score for matching hints

Follow-up

  • Security S2: add 128-char cap on PlannedToolHint.tool_name (#TBD)
  • Security S3: type-enforce depth cap via newtype or saturating clamp (#TBD)
  • Perf S3: pre-build content_words HashSet once in plan_relevance() (#TBD)
  • Impl S4: diamond-DAG BFS distance test (#TBD)

Closes #4549

@bug-ops bug-ops enabled auto-merge (squash) May 29, 2026 14:35
@github-actions github-actions Bot added rust Rust code changes enhancement New feature or request core zeph-core crate labels May 29, 2026
@bug-ops bug-ops force-pushed the 4549-paace-lookahead-dag branch from 2cc26d2 to 9f26a85 Compare May 29, 2026 14:35
@github-actions github-actions Bot added the size/L Large PR (201-500 lines) label May 29, 2026
bug-ops added 2 commits May 29, 2026 16:45
…xtAssemblyInput

Add `lookahead_tools(graph, depth)` to zeph-orchestration that performs a BFS
from the Running/Ready frontier and returns `Vec<PlannedToolHint>` for the next
`depth` scheduled tool calls. Cache the result in `OrchestrationState` and
propagate it into `ContextAssemblyInput::planned_next_tools` at turn start,
activating the FidelityScorer w_plan relevance signal.

- zeph-orchestration: `lookahead_tools()` free function in dag.rs, BFS from
  frontier (frontier not emitted), full tool_name as first keyword, depth=0
  fast-path, tracing span, 9 unit tests
- zeph-config: `FidelityConfig.lookahead_depth` (default 3, range 0..=5)
- zeph-core: `OrchestrationState.cached_lookahead` updated after each tick,
  cleared on loop exit; assembly.rs reads the cache instead of &[]
- zeph-agent-context: service.rs second &[] site replaced with live hints
- zeph-context: test fixtures updated, w_plan scoring test added

Closes #4549
@bug-ops bug-ops force-pushed the 4549-paace-lookahead-dag branch from e89ce4c to 5b6032e Compare May 29, 2026 14:46
@bug-ops bug-ops merged commit 0681356 into main May 29, 2026
32 checks passed
@bug-ops bug-ops deleted the 4549-paace-lookahead-dag branch May 29, 2026 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core zeph-core crate enhancement New feature or request rust Rust code changes size/L Large PR (201-500 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(context): CAM Phase 2-A — wire PAACE lookahead from orchestration DAG into ContextAssemblyInput

1 participant