Skip to content

fix(commands): a command declares BOTH halves or the core refuses to boot — activity/* was routable and invisible - #2332

Merged
joelteply merged 2 commits into
canaryfrom
fix/spawn-comment-lies-and-invisible-verb
Aug 17, 2026
Merged

joelteply merged 2 commits into
canaryfrom
fix/spawn-comment-lies-and-invisible-verb

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

The defect

activity/spawn — the verb that mints every room, benchmark rooms included — did not appear in commands/list. Neither did activity/archive or activity/protect. All three route fine, so every smoke test passed.

Mechanism

A command is ONE thing declared as a (descriptor, constructor) pair:

half what it is who reads it
descriptor CommandDescriptor::of::<Spec>() — type-only, needs no deps codegen, ACL, commands/list, persona tool surface
constructor the runtime object; dep-holding ones come from the module's commands() the executor

action_command! emits both, in both its stateless and dep-holding forms. register_stateless_command! emits both. BenchmarkDispatch splits them correctly and documents why. The generator has never gotten this wrong.

Only the three hand-written impl ActionCommand blocks in activity.rs dropped a half. Nothing checked, so it shipped.

Half a declaration is worse than none: the command routes, so it looks healthy, while being absent from every surface through which anyone — human or citizen — discovers it exists. commands/list describes itself as "the discovery pair — the persona reaches the long tail through this," and was quietly lying about three AI-safe verbs.

Fix

  1. The three missing register_command! declarations. They now also pass the AI-usability conformance floor they'd never been held to.
  2. sdk_codegen::descriptor_exists() — binary search over the same sorted list every other consumer reads, so it can't become a second opinion about what exists.
  3. The guard at the seam where constructors enter: ModuleRegistry::register panics on a constructor with no descriptor, naming the remedy and the worked example. Not a warning — a warning about an invisible command is read by nobody, for exactly the reason the command is invisible. It sits beside the duplicate-name panic already there, same rationale.

dispatch_orphans already audited the mirror case (descriptor, no route — #361). The pair is now total in both directions.

Also corrects the doc comment above ActivitySpawn::DESCRIPTION that claimed recipe validation "is NOT done" long after #431 shipped validate_recipe 40 lines below it.

Verified live (deployed, build 340eb6c)

  • commands/list --filter=activit → 4 matches, all three verbs, all ai-safe
  • catalog total 297 → 300, exactly +3
  • the core boots — so the guard passes against every real module; no other half-declared command exists tree-wide. Stronger than any static scan.

My first scan was by type name and produced 3 false positives (GenerateModule, PersonaAllocate, SystemPressureBrokerState are all registered through action_command!). Reverted before they became a fake fix. The runtime guard is the honest instrument; grep was a bad proxy for it.

cargo check clean · sdk_codegen 21/21 · runtime::registry 9/9 incl. a #[should_panic] positive control.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

…boot — activity/* was routable and invisible

`activity/spawn` — the verb that mints every room, benchmark rooms included —
did not appear in `commands/list`. Neither did `activity/archive` or
`activity/protect`. All three route fine, so every smoke test passed.

A command is ONE thing declared as a (descriptor, constructor) pair:

  descriptor  — `CommandDescriptor::of::<Spec>()`, TYPE-only, needs no deps.
                Feeds codegen, the ACL, `commands/list`, the persona tool surface.
  constructor — the runtime object. Dep-holding ones come from the module's
                `commands()` vec because the deps must be built somewhere.

`action_command!` emits both, in BOTH its stateless and dep-holding forms.
`register_stateless_command!` emits both. `BenchmarkDispatch` splits them
correctly and documents why. The generator has never gotten this wrong.

Only the three HAND-WRITTEN `impl ActionCommand` blocks in activity.rs dropped
a half — constructor, no descriptor. Nothing checked, so it shipped.

Half a declaration is worse than none: the command ROUTES, so it looks healthy,
while being absent from every surface through which anyone — human or citizen —
discovers that it exists. `commands/list` calls itself "the discovery pair, the
persona reaches the long tail through this" and was quietly lying about three
AI-safe verbs.

FIX, in three parts:

1. The three missing `register_command!` declarations. They now also pass the
   AI-usability conformance floor they had never been held to.

2. `sdk_codegen::descriptor_exists()` — binary search over the same sorted list
   every other consumer reads, so it can never become a second opinion about
   what commands exist.

3. The guard, at the seam where constructors enter: `ModuleRegistry::register`
   PANICS on a constructor with no descriptor, naming the remedy and the
   worked example. Not a warning — a warning about an invisible command is read
   by nobody, for exactly the reason the command is invisible. It sits beside
   the duplicate-name panic already there, same rationale: the "no central list"
   design removes the human backstop, so the registry catches its own gaps.

`dispatch_orphans` already audited the mirror case (descriptor, no route — #361).
The pair is now total in both directions.

Also: the doc comment above ActivitySpawn::DESCRIPTION claimed recipe validation
"is NOT done" long after #431 shipped `validate_recipe` 40 lines below it. A
comment describing absent code is a lying receipt of the #151/#357 class — it
lies to engineers instead of to citizens. Corrected, with the cost recorded.

VERIFIED LIVE (deployed, build 340eb6c):
  commands/list --filter=activit -> 4 matches, all three verbs, all ai-safe
  catalog total 297 -> 300, exactly +3
  the core BOOTS, which proves the guard passes against every real module —
  no other half-declared command exists tree-wide. Stronger than a static scan.

  (My first scan was by type name and produced 3 false positives — GenerateModule,
  PersonaAllocate, SystemPressureBrokerState are all registered THROUGH
  action_command!. Reverted before they became a fake fix. The runtime guard is
  the honest instrument; grep was a bad proxy for it.)

cargo check clean; sdk_codegen 21/21; runtime::registry 9/9 incl. a
should_panic positive control.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
… tool schema is a teaching surface (#333 slice 1, unblocks #2332)

schemars lifts a field's `///` doc comment VERBATIM into the JSON Schema, so one
piece of prose served two readers with opposite needs. A citizen deciding whether
to spawn a room was billed, every turn, for:

  "schemars(with = \"String\") describes the WIRE (a uuid string, per
   #[serde(transparent)]) to the tool schema while Rust keeps the type"

and, on `recipe`, a full paragraph explaining why the doc deliberately does NOT
list the valid values. Correct to write. Wrong to ship.

The projection now keeps the LEAD PARAGRAPH of every description in the offered
schema (properties AND definitions); everything after the first blank line stays
in the file for whoever opens it. Conventional split, not a declared one — it is
how these docs are already written, so it needs no per-command annotation and
cannot drift from a second source. Only 2 of 26 native verbs carry a second
paragraph today; the rest are byte-identical.

Deliberately NOT a length cap. A long first paragraph is a long ANSWER to "what
is this field", and truncating that is #358's shape — a citizen who cannot find
the verb reaches for the wrong one. Contentless length is the defect.

MEASURED, in the ratchet's own instrument: 11,972 → 11,244 (-728).

Ceiling re-pinned 10350 → 11300 with the growth named, per the ratchet's own
contract, and SHRUNK FIRST as its first branch requires — the first re-pin where
the shrink is a measurement rather than an assertion. What grew: the three NATIVE
activity verbs (+1,273), which routed all along and had simply never shipped a
descriptor.

RETRACTS a claim this ceiling invited and that I made earlier in the session:
that the native schemas run "3-5x over a clean design". Measured, the 26-verb
surface is 6,935 tokens, mean 266/verb — leaner PER VERB than the frontier agent
runtimes it was being compared against. Two sibling hypotheses died the same way
and are recorded in the doc so nobody re-derives them: $schema/title boilerplate
(already stripped, 0 tokens — that example came from `commands/list`, a DIFFERENT
surface) and undescribed params (171 tokens, one command).

The surface is not obese. It is paid TWICE (#333 — native schemas AND the prose
menu, both every turn) and charged against a 16k lane, where 6,935 tokens is 43%
of everything she has and the same code is ~3% on a frontier window.

Design + full measurement + build plan: docs/cognition/TOOL-DISCLOSURE-LADDER.md.
The next real shrink is structural: rung 2 of the ladder becoming the TURN's
working set instead of a static NATIVE list, after which this ceiling guards the
spine and stops taxing capability.

DEPLOY OWED: not rebooted. A round is in flight (Anon holds staged SWE cards) and
two citizens have already cited "the ongoing rebuilds and interruptions" verbatim
in withdrawal messages. Validated by unit test (the ratchet builds a real faculty
and measures the real registry); live deploy on the next legitimate reboot.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@github-actions github-actions Bot added size: XL and removed size: M labels Aug 17, 2026
@joelteply
joelteply merged commit ee9c541 into canary Aug 17, 2026
5 checks passed
@joelteply
joelteply deleted the fix/spawn-comment-lies-and-invisible-verb branch August 17, 2026 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant