coaiajs 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. package/dist/mcp/config.d.ts +4 -0
  2. package/dist/mcp/config.d.ts.map +1 -0
  3. package/dist/mcp/config.js +52 -26
  4. package/dist/mcp/config.js.map +1 -0
  5. package/dist/mcp/prompts.d.ts +19 -0
  6. package/dist/mcp/prompts.d.ts.map +1 -0
  7. package/dist/mcp/prompts.js +111 -0
  8. package/dist/mcp/prompts.js.map +1 -0
  9. package/dist/mcp/resources.d.ts +5 -0
  10. package/dist/mcp/resources.d.ts.map +1 -0
  11. package/dist/mcp/resources.js +77 -0
  12. package/dist/mcp/resources.js.map +1 -0
  13. package/dist/mcp/server.d.ts.map +1 -0
  14. package/dist/mcp/server.js +164 -73
  15. package/dist/mcp/server.js.map +1 -0
  16. package/dist/mcp/tools/coaiapy-tools.d.ts.map +1 -0
  17. package/dist/mcp/tools/coaiapy-tools.js +1 -0
  18. package/dist/mcp/tools/coaiapy-tools.js.map +1 -0
  19. package/dist/mcp/tools/index.d.ts.map +1 -0
  20. package/dist/mcp/tools/index.js.map +1 -0
  21. package/dist/src/audio.d.ts.map +1 -0
  22. package/dist/src/audio.js.map +1 -0
  23. package/dist/src/cli-helpers.d.ts.map +1 -0
  24. package/dist/src/cli-helpers.js.map +1 -0
  25. package/dist/src/cli.d.ts.map +1 -0
  26. package/dist/src/cli.js.map +1 -0
  27. package/dist/src/config.d.ts.map +1 -0
  28. package/dist/src/config.js.map +1 -0
  29. package/dist/src/environment.d.ts.map +1 -0
  30. package/dist/src/environment.js.map +1 -0
  31. package/dist/src/github.d.ts.map +1 -0
  32. package/dist/src/github.js.map +1 -0
  33. package/dist/src/index.d.ts +13 -0
  34. package/dist/src/index.d.ts.map +1 -0
  35. package/dist/src/index.js +13 -0
  36. package/dist/src/index.js.map +1 -0
  37. package/dist/src/langfuse/client.d.ts.map +1 -0
  38. package/dist/src/langfuse/client.js.map +1 -0
  39. package/dist/src/langfuse/comments.d.ts.map +1 -0
  40. package/dist/src/langfuse/comments.js.map +1 -0
  41. package/dist/src/langfuse/datasets.d.ts.map +1 -0
  42. package/dist/src/langfuse/datasets.js.map +1 -0
  43. package/dist/src/langfuse/index.d.ts.map +1 -0
  44. package/dist/src/langfuse/index.js.map +1 -0
  45. package/dist/src/langfuse/media.d.ts.map +1 -0
  46. package/dist/src/langfuse/media.js.map +1 -0
  47. package/dist/src/langfuse/observations.d.ts.map +1 -0
  48. package/dist/src/langfuse/observations.js.map +1 -0
  49. package/dist/src/langfuse/prompts.d.ts.map +1 -0
  50. package/dist/src/langfuse/prompts.js.map +1 -0
  51. package/dist/src/langfuse/scores.d.ts.map +1 -0
  52. package/dist/src/langfuse/scores.js.map +1 -0
  53. package/dist/src/langfuse/traces.d.ts.map +1 -0
  54. package/dist/src/langfuse/traces.js.map +1 -0
  55. package/dist/src/llm.d.ts.map +1 -0
  56. package/dist/src/llm.js.map +1 -0
  57. package/dist/src/narrative/graph-manager.d.ts.map +1 -0
  58. package/dist/src/narrative/graph-manager.js.map +1 -0
  59. package/dist/src/narrative/index.d.ts +32 -1
  60. package/dist/src/narrative/index.d.ts.map +1 -0
  61. package/dist/src/narrative/index.js +97 -1
  62. package/dist/src/narrative/index.js.map +1 -0
  63. package/dist/src/narrative/markdown-export.d.ts.map +1 -0
  64. package/dist/src/narrative/markdown-export.js.map +1 -0
  65. package/dist/src/narrative/tool-definitions.d.ts.map +1 -0
  66. package/dist/src/narrative/tool-definitions.js.map +1 -0
  67. package/dist/src/narrative/tool-handlers.d.ts.map +1 -0
  68. package/dist/src/narrative/tool-handlers.js.map +1 -0
  69. package/dist/src/narrative/types.d.ts.map +1 -0
  70. package/dist/src/narrative/types.js.map +1 -0
  71. package/dist/src/narrative/validation.d.ts.map +1 -0
  72. package/dist/src/narrative/validation.js.map +1 -0
  73. package/dist/src/pde/index.d.ts +4 -0
  74. package/dist/src/pde/index.d.ts.map +1 -0
  75. package/dist/src/pde/index.js +19 -0
  76. package/dist/src/pde/index.js.map +1 -0
  77. package/dist/src/pde/mcp-handlers.d.ts.map +1 -0
  78. package/dist/src/pde/mcp-handlers.js.map +1 -0
  79. package/dist/src/pde/mcp-tools.d.ts.map +1 -0
  80. package/dist/src/pde/mcp-tools.js.map +1 -0
  81. package/dist/src/pde/session-manager.d.ts.map +1 -0
  82. package/dist/src/pde/session-manager.js.map +1 -0
  83. package/dist/src/pde/stc-mapper.d.ts.map +1 -0
  84. package/dist/src/pde/stc-mapper.js.map +1 -0
  85. package/dist/src/pipeline/index.d.ts.map +1 -0
  86. package/dist/src/pipeline/index.js.map +1 -0
  87. package/dist/src/pipeline/template-engine.d.ts.map +1 -0
  88. package/dist/src/pipeline/template-engine.js.map +1 -0
  89. package/dist/src/planning/index.d.ts +3 -0
  90. package/dist/src/planning/index.d.ts.map +1 -0
  91. package/dist/src/planning/index.js +13 -0
  92. package/dist/src/planning/index.js.map +1 -0
  93. package/dist/src/planning/mcp-handlers.d.ts.map +1 -0
  94. package/dist/src/planning/mcp-handlers.js.map +1 -0
  95. package/dist/src/planning/mcp-tools.d.ts.map +1 -0
  96. package/dist/src/planning/mcp-tools.js.map +1 -0
  97. package/dist/src/planning/plan-parser.d.ts.map +1 -0
  98. package/dist/src/planning/plan-parser.js.map +1 -0
  99. package/dist/src/redis.d.ts.map +1 -0
  100. package/dist/src/redis.js.map +1 -0
  101. package/dist/src/types.d.ts.map +1 -0
  102. package/dist/src/types.js.map +1 -0
  103. package/package.json +66 -1
  104. package/rispecs/00-coaiajs-platform.spec.md +18 -6
  105. package/rispecs/01-core-config.spec.md +7 -37
  106. package/rispecs/02-redis-module.spec.md +2 -1
  107. package/rispecs/03-langfuse-module.spec.md +7 -5
  108. package/rispecs/04-narrative-engine.spec.md +9 -9
  109. package/rispecs/05-pde-engine.spec.md +23 -23
  110. package/rispecs/06-planning-engine.spec.md +14 -13
  111. package/rispecs/07-pipeline-templates.spec.md +7 -7
  112. package/rispecs/08-cli-interface.spec.md +13 -25
  113. package/rispecs/09-mcp-server.spec.md +41 -44
  114. package/rispecs/10-audio-module.spec.md +3 -3
  115. package/rispecs/KINSHIP.md +4 -4
  116. package/rispecs/README.md +33 -7
  117. package/articles/academic/creative-orientation-vs-problem-solving.md +0 -177
  118. package/articles/academic/jsonl-knowledge-graphs-agent-memory.md +0 -142
  119. package/articles/academic/langfuse-observability-llm-pipelines.md +0 -144
  120. package/articles/academic/medicine-wheel-software-architecture.md +0 -163
  121. package/articles/academic/mmot-autonomous-agents.md +0 -156
  122. package/articles/academic/model-context-protocol-interagent.md +0 -161
  123. package/articles/academic/pde-prompt-decomposition.md +0 -186
  124. package/articles/academic/structural-tension-in-ai-agents.md +0 -134
  125. package/articles/reviews/mcp-protocol-design-review.md +0 -170
  126. package/articles/reviews/observability-ai-systems-review.md +0 -176
  127. package/articles/reviews/prompt-engineering-decomposition-review.md +0 -184
  128. package/articles/surveys/agent-orchestration-survey.md +0 -186
  129. package/articles/surveys/knowledge-graph-storage-survey.md +0 -204
  130. package/articles/surveys/structural-tension-methodology-survey.md +0 -154
  131. package/articles/technical/aws-sdk-v3-polly.md +0 -270
  132. package/articles/technical/commander-cli-framework.md +0 -262
  133. package/articles/technical/dotenv-config-patterns.md +0 -360
  134. package/articles/technical/ioredis-vs-redis.md +0 -142
  135. package/articles/technical/langfuse-js-sdk-vs-rest.md +0 -191
  136. package/articles/technical/mcp-sdk-typescript.md +0 -291
  137. package/articles/technical/octokit-github-api.md +0 -293
  138. package/articles/technical/openai-sdk-modern.md +0 -231
  139. package/articles/technical/yaml-parsing-node.md +0 -266
  140. package/articles/technical/zod-runtime-validation.md +0 -212
  141. package/mcp/config.ts +0 -196
  142. package/mcp/server.ts +0 -402
  143. package/mcp/tools/coaiapy-tools.ts +0 -364
  144. package/mcp/tools/index.ts +0 -4
  145. package/src/audio.ts +0 -76
  146. package/src/cli-helpers.ts +0 -86
  147. package/src/cli.ts +0 -1223
  148. package/src/config.ts +0 -172
  149. package/src/environment.ts +0 -171
  150. package/src/github.ts +0 -143
  151. package/src/langfuse/client.ts +0 -105
  152. package/src/langfuse/comments.ts +0 -52
  153. package/src/langfuse/datasets.ts +0 -178
  154. package/src/langfuse/index.ts +0 -33
  155. package/src/langfuse/media.ts +0 -193
  156. package/src/langfuse/observations.ts +0 -131
  157. package/src/langfuse/prompts.ts +0 -157
  158. package/src/langfuse/scores.ts +0 -456
  159. package/src/langfuse/traces.ts +0 -276
  160. package/src/llm.ts +0 -106
  161. package/src/narrative/graph-manager.ts +0 -1358
  162. package/src/narrative/index.ts +0 -32
  163. package/src/narrative/markdown-export.ts +0 -535
  164. package/src/narrative/tool-definitions.ts +0 -635
  165. package/src/narrative/tool-handlers.ts +0 -528
  166. package/src/narrative/types.ts +0 -9
  167. package/src/narrative/validation.ts +0 -179
  168. package/src/pde/index.ts +0 -8
  169. package/src/pde/mcp-handlers.ts +0 -359
  170. package/src/pde/mcp-tools.ts +0 -201
  171. package/src/pde/session-manager.ts +0 -248
  172. package/src/pde/stc-mapper.ts +0 -298
  173. package/src/pipeline/index.ts +0 -7
  174. package/src/pipeline/template-engine.ts +0 -398
  175. package/src/planning/index.ts +0 -13
  176. package/src/planning/mcp-handlers.ts +0 -369
  177. package/src/planning/mcp-tools.ts +0 -155
  178. package/src/planning/plan-parser.ts +0 -587
  179. package/src/redis.ts +0 -97
  180. package/src/types.ts +0 -280
  181. package/tsconfig.json +0 -26
@@ -9,7 +9,7 @@ A unified config loader that provides every CoAiA module with its settings throu
9
9
  ## Structural Tension
10
10
 
11
11
  **Current Reality:**
12
- - `src/config.ts` is fully implemented (172 lines) with `readConfig()`, `getConfig()`, `mergeConfigs()`, `resetConfig()`, and a `config` Proxy for lazy access
12
+ - [`src/config.ts`](../src/config.ts) is implemented with `readConfig()`, `getConfig()`, `mergeConfigs()`, `resetConfig()`, and a `config` Proxy for lazy access
13
13
  - Supports env vars > .env > coaia.json > defaults priority chain
14
14
  - Searches for `coaia.json` or `.coaia/config.json` in cwd and home directory
15
15
  - Covers Redis (URL, host/port, Upstash), Langfuse, OpenAI, AWS, GitHub credentials
@@ -30,42 +30,12 @@ Config system that handles all module configuration needs including:
30
30
 
31
31
  ```typescript
32
32
  interface CoaiaConfig {
33
- // Redis
34
- redis_url?: string;
35
- redis_host?: string;
36
- redis_port?: number;
37
-
38
- // Langfuse
39
- langfuse_secret_key?: string;
40
- langfuse_public_key?: string;
41
- langfuse_host?: string;
42
- langfuse_dataset_name?: string;
43
- langfuse_prompt_cache_ttl?: number;
44
-
45
- // OpenAI
46
- openai_api_key?: string;
47
- openai_model?: string;
48
-
49
- // AWS (Polly)
50
- aws_access_key_id?: string;
51
- aws_secret_access_key?: string;
52
- aws_region?: string;
53
- aws_polly_voice?: string;
54
-
55
- // GitHub
56
- github_token?: string;
57
-
58
- // Narrative
59
- memory_file_path?: string;
60
-
61
- // PDE
62
- pde_dir?: string;
63
-
64
- // Pipeline
65
- pipeline_template_dir?: string;
66
-
67
- // MCP
68
- mcp_mode?: 'MINIMAL' | 'STANDARD' | 'FULL';
33
+ redis?: { url?: string; host?: string; port?: number; password?: string; upstashUrl?: string; upstashToken?: string };
34
+ langfuse?: { publicKey?: string; secretKey?: string; baseUrl?: string };
35
+ openai?: { apiKey?: string; model?: string };
36
+ aws?: { accessKeyId?: string; secretAccessKey?: string; region?: string };
37
+ github?: { token?: string };
38
+ [key: string]: unknown;
69
39
  }
70
40
  ```
71
41
 
@@ -9,11 +9,12 @@ A thin Redis wrapper providing `tash(key, value, ttl?)` and `fetch(key)` with la
9
9
  ## Structural Tension
10
10
 
11
11
  **Current Reality:**
12
- - `src/redis.ts` is fully implemented (94 lines) with `tash()`, `fetch()`, `del()`, `keys()`, `exists()`, `disconnect()`, `resetClient()`
12
+ - [`src/redis.ts`](../src/redis.ts) is implemented with `tash()`, `fetch()`, `del()`, `keys()`, `exists()`, `disconnect()`, `resetClient()`
13
13
  - Uses ioredis with lazy connection
14
14
  - Supports direct URL, Upstash REST (`rediss://`) URLs, host/port fallback
15
15
  - Key-value operations with optional TTL
16
16
  - Parity with coaiapy's `tash/fetch` pattern achieved
17
+ - [`mcp/server.ts`](../mcp/server.ts) wires `coaia_tash` and `coaia_fetch` through the Redis module.
17
18
 
18
19
  **Desired Outcome:**
19
20
  Redis module with everything currently implemented plus:
@@ -9,11 +9,13 @@ A comprehensive Langfuse client covering traces, observations, prompts, datasets
9
9
  ## Structural Tension
10
10
 
11
11
  **Current Reality:**
12
- - `src/langfuse/` directory exists but is empty
13
- - Types defined in `src/types.ts`: `ScoreCategory`, `ScoreConfig`
14
- - coaiapy's `cofuse.py` is 4,480 lines covering: traces, observations (spans/generations/events), prompts, datasets, scores, score configs, comments, media, projects
15
- - cofuse.py uses raw `requests` library against Langfuse REST API
16
- - No MCP tools exist for Langfuse in any parent project
12
+ - [`src/langfuse/`](../src/langfuse/) is implemented as a REST client module split by domain:
13
+ - [`client.ts`](../src/langfuse/client.ts) centralizes auth, base URL, JSON requests, and errors.
14
+ - [`traces.ts`](../src/langfuse/traces.ts), [`observations.ts`](../src/langfuse/observations.ts), [`prompts.ts`](../src/langfuse/prompts.ts), [`datasets.ts`](../src/langfuse/datasets.ts), [`scores.ts`](../src/langfuse/scores.ts), [`comments.ts`](../src/langfuse/comments.ts), and [`media.ts`](../src/langfuse/media.ts) port the coaiapy `cofuse.py` surface.
15
+ - [`index.ts`](../src/langfuse/index.ts) exposes a public barrel for `coaiajs/langfuse`.
16
+ - [`mcp/server.ts`](../mcp/server.ts) wires coaiapy-compatible Langfuse MCP tools such as `coaia_fuse_trace_create`, `coaia_fuse_add_observation`, `coaia_fuse_score_apply`, comments, prompts, datasets, and media.
17
+ - Types defined in [`src/types.ts`](../src/types.ts): `ScoreCategory`, `ScoreConfig`.
18
+ - Remaining gap: not every Langfuse formatting and cache helper from `cofuse.py` has a TypeScript equivalent; the core trace/observation/prompt/dataset/score/comment/media path is present.
17
19
 
18
20
  **Desired Outcome:**
19
21
  TypeScript Langfuse client with:
@@ -11,15 +11,15 @@ A KnowledgeGraphManager that provides full CRUD for entities and relations store
11
11
  ## Structural Tension
12
12
 
13
13
  **Current Reality:**
14
- - `src/narrative/` directory exists but is empty
15
- - Types fully defined in `src/types.ts`: `Entity`, `EntityMetadata`, `Relation`, `RelationMetadata`, `KnowledgeGraph`, `McpToolResult`
16
- - coaia-narrative v0.12.0 has a working implementation:
17
- - `graph-manager.ts` (1,294 lines) — the core engine
18
- - `tool-definitions.ts` — 27 MCP tool schemas
19
- - `tool-handlers.ts` — tool implementation connecting MCP to graph manager
20
- - `tool-groups.ts` — tool filtering by group (STC_TOOLS, KG_TOOLS, CORE_TOOLS)
21
- - `types.ts` — type definitions (absorbed into coaiajs `src/types.ts`)
22
- - coaia-narrative rispecs are the most mature (15 specs) — detailed behavioral specifications exist for every capability
14
+ - [`src/narrative/`](../src/narrative/) is implemented:
15
+ - [`graph-manager.ts`](../src/narrative/graph-manager.ts) is the core JSONL graph/STC/narrative/MMOT engine.
16
+ - [`tool-definitions.ts`](../src/narrative/tool-definitions.ts) defines the MCP tool schemas and groups.
17
+ - [`tool-handlers.ts`](../src/narrative/tool-handlers.ts) connects MCP tool calls to `KnowledgeGraphManager`.
18
+ - [`markdown-export.ts`](../src/narrative/markdown-export.ts) handles chart, progress, stats, and all-chart markdown exports.
19
+ - [`index.ts`](../src/narrative/index.ts) exposes library and CLI helper functions for `coaiajs/narrative`.
20
+ - Types are shared through [`src/types.ts`](../src/types.ts) and re-exported through [`src/narrative/types.ts`](../src/narrative/types.ts).
21
+ - [`mcp/server.ts`](../mcp/server.ts) now routes narrative tools to `handleToolCall()` with a `KnowledgeGraphManager`.
22
+ - `coaia narrative list` smoke-tested successfully against an empty memory file.
23
23
 
24
24
  **Desired Outcome:**
25
25
  Narrative engine in `src/narrative/` that:
@@ -9,13 +9,15 @@ A PDE module that transforms `DecompositionResult` objects into coaia-narrative-
9
9
  ## Structural Tension
10
10
 
11
11
  **Current Reality:**
12
- - `src/pde/` directory exists but is empty
13
- - PDE types fully defined in `src/types.ts`: `DecompositionResult`, `PrimaryIntent`, `SecondaryIntent`, `DirectionMap`, `ActionItem`, `AmbiguityFlag`, `StoredDecomposition`, `PdeSession`
14
- - coaia-pde v0.1.1 has a working implementation:
15
- - `stc-mapper.ts` (~300 lines) — transforms DecompositionResult → Entity[]/Relation[]
16
- - `session-manager.ts` — persists PDE sessions as JSONL
17
- - `mcp-server.ts` — 12 MCP tools
18
- - coaia-pde rispec exists: `pde-to-stc-transformation.rispec.md` — defines the Four Directions → STC mapping
12
+ - [`src/pde/`](../src/pde/) is implemented:
13
+ - [`stc-mapper.ts`](../src/pde/stc-mapper.ts) transforms `DecompositionResult` into coaia-narrative-compatible `Entity[]` and `Relation[]`.
14
+ - [`session-manager.ts`](../src/pde/session-manager.ts) persists PDE/STC sessions as JSONL in `.coaia/pde/`.
15
+ - [`mcp-tools.ts`](../src/pde/mcp-tools.ts) defines 10 implemented MCP tool schemas.
16
+ - [`mcp-handlers.ts`](../src/pde/mcp-handlers.ts) handles import, STC creation, session listing/viewing, action progress, action completion, current-reality updates, and session completion.
17
+ - [`index.ts`](../src/pde/index.ts) exposes library and CLI helper functions.
18
+ - PDE types are defined in [`src/types.ts`](../src/types.ts): `DecompositionResult`, `PrimaryIntent`, `SecondaryIntent`, `DirectionMap`, `ActionItem`, `AmbiguityFlag`, `StoredDecomposition`, `PdeSession`.
19
+ - [`mcp/server.ts`](../mcp/server.ts) wires PDE tools and namespaces session-action tools that conflict with narrative names (`pde_add_action_step`, `pde_update_current_reality`, etc.).
20
+ - Remaining gap: prompt decomposition itself (`pde_decompose`, `pde_parse_response`, `pde_get`, `pde_list`, `pde_export_markdown`) is not implemented inside `coaiajs`; `coaiajs` currently consumes stored/external PDE outputs and maps them to STC.
19
21
 
20
22
  **Desired Outcome:**
21
23
  PDE engine in `src/pde/` that:
@@ -77,22 +79,20 @@ class SessionManager {
77
79
  }
78
80
  ```
79
81
 
80
- ## MCP Tools (12)
82
+ ## MCP Tools (Implemented)
81
83
 
82
84
  | Tool | Purpose |
83
85
  |------|---------|
84
- | `pde_decompose` | Build prompts for LLM-driven decomposition |
85
- | `pde_parse_response` | Parse LLM response into DecompositionResult |
86
- | `pde_get` | Retrieve stored decomposition by ID |
87
- | `pde_list` | List stored decompositions |
88
- | `pde_export_markdown` | Export as git-diffable markdown |
89
- | `pde_to_stc` | Transform decomposition into STC |
90
- | `pde_preview_stc` | Preview STC mapping without creating |
91
- | `pde_create_session` | Create new PDE session |
92
- | `pde_get_session` | Get session details |
93
- | `pde_list_sessions` | List all sessions |
94
- | `pde_session_status` | Get session transformation status |
95
- | `pde_bridge_plan` | Bridge to planning engine |
86
+ | `import_pde_decomposition` | Load stored `.pde` decomposition and create an STC session |
87
+ | `create_stc_from_pde` | Create an STC session from an in-memory `DecompositionResult` |
88
+ | `list_pde_decompositions` | List importable stored PDE decomposition files |
89
+ | `get_session` | Get PDE/STC session state |
90
+ | `list_sessions` | List PDE/STC sessions |
91
+ | `pde_update_action_progress` | Add factual progress to a session action |
92
+ | `pde_mark_action_complete` | Mark a session action complete |
93
+ | `pde_add_action_step` | Add a session action step |
94
+ | `pde_update_current_reality` | Add observations to session current reality |
95
+ | `complete_session` | Mark a session completed |
96
96
 
97
97
  ## Relation to Planning Engine
98
98
 
@@ -106,7 +106,7 @@ Claude Plan mode → plan.md → coaiajs planning-engine → narrative JSONL →
106
106
  ## Quality Criteria
107
107
 
108
108
  - ✅ StcMapper produces entities/relations compatible with narrative engine's JSONL format
109
- - ✅ All 12 coaia-pde MCP tools produce identical results
110
- - ✅ PDE sessions are persisted as `.pde/*.json` files
111
- - ✅ Preview mapping shows the transformation without side effects
109
+ - ✅ Implemented PDE MCP tools route through `mcp/server.ts`
110
+ - ✅ PDE sessions are persisted as `.coaia/pde/*.jsonl` files
111
+ - ⚠️ Preview mapping and native prompt decomposition remain desired capabilities
112
112
  - ✅ Ambiguities from decomposition surface as tension sources in the STC
@@ -9,12 +9,13 @@ A planning module that parses markdown plans (particularly Claude Plan mode outp
9
9
  ## Structural Tension
10
10
 
11
11
  **Current Reality:**
12
- - `src/planning/` directory exists but is empty
13
- - Types defined in `src/types.ts`: `StructuralTensionPlan`, `StructuralElement`
14
- - coaia-planning v0.1.0 has a working implementation:
15
- - `plan-parser.ts` (821 lines) — parses markdown plans into structured objects
16
- - `tools/index.ts` — 5 MCP tools + 1 PDE bridge tool
17
- - No rispecs exist for coaia-planning — this is the first specification
12
+ - [`src/planning/`](../src/planning/) is implemented:
13
+ - [`plan-parser.ts`](../src/planning/plan-parser.ts) parses markdown plans, converts plans to STC entities/relations, exports JSONL, and converts `DecompositionResult` to plan/STC output.
14
+ - [`mcp-tools.ts`](../src/planning/mcp-tools.ts) defines 6 MCP tool schemas.
15
+ - [`mcp-handlers.ts`](../src/planning/mcp-handlers.ts) handles parse, plan-to-STC, plan-to-chart sync, chart-to-plan sync, plan trace creation, and PDE-to-plan conversion.
16
+ - [`index.ts`](../src/planning/index.ts) exposes library and CLI helper functions.
17
+ - Types are defined in [`src/types.ts`](../src/types.ts): `StructuralTensionPlan`, `StructuralElement`.
18
+ - [`mcp/server.ts`](../mcp/server.ts) routes planning tools to `handlePlanningTool()`.
18
19
 
19
20
  **Desired Outcome:**
20
21
  Planning engine in `src/planning/` that:
@@ -108,21 +109,21 @@ STC → Plan:
108
109
 
109
110
  Conflict resolution: STC wins by default (it is the source of truth). Conflicts are reported in `SyncResult.conflicts` for human review.
110
111
 
111
- ## MCP Tools (6)
112
+ ## MCP Tools (Implemented)
112
113
 
113
114
  | Tool | Purpose |
114
115
  |------|---------|
115
- | `plan_parse` | Parse markdown plan into structured object |
116
+ | `parse_plan_structural` | Parse markdown plan into structured object |
116
117
  | `plan_to_stc` | Convert parsed plan to STC entities |
117
- | `plan_from_stc` | Generate plan markdown from STC |
118
- | `plan_sync` | Bidirectional sync between plan and STC |
119
- | `plan_diff` | Show differences between plan and STC |
120
- | `plan_bridge_pde` | Import PDE decomposition as plan |
118
+ | `sync_plan_to_chart` | Write plan-derived STC JSONL |
119
+ | `sync_chart_to_plan` | Generate plan markdown from STC JSONL |
120
+ | `create_plan_trace` | Generate trace payload for plan→STC transformation |
121
+ | `pde_to_plan` | Convert PDE decomposition into STC JSONL |
121
122
 
122
123
  ## Quality Criteria
123
124
 
124
125
  - ✅ Parses Claude Plan mode output without modification
125
126
  - ✅ Checkbox state (`[ ]` / `[x]`) maps correctly to action completion
126
127
  - ✅ Sub-items preserved through parse → STC → plan round-trip
127
- - ✅ Bidirectional sync detects and reports conflicts
128
+ - ✅ Bidirectional sync supports dry-run and write modes
128
129
  - ✅ Generated markdown is readable and re-parseable
@@ -9,13 +9,13 @@ A template engine that loads pipeline definitions, renders them with `{{variable
9
9
  ## Structural Tension
10
10
 
11
11
  **Current Reality:**
12
- - `src/pipeline/` directory exists but is empty
13
- - Types defined in `src/types.ts`: `PipelineVariable`, `PipelineStep`, `PipelineTemplate`
14
- - coaiapy has two relevant files:
15
- - `pipeline.py` — loads and executes pipeline templates
16
- - `mobile_template.py` — a specific pipeline template for mobile workflows
17
- - Pipeline templates use `{{variable}}` Mustache-style substitution
18
- - No MCP tools exist for pipelines in any parent project
12
+ - [`src/pipeline/`](../src/pipeline/) is implemented:
13
+ - [`template-engine.ts`](../src/pipeline/template-engine.ts) ports coaiapy `pipeline.py` and `mobile_template.py` patterns into `MobileTemplateEngine`, `TemplateLoader`, and `TemplateRenderer`.
14
+ - [`index.ts`](../src/pipeline/index.ts) exports the public pipeline API.
15
+ - Types are defined in [`src/types.ts`](../src/types.ts): `PipelineVariable`, `PipelineStep`, `PipelineTemplate`.
16
+ - Pipeline templates use `{{variable}}` substitution, simple filters, conditionals, defaults, and built-in functions.
17
+ - [`mcp/resources.ts`](../mcp/resources.ts) exposes template listing, template detail, and template-variable resources.
18
+ - Remaining gap: pipeline execution as a first-class MCP tool remains desired; current implementation renders template steps but does not execute external action dependencies.
19
19
 
20
20
  **Desired Outcome:**
21
21
  Pipeline engine in `src/pipeline/` that:
@@ -9,12 +9,11 @@ A single `coaia` CLI binary that provides subcommands for every CoAiA module —
9
9
  ## Structural Tension
10
10
 
11
11
  **Current Reality:**
12
- - CLI entry point defined in `package.json` as `"coaia": "./dist/src/cli.js"` but no implementation exists
13
- - commander dependency is installed
14
- - coaiapy has an argparse-based CLI covering: tash, fetch, env, pipeline, transcribe, synthesize, fuse, gh
15
- - coaia-narrative has a minimist-based CLI covering: chart visualization, markdown export, progress display
16
- - coaia-pde has no CLI
17
- - coaia-planning has no CLI
12
+ - [`package.json`](../package.json) defines `"coaia": "./dist/src/cli.js"`.
13
+ - [`src/cli.ts`](../src/cli.ts) implements a commander-based CLI covering root coaiapy parity commands, Langfuse, pipeline, environment, GitHub, narrative, PDE, and planning command groups.
14
+ - [`src/narrative/index.ts`](../src/narrative/index.ts), [`src/pde/index.ts`](../src/pde/index.ts), and [`src/planning/index.ts`](../src/planning/index.ts) expose helper functions used by the CLI dynamic module loader.
15
+ - `npx coaia --help` works from an installed package tarball.
16
+ - Remaining gaps: `synthesize` and explicit `mcp` CLI subcommands are desired but not currently registered as CLI groups.
18
17
 
19
18
  **Desired Outcome:**
20
19
  Unified CLI at `src/cli.ts` using commander, with subcommands:
@@ -26,12 +25,10 @@ coaia env [list|get|set|unset|init]
26
25
  coaia fuse [traces|trace|prompts|scores|datasets]
27
26
  coaia pipeline [list|render|execute] <template>
28
27
  coaia transcribe <audio-file>
29
- coaia synthesize <text> --output <file>
30
28
  coaia gh [issues|issue|comments]
31
29
  coaia narrative [charts|chart|progress|export]
32
- coaia pde [decompose|list|get|export|to-stc]
33
- coaia plan [parse|to-stc|from-stc|sync|diff]
34
- coaia mcp [start|tools]
30
+ coaia pde [import|list|sessions|show]
31
+ coaia plan [parse|convert|sync-to-chart|sync-to-plan]
35
32
  ```
36
33
 
37
34
  ## Core Structure
@@ -54,7 +51,6 @@ program.addCommand(ghCommands());
54
51
  program.addCommand(narrativeCommands());
55
52
  program.addCommand(pdeCommands());
56
53
  program.addCommand(planCommands());
57
- program.addCommand(mcpCommands());
58
54
  ```
59
55
 
60
56
  ## Command Details
@@ -95,26 +91,18 @@ coaia narrative export <id> [--format md|json] # Export chart
95
91
 
96
92
  ### PDE Commands
97
93
  ```
98
- coaia pde decompose <prompt> # Decompose a prompt
94
+ coaia pde import <id> # Import stored PDE decomposition into STC session
99
95
  coaia pde list # List decompositions
100
- coaia pde get <id> # Get decomposition
101
- coaia pde export <id> # Export as markdown
102
- coaia pde to-stc <id> # Transform to STC
96
+ coaia pde sessions # List PDE sessions
97
+ coaia pde show <session-id> # Show PDE session state
103
98
  ```
104
99
 
105
100
  ### Plan Commands
106
101
  ```
107
102
  coaia plan parse <file> # Parse plan markdown
108
- coaia plan to-stc <file> # Convert plan to STC
109
- coaia plan from-stc <chart-id> # Generate plan from STC
110
- coaia plan sync <file> <chart-id> # Bidirectional sync
111
- coaia plan diff <file> <chart-id> # Show differences
112
- ```
113
-
114
- ### MCP Commands
115
- ```
116
- coaia mcp start [--mode MINIMAL|STANDARD|FULL] # Start MCP server
117
- coaia mcp tools [--mode X] # List available tools
103
+ coaia plan convert <file> # Convert plan to STC JSONL
104
+ coaia plan sync-to-chart <file> <jsonl> # Sync plan into chart JSONL
105
+ coaia plan sync-to-plan <jsonl> <file> # Sync chart JSONL back to plan markdown
118
106
  ```
119
107
 
120
108
  ## Output Formatting
@@ -9,36 +9,36 @@ A single MCP server (`coaiajs-mcp`) that consolidates the 44 tools from coaia-na
9
9
  ## Structural Tension
10
10
 
11
11
  **Current Reality:**
12
- - MCP server entry defined in `package.json` as `"coaiajs-mcp": "./dist/mcp/server.js"` but `mcp/` directory is empty (only a `tools/` subdirectory stub)
13
- - `@modelcontextprotocol/sdk` v1.25.0 is installed as a dependency
14
- - Four separate MCP servers exist in parent projects:
15
- - coaia-narrative: 27 tools (STC lifecycle, knowledge graph, narrative beats, MMOT)
16
- - coaia-pde: 12 tools (decomposition, session management, STC transformation)
17
- - coaia-planning: 5 tools (plan parsing, plan↔STC sync, PDE bridge)
18
- - coaiapy: 0 MCP tools (Python library only, no MCP)
19
- - Each parent server has its own startup, tool registration, and transport handling
20
- - Users currently need 3 MCP server entries in their config to access all tools
12
+ - [`package.json`](../package.json) defines `"coaiajs-mcp": "./dist/mcp/server.js"`.
13
+ - [`mcp/server.ts`](../mcp/server.ts) implements stdio MCP transport using `@modelcontextprotocol/sdk`.
14
+ - [`mcp/config.ts`](../mcp/config.ts) implements `MINIMAL`, `STANDARD`, `OBSERVABILITY`, and `FULL` feature sets via `COAIAJS_FEATURES` or `--features`.
15
+ - [`mcp/tools/coaiapy-tools.ts`](../mcp/tools/coaiapy-tools.ts) defines coaiapy-compatible Redis and Langfuse tool schemas.
16
+ - [`mcp/resources.ts`](../mcp/resources.ts) implements `coaia://templates/` resources backed by the pipeline template loader.
17
+ - [`mcp/prompts.ts`](../mcp/prompts.ts) implements the three coaiapy-mcp prompt templates.
18
+ - `npx coaiajs-mcp` starts successfully from an installed package tarball and reports `STANDARD: 64 tools, 3 prompts, 3 resources`.
19
+ - Remaining gap: several desired package-native tool groups (audio and pipeline execution tools) are not exposed as standalone MCP tools yet; pipeline templates are currently exposed as resources.
21
20
 
22
21
  **Desired Outcome:**
23
22
  Single MCP server at `mcp/server.ts` providing:
24
- - All 44 parent tools with identical schemas and behavior
25
- - 20 new tools for previously-CLI-only functionality
26
- - Feature gating via `COAIAJS_MCP_MODE` environment variable
23
+ - Parent and coaiapy-compatible tools through one stdio server
24
+ - Template resources and workflow prompts from coaiapy-mcp
25
+ - Feature gating via `COAIAJS_FEATURES` or `--features`
27
26
  - Single server entry in MCP client config
28
27
 
29
28
  ## Feature Gating
30
29
 
31
30
  ```typescript
32
- type McpMode = 'MINIMAL' | 'STANDARD' | 'FULL';
31
+ type FeatureLevel = 'MINIMAL' | 'STANDARD' | 'OBSERVABILITY' | 'FULL';
33
32
  ```
34
33
 
35
34
  | Mode | Tools loaded | Use case |
36
35
  |------|-------------|----------|
37
- | **MINIMAL** | STC tools (11), KG tools (9), MMOT (2), narrative beats (3) = **25** | Memory-constrained agents, basic STC workflow |
38
- | **STANDARD** | MINIMAL + PDE (12) + planning (6) + Redis (5) = **48** | Standard development sessions |
39
- | **FULL** | STANDARD + Langfuse (8) + pipeline (3) + audio (2) + guidance (3) = **64** | Full-featured agent sessions |
36
+ | **MINIMAL** | Redis + Langfuse observability core tools | Observability-only sessions |
37
+ | **STANDARD** | MINIMAL + narrative + PDE + planning tools | Standard development sessions |
38
+ | **OBSERVABILITY** | Alias of STANDARD in current implementation | Compatibility mode |
39
+ | **FULL** | All registered tools, including media tools | Full-featured agent sessions |
40
40
 
41
- Default mode: `STANDARD`.
41
+ Default feature level: `STANDARD`.
42
42
 
43
43
  ## Server Architecture
44
44
 
@@ -82,47 +82,44 @@ Narrative Beats: `create_narrative_beat`, `telescope_narrative_beat`, `list_narr
82
82
 
83
83
  MMOT: `perform_mmot_evaluation`, `init_llm_guidance`
84
84
 
85
- ### PDE Engine (12 tools — STANDARD+)
85
+ ### PDE Engine (10 tools — STANDARD+)
86
86
 
87
- `pde_decompose`, `pde_parse_response`, `pde_get`, `pde_list`, `pde_export_markdown`, `pde_to_stc`, `pde_preview_stc`, `pde_create_session`, `pde_get_session`, `pde_list_sessions`, `pde_session_status`, `pde_bridge_plan`
87
+ `import_pde_decomposition`, `create_stc_from_pde`, `list_pde_decompositions`, `get_session`, `list_sessions`, `pde_update_action_progress`, `pde_mark_action_complete`, `pde_add_action_step`, `pde_update_current_reality`, `complete_session`
88
88
 
89
89
  ### Planning Engine (6 tools — STANDARD+)
90
90
 
91
- `plan_parse`, `plan_to_stc`, `plan_from_stc`, `plan_sync`, `plan_diff`, `plan_bridge_pde`
91
+ `parse_plan_structural`, `plan_to_stc`, `sync_plan_to_chart`, `sync_chart_to_plan`, `create_plan_trace`, `pde_to_plan`
92
92
 
93
- ### Redis (5 tools — STANDARD+)
93
+ ### Redis
94
94
 
95
- `redis_tash`, `redis_fetch`, `redis_del`, `redis_keys`, `redis_exists`
95
+ `coaia_tash`, `coaia_fetch`
96
96
 
97
- ### Langfuse (8 tools — FULL only)
97
+ ### Langfuse
98
98
 
99
- `langfuse_list_traces`, `langfuse_get_trace`, `langfuse_list_prompts`, `langfuse_get_prompt`, `langfuse_list_datasets`, `langfuse_list_scores`, `langfuse_create_score`, `langfuse_list_score_configs`
99
+ `coaia_fuse_trace_create`, `coaia_fuse_add_observation`, `coaia_fuse_trace_patch_output`, `coaia_fuse_trace_get`, `coaia_fuse_trace_view`, `coaia_fuse_observation_get`, `coaia_fuse_traces_list`, `coaia_fuse_traces_session_view`, comments, prompts, datasets, score configs, score application, and media tools.
100
100
 
101
- ### Pipeline (3 tools — FULL only)
101
+ ### Resources
102
102
 
103
- `pipeline_list`, `pipeline_render`, `pipeline_execute`
103
+ `coaia://templates/`, `coaia://templates/{name}`, `coaia://templates/{name}/variables`
104
104
 
105
- ### Audio (2 tools — FULL only)
105
+ ### Prompts
106
106
 
107
- `audio_transcribe`, `audio_synthesize`
107
+ `mia_miette_duo`, `create_observability_pipeline`, `analyze_audio_workflow`
108
108
 
109
109
  ## Tool Registration Pattern
110
110
 
111
- Each module provides a `registerXxxTools(server: McpServer)` function:
111
+ The current server uses plain tool definition arrays plus dispatch handlers:
112
112
 
113
113
  ```typescript
114
- // mcp/tools/redis.ts
115
- export function registerRedisTools(server: McpServer) {
116
- server.tool('redis_tash', 'Store a value in Redis with optional TTL', {
117
- key: z.string().describe('Redis key'),
118
- value: z.string().describe('Value to store'),
119
- ttl: z.number().optional().describe('TTL in seconds'),
120
- }, async ({ key, value, ttl }) => {
121
- await tash(key, value, ttl);
122
- return { content: [{ type: 'text', text: `Stored ${key}` }] };
123
- });
124
- // ... more tools
125
- }
114
+ const allToolDefs = [
115
+ ...getCoaiapyToolDefinitions(featureConfig),
116
+ ...getNarrativeToolDefinitions(featureConfig),
117
+ ...getPdeToolDefinitions(featureConfig),
118
+ ...getPlanningToolDefinitions(featureConfig),
119
+ ];
120
+
121
+ server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: allToolDefs }));
122
+ server.setRequestHandler(CallToolRequestSchema, async (request) => routeToolCall(request.params));
126
123
  ```
127
124
 
128
125
  ## Transport
@@ -132,9 +129,9 @@ stdio transport only (standard MCP pattern). Server reads JSON-RPC from stdin, w
132
129
  ## Quality Criteria
133
130
 
134
131
  - ✅ Single MCP config entry replaces three separate servers
135
- - ✅ All 44 parent tools produce identical results to their parent implementations
132
+ - ✅ Implemented parent tools route to TypeScript handlers instead of placeholders
136
133
  - ✅ Feature gating reduces tool count without breaking functionality
137
- - ✅ `COAIAJS_MCP_MODE=MINIMAL` loads ≤25 tools
138
- - ✅ Server starts in <500ms for MINIMAL mode
134
+ - ✅ `COAIAJS_FEATURES` and `--features` select feature level
135
+ - ✅ Server starts from installed tarball with `npx coaiajs-mcp`
139
136
  - ✅ Tool descriptions are self-documenting (LLMs understand usage without external docs)
140
137
  - ✅ Error responses include actionable information
@@ -9,11 +9,11 @@ An audio module providing speech-to-text transcription via OpenAI Whisper and te
9
9
  ## Structural Tension
10
10
 
11
11
  **Current Reality:**
12
- - `src/audio.ts` is fully implemented (76 lines) with `synthesize()` function using AWS Polly
13
- - `src/llm.ts` includes `transcribeAudio()` using OpenAI Whisper
12
+ - [`src/audio.ts`](../src/audio.ts) implements `synthesize()` with AWS Polly and lazy client initialization.
13
+ - [`src/llm.ts`](../src/llm.ts) implements `transcribeAudio()` with OpenAI Whisper and exposes `llm()`, `generateImage()`, and `abstractProcess()`.
14
14
  - Both use lazy client initialization
15
15
  - coaiapy's `syntation.py` provides the same functionality via boto3 and openai Python packages
16
- - No MCP tools exist for audio in any parent project
16
+ - Remaining gap: audio is available through the library and CLI transcription path, but standalone MCP audio tools are not wired yet.
17
17
 
18
18
  **Desired Outcome:**
19
19
  Audio module consolidating transcription and synthesis in one place:
@@ -4,7 +4,7 @@
4
4
 
5
5
  **Name:** coaiajs rispecs
6
6
  **Role:** RISE-based structural specifications for the coaiajs platform
7
- **Status:** Genesis (2026-03-11)
7
+ **Status:** Maintained implementation-linked specs (updated 2026-05-07)
8
8
 
9
9
  ## Lineage
10
10
 
@@ -34,10 +34,10 @@ These specifications synthesize the creative intent, structural patterns, and be
34
34
  ## Accountabilities
35
35
 
36
36
  1. **Completeness** — These specs are sufficient for another LLM to re-implement the entire coaiajs platform from scratch
37
- 2. **Accuracy** — Current reality assessments are honest and factual, reflecting actual implementation state as of 2026-03-11
37
+ 2. **Accuracy** — Current reality assessments are honest and factual, reflecting actual implementation state as of 2026-05-07
38
38
  3. **Creative orientation** — All desired outcomes use creation language, not problem-solving language
39
39
  4. **Backward compatibility** — Specs preserve behavioral compatibility with parent projects
40
- 5. **Independence** — Specs are codebase-agnostic; they describe behavior, not implementation
40
+ 5. **Traceability** — Specs link to the code files that carry current behavior
41
41
 
42
42
  ## Consumers
43
43
 
@@ -53,4 +53,4 @@ These specifications synthesize the creative intent, structural patterns, and be
53
53
 
54
54
  **Desired Outcome:** These rispecs serve as the single source of truth for what coaiajs should become — complete enough for autonomous re-implementation, accurate enough for MMOT self-evaluation.
55
55
 
56
- **Current Reality:** 13 spec files covering the full platform. Parent project rispecs remain authoritative for deep behavioral details (especially coaia-narrative's 15 specs). These specs provide the consolidation vision and module boundaries.
56
+ **Current Reality:** 13 spec files covering the full platform. Parent project rispecs remain authoritative for deep behavioral details (especially coaia-narrative's 15 specs). These specs now include implementation links for `src/`, `mcp/`, and package metadata so evaluators can trace desired behavior to current code.
package/rispecs/README.md CHANGED
@@ -7,6 +7,15 @@
7
7
 
8
8
  These rispecs define the structural specifications for **coaiajs** — the unified TypeScript platform that consolidates `coaiapy`, `coaia-narrative`, `coaia-pde`, and `coaia-planning` into a single modern Node.js package.
9
9
 
10
+ ## RISE Framework Source
11
+
12
+ These specs use the RISE Framework at `/src/llms/llms-rise-framework.txt` as the governing method:
13
+
14
+ - **Reverse-engineer** parent package behavior from `coaiapy`, `coaia-narrative`, `coaia-pde`, and `coaia-planning`.
15
+ - **Intent-extract** the creative outcome each module makes possible.
16
+ - **Specify** the structural tension between current implementation and desired package behavior.
17
+ - **Export** enough code-linked detail for an evaluator or implementation agent to act without rediscovery.
18
+
10
19
  ## Specification Index
11
20
 
12
21
  ### Platform
@@ -73,6 +82,22 @@ These rispecs define the structural specifications for **coaiajs** — the unifi
73
82
  └─────────────────────────────────────────────────────┘
74
83
  ```
75
84
 
85
+ ## Implementation Map
86
+
87
+ | Spec | Primary implementation |
88
+ |------|------------------------|
89
+ | 00 platform | [`package.json`](../package.json), [`src/index.ts`](../src/index.ts) |
90
+ | 01 config | [`src/config.ts`](../src/config.ts), [`src/types.ts`](../src/types.ts) |
91
+ | 02 redis | [`src/redis.ts`](../src/redis.ts), [`mcp/tools/coaiapy-tools.ts`](../mcp/tools/coaiapy-tools.ts) |
92
+ | 03 langfuse | [`src/langfuse/`](../src/langfuse/), [`mcp/server.ts`](../mcp/server.ts) |
93
+ | 04 narrative | [`src/narrative/`](../src/narrative/), [`src/narrative/index.ts`](../src/narrative/index.ts) |
94
+ | 05 PDE | [`src/pde/`](../src/pde/), [`src/pde/mcp-tools.ts`](../src/pde/mcp-tools.ts) |
95
+ | 06 planning | [`src/planning/`](../src/planning/), [`src/planning/mcp-tools.ts`](../src/planning/mcp-tools.ts) |
96
+ | 07 pipeline | [`src/pipeline/`](../src/pipeline/), [`mcp/resources.ts`](../mcp/resources.ts) |
97
+ | 08 CLI | [`src/cli.ts`](../src/cli.ts), [`package.json`](../package.json) `bin.coaia` |
98
+ | 09 MCP | [`mcp/server.ts`](../mcp/server.ts), [`mcp/config.ts`](../mcp/config.ts), [`mcp/prompts.ts`](../mcp/prompts.ts) |
99
+ | 10 audio | [`src/audio.ts`](../src/audio.ts), [`src/llm.ts`](../src/llm.ts) |
100
+
76
101
  ## Conventions
77
102
 
78
103
  - **Creative orientation**: Desired Outcome describes what IS CREATED, not what is fixed
@@ -80,7 +105,7 @@ These rispecs define the structural specifications for **coaiajs** — the unifi
80
105
  - **Structural tension**: The gap between current and desired that drives advancement
81
106
  - **Variable detail**: Broad for obvious patterns, precise for critical behavior
82
107
  - **Naming**: `NN-kebab-case.spec.md`
83
- - **Codebase-agnostic**: Specs describe behavior, not implementation details
108
+ - **Code-linked**: Specs describe behavior and link to the implementation files that currently carry it
84
109
 
85
110
  ## Relationship to Parent Rispecs
86
111
 
@@ -91,10 +116,11 @@ These rispecs define the structural specifications for **coaiajs** — the unifi
91
116
  | coaia-planning | — | No rispecs yet — spec 06 here is the first |
92
117
  | coaiapy | — | No rispecs — specs 01-03, 07, 10 here are the first |
93
118
 
94
- ## RISE Framework Reference
119
+ ## Maintenance Protocol
120
+
121
+ When code changes, update the relevant spec in the same pass:
95
122
 
96
- These specs follow the RISE Framework (`/src/llms/llms-rise-framework.txt`):
97
- - **R**everse-engineer: Extract creative intent from parent projects
98
- - **I**ntent-extract: Identify what each module enables users to create
99
- - **S**pecify: Define structural tension between current and desired
100
- - **E**xport: Produce specs sufficient for autonomous re-implementation
123
+ 1. Adjust **Current Reality** to match implemented files and verified behavior.
124
+ 2. Add or revise implementation links in the local spec and this README map.
125
+ 3. Keep **Desired Outcome** forward-looking only where a gap remains.
126
+ 4. Re-run `npm run build`, `npm test`, and `npm pack --dry-run` before handing off.