Skip to content

fix+feat: repair agent-term red main — complete the half-merged config/pipeline/office/matrix/registry features (24→0)#91

Merged
mdheller merged 3 commits into
mainfrom
fix/agent-term-config-schema
Jul 19, 2026
Merged

fix+feat: repair agent-term red main — complete the half-merged config/pipeline/office/matrix/registry features (24→0)#91
mdheller merged 3 commits into
mainfrom
fix/agent-term-config-schema

Conversation

@mdheller

@mdheller mdheller commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

agent-term's main was red — 24 failing tests from several features whose code+tests landed without their supporting schema/wiring. This PR completes them; full suite now 188 passed, 0 failed.

Fixes

  1. Config schema (config.py): added PolicyFabricConfig + the missing agent_registration fields (fixture_path/endpoint_url/token_env/timeout_seconds) that health.py and the service builders required → killed the AttributeError cascade.
  2. Policy decision propagation (pipeline.py): the policy gate admitted events but never put the policy_decision_ref on the event, so domain adapters denied everything missing_policy_decision. Now propagated.
  3. office CLI command (cli.py): create-deck / inspect / convert recording governed office_artifact_request events — the subcommand the tests referenced existed in no branch.
  4. Config-authoritative backends (dispatch_cli.py): a config-declared Policy Fabric and Agent Registry (file- or HTTP-backed) are now used, with the CLI-flag/local-runtime backends as fallback.
  5. Side-effecting kinds (policy_fabric.py): matrix_service_send + office_artifact_request now trigger admission.
  6. Matrix state CLI (matrix_cli.py): wired --state / --save-state + room-alias resolution via the existing matrix_state module.

Two commits: (1) config+pipeline root causes, (2) the remaining feature completions. Zero regressions at each step (24→15→9→8→5→3→2→0).

mdheller added 2 commits July 18, 2026 22:29
… schema + propagate admitted decision

Main was red (24 failing). Two root causes, both half-merged features whose
code+tests landed without the supporting schema/wiring:

1. config.py: health.py and the *_service builders read
   config.policy_fabric.{repository,fixture_path,endpoint_url,token_env,timeout_seconds}
   and config.agent_registration.{fixture_path,endpoint_url,token_env,timeout_seconds},
   none of which existed -> AttributeError across health/registry/policy tests.
   Added the missing fields + a PolicyFabricConfig dataclass, parsed from the
   camelCase JSON keys (policyFabric.fixturePath, agentRegistration.fixturePath, ...).

2. pipeline.py: the policy gate admitted an event but the domain adapters
   (memory-mesh, cloudshell-fog, workspace) require a policy_decision_ref that was
   never propagated onto the event -> missing_policy_decision denials. Enrich the
   dispatch event with the admitted decision id before the domain adapter runs.

Result: 24 -> 8 failing, +16 tests, no regressions. The remaining 8 are separate
UNIMPLEMENTED features (the 'office' CLI subcommand exists in no branch;
dispatch_cli does not wire the file-backed policy fabric) -> follow-up.
… fully green (24->0)

Builds on the config/pipeline fix. Implements the pieces whose tests had landed
without code:

- office CLI subcommand (create-deck / inspect / convert) recording governed
  prophet-workspace office_artifact_request events (test_office_cli).
- dispatch_cli now treats a config-declared Policy Fabric (file/HTTP) and Agent
  Registry (file/HTTP) as authoritative, with the CLI-flag/local-runtime backends
  as fallback (test_dispatch_policy_fabric_service, operator_smoke github grant).
- matrix_service_send + office_artifact_request are side-effecting kinds so the
  policy gate admits+records them (test_matrix_cli persisted_events order).
- matrix_cli --state / --save-state wiring + room-alias resolution via the
  existing matrix_state module (operator_smoke matrix steps).

Full suite: 188 passed, 0 failed.
@mdheller mdheller changed the title fix(config,pipeline): restore policy-fabric config schema + propagate admitted policy decision fix+feat: repair agent-term red main — complete the half-merged config/pipeline/office/matrix/registry features (24→0) Jul 19, 2026
CI runs 'ruff check .' before pytest; these ambiguous-name (l) and unused-var
(json_mode) lints predate this PR but block the check. Renamed to 'lease' and
dropped the dead assignment. ruff clean; 188 tests still pass.
@mdheller
mdheller merged commit 738f706 into main Jul 19, 2026
1 check passed
@mdheller
mdheller deleted the fix/agent-term-config-schema branch July 19, 2026 03:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant