thehood 0.1.0-preview.0

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 (274) hide show
  1. package/CODE_OF_CONDUCT.md +21 -0
  2. package/CONTRIBUTING.md +58 -0
  3. package/LICENSE +21 -0
  4. package/PRIVACY.md +49 -0
  5. package/README.md +264 -0
  6. package/SECURITY.md +31 -0
  7. package/dist/bridges/chatgptWebBridge.d.ts +2 -0
  8. package/dist/bridges/chatgptWebBridge.js +981 -0
  9. package/dist/bridges/chatgptWebBridge.js.map +1 -0
  10. package/dist/cli/args.d.ts +9 -0
  11. package/dist/cli/args.js +82 -0
  12. package/dist/cli/args.js.map +1 -0
  13. package/dist/cli/format.d.ts +56 -0
  14. package/dist/cli/format.js +752 -0
  15. package/dist/cli/format.js.map +1 -0
  16. package/dist/cli/main.d.ts +2 -0
  17. package/dist/cli/main.js +996 -0
  18. package/dist/cli/main.js.map +1 -0
  19. package/dist/cli/mcpConfig.d.ts +36 -0
  20. package/dist/cli/mcpConfig.js +98 -0
  21. package/dist/cli/mcpConfig.js.map +1 -0
  22. package/dist/index.d.ts +37 -0
  23. package/dist/index.js +38 -0
  24. package/dist/index.js.map +1 -0
  25. package/dist/mcp/protocol.d.ts +44 -0
  26. package/dist/mcp/protocol.js +33 -0
  27. package/dist/mcp/protocol.js.map +1 -0
  28. package/dist/mcp/server.d.ts +1 -0
  29. package/dist/mcp/server.js +106 -0
  30. package/dist/mcp/server.js.map +1 -0
  31. package/dist/mcp/tools.d.ts +10 -0
  32. package/dist/mcp/tools.js +2200 -0
  33. package/dist/mcp/tools.js.map +1 -0
  34. package/dist/mcp/validation.d.ts +8 -0
  35. package/dist/mcp/validation.js +67 -0
  36. package/dist/mcp/validation.js.map +1 -0
  37. package/dist/providers/chatgptWeb.d.ts +2 -0
  38. package/dist/providers/chatgptWeb.js +26 -0
  39. package/dist/providers/chatgptWeb.js.map +1 -0
  40. package/dist/providers/claudeCode.d.ts +4 -0
  41. package/dist/providers/claudeCode.js +32 -0
  42. package/dist/providers/claudeCode.js.map +1 -0
  43. package/dist/providers/codexCli.d.ts +6 -0
  44. package/dist/providers/codexCli.js +25 -0
  45. package/dist/providers/codexCli.js.map +1 -0
  46. package/dist/providers/codexCliModels.d.ts +23 -0
  47. package/dist/providers/codexCliModels.js +147 -0
  48. package/dist/providers/codexCliModels.js.map +1 -0
  49. package/dist/providers/localCommand.d.ts +26 -0
  50. package/dist/providers/localCommand.js +614 -0
  51. package/dist/providers/localCommand.js.map +1 -0
  52. package/dist/providers/markdownPayload.d.ts +7 -0
  53. package/dist/providers/markdownPayload.js +29 -0
  54. package/dist/providers/markdownPayload.js.map +1 -0
  55. package/dist/providers/responseSchema.d.ts +3 -0
  56. package/dist/providers/responseSchema.js +187 -0
  57. package/dist/providers/responseSchema.js.map +1 -0
  58. package/dist/providers/router.d.ts +3 -0
  59. package/dist/providers/router.js +21 -0
  60. package/dist/providers/router.js.map +1 -0
  61. package/dist/providers/stub.d.ts +2 -0
  62. package/dist/providers/stub.js +177 -0
  63. package/dist/providers/stub.js.map +1 -0
  64. package/dist/providers/types.d.ts +37 -0
  65. package/dist/providers/types.js +2 -0
  66. package/dist/providers/types.js.map +1 -0
  67. package/dist/runtime/agentBoard.d.ts +79 -0
  68. package/dist/runtime/agentBoard.js +166 -0
  69. package/dist/runtime/agentBoard.js.map +1 -0
  70. package/dist/runtime/agentBoardArtifact.d.ts +9 -0
  71. package/dist/runtime/agentBoardArtifact.js +171 -0
  72. package/dist/runtime/agentBoardArtifact.js.map +1 -0
  73. package/dist/runtime/agentRunner.d.ts +17 -0
  74. package/dist/runtime/agentRunner.js +92 -0
  75. package/dist/runtime/agentRunner.js.map +1 -0
  76. package/dist/runtime/approvalInbox.d.ts +54 -0
  77. package/dist/runtime/approvalInbox.js +143 -0
  78. package/dist/runtime/approvalInbox.js.map +1 -0
  79. package/dist/runtime/approvalPolicy.d.ts +11 -0
  80. package/dist/runtime/approvalPolicy.js +58 -0
  81. package/dist/runtime/approvalPolicy.js.map +1 -0
  82. package/dist/runtime/artifacts.d.ts +23 -0
  83. package/dist/runtime/artifacts.js +48 -0
  84. package/dist/runtime/artifacts.js.map +1 -0
  85. package/dist/runtime/browserManager.d.ts +37 -0
  86. package/dist/runtime/browserManager.js +356 -0
  87. package/dist/runtime/browserManager.js.map +1 -0
  88. package/dist/runtime/canonicalMemory.d.ts +23 -0
  89. package/dist/runtime/canonicalMemory.js +134 -0
  90. package/dist/runtime/canonicalMemory.js.map +1 -0
  91. package/dist/runtime/chatGptPageReadiness.d.ts +16 -0
  92. package/dist/runtime/chatGptPageReadiness.js +74 -0
  93. package/dist/runtime/chatGptPageReadiness.js.map +1 -0
  94. package/dist/runtime/commandRunner.d.ts +18 -0
  95. package/dist/runtime/commandRunner.js +115 -0
  96. package/dist/runtime/commandRunner.js.map +1 -0
  97. package/dist/runtime/commandSafety.d.ts +7 -0
  98. package/dist/runtime/commandSafety.js +61 -0
  99. package/dist/runtime/commandSafety.js.map +1 -0
  100. package/dist/runtime/config.d.ts +10 -0
  101. package/dist/runtime/config.js +107 -0
  102. package/dist/runtime/config.js.map +1 -0
  103. package/dist/runtime/crewLanes.d.ts +2 -0
  104. package/dist/runtime/crewLanes.js +123 -0
  105. package/dist/runtime/crewLanes.js.map +1 -0
  106. package/dist/runtime/criticPolicy.d.ts +17 -0
  107. package/dist/runtime/criticPolicy.js +50 -0
  108. package/dist/runtime/criticPolicy.js.map +1 -0
  109. package/dist/runtime/defaults.d.ts +5 -0
  110. package/dist/runtime/defaults.js +100 -0
  111. package/dist/runtime/defaults.js.map +1 -0
  112. package/dist/runtime/directives.d.ts +3 -0
  113. package/dist/runtime/directives.js +218 -0
  114. package/dist/runtime/directives.js.map +1 -0
  115. package/dist/runtime/doctor.d.ts +36 -0
  116. package/dist/runtime/doctor.js +185 -0
  117. package/dist/runtime/doctor.js.map +1 -0
  118. package/dist/runtime/errors.d.ts +20 -0
  119. package/dist/runtime/errors.js +41 -0
  120. package/dist/runtime/errors.js.map +1 -0
  121. package/dist/runtime/externalTransfer.d.ts +20 -0
  122. package/dist/runtime/externalTransfer.js +156 -0
  123. package/dist/runtime/externalTransfer.js.map +1 -0
  124. package/dist/runtime/fanout.d.ts +64 -0
  125. package/dist/runtime/fanout.js +263 -0
  126. package/dist/runtime/fanout.js.map +1 -0
  127. package/dist/runtime/gitEvidence.d.ts +10 -0
  128. package/dist/runtime/gitEvidence.js +80 -0
  129. package/dist/runtime/gitEvidence.js.map +1 -0
  130. package/dist/runtime/handoffs.d.ts +32 -0
  131. package/dist/runtime/handoffs.js +100 -0
  132. package/dist/runtime/handoffs.js.map +1 -0
  133. package/dist/runtime/ids.d.ts +2 -0
  134. package/dist/runtime/ids.js +4 -0
  135. package/dist/runtime/ids.js.map +1 -0
  136. package/dist/runtime/localStateIgnore.d.ts +9 -0
  137. package/dist/runtime/localStateIgnore.js +98 -0
  138. package/dist/runtime/localStateIgnore.js.map +1 -0
  139. package/dist/runtime/loop.d.ts +14 -0
  140. package/dist/runtime/loop.js +1863 -0
  141. package/dist/runtime/loop.js.map +1 -0
  142. package/dist/runtime/loopRecommendation.d.ts +109 -0
  143. package/dist/runtime/loopRecommendation.js +566 -0
  144. package/dist/runtime/loopRecommendation.js.map +1 -0
  145. package/dist/runtime/loopResponsibilities.d.ts +2 -0
  146. package/dist/runtime/loopResponsibilities.js +395 -0
  147. package/dist/runtime/loopResponsibilities.js.map +1 -0
  148. package/dist/runtime/loopRunner.d.ts +28 -0
  149. package/dist/runtime/loopRunner.js +81 -0
  150. package/dist/runtime/loopRunner.js.map +1 -0
  151. package/dist/runtime/operatorNextActions.d.ts +2 -0
  152. package/dist/runtime/operatorNextActions.js +344 -0
  153. package/dist/runtime/operatorNextActions.js.map +1 -0
  154. package/dist/runtime/paths.d.ts +9 -0
  155. package/dist/runtime/paths.js +14 -0
  156. package/dist/runtime/paths.js.map +1 -0
  157. package/dist/runtime/permissions.d.ts +9 -0
  158. package/dist/runtime/permissions.js +73 -0
  159. package/dist/runtime/permissions.js.map +1 -0
  160. package/dist/runtime/progressPacket.d.ts +12 -0
  161. package/dist/runtime/progressPacket.js +512 -0
  162. package/dist/runtime/progressPacket.js.map +1 -0
  163. package/dist/runtime/protectedPaths.d.ts +6 -0
  164. package/dist/runtime/protectedPaths.js +48 -0
  165. package/dist/runtime/protectedPaths.js.map +1 -0
  166. package/dist/runtime/providers.d.ts +13 -0
  167. package/dist/runtime/providers.js +60 -0
  168. package/dist/runtime/providers.js.map +1 -0
  169. package/dist/runtime/reconciliation.d.ts +17 -0
  170. package/dist/runtime/reconciliation.js +283 -0
  171. package/dist/runtime/reconciliation.js.map +1 -0
  172. package/dist/runtime/redaction.d.ts +1 -0
  173. package/dist/runtime/redaction.js +5 -0
  174. package/dist/runtime/redaction.js.map +1 -0
  175. package/dist/runtime/remoteRepoContext.d.ts +77 -0
  176. package/dist/runtime/remoteRepoContext.js +316 -0
  177. package/dist/runtime/remoteRepoContext.js.map +1 -0
  178. package/dist/runtime/repoContext.d.ts +50 -0
  179. package/dist/runtime/repoContext.js +399 -0
  180. package/dist/runtime/repoContext.js.map +1 -0
  181. package/dist/runtime/repoGateway.d.ts +64 -0
  182. package/dist/runtime/repoGateway.js +308 -0
  183. package/dist/runtime/repoGateway.js.map +1 -0
  184. package/dist/runtime/responseContracts.d.ts +3 -0
  185. package/dist/runtime/responseContracts.js +86 -0
  186. package/dist/runtime/responseContracts.js.map +1 -0
  187. package/dist/runtime/reviewLanes.d.ts +2 -0
  188. package/dist/runtime/reviewLanes.js +343 -0
  189. package/dist/runtime/reviewLanes.js.map +1 -0
  190. package/dist/runtime/reviewRouting.d.ts +51 -0
  191. package/dist/runtime/reviewRouting.js +152 -0
  192. package/dist/runtime/reviewRouting.js.map +1 -0
  193. package/dist/runtime/revisionPacket.d.ts +38 -0
  194. package/dist/runtime/revisionPacket.js +144 -0
  195. package/dist/runtime/revisionPacket.js.map +1 -0
  196. package/dist/runtime/revisionTrail.d.ts +2 -0
  197. package/dist/runtime/revisionTrail.js +162 -0
  198. package/dist/runtime/revisionTrail.js.map +1 -0
  199. package/dist/runtime/role-assignment.d.ts +4 -0
  200. package/dist/runtime/role-assignment.js +21 -0
  201. package/dist/runtime/role-assignment.js.map +1 -0
  202. package/dist/runtime/roleRoster.d.ts +28 -0
  203. package/dist/runtime/roleRoster.js +96 -0
  204. package/dist/runtime/roleRoster.js.map +1 -0
  205. package/dist/runtime/runInsights.d.ts +121 -0
  206. package/dist/runtime/runInsights.js +305 -0
  207. package/dist/runtime/runInsights.js.map +1 -0
  208. package/dist/runtime/runMonitor.d.ts +33 -0
  209. package/dist/runtime/runMonitor.js +143 -0
  210. package/dist/runtime/runMonitor.js.map +1 -0
  211. package/dist/runtime/runtime.d.ts +15 -0
  212. package/dist/runtime/runtime.js +199 -0
  213. package/dist/runtime/runtime.js.map +1 -0
  214. package/dist/runtime/runtimeInfo.d.ts +9 -0
  215. package/dist/runtime/runtimeInfo.js +76 -0
  216. package/dist/runtime/runtimeInfo.js.map +1 -0
  217. package/dist/runtime/store.d.ts +4 -0
  218. package/dist/runtime/store.js +48 -0
  219. package/dist/runtime/store.js.map +1 -0
  220. package/dist/runtime/summons.d.ts +25 -0
  221. package/dist/runtime/summons.js +403 -0
  222. package/dist/runtime/summons.js.map +1 -0
  223. package/dist/runtime/teamPresets.d.ts +14 -0
  224. package/dist/runtime/teamPresets.js +153 -0
  225. package/dist/runtime/teamPresets.js.map +1 -0
  226. package/dist/runtime/types.d.ts +505 -0
  227. package/dist/runtime/types.js +28 -0
  228. package/dist/runtime/types.js.map +1 -0
  229. package/dist/runtime/validationCommands.d.ts +18 -0
  230. package/dist/runtime/validationCommands.js +106 -0
  231. package/dist/runtime/validationCommands.js.map +1 -0
  232. package/dist/tui/dashboard.d.ts +41 -0
  233. package/dist/tui/dashboard.js +1115 -0
  234. package/dist/tui/dashboard.js.map +1 -0
  235. package/docs/ARCHITECTURE.md +277 -0
  236. package/docs/CLI_SPEC.md +396 -0
  237. package/docs/CODEX_SETUP.md +288 -0
  238. package/docs/COMPLETION_CONTRACT.md +52 -0
  239. package/docs/CONTRIBUTOR_GUIDE.md +70 -0
  240. package/docs/DEMO.md +62 -0
  241. package/docs/GLOSSARY.md +46 -0
  242. package/docs/GOAL_LOOP_SCHEDULE.md +50 -0
  243. package/docs/KNOWN_LIMITATIONS.md +29 -0
  244. package/docs/LICENSING.md +21 -0
  245. package/docs/LOOP_RECIPES.md +290 -0
  246. package/docs/LOOP_SELECTION_UX.md +118 -0
  247. package/docs/MCP_SPEC.md +689 -0
  248. package/docs/MEMORY_AND_RECONCILIATION.md +222 -0
  249. package/docs/NPM_PUBLISHING.md +51 -0
  250. package/docs/OPEN_DECISIONS.md +81 -0
  251. package/docs/PROMPT_SCHEMAS.md +411 -0
  252. package/docs/PROVIDER_ADAPTERS.md +323 -0
  253. package/docs/PROVIDER_MATRIX.md +21 -0
  254. package/docs/PUBLIC_REPO_READINESS.md +49 -0
  255. package/docs/RESEARCH_NOTES.md +92 -0
  256. package/docs/ROADMAP.md +94 -0
  257. package/docs/ROLE_CONTRACTS.md +252 -0
  258. package/docs/RUNTIME_LOOP.md +240 -0
  259. package/docs/SECURITY_AND_PRIVACY.md +161 -0
  260. package/docs/TESTING_AND_VERIFICATION.md +180 -0
  261. package/docs/TRUST_MODEL.md +65 -0
  262. package/docs/decisions/0001-runtime-first-cli-and-mcp.md +23 -0
  263. package/docs/decisions/0002-provider-neutral-role-mapping.md +43 -0
  264. package/docs/decisions/0003-separate-implementation-and-verification.md +27 -0
  265. package/docs/product/README.md +14 -0
  266. package/docs/product/model-selection.md +88 -0
  267. package/docs/product/positioning.md +37 -0
  268. package/docs/product/pro-usage-modes.md +70 -0
  269. package/docs/product/roadmap.md +57 -0
  270. package/docs/product/role-policy.md +89 -0
  271. package/docs/product/runtime-invariants.md +44 -0
  272. package/docs/release/v0.1.0-preview.0.md +48 -0
  273. package/examples/stub-demo/README.md +25 -0
  274. package/package.json +55 -0
@@ -0,0 +1,222 @@
1
+ # Memory And Reconciliation
2
+
3
+ TheHood should make model chat context disposable. A provider window or API conversation can help with reasoning, but it must not be the durable memory for a project.
4
+
5
+ ## Core Principle
6
+
7
+ ```text
8
+ TheHood remembers.
9
+ Models are rehydrated from TheHood state.
10
+ ```
11
+
12
+ The runtime preserves exact state first, then builds bounded context packets from that state when a model needs to reason.
13
+
14
+ Summaries can be useful as previews, labels, or navigation aids. They are not canonical memory and must not replace source artifacts.
15
+
16
+ ## Memory Layers
17
+
18
+ ### Canonical Memory
19
+
20
+ Canonical memory is the source of truth. It must be inspectable, durable, and grounded in exact artifacts.
21
+
22
+ Examples:
23
+
24
+ - run records
25
+ - event logs
26
+ - approval events
27
+ - provider directives
28
+ - provider responses
29
+ - plans
30
+ - diffs and commits
31
+ - command logs
32
+ - validation results
33
+ - verifier verdicts
34
+ - final reports
35
+ - reconciliation outputs
36
+
37
+ Canonical memory should be local-first and append-oriented. Existing filesystem run records and artifacts are the first implementation. A later SQLite store can index these records, but it should not replace the artifacts as the source of truth.
38
+
39
+ ### Index Memory
40
+
41
+ Index memory exists to make canonical memory searchable and queryable.
42
+
43
+ Examples:
44
+
45
+ - SQLite tables
46
+ - full-text search
47
+ - embeddings
48
+ - graph indexes
49
+ - typed plan and task indexes
50
+
51
+ Index memory can be rebuilt from canonical memory. If an index disagrees with a source artifact, the artifact wins.
52
+
53
+ ### Derived Memory
54
+
55
+ Derived memory helps models retrieve relevant context efficiently.
56
+
57
+ Examples:
58
+
59
+ - retrieved excerpts
60
+ - model-generated reflections
61
+ - planner reconciliations
62
+ - temporal graphs
63
+ - vector memories
64
+ - external memory engines such as Mem0, Zep, Letta, MemVid-style systems, or future adapters
65
+
66
+ Derived memory must keep provenance:
67
+
68
+ - source artifact refs
69
+ - run id
70
+ - created timestamp
71
+ - commit or repo state when applicable
72
+ - derivation method
73
+ - supersedes or invalidates relationships when applicable
74
+
75
+ Derived memory can accelerate reasoning, but it is not an authority boundary.
76
+
77
+ ## Ontology
78
+
79
+ The runtime should preserve a stable project ontology so different models can share the same concepts even when provider sessions are reset.
80
+
81
+ Initial entities:
82
+
83
+ - `Run`
84
+ - `Plan`
85
+ - `Slice`
86
+ - `Task`
87
+ - `Agent`
88
+ - `Role`
89
+ - `Artifact`
90
+ - `Evidence`
91
+ - `Approval`
92
+ - `Commit`
93
+ - `Validation`
94
+ - `VerifierVerdict`
95
+ - `Reconciliation`
96
+ - `Decision`
97
+
98
+ Initial relationships:
99
+
100
+ - `plan_created_by`
101
+ - `task_implements_plan_item`
102
+ - `artifact_derived_from`
103
+ - `commit_satisfies_criteria`
104
+ - `validation_checks_commit`
105
+ - `verifier_reviews_evidence`
106
+ - `reconciliation_supersedes_plan_state`
107
+ - `decision_selects_next_slice`
108
+
109
+ These names should be versioned with the runtime schema. Provider prompts should use these terms instead of inventing new labels per provider.
110
+
111
+ ## Rehydration Packets
112
+
113
+ Before invoking an orchestrator, planner, verifier, critic, or memory-aware provider, TheHood should build a bounded context packet from canonical state.
114
+
115
+ The packet should include exact refs and selected exact excerpts where possible:
116
+
117
+ - current run id and parent or related run ids
118
+ - repo path and current git HEAD
119
+ - dirty state
120
+ - original user goal
121
+ - latest accepted plan state
122
+ - selected plan items and acceptance criteria
123
+ - relevant artifacts and refs
124
+ - changed files and commits
125
+ - command and validation evidence
126
+ - verifier verdicts
127
+ - open risks and unresolved questions
128
+
129
+ The packet may include compact descriptions for navigation, but every important claim should point back to an artifact, command log, commit, or event.
130
+
131
+ Provider directives should tell the model to ignore stale browser or conversation memory and reason only from TheHood-provided state.
132
+
133
+ Current provider directives include a compact `canonicalMemory` object. This is not a memory engine. It is a bounded runtime-owned index with the current run snapshot, recent run summaries, and latest artifact refs for progress packets, reconciliation, local repo context, remote repo context, provider execution, final reports, review routing, and transfer manifests. It intentionally excludes large artifact bodies so browser/API providers can be rehydrated without making ChatGPT conversation history the source of truth.
134
+
135
+ ## Repo Context Retrieval
136
+
137
+ Repo context retrieval should behave like an evidence-led repository inspection, not a one-shot dump.
138
+
139
+ The default pattern is:
140
+
141
+ ```text
142
+ repo map
143
+ targeted reads
144
+ follow-up evidence
145
+ verification
146
+ ```
147
+
148
+ The runtime should include a bounded tree, then prioritize files explicitly named by the user goal, provider decision, or source-of-truth instructions. Explicitly requested files may receive a larger per-file budget than generic files, but they still count against the total packet budget and must retain truncation metadata.
149
+
150
+ Generic high-priority files such as `README.md`, `AGENTS.md`, architecture docs, runtime contracts, and key runtime modules should fill the remaining budget after requested files.
151
+
152
+ Huge files should not silently consume the packet. When a source file is too large to include fully, the runtime preserves refs and excerpts, then allows a follow-up targeted context capture when the provider delegates concrete repo paths that were not already captured. For clean pushed GitHub repos used through ChatGPT Web, the runtime may preserve a refs-only remote context instead of local excerpts only when the active bridge GitHub connector surface is confirmed, then ask the provider to use its GitHub connector at the exact commit. Broad or duplicate follow-up delegations still stop rather than pretending the model has complete evidence.
153
+
154
+ ## Planner Reconciliation
155
+
156
+ Planner reconciliation is the missing loop after implementation.
157
+
158
+ ```text
159
+ planner creates plan
160
+ runtime stores plan
161
+ implementer builds selected slice
162
+ runtime captures evidence
163
+ verifier reviews evidence
164
+ runtime sends approved progress packet back to planner
165
+ planner reconciles plan against evidence
166
+ runtime stores reconciliation
167
+ ```
168
+
169
+ The planner should answer with small mechanical JSON fields plus markdown narrative in the role payload's `markdown` field:
170
+
171
+ - which plan items are complete
172
+ - which acceptance criteria are satisfied
173
+ - which items remain open
174
+ - whether implementation deviated from the plan
175
+ - whether the next slice should change
176
+ - whether user input is needed
177
+
178
+ Reconciliation is advisory. The runtime remains responsible for approvals, tool execution, artifact storage, verification gates, and final state.
179
+
180
+ The current runtime stores `progress` artifacts for completed runs and can reconcile them through the configured planner or orchestrator with `thehood reconcile` or `thehood_reconcile`. Browser and API providers require explicit approval before the progress packet is sent, and successful provider responses are stored as `reconciliation` artifacts. Future planning and reconciliation directives receive latest reconciliation refs through `canonicalMemory` when available.
181
+
182
+ ## Risks
183
+
184
+ ### Lossy Memory
185
+
186
+ Risk: a summary omits critical details and a model reasons from an incomplete state.
187
+
188
+ Guardrail: source artifacts remain canonical. Context packets include exact refs and excerpts instead of summary-only memory.
189
+
190
+ ### Stale Memory
191
+
192
+ Risk: a model reconciles against an old plan, old commit, or old run state.
193
+
194
+ Guardrail: packets include run ids, timestamps, git HEAD, dirty state, and supersession links.
195
+
196
+ ### Retrieval Poisoning
197
+
198
+ Risk: a semantically related memory is contextually wrong, unsafe, or obsolete.
199
+
200
+ Guardrail: retrieved memories must include provenance, source type, and validity metadata. High-impact actions still require runtime gates.
201
+
202
+ ### Provider Session Contamination
203
+
204
+ Risk: old browser context influences a new answer.
205
+
206
+ Guardrail: directives instruct browser-backed providers to ignore prior conversation and use only TheHood canonical state. ChatGPT Web bridge responses must echo the current directive acknowledgement before the runtime accepts schema-valid JSON.
207
+
208
+ ### Schema Drift
209
+
210
+ Risk: provider outputs slowly change shape.
211
+
212
+ Guardrail: all provider responses remain schema-bound and fail closed when invalid.
213
+
214
+ ## Build Direction
215
+
216
+ The first implementation should avoid a large memory engine. Build the exact loop first:
217
+
218
+ 1. Add a progress packet builder from canonical run artifacts.
219
+ 2. Add planner reconciliation as a schema-bound provider call.
220
+ 3. Store reconciliation artifacts and expose them through CLI and MCP status.
221
+ 4. Add SQLite or another local index only after the artifact contract is stable.
222
+ 5. Make advanced memory engines pluggable after canonical and index layers are proven.
@@ -0,0 +1,51 @@
1
+ # NPM Publishing
2
+
3
+ TheHood `v0.1.0-preview.0` should be published as a preview package only after the public repo, CI, and package boundary are reviewed.
4
+
5
+ Do not publish from a local machine for the public preview. Do not add npm tokens to the repository or GitHub Actions secrets. Use npm Trusted Publishing / OIDC for the tag-based workflow.
6
+
7
+ ## Before Publishing
8
+
9
+ 1. Verify the npm package name is available or owned by the project maintainer.
10
+ 2. Configure npm Trusted Publisher for the GitHub repository `lemberalla/the-hood`.
11
+ 3. Confirm `.github/workflows/publish.yml` is the trusted workflow.
12
+ 4. Confirm the workflow has `id-token: write` and does not use an npm token.
13
+ 5. Run the release gate from a clean checkout:
14
+
15
+ ```bash
16
+ npm ci
17
+ npm run release:check
18
+ ```
19
+
20
+ `npm run pack:check` uses a temporary npm cache by default so local cache ownership problems do not block package-boundary verification. If a specific cache path is required, set `THEHOOD_NPM_PACK_CACHE`:
21
+
22
+ ```bash
23
+ THEHOOD_NPM_PACK_CACHE=/private/tmp/thehood-npm-cache npm run pack:check
24
+ ```
25
+
26
+ ## First Preview Publish
27
+
28
+ Publish only from a version tag:
29
+
30
+ ```bash
31
+ git tag v0.1.0-preview.0
32
+ git push origin main --tags
33
+ ```
34
+
35
+ The workflow publishes with:
36
+
37
+ ```bash
38
+ npm publish --tag next
39
+ ```
40
+
41
+ ## Install Test
42
+
43
+ After the workflow publishes, test from a clean shell or temp directory:
44
+
45
+ ```bash
46
+ npm install -g thehood@next
47
+ thehood --help
48
+ thehood doctor --repo .
49
+ ```
50
+
51
+ Promote to `latest` only after external installs and public docs are verified.
@@ -0,0 +1,81 @@
1
+ # Open Decisions
2
+
3
+ These decisions should be resolved before or during the runtime skeleton phase.
4
+
5
+ ## License
6
+
7
+ Recommended default: Apache-2.0.
8
+
9
+ Alternatives:
10
+
11
+ - MIT for simplicity
12
+ - dual license only if there is a clear commercial strategy
13
+
14
+ ## Implementation Language
15
+
16
+ Current direction:
17
+
18
+ - TypeScript for runtime, CLI, schemas, provider adapters, and MCP
19
+ - Swift only for the eventual macOS menubar companion
20
+
21
+ ## State Store
22
+
23
+ Initial implementation:
24
+
25
+ - local filesystem JSON run records under `.thehood/runs`
26
+
27
+ Later option:
28
+
29
+ - SQLite for querying run history and UI state
30
+
31
+ ## Memory Store
32
+
33
+ Current direction:
34
+
35
+ - exact run records and artifacts are canonical
36
+ - summaries, embeddings, graphs, and provider reflections are derived memory
37
+ - derived memory must preserve source refs and be rebuildable
38
+
39
+ Open options:
40
+
41
+ - SQLite plus full-text search for the first local index
42
+ - vector index for semantic retrieval
43
+ - graph index for ontology relationships
44
+ - external or embedded memory engines after canonical artifacts and reconciliation are stable
45
+
46
+ ## Planner Reconciliation
47
+
48
+ Current direction:
49
+
50
+ - after implementation and verification, TheHood can send an approved progress packet back to the original planner or orchestrator
51
+ - the provider returns a schema-bound reconciliation result
52
+ - runtime stores the result as an artifact and uses it to inform the next slice
53
+
54
+ Open question:
55
+
56
+ - should reconciliation attach to the original plan run, create a child run, or both?
57
+
58
+ ## Remaining Provider Adapters
59
+
60
+ Current status:
61
+
62
+ 1. Codex CLI adapter is implemented through the local command runner.
63
+ 2. Claude Code adapter is implemented through the local command runner.
64
+ 3. ChatGPT Web adapter is implemented as an experimental user-authenticated bridge.
65
+ 4. OpenAI API adapter remains future work.
66
+ 5. Anthropic API adapter remains future work.
67
+ 6. Local model adapter remains future work.
68
+
69
+ ## First Runtime Validation Strategy
70
+
71
+ Start with project-discovered commands:
72
+
73
+ - package scripts
74
+ - language build files
75
+ - CI files
76
+
77
+ Avoid inventing validation commands when a repo already defines them.
78
+
79
+ ## macOS Menubar Timing
80
+
81
+ Build after the CLI and local runtime can run a complete plan/implement/verify loop.