Repository navigation
P1B: Generator SDK auto-fixer — factory functions for 84 commands - #309
Merged
Merged
Conversation
…functions New generator infrastructure: - TypesFilePatcher: domain-agnostic TypeScript code injection engine with PatchOperation abstraction (addImport, injectAfter, append, replace) - CommandFixerStrategies: extracts type info from existing Types files and generates factory/accessor patches without needing a spec - CommandGeneratorType.fixOne() now surgically patches existing Types files instead of punting with "add manually" Results: 72 commands auto-patched with createParams/createResult/ createResultFromParams factories. Uses Omit<T, inherited> for data param types — robust against complex nested types. Zero compilation errors. Missing factories: 98 → 26 (14 have non-standard types).
- 12 commands had standalone Result interfaces duplicating CommandResult fields (context, sessionId) instead of inheriting — compression violation - Fixed all to extend CommandResult, removed duplicate fields - Ran fixAll to inject factory functions into newly-conformant files - Missing factories: 98 → 14 (12 have no Types file, 2 non-standard)
…rSDK (TypesFilePatcher + CommandFixerStrategies)
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances the command generator/auditor “fix” flow by adding a reusable TypeScript file patcher and command-specific patch strategies, enabling “surgical” injection of missing accessors/factories into existing *Types.ts files without requiring a generator spec. It also applies these factory/accessor additions across many existing command Types modules and removes the old one-off accessor injection script.
Changes:
- Add
TypesFilePatcher+CommandFixerStrategiesto build/apply idempotent code injections into existing TypeScript files. - Update
CommandGeneratorType.fixOne()to patch missing accessor/factory directly from an existing Types file (spec optional; spec still required for generating new files). - Add factory helpers (and some
CommandResultinheritance cleanups) to many commandshared/*Types.tsfiles; removeadd-static-accessors.ts.
Reviewed changes
Copilot reviewed 88 out of 88 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| src/generator/types/CommandGeneratorType.ts | Uses new surgical patch path to fix missing accessor/factories without requiring specs. |
| src/generator/core/TypesFilePatcher.ts | New generic patch engine for idempotent add-import/append/inject/replace operations. |
| src/generator/core/CommandFixerStrategies.ts | New command-specific patch builders (type extraction + patch operation generation). |
| src/generator/add-static-accessors.ts | Removed legacy one-off script for accessor injection. |
| src/commands/workspace/task/complete/shared/TaskCompleteTypes.ts | Adds factories (params/result/from-params) + required imports. |
| src/commands/workspace/recipe/load/shared/RecipeLoadTypes.ts | Adds factories + required imports. |
| src/commands/voice/snapshot-room/shared/VoiceSnapshotRoomTypes.ts | Adds factories + required imports. |
| src/commands/voice/snapshot-participant/shared/VoiceSnapshotParticipantTypes.ts | Adds factories + required imports. |
| src/commands/utilities/docs/search/shared/DocsSearchTypes.ts | Makes Result extend CommandResult; adds factories + imports. |
| src/commands/utilities/docs/read/shared/DocsReadTypes.ts | Makes Result extend CommandResult; adds factories + imports. |
| src/commands/utilities/docs/list/shared/DocsListTypes.ts | Makes Result extend CommandResult; adds factories + imports. |
| src/commands/user/get-me/shared/UserGetMeTypes.ts | Adds factories + imports (currently mixes relative + @system imports). |
| src/commands/system/metrics/shared/SystemMetricsTypes.ts | Adds factories + required imports. |
| src/commands/system/daemons/shared/DaemonsTypes.ts | Adds factories + imports (currently mixes relative + @system imports). |
| src/commands/state/content/switch/shared/StateContentSwitchTypes.ts | Adds factories + required imports. |
| src/commands/state/content/close/shared/StateContentCloseTypes.ts | Adds factories + required imports. |
| src/commands/session/get-user/shared/SessionGetUserTypes.ts | Adds factories + required imports. |
| src/commands/session/get-id/shared/SessionGetIdTypes.ts | Adds factories + required imports. |
| src/commands/sentinel/status/shared/SentinelStatusTypes.ts | Adds factories + required imports. |
| src/commands/sentinel/save/shared/SentinelSaveTypes.ts | Adds factories + required imports. |
| src/commands/sentinel/logs/tail/shared/SentinelLogsTailTypes.ts | Adds factories + required imports. |
| src/commands/sentinel/logs/read/shared/SentinelLogsReadTypes.ts | Adds factories + required imports. |
| src/commands/sentinel/logs/list/shared/SentinelLogsListTypes.ts | Adds factories + required imports. |
| src/commands/sentinel/load/shared/SentinelLoadTypes.ts | Adds factories + required imports. |
| src/commands/sentinel/escalate/shared/SentinelEscalateTypes.ts | Adds factories + required imports. |
| src/commands/sentinel/coding-agent/shared/SentinelCodingAgentTypes.ts | Adds factories + required imports. |
| src/commands/sentinel/cancel/shared/SentinelCancelTypes.ts | Adds factories + required imports. |
| src/commands/security/setup/shared/SecuritySetupTypes.ts | Adds factories + required imports. |
| src/commands/search/vector/shared/SearchVectorTypes.ts | Adds factories + required imports. |
| src/commands/search/params/shared/SearchParamsTypes.ts | Adds factories + required imports. |
| src/commands/search/list/shared/SearchListTypes.ts | Adds factories + required imports. |
| src/commands/search/execute/shared/SearchExecuteTypes.ts | Adds factories + required imports. |
| src/commands/rag/load/shared/RAGLoadTypes.ts | Adds factories + required imports. |
| src/commands/rag/budget/shared/RAGBudgetTypes.ts | Adds factories + required imports. |
| src/commands/ping/shared/PingTypes.ts | Adds factories + required imports. |
| src/commands/persona/learning/multi-agent-learn/shared/GenomeMultiAgentLearnTypes.ts | Adds factories + required imports. |
| src/commands/persona/learning/capture-interaction/shared/GenomeCaptureInteractionTypes.ts | Adds factories + required imports. |
| src/commands/persona/learning/capture-feedback/shared/GenomeCaptureFeedbackTypes.ts | Adds factories + required imports. |
| src/commands/logs/stats/shared/LogsStatsTypes.ts | Makes Result extend CommandResult; adds factories + imports. |
| src/commands/logs/search/shared/LogsSearchTypes.ts | Makes Result extend CommandResult; adds factories + imports. |
| src/commands/logs/read/shared/LogsReadTypes.ts | Makes Result extend CommandResult; adds factories + imports. |
| src/commands/logs/list/shared/LogsListTypes.ts | Makes Result extend CommandResult; adds factories + imports. |
| src/commands/genome/batch-micro-tune/shared/GenomeBatchMicroTuneTypes.ts | Adds factories + required imports. |
| src/commands/development/timing/shared/TimingTypes.ts | Makes Result extend CommandResult; adds factories + imports. |
| src/commands/development/shell/execute/shared/ShellExecuteTypes.ts | Adds factories + required imports. |
| src/commands/development/debug/content-types/shared/ContentTypesDebugTypes.ts | Adds factories + required imports. |
| src/commands/development/debug/artifacts-check/shared/ArtifactsCheckTypes.ts | Adds factories + required imports. |
| src/commands/development/debug/academy-sessions/shared/AcademySessionsDebugTypes.ts | Adds factories + required imports. |
| src/commands/development/benchmark-vectors/shared/BenchmarkVectorsTypes.ts | Makes Result extend CommandResult; adds factories + imports. |
| src/commands/data/query-open/shared/QueryOpenTypes.ts | Adds factories + required imports. |
| src/commands/data/query-next/shared/QueryNextTypes.ts | Adds factories (generic result) + required imports. |
| src/commands/data/query-close/shared/QueryCloseTypes.ts | Adds factories + required imports. |
| src/commands/continuum/set/shared/ContinuumSetTypes.ts | Adds factories + required imports. |
| src/commands/continuum/emotion/shared/EmotionTypes.ts | Adds factories + required imports. |
| src/commands/collaboration/wall/shared/WallTypes.ts | Adds factories for wall write result/params + required imports. |
| src/commands/collaboration/live/send/shared/LiveSendTypes.ts | Adds factories + required imports. |
| src/commands/collaboration/live/leave/shared/LiveLeaveTypes.ts | Adds factories + required imports. |
| src/commands/collaboration/live/export/shared/LiveExportTypes.ts | Adds factories + required imports. |
| src/commands/collaboration/decision/rank/shared/DecisionRankTypes.ts | Adds factories + required imports. |
| src/commands/collaboration/decision/propose/shared/DecisionProposeTypes.ts | Adds factories + required imports. |
| src/commands/collaboration/chat/poll/shared/ChatPollTypes.ts | Adds factories + required imports. |
| src/commands/collaboration/chat/export/shared/ChatExportTypes.ts | Adds factories + required imports. |
| src/commands/collaboration/chat/analyze/shared/ChatAnalyzeTypes.ts | Adds factories + required imports. |
| src/commands/collaboration/activity/user-present/shared/ActivityUserPresentTypes.ts | Adds factories + required imports. |
| src/commands/collaboration/activity/update/shared/ActivityUpdateTypes.ts | Adds factories + required imports. |
| src/commands/collaboration/activity/join/shared/ActivityJoinTypes.ts | Adds factories + required imports. |
| src/commands/collaboration/activity/get/shared/ActivityGetTypes.ts | Adds factories + required imports. |
| src/commands/ai/validate-response/shared/AIValidateResponseTypes.ts | Adds factories + required imports. |
| src/commands/ai/thoughtstream/shared/ThoughtStreamTypes.ts | Makes Result extend CommandResult; adds factories + imports. |
| src/commands/ai/status/shared/AIStatusTypes.ts | Makes Result extend CommandResult; adds factories + imports. |
| src/commands/ai/should-respond/shared/AIShouldRespondTypes.ts | Adds factories + required imports. |
| src/commands/ai/should-respond-fast/shared/ShouldRespondFastTypes.ts | Adds factories + required imports. |
| src/commands/ai/rag/query-open/shared/RagQueryOpenTypes.ts | Adds factories + required imports. |
| src/commands/ai/rag/query-fetch/shared/RagQueryFetchTypes.ts | Adds factories + required imports. |
| src/commands/ai/rag/query-close/shared/RagQueryCloseTypes.ts | Adds factories + required imports. |
| src/commands/ai/rag/inspect/shared/RAGInspectTypes.ts | Adds factories + required imports. |
| src/commands/ai/rag/index-codebase/shared/CodebaseIndexTypes.ts | Adds factories + required imports. |
| src/commands/ai/providers/status/shared/AIProvidersStatusTypes.ts | Adds factories + required imports. |
| src/commands/ai/mute/shared/AIMuteTypes.ts | Adds factories + required imports. |
| src/commands/ai/model/list/shared/ModelListTypes.ts | Adds factories + required imports. |
| src/commands/ai/model/find/shared/ModelFindTypes.ts | Adds factories + required imports. |
| src/commands/ai/genome/stats/shared/GenomeStatsTypes.ts | Adds factories + required imports. |
| src/commands/ai/embedding/generate/shared/EmbeddingGenerateTypes.ts | Adds factories + required imports. |
| src/commands/ai/cost/shared/AICostTypes.ts | Makes Result extend CommandResult; adds factories + imports. |
| src/commands/agent/stop/shared/AgentStopTypes.ts | Adds factories + required imports. |
| src/commands/agent/status/shared/AgentStatusTypes.ts | Adds factories + required imports. |
| src/commands/agent/start/shared/AgentStartTypes.ts | Adds factories + required imports. |
| src/commands/agent/list/shared/AgentListTypes.ts | Adds factories + required imports. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+96
to
+113
| // Build class name from command name: "agent/list" → "AgentList" | ||
| const className = commandName | ||
| .split(/[\/\-_]/) | ||
| .map(part => part.charAt(0).toUpperCase() + part.slice(1)) | ||
| .join(''); | ||
|
|
||
| return { | ||
| paramsName, | ||
| resultName, | ||
| resultHasGeneric, | ||
| resultGenericParam: normalizedGenericParam, | ||
| resultGenericName, | ||
| resultGenericDefault, | ||
| paramFields, | ||
| resultFields, | ||
| className, | ||
| commandPath: commandName, | ||
| }; |
Comment on lines
+255
to
+310
| // ── createResult factory ────────────────────────────────────────── | ||
| const createResultFnName = `create${info.className}Result`; | ||
| if (!content.includes(createResultFnName)) { | ||
| let resultType = info.resultName; | ||
| let genericPrefix = ''; | ||
| if (info.resultHasGeneric) { | ||
| resultType = `${info.resultName}<${info.resultGenericName}>`; | ||
| genericPrefix = `<${info.resultGenericParam} = ${info.resultGenericDefault}>`; | ||
| } | ||
|
|
||
| ops.push({ | ||
| type: 'append', | ||
| guard: createResultFnName, | ||
| code: ` | ||
| /** | ||
| * Factory function for creating ${info.className}Result with defaults | ||
| */ | ||
| export const ${createResultFnName} = ${genericPrefix}( | ||
| context: JTAGContext, | ||
| sessionId: UUID, | ||
| data: Omit<${resultType}, 'context' | 'sessionId' | 'userId'> | ||
| ): ${resultType} => createPayload(context, sessionId, { | ||
| ...data | ||
| }); | ||
| `, | ||
| }); | ||
| } | ||
|
|
||
| // ── createResultFromParams ──────────────────────────────────────── | ||
| const createFromParamsFnName = `create${info.className}ResultFromParams`; | ||
| if (!content.includes(createFromParamsFnName)) { | ||
| let resultType = info.resultName; | ||
| if (info.resultHasGeneric) { | ||
| resultType = `${info.resultName}<${info.resultGenericName}>`; | ||
| } | ||
| let genericPrefix = ''; | ||
| if (info.resultHasGeneric) { | ||
| genericPrefix = `<${info.resultGenericParam} = ${info.resultGenericDefault}>`; | ||
| } | ||
|
|
||
| ops.push({ | ||
| type: 'append', | ||
| guard: createFromParamsFnName, | ||
| code: ` | ||
| /** | ||
| * Smart ${info.commandPath}-specific inheritance from params | ||
| * Auto-inherits context and sessionId from params | ||
| * Must provide all required result fields | ||
| */ | ||
| export const ${createFromParamsFnName} = ${genericPrefix}( | ||
| params: ${info.paramsName}, | ||
| differences: Omit<${resultType}, 'context' | 'sessionId' | 'userId'> | ||
| ): ${resultType} => transformPayload(params, differences); | ||
| `, | ||
| }); | ||
| } |
Comment on lines
+187
to
+230
| // ── Required imports ────────────────────────────────────────────── | ||
| if (!content.includes('createPayload')) { | ||
| ops.push({ | ||
| type: 'addImport', | ||
| importLine: "import { createPayload, transformPayload } from '@system/core/types/JTAGTypes';", | ||
| guard: 'createPayload', | ||
| }); | ||
| } else if (!content.includes('transformPayload')) { | ||
| // createPayload exists but transformPayload might be missing | ||
| // Need to add transformPayload to existing import — complex, just check | ||
| if (!content.includes('transformPayload')) { | ||
| ops.push({ | ||
| type: 'addImport', | ||
| importLine: "import { transformPayload } from '@system/core/types/JTAGTypes';", | ||
| guard: 'transformPayload', | ||
| }); | ||
| } | ||
| } | ||
|
|
||
| // JTAGContext must be a proper top-level import, not just an inline import() type | ||
| const hasJTAGContextImport = /import\s+(?:type\s+)?{[^}]*JTAGContext[^}]*}\s+from/.test(content); | ||
| if (!hasJTAGContextImport) { | ||
| ops.push({ | ||
| type: 'addImport', | ||
| importLine: "import type { JTAGContext } from '@system/core/types/JTAGTypes';", | ||
| guard: 'import type { JTAGContext }', | ||
| }); | ||
| } | ||
|
|
||
| if (!/import\s+{[^}]*SYSTEM_SCOPES[^}]*}\s+from/.test(content)) { | ||
| ops.push({ | ||
| type: 'addImport', | ||
| importLine: "import { SYSTEM_SCOPES } from '@system/core/types/SystemScopes';", | ||
| guard: 'SYSTEM_SCOPES', | ||
| }); | ||
| } | ||
|
|
||
| if (!/import\s+(?:type\s+)?{[^}]*\bUUID\b[^}]*}\s+from/.test(content)) { | ||
| ops.push({ | ||
| type: 'addImport', | ||
| importLine: "import type { UUID } from '@system/core/types/CrossPlatformUUID';", | ||
| guard: "CrossPlatformUUID", | ||
| }); | ||
| } |
Comment on lines
+382
to
+394
| // ── Helpers ───────────────────────────────────────────────────────────── | ||
|
|
||
| function getDefaultForType(type: string): string { | ||
| const trimmed = type.trim(); | ||
| if (trimmed === 'string') return "''"; | ||
| if (trimmed === 'number') return '0'; | ||
| if (trimmed === 'boolean') return 'false'; | ||
| if (trimmed.endsWith('[]') || trimmed.startsWith('Array<')) return '[]'; | ||
| if (trimmed === 'object' || trimmed.startsWith('{')) return '{}'; | ||
| if (trimmed.startsWith('Record<')) return '{}'; | ||
| // For union types, optional types, etc. — use empty string as safe default | ||
| return "'' as never"; | ||
| } |
Comment on lines
1
to
+7
| import type { CommandParams, CommandResult, CommandInput} from '../../../../system/core/types/JTAGTypes'; | ||
| import type { UserEntity } from '../../../../system/data/entities/UserEntity'; | ||
| import { Commands } from '../../../../system/core/shared/Commands'; | ||
| import { createPayload, transformPayload } from '@system/core/types/JTAGTypes'; | ||
| import type { JTAGContext } from '@system/core/types/JTAGTypes'; | ||
| import { SYSTEM_SCOPES } from '@system/core/types/SystemScopes'; | ||
| import type { UUID } from '@system/core/types/CrossPlatformUUID'; |
Comment on lines
+73
to
+83
| /** | ||
| * Factory function for creating CollaborationDecisionProposeParams | ||
| */ | ||
| export const createCollaborationDecisionProposeParams = ( | ||
| context: JTAGContext, | ||
| sessionId: UUID, | ||
| data: Omit<DecisionProposeParams, 'context' | 'sessionId' | 'userId'> | ||
| ): DecisionProposeParams => createPayload(context, sessionId, { | ||
| userId: SYSTEM_SCOPES.SYSTEM, | ||
| ...data | ||
| }); |
Comment on lines
+93
to
+103
| /** | ||
| * Factory function for creating WorkspaceTaskCompleteResult with defaults | ||
| */ | ||
| export const createWorkspaceTaskCompleteResult = ( | ||
| context: JTAGContext, | ||
| sessionId: UUID, | ||
| data: Omit<TaskCompleteResult, 'context' | 'sessionId' | 'userId'> | ||
| ): TaskCompleteResult => createPayload(context, sessionId, { | ||
| ...data | ||
| }); | ||
|
|
Comment on lines
+60
to
+69
| /** | ||
| * Factory function for creating SystemDaemonsResult with defaults | ||
| */ | ||
| export const createSystemDaemonsResult = ( | ||
| context: JTAGContext, | ||
| sessionId: UUID, | ||
| data: Omit<DaemonsResult, 'context' | 'sessionId' | 'userId'> | ||
| ): DaemonsResult => createPayload(context, sessionId, { | ||
| ...data | ||
| }); |
- CommandFixerStrategies: className derived from existing accessor or Params name instead of full command path (fixes Copilot review #309) - Remove dead getDefaultForType() (replaced by Omit<> approach) - Rename 146 factory functions across 51 files to match accessor names (e.g., createCollaborationDecisionProposeParams → createDecisionProposeParams) - Fix 3 BaseDataTypes consumer imports after rename
This reverts commit 42d9309.
- Derive className from existing accessor or Params name (not full path) - Remove dead getDefaultForType() helper - Move OPENCLAW-INTEGRATION-STRATEGY.md to docs/
joelteply
added a commit
that referenced
this pull request
Aug 3, 2026
The surface was write-only (claim/create/release/state/heartbeat); card content reached personas ONLY via the perception-side projection, so a persona that missed the render — or wanted to re-verify a spec mid-task — had no tool to fetch it. Live 2026-08-03: 'I don't have access to the work card' was LITERALLY TRUE, repeated for an hour by two personas including the bakery card's own claimant after a failed observe; the card sat at five plans / zero files partly because nobody could re-read the spec. Every write-only surface eventually proves it needs its read half. work/list: short id + title + state + owner per card, optional state filter. work/get: full card (title, BODY = the requirements, state, owner, claim id) by full-or-short id via the shared resolver. AiSafe, read-only, same board projection the write verbs already consult. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply
added a commit
that referenced
this pull request
Aug 3, 2026
…gistered-but-invisible was the residual #309 hole Prompt-capture diagnostic on live residents: the offered vocabulary carried claim_task but neither new read verb — they registered in the command registry but never opted into NATIVE, so the board stayed effectively write-only from the persona's seat (Atlas kept asking the room for card specs post-deploy). Adds NATIVE + trained-reflex aliases (list_tasks / get_task, mirroring claim_task) and pins the pairs in the dialect round-trip test. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply
added a commit
that referenced
this pull request
Aug 3, 2026
…, catalog row, gateway adapter (#306) (#2126) * feat(catalog): DeepSeek-V4-Flash via the ds4 sidecar — the 304B deliberator joins the registry (#306) Provider 'ds4' (DwarfStar local, OpenAI-compatible on :8901, single resident model, external lifecycle) + model row 'deepseek-v4-flash'. Measured on this M5 2026-08-02 (launch day): 2.73 t/s gen cold / ~2.3 t/s warm at a 16GB governed expert cache with the full stack resident; compile-graded 3/3 on the merge_intervals Rust probe. persona_serving_eligible=false until the sidecar lifecycle is governed — evals reach her by explicit model id; the autonomic planner never adopts her by surprise. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * feat(inference): register the ds4 sidecar adapter at boot — probe-then-register, DMR's shape (#306) Priority 2, below in-process llama.cpp and DMR — ds4 only wins the models it exclusively claims (deepseek-v4 prefix). Operator-managed endpoint on :8901; not reachable at boot = not registered, with a teaching log line. Watchdog parity follows with governed lifecycle. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * fix(catalog): ds4 residency authority is the SIDECAR, not the serving daemon (#306) single_resident_model made the adapter consult the llama-server snapshot — which truthfully answered 'Devstral is resident' and refused her (live 2026-08-02). dynamic_model_catalog is the honest contract for an external sidecar: supports_model answers from ds4's own /v1/models. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * fix(persona): workspace map must never describe a root the hands don't act in — provision-and-tell (#49 severe slice) Two stacked perception lies killed a full resident evening (2026-08-02): (1) the mixed-truth window — an unprovisioned layer made the map fall back to the SHARED cwd's layout, so a fresh persona perceived directories (conway_game_of_life…) its first tool call, provisioning and acting in the layer, could not see: the live 'I see it / my list is empty' roommate contradictions, verbatim; (2) nothing ever TOLD the persona it lives in a private CoW layer, so roommates reasoned as if the room shared one filesystem and concluded each other's work was missing or wrong. Fix: the reader provisions through the SAME ensure_citizen_layer the hands use (incl. its sync-forward self-heal) and reports THAT root — map and tools cannot describe different worlds; and the rendered map now states the isolation contract (your own layer over the shared base; teammates' files live in THEIR layers; commit to share) so the collaboration model is perceived, not guessed. Param renamed peer_id (it always received the peer id, never the persona id). Test repinned from the deleted fallback to the provision-and-tell contract, with throwaway-layer cleanup. The remaining #49 arc (airc lease API, cross-peer work propagation cadence, shared task workspaces) stays open — this closes the perception-lie half that made the divergence invisible AND misattributed. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * feat(work): work/list + work/get — the board's read half (#309) The surface was write-only (claim/create/release/state/heartbeat); card content reached personas ONLY via the perception-side projection, so a persona that missed the render — or wanted to re-verify a spec mid-task — had no tool to fetch it. Live 2026-08-03: 'I don't have access to the work card' was LITERALLY TRUE, repeated for an hour by two personas including the bakery card's own claimant after a failed observe; the card sat at five plans / zero files partly because nobody could re-read the spec. Every write-only surface eventually proves it needs its read half. work/list: short id + title + state + owner per card, optional state filter. work/get: full card (title, BODY = the requirements, state, owner, claim id) by full-or-short id via the shared resolver. AiSafe, read-only, same board projection the write verbs already consult. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * fix(work): offer work/list + work/get in the native tool surface — registered-but-invisible was the residual #309 hole Prompt-capture diagnostic on live residents: the offered vocabulary carried claim_task but neither new read verb — they registered in the command registry but never opted into NATIVE, so the board stayed effectively write-only from the persona's seat (Atlas kept asking the room for card specs post-deploy). Adds NATIVE + trained-reflex aliases (list_tasks / get_task, mirroring claim_task) and pins the pairs in the dialect round-trip test. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo --------- Co-authored-by: Claude Fable 5 <[email protected]>
joelteply
added a commit
that referenced
this pull request
Aug 3, 2026
…st_tasks`' must act, not advise (#309 tail) (#2128) Glass-boxed live 2026-08-03: three residents circled the bakery card for an hour, each narrating 'use list_tasks' at the room while zero calls fired. The verbs were offered, the in-room teach was understood and even relayed as advice — never once executed. Every prior member of this defect family (#143/#149/#153/#219/#271) was fixed the same way: honor the emission idiom structurally. NarratedToolMentionFormat, last-resort in the registry: fires only on a fence-free message with first-person committed framing (never a request TO a peer — 'please use X' stays inert) naming a backticked tool-shaped token — a slash name or a snake_case wire alias (underscore required so backticked prose stays inert). Arguments are {}: a lifted tool that needs params fails loud downstream with the executor's did-you-mean/missing-param receipt, which re-enters as memory — an honest teacher, unlike silent narration. Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo Co-authored-by: Claude Fable 5 <[email protected]>
joelteply
added a commit
that referenced
this pull request
Aug 3, 2026
…istered-but-undispatchable was the LAST layer (#309) (#2130) The onion, fully peeled live tonight: (1) commands existed but weren't in the native tool surface (fixed: NATIVE + aliases); (2) the tool surface reached the wire (verified: tools_n=20 probe); (3) the model CALLED — Benchy's first live native list_tasks — and dispatch refused it with a did-you-mean listing work/list ITSELF, because register_command! feeds the DESCRIPTOR registry (help/suggestions/offer) while the module's commands() vec is what actually dispatches, and the two new verbs were never added to it. Two lines. Benchy is retrying list_tasks with refined args off the error receipt as this lands — the feedback loop working while blocked, about to work unblocked. Follow-up worth its own card: a registry-parity guard (every descriptor with NATIVE or AiSafe must be dispatchable) so this three-layer class dies. Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo Co-authored-by: Claude Fable 5 <[email protected]>
joelteply
added a commit
that referenced
this pull request
Aug 3, 2026
…robe (#2131) * probe(ai): outbound tool-surface wire truth — tools_n/stops_n/temp per chat request Live residents narrated for hours with ZERO tool calls while every offline replay of the same context+tools+sampling (exact captured system+messages, all 20 tools, temp 0.7, live stop list, streaming) called list_tasks instantly — 2/3 at live temperature, 3/3 at temp 0. The only remaining unknown is what the live body actually carries; this probe states it per request so the offer is never inferred from a capture again. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * guard(registry): dispatch-parity audit — advertised commands must be routable (#309 structural kill) Every command descriptor (help / did-you-mean / persona tool offer) must be dispatchable — a typed object or a prefix route. register_command! and commands() are two per-module lists a human keeps in sync; work/list shipped advertised-but-unroutable for a night, and Benchy's first live native tool call was refused with a did-you-mean listing the refused name ITSELF. dispatch_orphans() reads both sides; boot logs each orphan as ERROR (registry.dispatch_parity) before any client is told the command exists — promotable to boot-refusal once fleet-clean. The test failed on the pre-fix tree and passes post-merge: it catches the exact bug that shipped. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo --------- Co-authored-by: Claude Fable 5 <[email protected]>
joelteply
added a commit
that referenced
this pull request
Aug 7, 2026
…t was reporting all along (#325/#309) With the Provided false positives gone (8f89472), the dispatch-parity audit named exactly one command: `generate/module`. It was right, and it had been right for as long as the probe has existed — nobody could see it under two bogus siblings. Nothing was wrong with the command. `GenerateModule` is a correct dep-holding typed command and IS in `GeneratorModule::commands()`. The module itself was never registered: `grep` finds `GeneratorModule` in the whole crate only inside doc comments. So `generate/module` was advertised in `commands/help`, in did-you-mean suggestions, and on the persona tool offer while nothing on the runtime could route it — the exact #309 class, still live, months after #309 shipped the detector for it. One line, next to the other Background modules, ahead of `runtime.initialize()` (which is where the audit runs). Live after deploy: dispatch_parity emits NOTHING. The probe fires only `if !orphans.is_empty()`, so silence IS the zero. Sequence across three boots: 3 -> 1 -> 0. That silence-on-success shape cost me two misreads worth recording, both the same mistake in different clothes: I first "verified" the binary by grepping for a COMMENT (Rust does not compile comments into binaries, so the check could only ever say no), then read `tail -1` of the probe file as the current boot when it was the previous one. An absent signal is invisible unless you measure it against a timestamp — which is what finally settled it. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
Summary
PatchOperationabstraction (addImport, injectAfter, append, replace). Reusable for entities, widgets, Rust IPC workers — not command-specific.Results
Remaining 14: 12 commands have no Types file at all, 1 is webmcp (not a command), 1 is file/mime-type (extends FileResult — correct as-is).
Test plan
cd src && npx tsc --noEmit— zero errorsnpx tsx -e "const {CommandAuditor}=require('./generator/CommandAuditor'); new CommandAuditor(process.cwd()).printAudit()"— verify audit numbersnpx tsx -e "const {CommandGeneratorType}=require('./generator/types/CommandGeneratorType'); new CommandGeneratorType(process.cwd()).fixAll()"— idempotent (0 fixes on second run)commands/ai/genome/stats/shared/GenomeStatsTypes.ts) for correct factory signatures