Skip to content

feat(setup): give Kilo a client-table row with an async layered location - #10823

Merged
morluto merged 13 commits into
feat/fold-goosefrom
feat/kilo-layered-location
Nov 15, 2026
Merged

morluto merged 13 commits into
feat/fold-goosefrom
feat/kilo-layered-location

Conversation

@morluto

@morluto morluto commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Summary

Kilo Code gets a client-table row whose user-scope location is resolved asynchronously from the layers that exist, through the same owner rea mcp add --agent kilo uses. This is step 1 of the Kilo fold (Refs #7181): it adds the hook and the resolver; the consumers move to it in the next stacked PR.

Problem and expected behavior

rea mcp add registers Kilo from a registration-only catalog entry whose location (kiloLocation) probes Kilo's global files, KILO_CONFIG, ~/.kilocode, ~/.kilo and KILO_CONFIG_DIR with async lstat. The client table resolves locations synchronously, so Kilo could not become a row without either duplicating that interpretation or guessing a target before the layers are observed. Expected: one owner of Kilo's user-scope layers, used by both the table and mcp add, and a table entry point that applies it.

Change and scope

  • ClientDefinition.layeredLocation (async) and resolveSupportedClients() in SupportedClients.ts, which awaits it per row; supportedClients() stays synchronous and keeps each row's default location.
  • New KiloClientLocation.ts owns Kilo's user-scope layer order and write target (moved from McpRegistrationKiloLocations.ts, which now calls it and keeps the project location and KILO_CONFIG_CONTENT). Callers supply how a configured path is resolved: mcp add resolves it against its working directory as before; the table refuses a relative KILO_CONFIG, KILO_CONFIG_DIR or XDG_CONFIG_HOME, because Kilo's working directory is unknown.
  • Kilo row kilo (format kilo, now part of SetupClient["format"]): synchronous default ~/.config/kilo/kilo.json with every candidate layer; marker is Kilo's config root, discovery adds the VS Code extension storage.
  • tests/fixtures/clientEnvironment.ts clears the KILO_* variables.
  • Review fix (a090d4c): readClientConfigurationFiles refuses a row with configPathError (unreadable), so doctor's selected-client settings no longer read a relative KILO_CONFIG against REA's folder; every reader inherits the refusal.
  • docs/adr/setup/client-table.md records the one-client-table decision (dialect and read-scope fields, the async location hook, read-only layers, uninstall's refusal rule).
  • Review fixes: Kilo's evidence is every folder Kilo reads plus the extension storage (a row's discoveryPaths replaces the default probe); absolute table paths are normalized as mcp add normalizes them (absoluteCallerPath), so a /./ segment cannot hide an existing file; parseClientRegistrationPolicy reads kilo entries with OpenCode's command array and environment shape.

Not included (next stacked PRs, in order): moving setup, doctor, uninstall, ClientRegistrationStatus and the mcp add catalog to resolveSupportedClients; KILO_CONFIG_CONTENT as a read-only inline layer; layered uninstall refusal for Kilo; mcp add project hook and removal of the registration-only kind. Until the consumers move, synchronous callers see the default kilo.json target, so this PR is not meant to merge on its own; the stack collapses into #10694 before main.

Scope: not applicable (client registration; no target execution, injection, mutation or protection recovery).

Contract and boundary impact

  • Semantic owner and earliest changed stage: KiloClientLocation.kiloGlobalLocation owns Kilo's user-scope layers; its consumers are the table row and McpRegistrationKiloLocations.kiloLocation. The module-local helpers were moved, not copied.
  • Contribution scope fit and linked maintainer decision: not applicable.
  • CLI and MCP/tool-catalog contract: rea setup --client kilo, doctor and uninstall gain the kilo id. mcp add ids and aliases are unchanged.
  • Provider, bridge, target-format, or platform compatibility: none.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): the table reports relative Kilo paths as a configPathError instead of guessing.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact: docs client lists gain kilo; the Cursor plugin skill copy was regenerated.

Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated: tests/boundary/filesystem/kiloClientLocation.test.ts (default target; the last present layer, matching mcp add, and detection from ~/.kilocode alone; an existing file in a KILO_CONFIG_DIR with a /./ segment; planned kilo.json in an empty KILO_CONFIG_DIR; relative paths refused). kilo joins DETECTED_CLIENT_ORDER in clientLifecycle.test.ts.
  • Base reproduction or other evidence: source-derived; the base has no kilo row.
  • User-visible CLI/MCP output (if applicable): not applicable yet.
  • Remaining proof gaps: no installed Kilo was run; layer order follows Kilo v7.8.27 source, as the existing mcp add code already did.

Validation performed

  • npm run test:focused -- tests/boundary/filesystem/kiloClientLocation.test.ts tests/boundary/filesystem/clientLifecycle.test.ts src/application/ClientRegistration.test.ts — 89 passed; the dot-segment case failed with the normalization reverted, and the clientLifecycle detection order failed before the evidence fix.

  • npm run test:focused -- tests/boundary/filesystem/clientLifecycle.test.ts tests/boundary/filesystem/mcpAddClientLifecycle.test.ts src/application/McpRegistrationCatalog.test.ts src/application/McpClientRegistration.test.ts tests/boundary/filesystem/clientRegistrationStatus.test.ts tests/acceptance/setup/automaticClientSetup.test.ts tests/boundary/cli/cliSetup.test.ts src/application/Uninstall.test.ts — 241 passed.

  • npm run docs:check — passed (after node scripts/generate-cursor-plugin-skill.mjs).

  • Pre-push npm run check:fast — passed.

  • 2026-11-15 (ADR): npm run docs:check — passed.

  • 2026-11-15 (a090d4c): npm run test:focused -- tests/boundary/filesystem/kiloClientLocation.test.ts tests/boundary/filesystem/clientRegistrationStatus.test.ts tests/boundary/filesystem/mcpAddClientLifecycle.test.ts src/doctorRuntime.test.ts — 122 passed, 1 skipped; the relative-path reader assertion fails without the source change. npm run check:fast — passed.

  • 2026-11-15 rebase onto main after feat(setup): inspect, refresh and remove five mcp-add-only clients #10694 merged (refactor(platform): give the host platform one owner and ratchet ambient process.platform reads #10911 ratchet, refactor(domain): one owner for the non-array record predicate #10588 record predicate): Kilo layer readers default the host through HOST_PLATFORM, layered merges use isRecord (a327baa). Refresh-refusal reader returns typed file failures (ef5310d); inline-only Kilo entry counts as lifecycle evidence (f470a55, new test fails on the previous commit). npm run test:focused -- kiloClientLocation, mcpAddClientLifecycle, updateMaintenance, setupClientConfigCleanupOwnership, clientLifecycle, ClientConfigurationFiles, Update, clientRegistrationStatus, setupConfig — all passed. npm run check:fast, node scripts/verify/architecture-guards.mjs, npx oxfmt --check ., npm run docs:check — passed.

  • 2026-11-15 (5065331, update maintenance and discovered provider paths): a Kilo client whose KILO_CONFIG_CONTENT entry differs only in a setting setup discovers (HOPPER_LAUNCHER_PATH, GHIDRA_INSTALL_DIR, JAVA_HOME) and the caller did not select is reported by update with state: "unknown" and a rea setup recovery instead of a definite refusal. npm run test:focused -- tests/boundary/filesystem/kiloClientLocation.test.ts — 23 passed; the new case failed with the source change reverted. npm run test:focused -- tests/boundary/filesystem/clientRegistrationStatus.test.ts tests/boundary/filesystem/setupClientConfigCleanupOwnership.test.ts tests/boundary/filesystem/mcpAddClientLifecycle.test.ts tests/process-global/updateMaintenance.test.ts src/application/Update.test.ts src/application/ClientConfigurationFiles.test.ts — 194 passed. npm run check:fast — passed.

  • 2026-11-15 (63cd1b2): discovered setting names match by the platform's environment identity (Java_Home is JAVA_HOME on Windows); clientRefreshRefusal takes the platform. npm run test:focused -- tests/process-global/updateMaintenance.test.ts tests/boundary/filesystem/setupClientConfigCleanupOwnership.test.ts tests/boundary/filesystem/kiloClientLocation.test.ts — 99 passed; the new Windows case failed with the normalization removed. Pre-push npm run check:fast — passed.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: macOS only; no installed Kilo.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: no new kind of write beyond setup's existing client configuration writes.

Author readiness

Human owner:

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-15T10:55:43.302763Z
We couldn’t complete this review. Comment @codex review to try again.
4f0799f New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 58a97cc8bd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/application/SupportedClients.ts Resolved
Comment thread src/application/SupportedClients.ts Resolved
Comment thread src/application/SupportedClients.ts Resolved
@greptile-apps

greptile-apps Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

[Medium impact] The reviewed changes appear safe to merge, with the previous Windows repair-advice issue fixed.

Summary

Kilo joins the shared client table with asynchronously resolved files and a read-only KILO_CONFIG_CONTENT layer. Setup, doctor, update, uninstall, and mcp add use those shared facts.

  • Kilo Code has a shared client row that finds its user configuration layers.
  • Kilo’s layered settings are read without letting REA overwrite its inline settings.
  • Client location overrides must name a path REA can resolve unambiguously.
  • Windows registration comparisons treat environment names without regard to case.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Kilo client-table row] --> B[Resolve ordered file layers]
  B --> C[Select writable file]
  B --> D[Read effective registration]
  E[KILO_CONFIG_CONTENT: read-only] --> D
  D --> F[Doctor and update checks]
  D --> G[Setup and uninstall checks]
  C --> G
  C --> H[mcp add]
Loading

Reviews (9) · Last reviewed commit: "fix(update): match discovered settings b..." · Reviewed by Greptile

Comment thread src/application/SupportedClients.ts Resolved
Comment thread src/application/SupportedClients.ts Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: da1f642221

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/application/SupportedClients.ts Resolved
Comment thread src/application/SupportedClients.ts Resolved
@morluto

morluto commented Nov 15, 2026

Copy link
Copy Markdown
Owner Author

Greptile Issue 1 ("Kilo's feature records are missing"): addressed by 60228be, which adds docs/adr/setup/client-table.md. Per docs/development/documentation.md, this change is one architectural decision rather than a new feature with requirements, so it is recorded as an ADR (Status, Context, Decision, Consequences): one client table owning each client's user-scope registration, separate dialect (format) and read-scope fields, the asynchronous layeredLocation hook applied by resolveSupportedClients, read-only lower layers, and uninstall's refusal rule. #10851 extends it with Kilo's read-only inline layer. npm run docs:check passed.

@greptile-apps please re-review.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 60228be550

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/application/SupportedClients.ts Resolved
Comment thread src/doctorRuntime.ts Resolved
Comment thread docs/adr/setup/client-table.md Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 85011de3cc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/application/KiloClientLocation.ts Resolved
Comment thread src/application/UpdateMaintenance.ts Resolved
@morluto
morluto force-pushed the feat/kilo-layered-location branch from 85011de to a327baa Compare November 15, 2026 10:13
@morluto

morluto commented Nov 15, 2026

Copy link
Copy Markdown
Owner Author

Greptile findings on 85011de, answered on 5065331:

Issue 1 (Update skips repairable Kilo registrations): valid; fixed. Root cause: maintenance computes setup's refusal from the explicitly selected settings only, because it does not run the provider discovery setup runs (Hopper's launcher search, Ghidra's install/Java inspection). A KILO_CONFIG_CONTENT entry that only adds a discovered value was reported as a definite override refusal with the "remove it or make it match" recovery, even though setup might write the same value. Running provider probes on every rea update is out of scope (maintainer decision), so the fix makes that case explicit instead:

  • SetupRegistrationEnvironment.ts owns DISCOVERED_REGISTRATION_SETTINGS (HOPPER_LAUNCHER_PATH, GHIDRA_INSTALL_DIR, JAVA_HOME: the settings setup adds from discovery rather than echoing a selection).
  • clientRefreshRefusal now returns { alignment: "refused" | "unknown", remediation }. When an inline-layer override clears once the refreshed entry takes the inline layer's values for discovered settings the caller did not select, alignment is unknown and the recovery says REA cannot tell whether the registration is current and to run rea setup.
  • existingMaintenanceScope reports that client with state: "unknown" (never aligned/stale), so update neither maintains it silently nor presents a definite refusal. An explicit selection, or any other differing setting, remains a proven refusal.

Validation: new case in tests/boundary/filesystem/kiloClientLocation.test.ts (discovered-only difference → unknown + rea setup; explicit HOPPER_LAUNCHER_PATH or an extra FOO → refusal) fails without the fix and passes with it; kiloClientLocation, clientRegistrationStatus, setupClientConfigCleanupOwnership, mcpAddClientLifecycle, updateMaintenance, Update and ClientConfigurationFiles suites: 194 + 23 passed; npm run check:fast passed.

Issue 2 (Refresh read errors disappear): already fixed in ef5310d. readClientRefresh returns Result<ClientRefresh, ClientConfigurationFileError>; clientRefreshRefusal maps a failed read to a refused result carrying the file's path and recovery (refresh.error.detail), distinct from undefined (no blocker). Cleanup failures still throw so the caller's scope retains them.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

The client table gains a layeredLocation hook and resolveSupportedClients, which awaits it. Kilo's row resolves its user-scope layers through the same owner rea mcp add uses (KiloClientLocation), so both pick the same write target; the synchronous row keeps kilo.json in Kilo's config root with every candidate layer. The table refuses a relative KILO_CONFIG, KILO_CONFIG_DIR or XDG_CONFIG_HOME because Kilo's working directory is unknown.

Refs #7181
…octor, update and uninstall (#10832)

SetupHost (detection and the selectable table), ClientRegistrationStatus, uninstall, doctor's selected-registration environment and the mcp add catalog now read resolveSupportedClients, so each sees the Kilo layer Kilo writes rather than the synchronous default.

Refs #7181
Doctor's selected-client settings read a Kilo row whose relative
KILO_CONFIG left only path evidence, so it inspected a file relative to
REA's folder. The shared configuration reader now refuses such a row,
so every reader reports the registration as unreadable.
…10851)

* feat(setup): read KILO_CONFIG_CONTENT as Kilo's top read-only layer

* fix(setup): refuse a Kilo uninstall that would expose or keep another layer's rea entry (#10852)

* fix(setup): recheck KILO_CONFIG_CONTENT at write time and name it in doctor's recovery

* refactor(mcp): register Kilo through its table row and remove the registration-only catalog kind (#10862)

* refactor(mcp): register Kilo through its table row and remove the registration-only catalog kind

* refactor(mcp): resolve user-scope targets in the catalog so location modules never import the client table

* test(setup): cover Kilo's KILO_CONFIG, home-folder and inline-only layers

* fix(setup): report REA's Kilo entry that only KILO_CONFIG_CONTENT sets during uninstall

Doctor reports a registration that KILO_CONFIG_CONTENT alone defines, but
uninstall found no file entry and reported Kilo as skipped. Uninstall now
reports it once as failed and names the variable to edit.

* docs(adr): record Kilo's inline layer in the client-table decision

* fix(setup): compare Windows environment names without case when a higher layer overrides REA's entry

Kilo's inline-layer check and Gemini's system-override check compared
environment maps by exact key, so an equal Path beside PATH on Windows was
reported as an override and setup refused the client. Both compare the
entry as the client launches it.

* fix(update): leave a stale Kilo registration KILO_CONFIG_CONTENT sets out of maintenance

Setup refuses a refresh the inline layer would override, and one refused
client failed every other client's maintenance. The registration inspection
now names the inline layer as the setup blocker of a stale entry, and
maintenance reports Kilo with that recovery instead of selecting it.

* fix(setup): refuse relative JUNIE_HOME and Cline CLI overrides like the other client roots (#10909)

* fix(setup): refuse relative JUNIE_HOME and Cline CLI overrides like the other client roots

* fix(setup): refuse Windows client paths without a drive that follow the client's current drive

* fix(update): select maintenance clients through setup's own refresh refusal check

Maintenance predicted setup's refusal with its own rule: any inline rea entry
blocked a stale registration, while an aligned one was never checked. A
harmless KILO_CONFIG_CONTENT entry (enabled: true) kept a stale Kilo launcher
pinned, and an inline value setup would not write (an extra environment
variable) let an aligned Kilo registration block every client's maintenance.

Setup's refusal checks (client policy, then the inline override comparison of
the entry it would write) now live in one reader that setup's alignment check
and maintenance share. Maintenance asks it for every owned enabled candidate
and reports a refused client with setup's remediation and its real state.

* fix(update): keep failed refresh-check reads owned by the supplied maintenance scope

clientRefreshRefusal read the client's layers, target file and policy without
the caller's resource scope, so a close that failed during those reads threw a
cleanup failure no scope retained; maintenance then reported it as text and
the scope's close could not retry the descriptor. The refresh reader now takes
the scope and passes it to every read.
…ORM and the shared record predicate

After rebasing on main (#10911, #10588): the new inlineRegistrationOverride and
resolveSupportedClients defaults read the running host through the
host-platform owner, and the layered launcher merge uses isRecord.
… check

readClientRefresh returned undefined for an unreadable or malformed layer, so
clientRefreshRefusal reported no refusal and maintenance selected a client
whose setup preflight then failed. The reader returns the typed file failure,
and the refusal check reports its detail like setup's preflight does.
…e evidence

Doctor, update and uninstall inspected a client only when one of its folders
existed, so a registration set only by KILO_CONFIG_CONTENT was skipped. A
read-only inline layer that sets REA's entry is now evidence on its own.
@morluto
morluto force-pushed the feat/kilo-layered-location branch from 63cd1b2 to 4f0799f Compare November 15, 2026 10:55
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@morluto
morluto merged commit 7fd7e61 into feat/fold-goose Nov 15, 2026
@morluto
morluto deleted the feat/kilo-layered-location branch November 15, 2026 11:10
morluto added a commit that referenced this pull request Nov 15, 2026
…rs (#10715)

* feat(setup): manage Goose registrations across its configuration layers

Goose becomes a client-table row, so doctor, update and uninstall see
the registration rea mcp add wrote, and setup offers Goose when its user
file or system file exists. Goose loads its system file and
GOOSE_ADDITIONAL_CONFIG_FILES beneath the user file and overlays each
extension one field deep; doctor now reports that effective
registration, while setup, update and uninstall change only the user
file. Doctor also parses Goose's cmd launcher instead of reporting it
invalid.

* fix(setup): keep Goose's layered environment and load order through setup and uninstall

Address review: read Goose's env alias and apply requested settings over envs; keep an inherited lower envs map instead of masking it with an empty default; keep each layer's last load so a repeated user file keeps its precedence; split GOOSE_ADDITIONAL_CONFIG_FILES with Windows quoting; validate only the effective environment across read-only layers; refuse uninstall while a read-only layer keeps REA enabled; and clear Goose's location variables in tests.

* fix(setup): apply requested Goose settings over the inherited environment

* fix(setup): leave lower-layer Goose settings in force and read admin layers read-only

Setup no longer writes its default timeout, enabled, name or description into Goose's user entry when only a lower layer declares that setting, so the inherited value keeps applying and a repeat setup stays current. Uninstall reads Goose's read-only lower layers where Goose reads them, without the write target's ownership check, so an administrator-owned system file no longer blocks removal. The client table accepts an injected Goose system-config path so tests no longer read or skip on the host's /etc/goose/config.yaml; adds a shadowed-invalid-lower-layer regression.

* fix(setup): keep an inherited Goose env alias's spelling when writing the user entry

Goose overlays each extension field separately, so writing envs into the user file beside a lower layer's env alias left both in force, which readers reject as ambiguous. Setup now writes the user map under the alias a lower layer declares, and mcp add neither adds a default envs map beside an inherited alias nor renames a user alias the lower layer shares.

* test(setup): inject Goose's system layer into mcp add selection

resolveMcpRegistrationClients accepts the caller's system configuration paths, so the Goose layers test no longer reads the host's /etc/goose/config.yaml.

* fix(setup): report REA's Goose registration that only a read-only layer defines

* test(setup): pass an isolated Goose system path through update maintenance and the mcp add table

* fix(setup): judge Goose uninstall by the merged entry and stop on an unreadable lower layer

* fix(setup): select Goose's env alias by presence so a null alias stays malformed

* fix(setup): use the shared record predicate for Goose's layered merge after #10588

* feat(setup): give Kilo a client-table row with an async layered location (#10823)

* feat(setup): give Kilo a client-table row with an async layered location

The client table gains a layeredLocation hook and resolveSupportedClients, which awaits it. Kilo's row resolves its user-scope layers through the same owner rea mcp add uses (KiloClientLocation), so both pick the same write target; the synchronous row keeps kilo.json in Kilo's config root with every candidate layer. The table refuses a relative KILO_CONFIG, KILO_CONFIG_DIR or XDG_CONFIG_HOME because Kilo's working directory is unknown.

Refs #7181

* fix(setup): treat every folder Kilo reads as evidence that it is installed

* fix(setup): normalize Kilo's absolute table paths and parse its command array

* feat(setup): resolve the client table's layered locations in setup, doctor, update and uninstall (#10832)

SetupHost (detection and the selectable table), ClientRegistrationStatus, uninstall, doctor's selected-registration environment and the mcp add catalog now read resolveSupportedClients, so each sees the Kilo layer Kilo writes rather than the synchronous default.

Refs #7181

* docs(adr): record the one-client-table decision for setup and mcp add

* fix(setup): refuse to read a client row whose location is unresolved

Doctor's selected-client settings read a Kilo row whose relative
KILO_CONFIG left only path evidence, so it inspected a file relative to
REA's folder. The shared configuration reader now refuses such a row,
so every reader reports the registration as unreadable.

* docs(adr): name the row's layeredLocation hook

* feat(setup): read KILO_CONFIG_CONTENT as Kilo's top read-only layer (#10851)

* feat(setup): read KILO_CONFIG_CONTENT as Kilo's top read-only layer

* fix(setup): refuse a Kilo uninstall that would expose or keep another layer's rea entry (#10852)

* fix(setup): recheck KILO_CONFIG_CONTENT at write time and name it in doctor's recovery

* refactor(mcp): register Kilo through its table row and remove the registration-only catalog kind (#10862)

* refactor(mcp): register Kilo through its table row and remove the registration-only catalog kind

* refactor(mcp): resolve user-scope targets in the catalog so location modules never import the client table

* test(setup): cover Kilo's KILO_CONFIG, home-folder and inline-only layers

* fix(setup): report REA's Kilo entry that only KILO_CONFIG_CONTENT sets during uninstall

Doctor reports a registration that KILO_CONFIG_CONTENT alone defines, but
uninstall found no file entry and reported Kilo as skipped. Uninstall now
reports it once as failed and names the variable to edit.

* docs(adr): record Kilo's inline layer in the client-table decision

* fix(setup): compare Windows environment names without case when a higher layer overrides REA's entry

Kilo's inline-layer check and Gemini's system-override check compared
environment maps by exact key, so an equal Path beside PATH on Windows was
reported as an override and setup refused the client. Both compare the
entry as the client launches it.

* fix(update): leave a stale Kilo registration KILO_CONFIG_CONTENT sets out of maintenance

Setup refuses a refresh the inline layer would override, and one refused
client failed every other client's maintenance. The registration inspection
now names the inline layer as the setup blocker of a stale entry, and
maintenance reports Kilo with that recovery instead of selecting it.

* fix(setup): refuse relative JUNIE_HOME and Cline CLI overrides like the other client roots (#10909)

* fix(setup): refuse relative JUNIE_HOME and Cline CLI overrides like the other client roots

* fix(setup): refuse Windows client paths without a drive that follow the client's current drive

* fix(update): select maintenance clients through setup's own refresh refusal check

Maintenance predicted setup's refusal with its own rule: any inline rea entry
blocked a stale registration, while an aligned one was never checked. A
harmless KILO_CONFIG_CONTENT entry (enabled: true) kept a stale Kilo launcher
pinned, and an inline value setup would not write (an extra environment
variable) let an aligned Kilo registration block every client's maintenance.

Setup's refusal checks (client policy, then the inline override comparison of
the entry it would write) now live in one reader that setup's alignment check
and maintenance share. Maintenance asks it for every owned enabled candidate
and reports a refused client with setup's remediation and its real state.

* fix(update): keep failed refresh-check reads owned by the supplied maintenance scope

clientRefreshRefusal read the client's layers, target file and policy without
the caller's resource scope, so a close that failed during those reads threw a
cleanup failure no scope retained; maintenance then reported it as text and
the scope's close could not retry the descriptor. The refresh reader now takes
the scope and passes it to every read.

* fix(setup): take the Kilo layer readers' default host from HOST_PLATFORM and the shared record predicate

After rebasing on main (#10911, #10588): the new inlineRegistrationOverride and
resolveSupportedClients defaults read the running host through the
host-platform owner, and the layered launcher merge uses isRecord.

* fix(update): keep an unreadable layer's reason in the refresh refusal check

readClientRefresh returned undefined for an unreadable or malformed layer, so
clientRefreshRefusal reported no refusal and maintenance selected a client
whose setup preflight then failed. The reader returns the typed file failure,
and the refusal check reports its detail like setup's preflight does.

* fix(setup): count REA's entry in KILO_CONFIG_CONTENT as Kilo lifecycle evidence

Doctor, update and uninstall inspected a client only when one of its folders
existed, so a registration set only by KILO_CONFIG_CONTENT was skipped. A
read-only inline layer that sets REA's entry is now evidence on its own.

* fix(update): report a client whose only conflict is a discovered provider path as needing setup

* fix(update): match discovered settings by the platform's environment identity
morluto added a commit that referenced this pull request Nov 15, 2026
…he client table (#10709)

* feat(setup): manage fx registrations with its private profile modes

fx becomes a client-table row, so doctor, update and uninstall see the
registration rea mcp add wrote, and setup offers fx when ~/.fx or
FX_HOME exists. Setup now publishes a private profile through the same
owner as mcp add (folder 0700, file 0600) and repairs those modes when
the row is otherwise current. Doctor parses fx's array launcher instead
of reporting it invalid.

* fix(setup): judge fx's private profile by its targets and keep its cleanup owner

Address review: privateProfileModesCurrent reads the modes of the canonical file and folder, so a linked profile becomes current; clientConfigurationAligned applies the same modes rule as plan and apply; a private-folder close failure reaches the caller with its cleanup owner instead of becoming a write failure; and the setup plan names the folder and file modes it sets.

* fix(setup): keep fx's recovery backups owner-only beside a linked profile

Setup and uninstall copied a private profile's original bytes with copyFile, so a backup beside a linked ~/.fx/mcp.json kept the target's readable mode outside the folder setup secures. Both now use the owner-only backup owner that mcp add already used.

* feat(setup): manage Junie registrations and apply its location policy (#10712)

* feat(setup): manage Junie registrations and apply its location policy

Junie becomes a client-table row, so doctor, update and uninstall see
the registration rea mcp add wrote, and setup offers Junie when its home
exists. Whether Junie loads its default user MCP file now has one owner,
read through the client policy block that setup, doctor and mcp add
already consult: setup and mcp add refuse, and doctor reports, a
registration Junie would not load.

* fix(setup): read Junie's user configuration as strict JSON

Address review: Junie loads config.json as strict JSON, so comments, trailing commas or an empty file leave its MCP location choice unknown, as before the move into the row. Filesystem tests also clear JUNIE_*, FX_HOME and MCPORTER_CONFIG so a developer's own client locations cannot be inspected or removed.

* test(setup): keep the detected client order out of the lifecycle suite body

The expected detection order grew with each folded client until the suite callback exceeded the max-lines-per-function lint limit.

* fix(update): report a client whose policy setup refuses instead of failing maintenance

Junie's disabled default locations (and Gemini's settings policy) make
doctor report the registration stale, but setup refuses that client, so
selecting it failed every other client's maintenance. The registration
inspection now carries the setup blocker, and maintenance lists that
client with its reason instead of selecting it.

* refactor(setup): read fx's private-profile host through HOST_PLATFORM

The fx private-profile mode checks and permissions describe the host REA runs
on, so they take it from the host-platform owner instead of reading
process.platform (refused by the ratchet from #10911).

* feat(setup): manage Goose registrations across its configuration layers (#10715)

* feat(setup): manage Goose registrations across its configuration layers

Goose becomes a client-table row, so doctor, update and uninstall see
the registration rea mcp add wrote, and setup offers Goose when its user
file or system file exists. Goose loads its system file and
GOOSE_ADDITIONAL_CONFIG_FILES beneath the user file and overlays each
extension one field deep; doctor now reports that effective
registration, while setup, update and uninstall change only the user
file. Doctor also parses Goose's cmd launcher instead of reporting it
invalid.

* fix(setup): keep Goose's layered environment and load order through setup and uninstall

Address review: read Goose's env alias and apply requested settings over envs; keep an inherited lower envs map instead of masking it with an empty default; keep each layer's last load so a repeated user file keeps its precedence; split GOOSE_ADDITIONAL_CONFIG_FILES with Windows quoting; validate only the effective environment across read-only layers; refuse uninstall while a read-only layer keeps REA enabled; and clear Goose's location variables in tests.

* fix(setup): apply requested Goose settings over the inherited environment

* fix(setup): leave lower-layer Goose settings in force and read admin layers read-only

Setup no longer writes its default timeout, enabled, name or description into Goose's user entry when only a lower layer declares that setting, so the inherited value keeps applying and a repeat setup stays current. Uninstall reads Goose's read-only lower layers where Goose reads them, without the write target's ownership check, so an administrator-owned system file no longer blocks removal. The client table accepts an injected Goose system-config path so tests no longer read or skip on the host's /etc/goose/config.yaml; adds a shadowed-invalid-lower-layer regression.

* fix(setup): keep an inherited Goose env alias's spelling when writing the user entry

Goose overlays each extension field separately, so writing envs into the user file beside a lower layer's env alias left both in force, which readers reject as ambiguous. Setup now writes the user map under the alias a lower layer declares, and mcp add neither adds a default envs map beside an inherited alias nor renames a user alias the lower layer shares.

* test(setup): inject Goose's system layer into mcp add selection

resolveMcpRegistrationClients accepts the caller's system configuration paths, so the Goose layers test no longer reads the host's /etc/goose/config.yaml.

* fix(setup): report REA's Goose registration that only a read-only layer defines

* test(setup): pass an isolated Goose system path through update maintenance and the mcp add table

* fix(setup): judge Goose uninstall by the merged entry and stop on an unreadable lower layer

* fix(setup): select Goose's env alias by presence so a null alias stays malformed

* fix(setup): use the shared record predicate for Goose's layered merge after #10588

* feat(setup): give Kilo a client-table row with an async layered location (#10823)

* feat(setup): give Kilo a client-table row with an async layered location

The client table gains a layeredLocation hook and resolveSupportedClients, which awaits it. Kilo's row resolves its user-scope layers through the same owner rea mcp add uses (KiloClientLocation), so both pick the same write target; the synchronous row keeps kilo.json in Kilo's config root with every candidate layer. The table refuses a relative KILO_CONFIG, KILO_CONFIG_DIR or XDG_CONFIG_HOME because Kilo's working directory is unknown.

Refs #7181

* fix(setup): treat every folder Kilo reads as evidence that it is installed

* fix(setup): normalize Kilo's absolute table paths and parse its command array

* feat(setup): resolve the client table's layered locations in setup, doctor, update and uninstall (#10832)

SetupHost (detection and the selectable table), ClientRegistrationStatus, uninstall, doctor's selected-registration environment and the mcp add catalog now read resolveSupportedClients, so each sees the Kilo layer Kilo writes rather than the synchronous default.

Refs #7181

* docs(adr): record the one-client-table decision for setup and mcp add

* fix(setup): refuse to read a client row whose location is unresolved

Doctor's selected-client settings read a Kilo row whose relative
KILO_CONFIG left only path evidence, so it inspected a file relative to
REA's folder. The shared configuration reader now refuses such a row,
so every reader reports the registration as unreadable.

* docs(adr): name the row's layeredLocation hook

* feat(setup): read KILO_CONFIG_CONTENT as Kilo's top read-only layer (#10851)

* feat(setup): read KILO_CONFIG_CONTENT as Kilo's top read-only layer

* fix(setup): refuse a Kilo uninstall that would expose or keep another layer's rea entry (#10852)

* fix(setup): recheck KILO_CONFIG_CONTENT at write time and name it in doctor's recovery

* refactor(mcp): register Kilo through its table row and remove the registration-only catalog kind (#10862)

* refactor(mcp): register Kilo through its table row and remove the registration-only catalog kind

* refactor(mcp): resolve user-scope targets in the catalog so location modules never import the client table

* test(setup): cover Kilo's KILO_CONFIG, home-folder and inline-only layers

* fix(setup): report REA's Kilo entry that only KILO_CONFIG_CONTENT sets during uninstall

Doctor reports a registration that KILO_CONFIG_CONTENT alone defines, but
uninstall found no file entry and reported Kilo as skipped. Uninstall now
reports it once as failed and names the variable to edit.

* docs(adr): record Kilo's inline layer in the client-table decision

* fix(setup): compare Windows environment names without case when a higher layer overrides REA's entry

Kilo's inline-layer check and Gemini's system-override check compared
environment maps by exact key, so an equal Path beside PATH on Windows was
reported as an override and setup refused the client. Both compare the
entry as the client launches it.

* fix(update): leave a stale Kilo registration KILO_CONFIG_CONTENT sets out of maintenance

Setup refuses a refresh the inline layer would override, and one refused
client failed every other client's maintenance. The registration inspection
now names the inline layer as the setup blocker of a stale entry, and
maintenance reports Kilo with that recovery instead of selecting it.

* fix(setup): refuse relative JUNIE_HOME and Cline CLI overrides like the other client roots (#10909)

* fix(setup): refuse relative JUNIE_HOME and Cline CLI overrides like the other client roots

* fix(setup): refuse Windows client paths without a drive that follow the client's current drive

* fix(update): select maintenance clients through setup's own refresh refusal check

Maintenance predicted setup's refusal with its own rule: any inline rea entry
blocked a stale registration, while an aligned one was never checked. A
harmless KILO_CONFIG_CONTENT entry (enabled: true) kept a stale Kilo launcher
pinned, and an inline value setup would not write (an extra environment
variable) let an aligned Kilo registration block every client's maintenance.

Setup's refusal checks (client policy, then the inline override comparison of
the entry it would write) now live in one reader that setup's alignment check
and maintenance share. Maintenance asks it for every owned enabled candidate
and reports a refused client with setup's remediation and its real state.

* fix(update): keep failed refresh-check reads owned by the supplied maintenance scope

clientRefreshRefusal read the client's layers, target file and policy without
the caller's resource scope, so a close that failed during those reads threw a
cleanup failure no scope retained; maintenance then reported it as text and
the scope's close could not retry the descriptor. The refresh reader now takes
the scope and passes it to every read.

* fix(setup): take the Kilo layer readers' default host from HOST_PLATFORM and the shared record predicate

After rebasing on main (#10911, #10588): the new inlineRegistrationOverride and
resolveSupportedClients defaults read the running host through the
host-platform owner, and the layered launcher merge uses isRecord.

* fix(update): keep an unreadable layer's reason in the refresh refusal check

readClientRefresh returned undefined for an unreadable or malformed layer, so
clientRefreshRefusal reported no refusal and maintenance selected a client
whose setup preflight then failed. The reader returns the typed file failure,
and the refusal check reports its detail like setup's preflight does.

* fix(setup): count REA's entry in KILO_CONFIG_CONTENT as Kilo lifecycle evidence

Doctor, update and uninstall inspected a client only when one of its folders
existed, so a registration set only by KILO_CONFIG_CONTENT was skipped. A
read-only inline layer that sets REA's entry is now evidence on its own.

* fix(update): report a client whose only conflict is a discovered provider path as needing setup

* fix(update): match discovered settings by the platform's environment identity

* fix(update): preflight maintenance with setup's write-target checks and treat discovered inline paths as unknown
@morluto morluto added area: setup Setup, packaging, upgrade, install, Doctor, and client registration enhancement New feature or request labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: setup Setup, packaging, upgrade, install, Doctor, and client registration enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant