feat(cli): wire project context CLI stubs to ACMS pipeline
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 14s
CI / build (pull_request) Successful in 17s
CI / quality (pull_request) Successful in 19s
CI / security (pull_request) Successful in 32s
CI / typecheck (pull_request) Successful in 33s
CI / unit_tests (pull_request) Successful in 2m22s
CI / integration_tests (pull_request) Successful in 2m52s
CI / docker (pull_request) Successful in 39s
CI / coverage (pull_request) Successful in 4m13s
CI / lint (push) Successful in 13s
CI / build (push) Successful in 15s
CI / quality (push) Successful in 16s
CI / security (push) Successful in 31s
CI / typecheck (push) Successful in 32s
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Successful in 2m31s
CI / integration_tests (push) Successful in 3m0s
CI / docker (push) Successful in 39s
CI / coverage (push) Successful in 5m5s
CI / benchmark-publish (push) Successful in 14m43s
CI / benchmark-regression (pull_request) Successful in 25m44s

Wire all four project context CLI commands (inspect, simulate, set, show)
to live ACMS pipeline services via ContextTierService and CRP models.

- context inspect: queries ContextTierService for tier metrics and
  per-project fragments with filtering by strategy/focus/breadth/depth
- context simulate: dry-run context assembly using CRP models with
  configurable token budget and assembly strategies
- context set: 12 new ACMS pipeline options (hot_max_tokens,
  warm_max_decisions, cold_max_decisions, summary_max_tokens,
  temporal_scope, auto_refresh, focus_area, breadth, depth,
  assembly_strategy, retrieval_strategy, summary_strategy)
- context show: displays ACMS pipeline configuration alongside policy

- `context inspect` displayed global tier fragment counts (hot/warm/cold)
across all projects instead of counts for the target project only.

Add `ContextTierService.get_scoped_metrics(project_names)` which uses
`ScopedBackendView` to filter fragment counts to the specified projects
while keeping hit/miss counters as global service-level cache metrics.
Update `context_inspect()` to call `get_scoped_metrics([project])`
instead of `get_metrics()`.

- `context simulate --focus` accepted focus URIs and passed them to the
`ContextRequest` model but never used them to filter the fragment list,
making the `--focus` flag a no-op.

Add focus URI filtering in `_simulate_context_assembly()` after
`get_scoped_view()` — filters `project_fragments` by matching each
fragment's `resource_id` against the supplied focus URIs.

Also fixes redaction false positives for hot_max_tokens and
summary_max_tokens keys, and Rich Console line-wrapping in test
output that caused JSON parse failures.

Includes 28 new Behave BDD scenarios for wiring coverage, updated
Robot Framework integration tests, and reference documentation.

ISSUES CLOSED: #499
This commit was merged in pull request #534.
This commit is contained in:
Luis Mendes
2026-03-03 19:46:07 +00:00
parent a60cda1f02
commit ff42d59d6d
13 changed files with 2082 additions and 106 deletions
+6 -6
View File
@@ -76,17 +76,17 @@ Feature: Project context CLI commands (B2.cli)
When I run context show on "local/nonexistent-proj" without options
Then the context show command should fail
# ── inspect raises NotImplementedError ──────────────────────
# ── inspect now wired to ACMS tier service ─────────────────
Scenario: Inspect raises NotImplementedError with clear message
Scenario: Inspect succeeds and shows tier state
When I run context inspect on "local/ctx-app"
Then a NotImplementedError should be raised with message containing "ACMS"
Then the context inspect command should succeed
# ── simulate raises NotImplementedError ─────────────────────
# ── simulate now wired to ACMS tier service ────────────────
Scenario: Simulate raises NotImplementedError with clear message
Scenario: Simulate succeeds and shows assembly result
When I run context simulate on "local/ctx-app"
Then a NotImplementedError should be raised with message containing "ACMS"
Then the context simulate command should succeed
# ── view inheritance ─────────────────────────────────────────