fix(dispatch): correct the orchestrator registration route and adapter inventory - #102
Conversation
…apter inventory
chittyagent-dispatch's canonical documented an orchestrator registration step
that could never have run, and an adapter inventory that does not match disk.
Both are the same defect class: canon describing things that do not exist.
Registration (Mode 2, step 4). The documented route
`POST agent.chitty.cc/api/v1/agents/register` 404s. The real one is
`POST agent.chitty.cc/orchestrator/api/v1/registry/agents` — the worker strips
the `/orchestrator` prefix itself in its default export before handing off to
Hono (chittyentity/workers/chittyagent-orchestrator/src/index.ts:955-963), so
the prefix is required on the wire and absent from the Hono route.
The documented payload `{name, kind, canonical_sha, classification, runtimes,
version}` was also wrong, and wrong in a way that corrupts state rather than
erroring: the handler upserts with `findIndex(a => a.id === entry.id)`. A body
without `id` pushes an entry whose `id` is undefined; every later id-less POST
then matches that entry and overwrites it, so N registrations leave one
clobbered record. `id` is now documented as load-bearing.
Registration has never run, for three independent reasons — wrong route, wrong
payload key, and no adapter invoking it. All 15 entries in the live
`agent:index` carry `description: ""`, `capabilities: []`, `tools: 0`, which is
consistent with all three: worker bindings populate identity, registration
populates semantics, and the semantic half has never executed. The tool's own
fallback string is "(no description — run agent_register to add one)".
Adapters. Disk has 7; the doc named 7, of which 3 do not exist
(`notion-agent.sh`, `orchestrator-kv.sh`, `chatgpt-gpt.sh`), 1 was superseded
(`claude-code-skill.sh`), and 2 real ones were unlisted (`claude-code-hook.sh`,
`claude-code-mcp.sh`). Replaced with a table derived from `_MAP` in
`lib/resolve_output.py`, the actual resolver `sync`/`audit`/`reconcile` share.
`orchestrator-kv.sh` is deliberately NOT stubbed: a working one POSTs to
production KV, which is a state mutation behind an approval gate, and a stub
that does not register is worse than a documented absence.
Native-dotfile claim. The doc said the codex and openclaw adapters write
`~/.codex/skills/<name>/SKILL.md` and `~/.openclaw/agents/<name>.yaml`. They
write `plugins/{plugin}/codex-skills/...` and `plugins/{plugin}/openclaw-agents/...`
— every projection is a repo file. This one was worth correcting on its own:
silently writing a user's native config is forbidden (chittyconfig CLAUDE.md
prime directive 3), and canon claiming dispatch does it invites someone to
implement it. Also fixed the projection diagram, the reconcile example's path,
and the frontmatter description, which all carried the same claim.
Mode 4 named `canonical/.runtimes.json` as the runtime registry. It does not
exist and never did; `_MAP` supersedes it. `add-target` remains a stub whose
message still names the file. Adapters take two positional args and write the
output file — not stdin/stdout as documented. canonical/README.md's tree also
listed `.runtimes.json` and omitted the `<kind>/` path level.
(`.dispatch-log.jsonl` in that tree IS real — gitignored, written at runtime.)
Not fixed here, filed instead: `agent.chitty.cc/orchestrator/*` answers
unauthenticated (GET verified from this host; the route table carries only
`cors()`), while the same worker's `chitty.cc/ai/orchestrator/*` route sits
behind Cloudflare Access and returns 401. Same worker, two routes, one guarded.
POST was not tested — that would mutate production KV. This is a chittyentity
finding, not a chittymarket edit.
Provenance: only `canonical/agents/chittyagent-dispatch.md` and
`canonical/README.md` were hand-edited. The three files under `plugins/` and the
dispatch-state sentinel are generated — `dispatch.sh sync chittyagent-dispatch`,
exit 0. Full `dispatch.sh sync` afterwards produced no further change
(idempotent) and `dispatch.sh audit` reports 119/119 cells in sync, 0 drift,
0 orphans.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EHmrsgQKRudx2XFpjmZhks
…directing stub Three findings from the separated adversarial review (claude-sonnet-4-5 via the central gateway, reviewer != implementer): 1. Overstated verification. Step 4 was labelled "verified live 2026-09-04", which covered the route but not the POST contract — that was read from the handler source and deliberately never exercised, since issuing it mutates production KV. The label is removed and replaced with an explicit statement of what was probed (GET 200 on the prefixed path, 404 on the unprefixed one) versus what was source-derived. The previous version of this step was confidently wrong; a confident correction is the same failure repeated. 2. The `add-target` stub told users to register their adapter in `.runtimes.json` — the file this commit series documents as non-existent. A stub that misdirects is worse than one that admits it is a stub. It now names `_MAP` in `lib/resolve_output.py` and the adapter path. The Mode 4 note is updated to match rather than describing the old message as historical. 3. Dropping "orchestrator KV entries at agent.chitty.cc" from the frontmatter description narrowed what this agent gets selected for, while Mode 2 step 4 still makes it the owner of that step. Restored, phrased to match reality: it owns registration, which is currently manual with no adapter behind it. Re-synced after the canonical edit: `dispatch.sh sync` exit 0, `dispatch.sh audit` 119/119 in sync, 0 drift, 0 orphans. dispatch.sh itself changed, so both were re-run against the modified script. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EHmrsgQKRudx2XFpjmZhks
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughThe dispatch model now writes supported projections to repository-local files. Documentation defines manual orchestrator registration, ChangesDispatch projection model
Estimated code review effort: 2 (Simple) | ~15 minutes ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
chittyagent-dispatch— the agent that projects every canonical definition to every runtime — documented an orchestrator registration step that could never have run, and an adapter inventory that does not match disk. Same defect class throughout: canon describing things that do not exist.The registration step (Mode 2, step 4)
POST agent.chitty.cc/api/v1/agents/registerPOST agent.chitty.cc/orchestrator/api/v1/registry/agents{name, kind, canonical_sha, classification, runtimes, version}entry.idorchestrator-kv.shadapter performs itThe
/orchestratorprefix is required on the wire: the worker strips it in its default export before handing to Hono (chittyentity/.../chittyagent-orchestrator/src/index.ts:955-963), so it never appears in the Hono route table.The payload error corrupts rather than errors. The handler upserts with
findIndex(a => a.id === entry.id). A body withoutidpushes an entry whoseidisundefined; every laterid-less POST then matches that entry and overwrites it — N registrations leave one clobbered record.Registration has never run, for three independent reasons — wrong route, wrong payload key, no adapter invoking it. All 15 entries in the live
agent:indexcarrydescription: "",capabilities: [],tools: 0, consistent with all three: bindings populate identity, registration populates semantics, and the semantic half has never executed. The tool's own fallback string is"(no description — run agent_register to add one)".The dotfile claim
The doc said the codex and openclaw adapters write
~/.codex/skills/<name>/SKILL.mdand~/.openclaw/agents/<name>.yaml. They writeplugins/{plugin}/codex-skills/...andplugins/{plugin}/openclaw-agents/...— every projection is a repo file. Worth correcting on its own merits: silently writing a user's native config is forbidden (chittyconfigCLAUDE.md prime directive 3), and canon claiming dispatch does it invites someone to implement it. The projection diagram, the reconcile example, and the frontmatter description all carried the same claim.Also corrected
_MAPinlib/resolve_output.py, the resolversync/audit/reconcileactually share.canonical/.runtimes.json— never existed;_MAPsupersedes it.README.md's tree listed it and omitted the<kind>/path level. (.dispatch-log.jsonlin that tree is real — gitignored, written at runtime.)add-target's stub message told users to register their adapter in.runtimes.json. Now points at_MAP.Deliberately not done
orchestrator-kv.shis not stubbed. A working one POSTs to production KV — a state mutation behind an approval gate — and the no-stubs rule forbids the non-working alternative. Its absence is documented instead.Validation
GET /orchestrator/api/v1/registry/agents200, 15 agentsGET /api/v1/registry/agents(unprefixed)404GET /api/v1/agents/register(documented)404dispatch.sh sync chittyagent-dispatchdispatch.sh syncafterwardsdispatch.sh auditThe POST contract was read from handler source and not exercised — issuing it would mutate production KV. The doc says so explicitly rather than claiming verification it doesn't have.
Separated review
Reviewed by
claude-sonnet-4-5via the central gateway (different host, different model, reviewer ≠ implementer). Three findings acted on in 7abc7cc: an overstated "verified live" label, the misdirectingadd-targetstub, and a frontmatter change that narrowed agent selection while Mode 2 still assigned it that ownership. Remaining findings were requests for evidence the canonical-only diff didn't carry; each was verified live in-session (resolver_MAP, adapterls, route probes, handler source).Filed, not fixed here
agent.chitty.cc/orchestrator/*answers unauthenticated —GET /orchestrator/health→ 200, route table carries onlycors(). The same worker'schitty.cc/ai/orchestrator/*route sits behind Cloudflare Access and returns 401invalid_token. Same worker, two routes, one guarded. POST was not tested. This is a chittyentity finding, not a chittymarket edit.Open question for the orchestrator owner
The index holds 15 binding-derived agents against 49 workers, and
agent_register's else-branch creates entries withstatus: "unknown". A correct dispatch registering all 12 canonicals would add unbound entries to the discovery index that slim-MCPexecuteroutes against. Whether that's wanted isn't dispatch's call. It doesn't block this doc fix.🤖 Generated with Claude Code
https://claude.ai/code/session_01EHmrsgQKRudx2XFpjmZhks
Summary by CodeRabbit