Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions MAINTAINER.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ docs/
`docs/adr/0033-retire-codex-mcp-and-bound-qe-court-participants.md`,
`docs/adr/0043-managed-ruflo-browser-executor.md`,
`docs/adr/0044-receipt-aware-maintenance-control-plane.md`,
`docs/adr/0051-supported-peer-delegation-and-host-realignment.md`,
`tests/live/aqe-external-provider-transport.test.mjs`,
`tests/live/qe-court-participant-transport.test.mjs`,
`tests/live/codex-context-contract.test.mjs`, and
Expand Down
26 changes: 26 additions & 0 deletions docs/MAINTENANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,32 @@ before provider effects: the default filesystem adapter does not establish the r
durable storage on Windows. Directory-flush failures are not ignored. WSL uses its own Linux
environment; native Windows mutation support remains an integration gate.

## Host alignment in User and Project views

Select **Host alignment** under **More views**, then choose **User** or **Projects**
and an optional project filter. Use **Refresh evidence** to inspect current host
configuration. The rows identify retired peer transports and other host-alignment
anomalies without exposing configuration contents or local paths in the inventory.

Open a row to inspect the host, scope, policy reason, preserved integrations and
available correction. **Repair registration** opens the existing exact-action
preview. Applying requires confirmation of that one registration; another finding
in the same file or another project is not included. A changed file invalidates
the preview. The transaction records verification and refreshes the affected catalog.

Each correction creates a current-state recovery backup beside the configuration.
Automatic dashboard **Undo** is not provided for this recipe; review the backup
before manual restoration so later edits are preserved. Custom commands/environments,
ambiguous configuration and misplaced plugins remain review items instead of
receiving an unsupported Apply action. The companion plugin's separate exact
repair remains available through `ak heal hooks --host codex`.

Dashboard approval does not grant broad future cleanup permission. The CLI's
`ak host align --apply` repair-and-remember preference remains a separate explicit
choice. Ruflo dual-mode execution, AQE native providers, provider fallbacks and
modern MCP endpoints are preserved. See
[ADR-0051](adr/0051-supported-peer-delegation-and-host-realignment.md).

## Four destinations

The dashboard workspace has four tabs. Each answers a different question.
Expand Down
65 changes: 65 additions & 0 deletions docs/UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,71 @@ latest capability is *two* motions, not one: get the newer code, then turn the f
This page exists because those two are easy to conflate — and `ak sync`, despite its name,
updates the code and reconverges choices you have already made.

## Supported host delegation and realignment

Claude and Codex remain ambidextrous through their native CLI workers. Agentic-kit
uses `ak run`; Ruflo's dual-mode orchestrator and AQE's `claude-code` / `codex`
providers retain their own supported routes. The optional Codex plugin in Claude
uses App Server. These paths do not require the retired `codex mcp-server`.

To audit and correct this workstation:

```bash
ak host align --all-projects
ak host align --all-projects --apply
```

The first command is read-only. The second names the affected files and offers
backed-up removal of recognized retired transports. `--yes` approves the displayed
corrections noninteractively. Approval remembers the exact repair recipe,
file, host, scope, project and name; later matching corrections do not prompt again.
Remove `integrations.hostAlignment` from `kit.json` to revoke that preference.

The all-projects scope combines the bounded session census with existing projects
declared in Claude configuration, plus the home-directory `.mcp.json`. Add
`--project /absolute/path` for a project or worktree not in those sources.
Custom environments or executables, ambiguous syntax, symlinks, and misplaced
plugins require review. The companion plugin's existing correction workflow is
`ak heal hooks --host codex`; alignment does not reinstall or delete plugins.

`ak status` reports user/current-project anomalies. Setup and sync offer
realignment, and `ak run` refuses affected workers while blocking anomalies
remain. AQE routing, provider fallbacks, modern servers named `codex` or `claude`,
and supported `claude mcp serve` tool exposure are preserved. See
[ADR-0051](adr/0051-supported-peer-delegation-and-host-realignment.md) for the policy,
official source citations, authority boundaries and verification limits.

## 2026-09-10: Remembered Codex MCP correction

Claude Code's `claude-flow` registration and Codex's `ruflo` registration follow
Ruflo's host-specific conventions. Seeing both names across hosts is expected;
two enabled Ruflo connections inside Codex need review.

Run `ak sync` when status reports a duplicate. The repair prompt names the exact
configuration and offers to remember correction of the recognized user-scope
`claude-flow` alias. Accepting that prompt, or the equivalent disclosed setup
manifest with `--yes`, authorizes later setup/sync runs to repeat this bounded
correction. Historical approvals are not converted into remembered consent.

Legacy alias removal runs after provisioning, with an enabled canonical `ruflo`
replacement present. Each removal retains the live fingerprint check, creates a
current-state backup, and verifies the result. The remembered correction is used
only while agentic-kit owns the workspace-aware `ak x ruflo-mcp` replacement.
It does not authorize removing project entries, other names, custom commands,
custom environment settings, or plugin-provided servers. Standard upstream `npx`
launch forms are recognized for diagnostics; they do not expand removal consent.

Setup and sync recheck the final topology. An unresolved duplicate or in-scope
recursive transport prevents a success verdict. Machine-only setup can repair a
user-scope duplicate when its replacement already exists, without editing project
registrations. A mismatched `CODEX_HOME` stops native removal before any write.

The preference is stored at
`integrations.ownership.codex.mcpRepairConsent` in `kit.json`. Remove that property
to revoke remembered correction. Future matching repairs will ask again. This
protects the outcome of setup/sync; it cannot prevent another program from editing
configuration between runs.

## 2026-09-04: Human session identity in System

`storage.topSessions[]` now carries an additive `identity` object with the original storage name,
Expand Down
16 changes: 13 additions & 3 deletions docs/adr/0033-retire-codex-mcp-and-bound-qe-court-participants.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- **Status:** Implemented; handoff transport amended by
[ADR-0034](https://github.com/pacphi/agentic-kit/blob/main/docs/adr/0034-schema-native-handoffs-and-hermetic-seats.md)
- **Date:** 2026-08-25
- **Updated:** 2026-08-31
- **Updated:** 2026-09-10
- **Update note:** Initial implementation retires only receipt-owned legacy MCP state,
diagnoses effective Codex MCP topology, extends POSIX cleanup to process groups, and adds
fail-closed QE-Court readiness plus a reciprocal live participant-transport regression.
Expand All @@ -16,6 +16,12 @@
release drift is now actionable only when GitHub publishes the exact bundle asset consumed
by the installer; tag-only releases remain visible but are deferred without touching the
healthy installed Brain.
2026-09-10: setup/sync explicitly disclose remembered correction of the exact
recognized user-scope legacy Ruflo alias. Legacy removal is deferred until
after provisioning and requires an enabled canonical replacement. Successful
removal can record consent for matching future repairs while the workspace-aware
replacement remains agentic-kit-owned. Final topology verification rejects
unresolved duplication and in-scope recursion; custom entries remain preserved.
- **Deciders:** agentic-kit maintainers
- **Related:** [ADR-0001](https://github.com/pacphi/agentic-kit/blob/main/docs/adr/0001-one-routing-policy-many-projections.md),
[ADR-0006](https://github.com/pacphi/agentic-kit/blob/main/docs/adr/0006-primary-host-and-ambidextrous-mirroring.md),
Expand Down Expand Up @@ -50,8 +56,12 @@ seats. A successful Claude/Codex transport check therefore cannot be called a co
2. Setup, sync, and host selection stop creating `codex mcp-server`. They remove a legacy project
registration only when `integrations.ownership.codex.mcp === "ak"`, confirm its absence, and
clear the receipt only after confirmation. User-owned recursive and legacy duplicate entries
are disclosed by `ak sync`, removed only after explicit confirmation (or `--yes`), and verified;
unrelated user-owned entries remain preserved.
are disclosed by `ak sync`, removed only after explicit confirmation (or `--yes`), and verified.
A new repair-and-remember approval may persist the recognized user-scope alias
correction for later setup/sync runs; historical approvals confer no ongoing
authority. Reuse requires the same absolute config, alias and launch shape,
plus the enabled agentic-kit-owned workspace-aware replacement. Unrelated
user-owned entries remain preserved.
3. Codex keeps one independent, workspace-aware Ruflo MCP registration. Agentic-QE continues to
own its Codex platform/MCP integration. Agentic-kit detects recursive Codex self-registration,
missing concrete Agentic-QE registration, and duplicate Ruflo transports without rewriting
Expand Down
157 changes: 157 additions & 0 deletions docs/adr/0051-supported-peer-delegation-and-host-realignment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
# ADR-0051 — Supported peer delegation and host realignment

- **Status:** Accepted; implemented locally, release not published
- **Date:** 2026-09-10
- **Deciders:** Project maintainer, through the current design discussion
- **Amends:** [ADR-0033](0033-retire-codex-mcp-and-bound-qe-court-participants.md)
- **Related:** [ADR-0001](0001-one-routing-policy-many-projections.md),
[ADR-0018](0018-generalized-host-worker-execution.md),
[ADR-0037](0037-complexity-program-structural-patterns.md),
[ADR-0040](0040-codex-hook-audit-and-conservative-remediation.md)

## Context

The maintainer requires ambidextrous hosts, no continued support for retired
transports, and an explicit offer of correction whenever user- or project-scoped
configuration diverges. Repeated setup or upgrades must not silently restore a
degraded state or report success while an anomaly remains.

MCP registration, agent execution, inference-provider selection, and routing
policy are different mechanisms. Removing every registration or provider named
`codex` or `claude` would break valid integrations. Research of installed Ruflo
3.41.1 and Agentic QE 3.14.1 established independent supported CLI execution paths.

## Decision

### Preserve supported delegation at each owning layer

| Layer | Supported mechanism | Owner |
| --- | --- | --- |
| General managed workflows | `ak run` supervises `claude --print` and `codex exec` | agentic-kit |
| Ruflo dual-mode workflows | Ruflo's orchestrator launches Claude/Codex CLI workers | Ruflo |
| QE inference | AQE's `claude-code` and `codex` providers launch the corresponding CLIs | Agentic QE |
| Interactive Claude to Codex | Optional official Codex companion plugin using App Server | User / OpenAI |
| MCP capabilities | Ruflo, AQE, and other tool servers expose their own tools | Respective integration owner |

Either Claude or Codex can initiate work targeting the other through the supported
execution paths. Ambidexterity means usable peer execution; it does not require
identical protocol names, identical capabilities, or a symmetric plugin pair.
OpenCode and admitted external adapters retain their existing capability gates;
this decision does not promote an adapter or grant new execution authority.

AQE's project `llm-config.json`, `agentOverrides`, provider enablement, external
provider declarations, and user fallback choices remain in their existing
ownership domains. Agentic-kit continues projecting only its curated explicit
activity routes. Realignment never rewrites these into another execution system.

### Identify transport anomalies by behavior, not names

- `codex mcp-server` is retired, whether registered in Claude, Codex, or under
another alias. Do not provision it as a supported path.
- Codex registered inside Codex through that transport is a self-registration
hazard, not evidence of Claude interoperability.
- `codex@openai-codex` belongs in Claude. An enabled Codex copy is a placement
anomaly handled by the existing exact plugin-healing workflow.
- `claude mcp serve` is currently supported for exposing Claude Code's tools. It
is informational, not deprecated, and is not substituted for a Claude agent
session. Preserve intentionally configured tool servers.
- Modern remote servers named `codex` or `claude`, valid native providers, and
Ruflo's host-specific `claude-flow` / `ruflo` names are not anomalies by name.

### Inspect, offer, correct, and verify

`ak status` reports relevant user and current-project findings without mutation.
`ak host align` previews the same policy; explicit `--project` locations and
`--all-projects` extend inspection to the bounded census and existing projects
declared in Claude configuration, preserving distinct worktree locations.
Additional locations can be selected explicitly. The all-projects scope also examines the home directory's
`.mcp.json` as a project-location file, not as a global Claude registration.

`--apply` offers exact file/scope/name corrections. A newly accepted correction
may be remembered for that same recipe and location; historical approval grants
no new ongoing authority. A new name, scope, custom environment, command shape,
or ambiguous file requires review. Approval does not convert arbitrary external
configuration into agentic-kit-owned data.

Every write requires a fresh matching source snapshot, regular bounded files,
a current-state recovery copy, and post-write verification. Unrelated settings,
servers, projects, provider routing, and plugin installations are preserved.
Malformed/ambiguous configuration is unassessed, never silently called aligned.
Partial failure reports completed changes and recovery copies without claiming
success. Existing exact plugin healing remains the correction path for a
misplaced companion; no new broad plugin mutation is introduced.

Setup/sync offer alignment and reject unresolved in-scope anomalies. `ak run`
refuses to launch an affected host while its selected scope contains a blocking
transport anomaly. The guard includes configured escalation hosts.

## Grounding and rationale

1. OpenAI explicitly marks `codex mcp-server` deprecated and directs Claude users
to its companion plugin/App Server: [official notice](https://learn.chatgpt.com/docs/mcp-server).
2. `codex exec` is documented for pipeline use and structured events:
[OpenAI non-interactive mode](https://learn.chatgpt.com/docs/non-interactive-mode).
3. `claude -p` exposes the agent loop programmatically:
[Anthropic programmatic usage](https://code.claude.com/docs/en/headless).
4. `claude mcp serve` exposes tools, with confirmation delegated to the client:
[Anthropic MCP server documentation](https://code.claude.com/docs/en/mcp#use-claude-code-as-an-mcp-server).
5. Ruflo launches each native CLI in `executeHeadless`:
[dual-mode orchestrator](https://github.com/ruvnet/ruflo/blob/main/v3/%40claude-flow/codex/src/dual-mode/orchestrator.ts).
6. AQE independently launches each CLI and strips the relevant API billing keys:
[Claude provider](https://github.com/proffesor-for-testing/agentic-qe/blob/main/src/shared/llm/providers/claude-code.ts),
[Codex provider](https://github.com/proffesor-for-testing/agentic-qe/blob/main/src/shared/llm/providers/codex.ts).

The installed AQE resolver selected Codex for test architecture/security scanning
and Claude Code for code/security review under this workstation's existing
overrides. That proves route resolution, not authentication or model availability.
Those routes must resolve identically before and after MCP realignment.

Ruflo also ships a separate optional HTTP MCP bridge with a legacy Codex backend.
Its configuration is not the native dual-mode orchestrator or AQE provider route.
Do not silently patch installed upstream code or assume that bridge is running.
An active use of that backend requires an upstream migration, not removal of
working native providers. Environment flags alone do not prove runtime health.

## Consequences and limits

The managed surface rejects retired transports without maintaining a legacy
execution fallback. Detection and migration remain necessary to remove residue.
Supported upstream execution paths coexist rather than being replaced by a
single new router. Host login, provider billing, model access, sandbox settings,
and runtime health remain separate facts.

This policy governs agentic-kit's workflows and explicit alignment actions. It
cannot prevent another application editing configuration or police every direct
upstream CLI invocation. AQE/Ruflo children may inherit other host configuration;
removing the known legacy transport is not a proof of complete child isolation.

## Acceptance evidence

Required checks: user/local/project coverage; fresh and repeated alignment;
declined and stale approval; custom/modern transport preservation; distinct
worktree scope; no secret payload in public output; unchanged AQE routes; and
zero worker launches when a relevant retired transport is detected.

Implementation: `src/lib/host-alignment.mjs`, `src/commands/x/host-align.mjs`,
status/setup/sync integration, and the pre-execution guard in `src/commands/run.mjs`.
Executable regressions: `tests/kit/host-alignment.test.mjs`.

### Maintenance dashboard amendment — 2026-09-10

The Maintenance inventory exposes a Host alignment view compatible with User,
Project and specific-project filters. A read-only evidence provider projects
opaque placement identities and field-local evidence; raw configuration and paths
remain outside public inventory payloads. Unassessed project files retain their
project identity and cannot abort the entire projection or obtain an Apply action.

The existing one-placement transaction workflow owns preview, explicit approval,
source revalidation, application, verification and receipt recording. The provider
selects one finding ID, even when several findings share a physical file. It never
delegates a row click to the CLI's whole-scope apply. This recipe retains a backup
but does not offer automated dashboard Undo. Dashboard approval does not silently
create the CLI's remembered correction policy.

Regression evidence covers scope filtering, path-free projection, stale action
rejection, selected-only removal, and the real transaction coordinator. Browser
verification exercises the actual markup, filtering client and preview selection
against deterministic evidence fixtures.
1 change: 1 addition & 0 deletions docs/adr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ Consequences**, and cites the grounded source it rests on where relevant.
| [0047](0047-streaming-observation-forest.md) | Streaming observation forest for deep scans | Accepted; Projects pilot and separate Discovery continuation implemented |
| [0048](0048-inventory-led-maintenance-resource-management.md) | Inventory-led Maintenance resource management | Accepted; Focus browser implemented and focused checks pass; human/cross-platform gates pending |
| [0050](0050-dashboard-project-identity-and-context-reporting.md) | Dashboard project identity and context reporting | Implemented |
| [0051](0051-supported-peer-delegation-and-host-realignment.md) | Supported peer delegation and scoped host realignment | Accepted; implemented locally |

Theme: ADRs **0001–0006** define **dual-host LLM routing and leadership** — how `ak` lets ruflo route
each development activity (architecture, implementation, testing, review, …) to the right host (Claude
Expand Down
Loading
Loading