Repository navigation
feat(agent): install the six-tool-era standing manual and native client kit - #3061
Conversation
|
Warning Review limit reached
Next review available in: 13 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (37)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ebcad1575e
ℹ️ 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".
| if not self.state_path.exists(): | ||
| with contextlib.suppress(OSError): | ||
| self.lock_path.unlink() | ||
| fcntl.flock(stream.fileno(), fcntl.LOCK_UN) |
There was a problem hiding this comment.
Keep the lock file linked until after unlocking
When no state file exists, such as after uninstall or a failed first install, the lock path is unlinked while its inode is still locked. If one process is already waiting on that old inode and another starts after the unlink, the latter creates and locks a new inode; once the current holder unlocks, both waiting processes can enter the installer concurrently and race while rewriting native configuration and ownership state. Do not remove the lock file while contenders may still hold or wait on its inode.
Useful? React with 👍 / 👎.
…nt kit Add polylogue.agent_integration: typed spec, packaged generated manual/ deep-reference/manifest/recipes assets, native installer for Claude Code, Codex, Gemini, and Hermes, a role-scoped runtime manifest, a `polylogue agent` CLI (manual/manifest/install/status/doctor/uninstall/session-start), and a Home Manager module. Problem: the consumer-owned skill/SessionStart text agents currently see is stale, reports the wrong tool surface, and has no generated, verified, drift-checked path from the actual MCP declarations to what an agent is taught. Ref polylogue-3gd.2, polylogue-3gd.3. Solution: the manual/reference are generated from the existing 104-tool declaration registry (t46.8.1) and stage the target six-tool contract (query/read/get/explain/context/status + write/judge/run/operate) without falsely claiming the cutover has landed — installation and instruction injection fail closed until exact role-scoped tool names and a `live-verified` schema marker both exist. Retains the beads-06 native installer architecture (managed MCP entries, idempotent upgrade, drift detection, lossless uninstall) rather than forking it. External provenance: recovered GPT Pro result package mcp-01-agent-manual-r01.zip (SHA-256 verified against snapshot commit 536a53e); patch applied cleanly except the two generated topology files, which were regenerated locally rather than patched. Fixed post-apply: missing `-f`/`--format` short-flag aliases on all 6 new `agent` subcommands, a redundant cast flagged by mypy, and 5 undocumented CLI surfaces caught by `devtools verify docs-coverage` (added a CLI-commands section to the generated standing manual). - `devtools test tests/unit/agent_integration/ tests/unit/mcp/test_server_surfaces.py tests/unit/cli/` — 2731 passed, 1 skipped; the 11 remaining failures are pre-existing on unpatched master (confirmed by rerunning them there: `read_timeout` TypeError in test_diagnostics.py/test_json_output.py, schema-version snapshot drift in test_plain_cli_snapshots.py, and a `source_debt is locked` sqlite contention in test_insights.py), unrelated to this change. - `devtools verify --quick` — 16/16 steps passed (format, lint, mypy, render-all, topology, layering, closure-matrix, docs-coverage, manifests, ci-workflows, doc-commands, test-infra-currency, test-clock-hygiene, pytest-timeout-overrides, degrade-loudly). This is the installer/manual foundation, not the six-tool cutover itself: no compatibility tool is removed, FastMCP signatures are not yet `live-verified`, and instruction injection stays staged until t46.8.2/ t46.8.3 land the real read/context/judgment migration. Co-Authored-By: Claude <[email protected]>
Master moved 11 commits ahead (including the CI sqlite fix, mcp declaration retirements, and query-transaction epoch work) since this branch was opened. Rebased, regenerated docs/plans/topology-target.yaml and topology-status.md, and updated the CLI help/terminal snapshots that changed shape from the new `agent` command combined with master's own tool-surface changes. Verification: devtools test tests/unit/agent_integration/ tests/unit/mcp/ tests/unit/cli/ -- 3365 passed, 15 failed (all pre-existing on unpatched master: test_diagnostics.py x8, test_tool_declarations.py x4, plus test_insights_debt_json/test_json_status_snapshot/test_json_output.py, all confirmed failing identically on master HEAD). devtools verify --quick -- 16/16 green. Co-Authored-By: Claude <[email protected]>
ebcad15 to
7c10c1d
Compare
|
Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.
Only the rows listed above are dispositioned. Held findings remain open. |
|
Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.
Only the rows listed above are dispositioned. Held findings remain open. |
## Summary Check current package assets independently for every installed agent client. A selective reinstall leaves unreconciled clients visibly stale in status, doctor and plain/JSON CLI output. ## Problem The installer already stores each client's content version and package digest, but status compared only the top-level record. After installing assets A, upgrading to B and reinstalling one client, that aggregate record became current while the remaining clients still retained A. This implements bounded 56.F091 through `polylogue-45jrw`, preserving [the original finding](#3061 (comment)) and discovered-from custody in open `polylogue-43ltz`. ## Solution Compare every installed client's recorded digest and content version with the current package once per status observation. Aggregate readiness derives from those client comparisons. Preserve `native_ok` as independent native operation integrity, expose client `asset_current`, name stale clients in diagnostics and render their rows as attention. Doctor consumes the same status verdict. Top-level recorded metadata remains observable and supplies no installation currency authority. Empty/uninstalled status preserves its informational behavior; doctor still reports no installed clients. Selective removal derives currency from only remaining installations. The existing reference renderer and both packaged/docs mirrors describe current behavior. No schema, registry or native mutation path is introduced. ## Verification Exact final clean head: `5c2b0feae86ba6bc8744451b3e64141332ff0909`, tree `39958b36c6d19b05330877be9822656d26d0aafc`. ```sh agentctl job start polylogue pytest_focused --workspace <checkout> -- tests/unit/agent_integration/test_installer.py tests/unit/agent_integration/test_assets_and_cli.py tests/unit/agent_integration/test_manual_contract.py tests/unit/devtools/test_agent_integration_module.py -p no:randomly agentctl job start polylogue verify_quick --workspace <checkout> ``` Complete owning selection job 6270: `64 passed`, exit 0, receipt `20261002T054400Z-focused-test-2990298-11235a85`. Quick job 6271: all 12 gates passed, exit 0, receipt `20261002T054405Z-quick-2990300-52364ab3`. Both receipts start and end clean on the exact final head; no rerun or earlier-head reuse. Earlier quick 6268 failed solely on two test constant export references; the canonical version correction was verified in the complete final selection. Eight upgrade variants reinstall each of the four clients independently after either actual packaged resource byte changes or a declared content-version change. Production status/doctor and both command formats identify the three remaining stale clients, preserve their original native records and keep the updated client current. Additional controls cover stale aggregate/current clients, empty state and selective uninstall. Existing native drift, interrupted install/uninstall, idempotency, rollback, asset parity and command contracts are included. ## Self-review Hosted Code Review is disabled by the operator. The author reread the whole seven-path diff and both required checklists; the final pass was clean after the test version correction. Root reviewed the main and correction deltas with no finding. Author final whole-diff pass on 5c2b0fe against c09a858. Reread target AGENTS, nested devtools rules, docs/review/codex-review-guide.md and generic worker checklist. Two passes, final pass clean after the canonical-version test correction. Root reviewed the full seven-path main delta without a finding. Project checklist: 1. ✓ Siblings and owners. Existing install writes per-client package provenance; status owns its comparison, doctor consumes the same verdict and CLI emits the same client currency. Census of AgentIntegrationManager, asset_current and native_ok includes the actual devtools native verification owner and both CLI commands. No second classifier is introduced. 2. ✓ The fix itself. Both digest and content version participate in the per-client comparison. A selective reinstall updates only selected records; aggregate readiness combines every recorded installed client. The top-level recorded fields remain observations, with controls proving they cannot override client evidence. 3. ✓ Memory and limits. The comparison adds two scalar equalities per existing client and no new collection, cache, cap or timeout. Existing client payload retention is unchanged; no corpus data is acquired. 4. ✓ Cost per unit. Current package digest is computed once before the existing client loop, not once per client. No native operation or package asset is re-read by the new predicate. 5. ✓ Interruption. Existing prepared install/removal journal and transaction owners are untouched. Interrupted client native_ok remains false independently of currency; existing killed-install/uninstall controls are in the complete installer module. 6. ✓ Ordering and races. Status compares one loaded signed state to one current package digest. It performs no reconciliation write. Native install locking, journaling and rollback remain intact. The stale-top control compares state bytes before/after observation. 7. ✓ Failure classification. Existing state-integrity refusal and native missing/drifted/invalid observations are preserved. Stale package evidence explicitly blocks readiness with a named client diagnostic; no exception suppression or weaker fallback added. 8. ✓ Silent outcomes. Every stale client gets asset_current false, a diagnostic and CLI attention. Overall status/doctor and both command exits report failure when any installed client remains stale. The freshly reinstalled client remains current/native_ok true. 9. ✓ Cleanup on failure. No production resource acquisition added. Synthetic installations use the existing temporary test home; no live client configuration is touched. Existing rollback/uninstall controls cover cleanup consumers. 10. ✓ Identity and keys. The existing aggregate asset hash and declared content version are reused exactly, without an inferred model, new hash or registry. Per-client native operation identity and state integrity remain unchanged. 11. ✓ Lossless transforms. Selective install controls compare all untouched client records byte-for-value with their original records. Package metadata updates do not rewrite stale native files through observation. Renderer and both packaged/docs mirrors changed together. 12. ✓ Degenerate inputs. Empty/uninstalled status preserves existing informational readiness and doctor refusal. Selective removal of current versus stale clients proves aggregation follows only remaining installations. Both stale digest and stale version are exercised in both aggregate directions. 13. ✓ Consumers. The only human renderer now includes asset_current false in attention. JSON carries the authoritative client field, doctor consumes status, generated docs come from the existing renderer. Existing aggregate-only predicate is removed, with no alias or compatibility path. 14. ✓ Tests and stubs. Four real synthetic native client installs run against copied packaged resources. Actual resource bytes change for digest upgrades; version controls patch the actual installer version owner. All four clients are independently reinstalled. Restoring aggregate-only currency hides three stale clients; dropping either field fails its variant; omitting CLI attention fails the rendered row contract. 15. ✓ Trust boundaries. Public files contain only code, generated current behavior docs and neutral fixture builders. Package snapshots, signed synthetic state and receipts remain in temporary locations. No operator assets, secrets, captures or live installations enter the diff. Generic worker checklist: 1. ✓ Criteria. The currency and consumer laws are exercised through actual install/status/doctor and plain/JSON CLI. Delivery remains pending exact-head quick/hosted checks and protected merge; no full parent acceptance is claimed. 2. ✓ Defect classes. rg census covered all package digest/version writers, status/doctor, native_ok/asset_current readers, CLI renderer and generated reference owner. Selective install and both selective uninstall cases share the same status law. 3. ✓ Replacement. Aggregate metadata readiness authority is retired in the same change, preserving observations. All genuine consumers use per-client currency; no second registry, fallback or schema introduced. 4. ✓ Failure visibility. Stale client evidence blocks overall readiness and command exit, while native integrity remains separately observable. Existing integrity and interrupted-operation refusals remain. 5. ✓ Discriminating controls. Aggregate-only check fails current-top/stale-client cases; top-level authority fails stale-top/current-client cases. Version-only or digest-only comparisons fail one upgrade variant. A renderer ignoring currency falsely labels stale clients ok. Empty/selective-removal controls expose incorrect aggregate membership. 6. ✓ Public evidence. Original 56.F091/PR3061 custody is retained in child polylogue-45jrw. Full diff uses synthetic homes/package revisions; historical threads and live client installs remain untouched. ## Residuals Normal push job 6276 passed all 12 pre-push quick gates on the exact head, receipt `20261002T054634Z-quick-2995425-7c53177d`. Protected delivery awaits required hosted checks, fresh exact-head thread readback and merge. This is the bounded F091 implementation; parent `polylogue-43ltz` and its other residuals remain open. Historical review threads retain their original custody. All installations are neutral test homes. No live client install, host activation, corpus/whale run, provider/default change or private archive action occurred.
Summary
Adds
polylogue.agent_integration: a typed spec, generated manual/deep-reference/manifest/recipes assets, a native installer for Claude Code/Codex/Gemini/Hermes, a role-scoped runtime manifest, apolylogue agentCLI, and a Home Manager module.Problem
The consumer-owned skill/SessionStart text agents currently see is stale, reports the wrong tool surface, and has no generated, verified, drift-checked path from the actual MCP declarations to what an agent is taught.
Ref polylogue-3gd.2, polylogue-3gd.3.
Solution
The manual/reference are generated from the existing 104-tool declaration registry (
t46.8.1, landed in #3004) and stage the target six-tool contract (query/read/get/explain/context/status+write/judge/run/operate) without claiming the cutover has landed — installation and instruction injection fail closed until exact role-scoped tool names and alive-verifiedschema marker both exist. Retains the beads-06 native installer architecture (managed MCP entries, idempotent upgrade, drift detection, lossless uninstall) rather than forking it.External provenance: recovered GPT Pro result package
mcp-01-agent-manual-r01.zip, SHA-256 verified against snapshot commit536a53efac0cbe4a2473ad379e4db49ef3fce74d. The patch applied cleanly except the two generated topology files, which were regenerated locally (devtools render topology-projection && devtools render topology-status) rather than patched. Fixed post-apply: missing-f/--formatshort-flag aliases on all 6 newagentsubcommands, a redundantcastflagged by mypy, and 5 undocumented CLI surfaces caught bydevtools verify docs-coverage(added a CLI-commands section to the generated standing manual generator).Not claimed
This is the installer/manual foundation, not the six-tool cutover itself: no compatibility tool is removed, FastMCP signatures are not yet
live-verified, and instruction injection stays staged untilt46.8.2/t46.8.3land the real read/context/judgment migration.Verification
devtools test tests/unit/agent_integration/ tests/unit/mcp/test_server_surfaces.py tests/unit/cli/— 2731 passed, 1 skipped. The 11 remaining failures are pre-existing on unpatched master (confirmed by rerunning them there):read_timeoutTypeError intest_diagnostics.py/test_json_output.py, schema-version snapshot drift (37→39) intest_plain_cli_snapshots.py, and asource_debt is lockedsqlite contention intest_insights.py— none related to this change.devtools verify --quick— 16/16 steps passed (format, lint, mypy, render-all, topology, layering, closure-matrix, docs-coverage, manifests, ci-workflows, doc-commands, test-infra-currency, test-clock-hygiene, pytest-timeout-overrides, degrade-loudly).🤖 Generated with Claude Code