Skip to content

fix(dispatch): correct the orchestrator registration route and adapter inventory - #102

Merged
chitcommit merged 2 commits into
mainfrom
fix/dispatch-registration-route
Sep 4, 2026
Merged

fix(dispatch): correct the orchestrator registration route and adapter inventory#102
chitcommit merged 2 commits into
mainfrom
fix/dispatch-registration-route

Conversation

@chitcommit

@chitcommit chitcommit commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

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)

claim reality
POST agent.chitty.cc/api/v1/agents/register 404
POST agent.chitty.cc/orchestrator/api/v1/registry/agents
payload {name, kind, canonical_sha, classification, runtimes, version} handler upserts on entry.id
orchestrator-kv.sh adapter performs it adapter does not exist

The /orchestrator prefix 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 without id pushes an entry whose id is undefined; every later id-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:index carry description: "", 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.md and ~/.openclaw/agents/<name>.yaml. They write plugins/{plugin}/codex-skills/... and plugins/{plugin}/openclaw-agents/... — every projection is a repo file. Worth correcting on its own merits: 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. The projection diagram, the reconcile example, and the frontmatter description all carried the same claim.

Also corrected

  • Adapter list: 3 named that don't exist, 1 superseded, 2 real ones unlisted. Replaced with a table derived from _MAP in lib/resolve_output.py, the resolver sync/audit/reconcile actually share.
  • canonical/.runtimes.json — never existed; _MAP supersedes it. README.md's tree listed it and omitted the <kind>/ path level. (.dispatch-log.jsonl in that tree is real — gitignored, written at runtime.)
  • Adapters take two positional args and write the output file — not stdin/stdout as documented.
  • add-target's stub message told users to register their adapter in .runtimes.json. Now points at _MAP.

Deliberately not done

orchestrator-kv.sh is 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

check result
GET /orchestrator/api/v1/registry/agents 200, 15 agents
GET /api/v1/registry/agents (unprefixed) 404
GET /api/v1/agents/register (documented) 404
dispatch.sh sync chittyagent-dispatch exit 0
full dispatch.sh sync afterwards no further change (idempotent)
dispatch.sh audit 119/119 cells in sync, 0 drift, 0 orphans

The 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-5 via the central gateway (different host, different model, reviewer ≠ implementer). Three findings acted on in 7abc7cc: an overstated "verified live" label, the misdirecting add-target stub, 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, adapter ls, route probes, handler source).

Filed, not fixed here

agent.chitty.cc/orchestrator/* answers unauthenticated — GET /orchestrator/health → 200, route table carries only cors(). The same worker's chitty.cc/ai/orchestrator/* route sits behind Cloudflare Access and returns 401 invalid_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 with status: "unknown". A correct dispatch registering all 12 canonicals would add unbound entries to the discovery index that slim-MCP execute routes 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

  • Documentation
    • Updated dispatch documentation to reflect repository-local output for Claude Code, Codex, OpenClaw, Claude Skills, and ChatGPT Apps.
    • Added coverage for commands, hooks, MCP configurations, and tool manifests.
    • Clarified setup steps, supported targets, output locations, and adapter availability.
    • Documented orchestrator registration as a manual step with the verified endpoint and required identifier.
    • Updated onboarding instructions for adding new runtime and output-type combinations.

NB and others added 2 commits September 4, 2026 22:46
…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
@chitcommit
chitcommit enabled auto-merge (squash) September 4, 2026 22:51
@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.

@coderabbitai

coderabbitai Bot commented Sep 4, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: 62d43bd4-d60f-4b1c-916c-3db455d78fc6

📥 Commits

Reviewing files that changed from the base of the PR and between 0520fe1 and 7abc7cc.

📒 Files selected for processing (7)
  • canonical/.dispatch-state/agents/chittyagent-dispatch.json
  • canonical/README.md
  • canonical/agents/chittyagent-dispatch.md
  • plugins/chittyagent-dispatch/agents/chittyagent-dispatch.md
  • plugins/chittyagent-dispatch/codex-skills/chittyagent-dispatch/SKILL.md
  • plugins/chittyagent-dispatch/openclaw-agents/chittyagent-dispatch.yaml
  • plugins/chittyagent-dispatch/scripts/dispatch.sh

📝 Walkthrough

Walkthrough

The dispatch model now writes supported projections to repository-local files. Documentation defines manual orchestrator registration, _MAP runtime registration, two-argument adapters, updated output paths, and current adapter availability.

Changes

Dispatch projection model

Layer / File(s) Summary
Repository-local projection layout
canonical/.dispatch-state/..., canonical/README.md, canonical/agents/..., plugins/chittyagent-dispatch/...
Projection definitions and runtime targets now use repository-local paths. The documentation covers Claude Code, Codex, OpenClaw, Claude Skills, and ChatGPT Apps outputs.
Manual orchestrator registration
canonical/agents/..., plugins/chittyagent-dispatch/agents/..., plugins/chittyagent-dispatch/codex-skills/..., plugins/chittyagent-dispatch/openclaw-agents/...
Mode 2 now documents POST /orchestrator/api/v1/registry/agents, an id-bearing payload, and manual registration without an adapter.
Resolver and adapter onboarding
canonical/agents/..., plugins/chittyagent-dispatch/..., plugins/chittyagent-dispatch/scripts/dispatch.sh
Mode 4 now uses _MAP entries and adapters that receive canonical and output paths. The adapter inventory lists implemented, absent, and superseded adapters.

Estimated code review effort: 2 (Simple) | ~15 minutes

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/dispatch-registration-route

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chitcommit
chitcommit merged commit 0ed7558 into main Sep 4, 2026
6 of 7 checks passed
@chitcommit
chitcommit deleted the fix/dispatch-registration-route branch September 4, 2026 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant