Repository navigation
fix(commands): a command declares BOTH halves or the core refuses to boot — activity/* was routable and invisible - #2332
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The defect
activity/spawn— the verb that mints every room, benchmark rooms included — did not appear incommands/list. Neither didactivity/archiveoractivity/protect. All three route fine, so every smoke test passed.Mechanism
A command is ONE thing declared as a (descriptor, constructor) pair:
CommandDescriptor::of::<Spec>()— type-only, needs no depscommands/list, persona tool surfacecommands()action_command!emits both, in both its stateless and dep-holding forms.register_stateless_command!emits both.BenchmarkDispatchsplits them correctly and documents why. The generator has never gotten this wrong.Only the three hand-written
impl ActionCommandblocks inactivity.rsdropped 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/listdescribes itself as "the discovery pair — the persona reaches the long tail through this," and was quietly lying about three AI-safe verbs.Fix
register_command!declarations. They now also pass the AI-usability conformance floor they'd never been held to.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.ModuleRegistry::registerpanics 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_orphansalready audited the mirror case (descriptor, no route — #361). The pair is now total in both directions.Also corrects the doc comment above
ActivitySpawn::DESCRIPTIONthat claimed recipe validation "is NOT done" long after #431 shippedvalidate_recipe40 lines below it.Verified live (deployed, build 340eb6c)
commands/list --filter=activit→ 4 matches, all three verbs, allai-safeMy first scan was by type name and produced 3 false positives (
GenerateModule,PersonaAllocate,SystemPressureBrokerStateare all registered throughaction_command!). Reverted before they became a fake fix. The runtime guard is the honest instrument; grep was a bad proxy for it.cargo checkclean ·sdk_codegen21/21 ·runtime::registry9/9 incl. a#[should_panic]positive control.🤖 Generated with Claude Code
https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo