ultra-builder-pro-cli 0.25.1 → 0.26.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 (243) hide show
  1. package/.ultra-template/changes/abandoned/.gitkeep +0 -0
  2. package/.ultra-template/contexts/TEMPLATE.md +94 -0
  3. package/.ultra-template/decisions/.gitkeep +1 -0
  4. package/.ultra-template/evidence/.gitkeep +1 -0
  5. package/.ultra-template/north-star.md +46 -0
  6. package/.ultra-template/research/.gitkeep +1 -0
  7. package/.ultra-template/specs/discovery.md +2 -2
  8. package/.ultra-template/tasks.json +3 -0
  9. package/.ultra-template/test-report.json +27 -0
  10. package/CHANGELOG.md +107 -1
  11. package/README.md +217 -579
  12. package/adapters/_shared/delegate-profiles/kimi-read-only.md +15 -0
  13. package/adapters/_shared/delegate-profiles/kimi-write.md +17 -0
  14. package/adapters/_shared/file-ops.cjs +76 -2
  15. package/adapters/_shared/host-profile.cjs +97 -0
  16. package/adapters/_shared/plugin-core.cjs +204 -0
  17. package/adapters/_shared/runtime-assets.cjs +31 -96
  18. package/adapters/claude.js +92 -291
  19. package/adapters/codex.js +309 -842
  20. package/adapters/grok.js +143 -1469
  21. package/adapters/kimi.js +124 -1053
  22. package/adapters/opencode.js +230 -742
  23. package/bin/delegate-worker.cjs +328 -0
  24. package/bin/delegate.cjs +463 -0
  25. package/bin/install.js +38 -11
  26. package/docs/ARCHITECTURE.md +125 -216
  27. package/docs/ARTIFACT-AUTHORITY.md +90 -268
  28. package/docs/DECISIONS.md +77 -87
  29. package/docs/PHILOSOPHY.md +208 -0
  30. package/docs/PLUGIN-ISOLATION-CONTRACT.md +65 -39
  31. package/docs/RUNTIME-COMPAT-MATRIX.md +140 -155
  32. package/docs/SKILL-AUTHORING.md +94 -73
  33. package/docs/WORKFLOW-LIFECYCLE.md +97 -189
  34. package/hooks/README.md +19 -37
  35. package/hooks/_common.py +113 -0
  36. package/hooks/adapters/codex.py +9 -16
  37. package/hooks/adapters/grok.py +5 -5
  38. package/hooks/adapters/kimi.py +8 -14
  39. package/hooks/block_dangerous_commands.py +201 -0
  40. package/hooks/compact_context.py +65 -0
  41. package/hooks/mid_workflow_recall.py +25 -0
  42. package/hooks/post_edit_guard.py +105 -0
  43. package/hooks/session_context.py +30 -0
  44. package/package.json +17 -52
  45. package/skills/ultra-change/SKILL.md +115 -50
  46. package/skills/ultra-change/references/change-contract.md +68 -3
  47. package/skills/ultra-delegate/SKILL.md +89 -0
  48. package/skills/ultra-delegate/references/delegation-contract.md +59 -0
  49. package/skills/ultra-delegate/scripts/delegate_wait.py +86 -0
  50. package/skills/ultra-deliver/SKILL.md +98 -42
  51. package/skills/ultra-deliver/references/baseline-reconciliation.md +39 -20
  52. package/skills/ultra-dev/SKILL.md +115 -62
  53. package/skills/ultra-dev/references/debugging.md +22 -0
  54. package/skills/ultra-domain-modeling/SKILL.md +79 -0
  55. package/skills/ultra-grilling/SKILL.md +118 -0
  56. package/skills/ultra-grilling/references/reframing.md +72 -0
  57. package/skills/ultra-init/SKILL.md +102 -37
  58. package/skills/ultra-init/references/brownfield-adoption.md +33 -83
  59. package/skills/ultra-init/scripts/init_project.cjs +84 -0
  60. package/skills/ultra-plan/SKILL.md +101 -68
  61. package/skills/ultra-research/SKILL.md +68 -48
  62. package/skills/ultra-research/references/00-problem-validation.md +5 -5
  63. package/skills/ultra-research/references/01-opportunity-discovery.md +3 -3
  64. package/skills/ultra-research/references/02-market-assessment.md +5 -4
  65. package/skills/ultra-research/references/03-competitive-landscape.md +3 -3
  66. package/skills/ultra-research/references/04-product-strategy.md +3 -3
  67. package/skills/ultra-research/references/05-assumptions-validation.md +5 -5
  68. package/skills/ultra-research/references/10-user-personas.md +3 -2
  69. package/skills/ultra-research/references/11-user-scenarios.md +3 -3
  70. package/skills/ultra-research/references/20-user-stories.md +4 -3
  71. package/skills/ultra-research/references/21-features-scope.md +3 -2
  72. package/skills/ultra-research/references/22-success-metrics.md +3 -3
  73. package/skills/ultra-research/references/30-architecture-context.md +3 -3
  74. package/skills/ultra-research/references/31-solution-strategy.md +3 -3
  75. package/skills/ultra-research/references/32-building-blocks.md +3 -3
  76. package/skills/ultra-research/references/40-deployment.md +3 -3
  77. package/skills/ultra-research/references/41-quality-risks.md +3 -3
  78. package/skills/ultra-research/references/99-synthesis.md +7 -7
  79. package/skills/ultra-review/SKILL.md +84 -32
  80. package/skills/ultra-review/references/code.md +17 -0
  81. package/skills/ultra-review/references/comments.md +12 -0
  82. package/skills/ultra-review/references/design.md +12 -0
  83. package/skills/ultra-review/references/errors.md +13 -0
  84. package/skills/ultra-review/references/spec.md +13 -0
  85. package/skills/ultra-review/references/tests.md +12 -0
  86. package/skills/ultra-review/references/worker-packet.md +40 -0
  87. package/skills/ultra-review/scripts/review_wait.py +26 -15
  88. package/skills/ultra-status/SKILL.md +61 -36
  89. package/skills/ultra-tdd/SKILL.md +81 -0
  90. package/skills/ultra-tdd/references/templates/README.md +20 -0
  91. package/skills/ultra-tdd/references/templates/feature-flag-default-audit.sh +79 -0
  92. package/skills/ultra-tdd/references/templates/persistence-real.ts +78 -0
  93. package/skills/ultra-tdd/references/templates/testcontainer-postgres.py +78 -0
  94. package/skills/ultra-tdd/references/templates/testcontainer-postgres.ts +73 -0
  95. package/skills/ultra-tdd/references/templates/vertical-slice.ts +66 -0
  96. package/skills/ultra-tdd/references/test-execution.md +18 -0
  97. package/skills/ultra-test/SKILL.md +75 -30
  98. package/skills/ultra-test/references/export-syntax.md +18 -0
  99. package/skills/ultra-test/scripts/worktree_digest.cjs +54 -0
  100. package/skills/ultra-think/SKILL.md +49 -27
  101. package/skills/ultra-think/references/autonomy-boundary.md +48 -0
  102. package/skills/ultra-think/references/interaction-boundary.md +18 -33
  103. package/.ultra-template/docs/research/README.md +0 -55
  104. package/.ultra-template/reports/templates/delivery-report.json +0 -17
  105. package/.ultra-template/reports/templates/test-report.json +0 -18
  106. package/.ultra-template/tasks/tasks.json +0 -15
  107. package/.ultra-template/templates/task-context.md +0 -19
  108. package/adapters/_shared/codex-assets.cjs +0 -725
  109. package/adapters/_shared/codex-ultra-tools-entry.cjs +0 -11
  110. package/adapters/_shared/interaction-contract.cjs +0 -129
  111. package/adapters/_shared/path-rewrite.cjs +0 -79
  112. package/adapters/_shared/runtime-native.cjs +0 -132
  113. package/adapters/_shared/settings-merge.cjs +0 -76
  114. package/agents/code-reviewer.md +0 -42
  115. package/agents/debugger.md +0 -40
  116. package/agents/review-code.md +0 -49
  117. package/agents/review-comments.md +0 -38
  118. package/agents/review-coordinator.md +0 -56
  119. package/agents/review-design.md +0 -40
  120. package/agents/review-errors.md +0 -43
  121. package/agents/review-spec.md +0 -39
  122. package/agents/review-tests.md +0 -40
  123. package/agents/tdd-runner.md +0 -38
  124. package/bin/orchestrator.js +0 -383
  125. package/commands/ultra-change.md +0 -10
  126. package/commands/ultra-deliver.md +0 -10
  127. package/commands/ultra-dev.md +0 -10
  128. package/commands/ultra-doctor.md +0 -10
  129. package/commands/ultra-init.md +0 -10
  130. package/commands/ultra-plan.md +0 -10
  131. package/commands/ultra-research.md +0 -10
  132. package/commands/ultra-review.md +0 -10
  133. package/commands/ultra-status.md +0 -10
  134. package/commands/ultra-test.md +0 -10
  135. package/commands/ultra-think.md +0 -10
  136. package/docs/AGENT-CONTEXT.md +0 -191
  137. package/docs/COMMIT-HASH-BACKFILL.md +0 -51
  138. package/docs/LEGACY-CLI-CROSSWALK.md +0 -175
  139. package/docs/ROADMAP.md +0 -101
  140. package/docs/STATE-DB-ACCESS-POLICY.md +0 -161
  141. package/hooks/active_task_context.py +0 -152
  142. package/hooks/context_envelope.py +0 -100
  143. package/hooks/health_check.py +0 -196
  144. package/hooks/pre_stop_check.py +0 -66
  145. package/hooks/runtime_paths.py +0 -396
  146. package/hooks/subagent_tracker.py +0 -88
  147. package/hooks/workflow_checkpoint.py +0 -76
  148. package/hooks/workflow_context.py +0 -48
  149. package/hooks/workflow_resume.py +0 -84
  150. package/mcp-server/hook-context.cjs +0 -38
  151. package/mcp-server/hook-event.cjs +0 -34
  152. package/mcp-server/lib/archive-journal.cjs +0 -1119
  153. package/mcp-server/lib/archive-mutation-worker.py +0 -365
  154. package/mcp-server/lib/artifact-registry.cjs +0 -1232
  155. package/mcp-server/lib/baseline-workflow.cjs +0 -1193
  156. package/mcp-server/lib/canonical-json.cjs +0 -19
  157. package/mcp-server/lib/change-authority.cjs +0 -26
  158. package/mcp-server/lib/change-packet.cjs +0 -790
  159. package/mcp-server/lib/change-workflow.cjs +0 -65
  160. package/mcp-server/lib/context-envelope.cjs +0 -581
  161. package/mcp-server/lib/context-paths.cjs +0 -142
  162. package/mcp-server/lib/decision-records.cjs +0 -423
  163. package/mcp-server/lib/delivery-transaction.cjs +0 -471
  164. package/mcp-server/lib/doctor-backup-worker.cjs +0 -328
  165. package/mcp-server/lib/doctor.cjs +0 -627
  166. package/mcp-server/lib/git-bootstrap.cjs +0 -651
  167. package/mcp-server/lib/init-project.cjs +0 -1021
  168. package/mcp-server/lib/kernel-change-workflow.cjs +0 -2029
  169. package/mcp-server/lib/legacy-change-workflow.cjs +0 -3032
  170. package/mcp-server/lib/managed-file-write.cjs +0 -172
  171. package/mcp-server/lib/plan-checkpoint.cjs +0 -177
  172. package/mcp-server/lib/plan-publication-worker.cjs +0 -830
  173. package/mcp-server/lib/plan-store.cjs +0 -794
  174. package/mcp-server/lib/prd-parser.cjs +0 -83
  175. package/mcp-server/lib/pricing.cjs +0 -44
  176. package/mcp-server/lib/project-context.cjs +0 -178
  177. package/mcp-server/lib/projector.cjs +0 -386
  178. package/mcp-server/lib/provider-refs.cjs +0 -42
  179. package/mcp-server/lib/runtime-paths.cjs +0 -1714
  180. package/mcp-server/lib/runtime-state.cjs +0 -222
  181. package/mcp-server/lib/safe-project-file.cjs +0 -385
  182. package/mcp-server/lib/stage-checkpoints.cjs +0 -463
  183. package/mcp-server/lib/state-authority.cjs +0 -95
  184. package/mcp-server/lib/state-db.cjs +0 -1580
  185. package/mcp-server/lib/state-ops.cjs +0 -1428
  186. package/mcp-server/lib/task-contract.cjs +0 -404
  187. package/mcp-server/lib/task-expander.cjs +0 -105
  188. package/mcp-server/lib/task-ledger.cjs +0 -1964
  189. package/mcp-server/lib/telemetry.cjs +0 -85
  190. package/mcp-server/lib/topo.cjs +0 -131
  191. package/mcp-server/lib/ultra-facade.cjs +0 -2684
  192. package/mcp-server/lib/worker-packet.cjs +0 -358
  193. package/mcp-server/server.cjs +0 -437
  194. package/orchestrator/auto-merge.cjs +0 -128
  195. package/orchestrator/daemon.cjs +0 -264
  196. package/orchestrator/dispatch-rules.cjs +0 -78
  197. package/orchestrator/parallel-orchestrator.cjs +0 -903
  198. package/orchestrator/planner/plan-builder.cjs +0 -125
  199. package/orchestrator/recovery.cjs +0 -188
  200. package/orchestrator/session-close-journal-worker.cjs +0 -5
  201. package/orchestrator/session-close-journal.cjs +0 -1014
  202. package/orchestrator/session-runner.cjs +0 -1153
  203. package/orchestrator/worktree-manager.cjs +0 -282
  204. package/settings.json +0 -7
  205. package/skills/cc-collab/SKILL.md +0 -42
  206. package/skills/code-review-expert/SKILL.md +0 -43
  207. package/skills/code-review-expert/references/correctness-reliability.md +0 -30
  208. package/skills/code-review-expert/references/design-boundaries.md +0 -26
  209. package/skills/code-review-expert/references/removal-plan.md +0 -24
  210. package/skills/codex-collab/SKILL.md +0 -49
  211. package/skills/codex-collab/evals/evals.json +0 -35
  212. package/skills/integration-rules/SKILL.md +0 -32
  213. package/skills/security-rules/SKILL.md +0 -38
  214. package/skills/testing-rules/SKILL.md +0 -32
  215. package/skills/ultra-doctor/SKILL.md +0 -41
  216. package/skills/ultra-plan/references/semantic-preflight.md +0 -20
  217. package/skills/ultra-verify/SKILL.md +0 -46
  218. package/skills/ultra-verify/evals/evals.json +0 -46
  219. package/skills/ultra-verify/references/cross-verify-modes.md +0 -28
  220. package/skills/ultra-verify/references/evidence-status.md +0 -21
  221. package/skills/ultra-verify/scripts/verify_wait.py +0 -94
  222. package/spec/cli-protocol.md +0 -102
  223. package/spec/mcp-tools.yaml +0 -312
  224. package/spec/schemas/baseline-reconciliation.v1.schema.json +0 -73
  225. package/spec/schemas/change-delta.v1.schema.json +0 -153
  226. package/spec/schemas/command-manifest.schema.json +0 -29
  227. package/spec/schemas/context-file.v4.5.schema.json +0 -54
  228. package/spec/schemas/delivery-report.v1.schema.json +0 -66
  229. package/spec/schemas/documentation-reconciliation.v1.schema.json +0 -106
  230. package/spec/schemas/mcp-tools.schema.json +0 -136
  231. package/spec/schemas/skill-manifest.schema.json +0 -24
  232. package/spec/schemas/state-db.sql +0 -641
  233. package/spec/schemas/task-ledger.v2.schema.json +0 -296
  234. package/spec/schemas/tasks.v4.5.schema.json +0 -96
  235. package/spec/schemas/test-report.v1.schema.json +0 -225
  236. package/ultra-tools/cli.cjs +0 -129
  237. package/ultra-tools/commands/db.cjs +0 -226
  238. package/ultra-tools/commands/legacy-memory.cjs +0 -159
  239. package/ultra-tools/commands/migrate.cjs +0 -1386
  240. package/ultra-tools/commands/session.cjs +0 -213
  241. package/ultra-tools/commands/status.cjs +0 -559
  242. package/ultra-tools/commands/system.cjs +0 -498
  243. package/ultra-tools/commands/task.cjs +0 -105
@@ -0,0 +1,208 @@
1
+ # Ultra Builder PHILOSOPHY (v0.26)
2
+
3
+ **Authority**: This document defines the harness design philosophy. Every hook, Skill, template,
4
+ and CLI behavior must be justifiable by these principles. Conflicts → cite the principle, not the
5
+ rule.
6
+
7
+ **Provenance**: Goals 1–4 and Commandments C1–C5 are carried forward unchanged in substance from
8
+ Ultra Builder Pro v7.0, where they were derived from a 2026-04-30 system audit of real failures.
9
+ Do not weaken any of them without a reproduced failure case.
10
+
11
+ **Why exactly four goals and five commandments** — the counts are not sacred, the derivation
12
+ rules are:
13
+
14
+ - A **goal** is a class of systemic failure that has actually recurred, stated positively.
15
+ A fifth goal requires naming a fifth recurring failure class that none of these four covers.
16
+ - A **commandment** is a rule the model must cite to resolve a semantic conflict. If the model
17
+ will never face a moment where it needs to invoke the rule, the rule is not a commandment —
18
+ it is either a code invariant (enforce and test it) or dead weight (delete it).
19
+
20
+ By that second rule, "stay silent in repositories that never opted in" is **not** a commandment:
21
+ it is `if not exists('.ultra'): exit(0)`, a mechanical invariant the model never reasons about.
22
+ It lives in `docs/PLUGIN-ISOLATION-CONTRACT.md` and is verified by test, not by citation.
23
+
24
+ ---
25
+
26
+ ## 4 Core Goals
27
+
28
+ The harness exists to serve these — every constraint derives its legitimacy from contributing to
29
+ one or more.
30
+
31
+ 1. **Intent Fidelity** — what the user said they wanted is what gets built. No silent
32
+ reinterpretation, no scope creep, no convenient shortcuts that drift from the original ask.
33
+ 2. **Long-term Evolvability** — iteration #5 is as easy as iteration #1. Cognitive debt cannot
34
+ accumulate; spec / task / code / doc must stay coherent.
35
+ 3. **Production-Ready** — real persistence, real tests, real integration. No in-memory facades,
36
+ no `default off` to dodge integration, no `it.skip` to dodge failures.
37
+ 4. **Cognitive Coherence** — agent and user share the same picture of "what is currently true."
38
+ Spec changes propagate. Doc rot is detected. Orphan code surfaces.
39
+
40
+ ---
41
+
42
+ ## 5 Commandments
43
+
44
+ ### C1 — Goal-Always-Present
45
+
46
+ The agent never stops seeing the north-star. Every hook trigger that costs context budget injects:
47
+ the project one-liner plus the current task's acceptance criteria. The cost of repetition is
48
+ always less than the cost of drift.
49
+
50
+ > **Test**: pick a random in-progress task, ask the agent "what's the acceptance criteria?" — if
51
+ > it cannot answer in one sentence, this commandment is broken.
52
+
53
+ ### C2 — Enabling > Defensive
54
+
55
+ Every prohibition ships with a runnable alternative. Prohibitions without an enabling path force
56
+ agents to find loopholes (rename `mock` to `stub`, etc.). The cheaper path must be the right path.
57
+
58
+ > **Test**: scan every prohibition in every Skill; each must reference a template that exists
59
+ > under that Skill's `references/templates/` and can be copied as-is. The templates are rules,
60
+ > so they ship with the package rather than being copied into each project.
61
+
62
+ ### C3 — Sensors not Blockers
63
+
64
+ Hooks emit signal; agents and users decide. Block only the **truly irreversible or
65
+ privileged destructive** effects for which the hook has an exact repair:
66
+
67
+ - Funds transfer / on-chain transactions
68
+ - Protected-branch history rewrite or deletion
69
+ - `DROP` / `TRUNCATE`
70
+ - Hardcoded secret commit
71
+ - Arbitrary code execution driven by user input
72
+
73
+ Additive protected-branch publication and database migrations are advisory: the former
74
+ remains recoverable through Git and the portable hook cannot receive every host's
75
+ trusted approval receipt; the latter is not mechanically classifiable as reversible or
76
+ irreversible. The work stands, the signal is delivered, and the agent proceeds inside
77
+ the owner's authorized frame.
78
+
79
+ > **Why this is absolute**: hard final gates and hard pre-commit gates each produced the same
80
+ > over-correction loop in v7 — the agent weakened tests to escape the gate and drifted from the
81
+ > spec. A gate that can be escaped by damaging the work is worse than no gate.
82
+
83
+ > **Test**: count blocking outputs across all hooks; they must map 1:1 to the irreversible list.
84
+
85
+ ### C4 — Incremental Validation
86
+
87
+ The agent always knows "how far from done." Each edit updates `.ultra/progress/<task-id>.json`
88
+ with evidence completeness across six dimensions. Final-gate audits are forbidden — if a gap
89
+ matters at the end, it matters mid-flight.
90
+
91
+ > **Scoped exception**: whole-system wiring audit (`ultra-test`) is necessarily terminal, because
92
+ > "this export has no non-test importer" cannot be evaluated while later tasks are still pending.
93
+ > It is a terminal **sensor**, never a gate: it reports and hands the trade-off to the owner.
94
+ > This is the only permitted end-of-flow audit.
95
+
96
+ > **Test**: at any point in a task, reading `.ultra/progress/<task-id>.json` answers "what's left."
97
+
98
+ ### C5 — Bounded Autonomy
99
+
100
+ Autonomy is defined by goals, not rules. Inside the boundary the agent picks freely; crossing the
101
+ boundary surfaces to the user.
102
+
103
+ - **Inside**: choosing libraries, naming, file layout, internal abstractions, decomposition
104
+ strategy, evidence interpretation, prioritization, final expression
105
+ - **Crossing**: weakening test assertions, modifying spec to match implementation, default-off
106
+ feature flags, in-memory replacing real persistence, scope reduction, external or irreversible
107
+ effects
108
+
109
+ **Which decisions reach the owner.** Inside/Crossing above sorts actions. Read from the owner's
110
+ side, the same boundary sorts decisions into three:
111
+
112
+ | Type | Definition | Handling |
113
+ |---|---|---|
114
+ | taste | no objectively correct answer; only the owner's preference settles it | always ask |
115
+ | crossing | objectively decidable, but the consequence is irreversible | always ask |
116
+ | everything else | has an objective answer, or is cheap to reverse | decide and proceed; asking is the error |
117
+
118
+ How much lands in the third row is a function of how sharp the north star is. With constraints
119
+ that can veto a concrete decision, most execution-time questions are answered by reading them.
120
+ With vague ones, "does this cross a boundary?" cannot be decided at all, so every question
121
+ degrades into taste and reaches the owner. **Interrupt frequency measures the north star, not
122
+ the work.** Frequent interruptions mean going back to sharpen constraints, not asking faster.
123
+
124
+ **Boundaries grow; they do not change.** Adding a hard constraint or a non-goal mid-flight is
125
+ routine and needs no permission — the frame got sharper and no prior promise broke. Editing or
126
+ deleting one is a REDUCTION under the test below. This is what makes iteration five cheaper than
127
+ iteration one: the frame accumulates, and the share of decisions the model settles alone rises
128
+ with it.
129
+
130
+ **Operational test for spec changes.** When implementation and spec disagree, classify the change
131
+ before touching the spec. Do not classify by intent — classify by asking one question that can be
132
+ checked against the file:
133
+
134
+ > **Does every commitment the spec already made still hold after this change?**
135
+
136
+ | Answer | Classification | Action |
137
+ |---|---|---|
138
+ | Yes, and it now commits to more | EXPANSION | write it, log it |
139
+ | Yes, the commitment is unchanged but stated correctly | CORRECTION | write it, log it |
140
+ | **No — at least one prior commitment no longer holds** | **REDUCTION** | **stop and ask the owner** |
141
+
142
+ The classification follows from the outcome, never from the reason. A well-argued rationale does
143
+ not convert a REDUCTION into a CORRECTION; the rationale goes into the question put to the owner.
144
+ This is the mechanism by which specs shrink silently, so it is the one place the model must not
145
+ be allowed to self-certify.
146
+
147
+ **Not to be confused with Planning Posture.** A Change's `## Planning Posture` uses
148
+ EXPAND / SELECTIVE / HOLD / REDUCE to say how much work to plan right now. That is a scope
149
+ decision about the future and is freely reversible. The classification above is about the past:
150
+ whether a promise already made still holds. `REDUCE` the plan is routine; a `REDUCTION` of
151
+ commitments stops the work and goes to the owner.
152
+
153
+ > **Test**: any boundary-crossing action must trigger an owner question, an active task
154
+ > `## Change Log` entry, or an accepted `.ultra/decisions/<id>.md`.
155
+
156
+ ---
157
+
158
+ ## When commandments conflict
159
+
160
+ Goals override commandments. Commandments override rules. Cite the higher level:
161
+
162
+ - `C2 overrides rule "no mock" → use the testcontainer template`
163
+ - `goal Intent-Fidelity overrides C5 → ask the owner before reducing scope`
164
+
165
+ ---
166
+
167
+ ## Modifying this file
168
+
169
+ Changes to PHILOSOPHY require:
170
+
171
+ 1. A concrete failure case the change addresses, linked in the active Change or evidence
172
+ 2. An impact assessment on every dependent hook and Skill
173
+ 3. Migration of any dependent constraint
174
+
175
+ PHILOSOPHY is the only file whose changes propagate to every prohibition, template reference, and
176
+ Skill instruction. Do not touch it casually.
177
+
178
+ ---
179
+
180
+ ## Contract Table
181
+
182
+ > Each row is a hardcoded contract between two parts of the system. Changing one side **without**
183
+ > the other was the v7 audit's #1 cause of silently broken Goal-Always-Present injection. Update
184
+ > this table BEFORE editing either side.
185
+
186
+ | Consumer | Reads | Source of truth | Failure mode if drifted |
187
+ |---|---|---|---|
188
+ | `session_context` | headings `## One-line`, `## Hard Constraints` | `.ultra-template/north-star.md` | SessionStart shows no goal; C1 dies |
189
+ | `session_context` | active `in_progress` task → its context | `tasks.json[].context_file` | acceptance criteria never surfaced |
190
+ | `mid_workflow_recall` | heading `## Acceptance Criteria` | `.ultra-template/contexts/TEMPLATE.md` | hook injects nothing; C1 dies silently |
191
+ | `ultra-tdd` | path `references/templates/*` | `skills/ultra-tdd/references/templates/` | guidance points at a missing runnable alternative; C2 dies |
192
+ | `post_edit_guard` | writes `.ultra/progress/<task-id>.json` | `tasks.json[].id`, created on demand | mechanical observations disappear; C4 weakens |
193
+ | `ultra-dev` and `post_edit_guard` | 6 keys: `tests_written`, `tests_passed`, `persistence_real`, `feature_flags_audit`, `vertical_slice`, `spec_trace` | the six-dimension table in `skills/ultra-dev/SKILL.md` | sensor and workflow report different evidence |
194
+ | planning and status | marker `[NEEDS CLARIFICATION]` | `.ultra-template/specs/*.md` | unresolved product truth is hidden |
195
+ | `ultra-plan` / `ultra-dev` / hooks | `trace_to` form `.ultra/specs/file.md#anchor` | `tasks.json[].trace_to` + GFM heading slugify | traces appear resolved when their heading is absent |
196
+ | `ultra-deliver` / `ultra-status` | field `git_commit` | `.ultra/test-report.json` | stale test results pass as current |
197
+ | `compact_context` | `.ultra/.runtime/compact-snapshot.md` | derived from canonical files and Git | compact recovery loses acceleration, not authority |
198
+ | every hook | existence of `.ultra/` | the project directory | Ultra taxes projects that never opted in (see `docs/PLUGIN-ISOLATION-CONTRACT.md`) |
199
+ | `ultra-init` | the project data skeleton | `.ultra-template/` and the exact file list in its Skill | later Skills read missing authority paths; C1 dies |
200
+
201
+ ### Maintenance protocol
202
+
203
+ Before editing any row's source of truth:
204
+
205
+ 1. Find every consumer in this table
206
+ 2. Update consumer and source together in one change
207
+ 3. Re-run the end-to-end injection check
208
+ 4. Update this table if the contract surface changed
@@ -1,59 +1,85 @@
1
- # Plugin Isolation Contract
1
+ # Plugin isolation contract
2
2
 
3
- Ultra Builder Pro is an explicitly invoked, removable workflow plugin. Installation
4
- must not change a user's durable engineering policy or initialize any repository.
3
+ Ultra Builder Pro owns a narrow install surface and becomes active only in a project
4
+ that contains `.ultra/` or when the owner explicitly invokes an Ultra Skill.
5
5
 
6
6
  ## Owned surfaces
7
7
 
8
- An adapter may write only:
8
+ Per host, Ultra may install:
9
9
 
10
- - the host's plugin-owned command, skill, worker, hook, and runtime directories;
11
- - the host registry or manifest entries required to load those assets;
12
- - the plugin's own provenance and managed-file markers.
10
+ - exactly fourteen managed Skills;
11
+ - exactly five hook scripts plus `_common.py` and any required wire adapter;
12
+ - one native plugin manifest or entrypoint;
13
+ - provenance and managed-ownership markers;
14
+ - the host's native registry entry where required.
13
15
 
14
- The first command allowed to create project authority is `ultra-init`. Once invoked,
15
- Ultra owns only the repository-local `.ultra/` workflow-memory envelope and its
16
- MCP-published checkpoint plus generated local projections.
16
+ The package also owns `ubp delegate run`, its worker, and rule-side Skill references.
17
17
 
18
18
  ## Surfaces Ultra does not own
19
19
 
20
- Install, update, doctor, and uninstall must not create, rewrite, trim, merge, or delete:
20
+ Ultra must not create or rewrite:
21
21
 
22
- - user-level `CLAUDE.md`, `AGENTS.md`, or equivalent instruction files;
23
- - repository-level instruction files;
24
- - project source, Git history, remotes, or `.ultra/` data;
25
- - general memory or code-graph provider data.
22
+ - global user instruction files such as `~/.codex/AGENTS.md` or
23
+ `~/.claude/CLAUDE.md`;
24
+ - general memory, code-graph, browser, deployment, framework, or productivity assets;
25
+ - user-defined commands, agents, plugins, hooks, or registry entries;
26
+ - repository files outside `.ultra/` and `CONTEXT.md` unless the selected engineering
27
+ task itself authorizes them;
28
+ - an Ultra database, server registration, semantic runtime, or daemon.
26
29
 
27
- Existing Ultra marker blocks in a user handbook are legacy user content after this
28
- contract takes effect. They are not silently removed because the plugin cannot prove
29
- ownership or preserve unrelated edits. The owner may review and remove them separately.
30
+ ## Installation lifecycle
30
31
 
31
- ## Activation
32
+ Install builds a complete staging tree, marks it managed, writes provenance, then
33
+ atomically publishes it. An existing unmanaged target is never overwritten. Reinstall
34
+ replaces only the managed tree. Doctor is read-only. Uninstall removes only assets
35
+ whose ownership can be proven.
36
+
37
+ Host-owned sidecars must resolve from the same isolation root as `--config-dir`. For
38
+ Codex this includes both `plugins/ultra-builder-pro` and
39
+ `.agents/plugins/marketplace.json`; sandbox installation must not touch the real home
40
+ directory. Codex native registration runs with both `HOME` and `CODEX_HOME` set to that
41
+ root. If registration fails, install restores the previous managed tree and marketplace,
42
+ or removes every fresh partial artifact.
32
43
 
33
- Public Ultra workflows run only after an explicit user command or Skill invocation.
34
- Completion of one workflow may return current Context diagnostics and a host-model
35
- recommendation, but it must not start another public workflow. SQLite does not choose
36
- or authorize that recommendation.
44
+ When one invocation selects multiple hosts, the supplied path is a parent isolation
45
+ root and each adapter receives `<path>/<runtime>`. Sharing one concrete config directory
46
+ would collide host-native `skills/` and `plugins/` layouts.
37
47
 
38
- Host adapters prevent implicit model activation with the strongest native mechanism:
48
+ OpenCode installation may remove a specifically recognizable Ultra registration from
49
+ an older release. It must preserve unrelated configuration and files.
39
50
 
40
- - Claude Code and Kimi Code mark public workflow Skills as model-disabled;
41
- - Codex marks workflow metadata as implicit-invocation-disabled;
42
- - OpenCode exposes public workflows through commands backed by private plugin assets,
43
- not through the model-discoverable skill catalog.
44
- - Grok Build uses explicit plugin Skills/commands and makes Skill-entry
45
- `ultra.context` authoritative when a Hook output channel is not consumed.
51
+ Before first install, each adapter records only the exact config files and directory
52
+ shells that do not yet exist. Uninstall may prune those recorded paths only when they
53
+ are still empty (or a zero-byte host-created file); it preserves every pre-existing,
54
+ non-empty, modified, symlinked, or unowned path. Codex marketplace and Kimi registry
55
+ files additionally remember whether Ultra created the registry itself, so an empty
56
+ registry that existed before installation is retained.
57
+
58
+ ## Activation
46
59
 
47
- Internal review-rule skills remain available only to their bounded workers.
60
+ Owner-invoked Skills activate only through the host's explicit Skill surface.
61
+ Model-invoked Skills may be selected by the host model only as methods inside the
62
+ current authorized task. Hooks activate only through host lifecycle registrations.
63
+
64
+ One public Skill may recommend another but never launches it. Installation does not
65
+ create project authority or start background work.
48
66
 
49
67
  ## Idle behavior
50
68
 
51
- Outside a repository containing `.ultra/.runtime/state.db`, all Ultra Hooks are silent.
52
- Inside an initialized repository, a Hook may inject one bounded Context Envelope when
53
- the host consumes that channel. The sole idle-time enforcement is protection against
54
- direct writes to the MCP-owned team checkpoint or generated Ultra projections; the DB
55
- remains checkout-local operational authority. Semantic incompleteness is advisory.
69
+ Every hook resolves the current project and checks for `.ultra/` before reading,
70
+ writing, injecting context, or denying an effect. Without `.ultra/`, it emits no stdout,
71
+ exits zero, and leaves the project untouched.
72
+
73
+ The only hook denial is a named destructive shell effect in an active Ultra project.
74
+ The denial identifies the protected effect and supplies an exact-command SHA-256
75
+ authorization path. Additive protected-branch publication is an advisory observation
76
+ because a portable hook cannot consume every host's trusted owner-approval receipt;
77
+ history rewrites and branch deletion remain guarded. All other hook failures are
78
+ fail-open diagnostics.
79
+
80
+ ## Project data boundary
56
81
 
57
- Installation tests preserve byte-for-byte snapshots of all supported user handbook
58
- paths. Runtime tests cover explicit activation, idle silence, active recovery, and
59
- projection protection.
82
+ Canonical project data is owner-readable and Git-compatible. Derived hook, review, and
83
+ delegation artifacts live only under ignored `.ultra/.runtime/`, `.ultra/progress/`, or
84
+ `.ultra/reviews/`. Disabling or uninstalling Ultra leaves canonical project data intact
85
+ and resumable by ordinary file reading.