ultra-builder-pro-cli 0.26.1 → 3.0.2

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 (75) hide show
  1. package/.ultra-template/contexts/TEMPLATE.md +64 -29
  2. package/.ultra-template/north-star.md +36 -30
  3. package/.ultra-template/project-brief.md +28 -0
  4. package/.ultra-template/specs/product.md +4 -0
  5. package/.ultra-template/specs/research-distillate.md +8 -0
  6. package/.ultra-template/tasks.json +1 -0
  7. package/.ultra-template/test-report.json +18 -1
  8. package/CHANGELOG.md +227 -1
  9. package/README.md +161 -59
  10. package/adapters/_shared/host-profile.cjs +68 -12
  11. package/adapters/_shared/plugin-core.cjs +4 -5
  12. package/adapters/_shared/runtime-assets.cjs +11 -2
  13. package/adapters/zcode.js +375 -0
  14. package/bin/delegate-worker.cjs +20 -0
  15. package/bin/delegate.cjs +94 -25
  16. package/bin/install.js +11 -6
  17. package/docs/ARCHITECTURE.md +109 -25
  18. package/docs/ARTIFACT-AUTHORITY.md +204 -30
  19. package/docs/DECISIONS.md +141 -10
  20. package/docs/PHILOSOPHY.md +61 -8
  21. package/docs/PLUGIN-ISOLATION-CONTRACT.md +6 -0
  22. package/docs/RUNTIME-COMPAT-MATRIX.md +106 -13
  23. package/docs/SKILL-AUTHORING.md +14 -9
  24. package/docs/WORKFLOW-LIFECYCLE.md +211 -53
  25. package/docs/evals/adversarial-review-2026-08-14.md +84 -0
  26. package/docs/evals/zcode-automation-2026-08-14.md +103 -0
  27. package/hooks/README.md +31 -3
  28. package/hooks/_common.py +1699 -33
  29. package/hooks/adapters/zcode.py +227 -0
  30. package/hooks/compact_context.py +176 -17
  31. package/hooks/mid_workflow_recall.py +27 -5
  32. package/hooks/post_edit_guard.py +133 -23
  33. package/hooks/session_context.py +722 -11
  34. package/package.json +6 -3
  35. package/skills/ultra-change/SKILL.md +84 -64
  36. package/skills/ultra-change/references/change-contract.md +130 -32
  37. package/skills/ultra-change/references/execution-grant.md +109 -0
  38. package/skills/ultra-change/references/primary-transfer.md +273 -0
  39. package/skills/ultra-change/scripts/validate_primary_transfer.cjs +1928 -0
  40. package/skills/ultra-delegate/SKILL.md +38 -5
  41. package/skills/ultra-delegate/references/delegation-contract.md +21 -1
  42. package/skills/ultra-deliver/SKILL.md +123 -44
  43. package/skills/ultra-deliver/references/baseline-reconciliation.md +5 -3
  44. package/skills/ultra-dev/SKILL.md +173 -43
  45. package/skills/ultra-grilling/SKILL.md +19 -16
  46. package/skills/ultra-grilling/references/reframing.md +7 -3
  47. package/skills/ultra-init/SKILL.md +99 -87
  48. package/skills/ultra-init/references/brownfield-adoption.md +23 -40
  49. package/skills/ultra-init/scripts/init_project.cjs +968 -21
  50. package/skills/ultra-plan/SKILL.md +83 -46
  51. package/skills/ultra-plan/references/task-evidence-v2.md +300 -0
  52. package/skills/ultra-plan/scripts/validate_task_evidence.cjs +859 -0
  53. package/skills/ultra-research/SKILL.md +119 -68
  54. package/skills/ultra-research/references/{03-competitive-landscape.md → 03-alternatives.md} +6 -6
  55. package/skills/ultra-research/references/04-product-strategy.md +11 -2
  56. package/skills/ultra-research/references/21-features-scope.md +8 -0
  57. package/skills/ultra-research/references/22-success-metrics.md +9 -4
  58. package/skills/ultra-research/references/99-synthesis.md +25 -1
  59. package/skills/ultra-research/references/north-star-v2.md +168 -0
  60. package/skills/ultra-research/references/wayfinding.md +50 -0
  61. package/skills/ultra-research/scripts/validate_north_star.cjs +1174 -0
  62. package/skills/ultra-review/SKILL.md +201 -24
  63. package/skills/ultra-review/references/adversarial-evaluation.md +31 -0
  64. package/skills/ultra-review/references/spec.md +5 -0
  65. package/skills/ultra-review/references/unified-schema.md +146 -11
  66. package/skills/ultra-review/references/worker-packet.md +151 -8
  67. package/skills/ultra-review/scripts/review_wait.py +2653 -63
  68. package/skills/ultra-status/SKILL.md +146 -32
  69. package/skills/ultra-tdd/SKILL.md +14 -4
  70. package/skills/ultra-tdd/references/test-execution.md +6 -1
  71. package/skills/ultra-test/SKILL.md +157 -15
  72. package/skills/ultra-test/scripts/validate_review_transport.cjs +549 -0
  73. package/skills/ultra-test/scripts/worktree_digest.cjs +551 -29
  74. package/skills/ultra-think/SKILL.md +5 -10
  75. package/skills/ultra-think/references/interaction-boundary.md +2 -1
@@ -3,31 +3,146 @@
3
3
  Create `.ultra/reviews/<session>/WORKER-PACKET.json` once, before starting any lens.
4
4
  Serialize it as UTF-8 JSON with a trailing newline, compute SHA-256 over those exact
5
5
  bytes, and never edit the file. A changed scope requires a new session and packet.
6
+ Before serialization, read each context, the canonical `.ultra/north-star.md`, the exact
7
+ Change trace path, and every acceptance source from stable repository-contained
8
+ regular-file snapshots. Send the captured North Star bytes to the canonical validator,
9
+ then stable-read its reported decision and accepted-snapshot paths and verify their byte
10
+ lengths and SHA-256 values. Compute the recorded context SHA-256, capture the trace
11
+ fields, preserve each acceptance claim with its source path and heading, and write the
12
+ exact ordered v2 `subject_observations`. After writing the packet, run:
13
+
14
+ ```bash
15
+ python3 scripts/review_wait.py <session> packet --packet-digest <sha256>
16
+ ```
17
+
18
+ Do not launch a worker unless that producer-side preflight returns `status: complete`.
19
+ On success it atomically writes the derived
20
+ `.ultra/reviews/<session>/ADMISSION.json` receipt. That receipt binds admission version,
21
+ packet digest, observed Git HEAD, stable subject byte observations, and the exact
22
+ canonical North Star report input plus that report's exact decision and snapshot
23
+ `source_observations`. The subject digest binds all of those observations. It is
24
+ evidence of the mechanical ingress check, not semantic authority. Publication is atomic and create-once: exact existing bytes are an
25
+ idempotent success, while different existing bytes return `admission_conflict` and
26
+ require a fresh session without replacing the first receipt. If the receipt was
27
+ published, a fresh canonical root rewalk must confirm the session and exact receipt
28
+ identity. Unresolved cleanup and directory durability failures are returned together
29
+ as `status: complete` with `durability_warning`; a cleanup retry that succeeds is not a
30
+ warning. Retain this derived evidence through Test and Deliver. If it is lost after any
31
+ specialist artifact or `SUMMARY.json` exists, the session is `INCOMPLETE` and must be
32
+ replaced by a fresh review session; do not claim the old receipt is reconstructable.
33
+ Before any output exists, packet mode may recreate a missing v2 receipt only from the
34
+ same packet-recorded bytes. A retained strict v1 packet remains readable with its exact
35
+ existing receipt, but packet mode never creates or recreates a v1 receipt.
6
36
 
7
37
  ```json
8
38
  {
9
39
  "$schema": "ultra-review-worker-packet-v1",
40
+ "admission_contract": "ultra-review-admission-required-v2",
10
41
  "session": "<session-id>",
11
42
  "mode": "task | change | plan",
12
- "created_at": "<ISO-8601>",
43
+ "created_at": "<RFC-3339-instant>",
13
44
  "head": "<full-git-head>",
14
45
  "range": "<exact-diff-range>",
15
46
  "change_id": "<active-change-id>",
16
47
  "task_ids": ["<task-id>"],
17
48
  "acceptance": ["<criterion with source path and heading>"],
18
49
  "public_seams": ["<entry point or behavior>"],
50
+ "north_star_trace": {
51
+ "path": ".ultra/changes/active/<change-id>/intent.md#north-star-trace",
52
+ "first_principles": ["FP-1"],
53
+ "serves": ["NS-01"],
54
+ "touches": ["HC-2"],
55
+ "north_star_revision": "north-star-v2-r1",
56
+ "north_star_digest": "<git-blob-hash>"
57
+ },
19
58
  "context_files": [
20
- {"path": ".ultra/contexts/<task-id>.md", "sha256": "<digest>"}
59
+ {"path": ".ultra/contexts/task-<task-id>.md", "sha256": "<digest>"}
60
+ ],
61
+ "subject_observations": [
62
+ {"role": "change", "path": ".ultra/changes/active/<change-id>/intent.md", "sha256": "<digest>", "byte_length": 123},
63
+ {"role": "acceptance_source", "path": ".ultra/changes/active/<change-id>/intent.md", "sha256": "<digest>", "byte_length": 123},
64
+ {"role": "decision", "path": ".ultra/decisions/<decision>.md", "sha256": "<digest>", "byte_length": 456},
65
+ {"role": "snapshot", "path": ".ultra/research/<run>/north-star-v2-r1.accepted.md", "sha256": "<digest>", "byte_length": 789}
66
+ ],
67
+ "workers": [
68
+ {
69
+ "agent": "review-spec",
70
+ "axis": "spec_fidelity",
71
+ "lens": "skills/ultra-review/references/spec.md",
72
+ "output": ".ultra/reviews/<session>/review-spec.json"
73
+ }
21
74
  ],
22
75
  "diff_files": ["src/example.ts"],
23
76
  "output_directory": ".ultra/reviews/<session>"
24
77
  }
25
78
  ```
26
79
 
27
- All paths are repository-relative. `mode`, `head`, `range`, `change_id`, `task_ids`,
28
- `acceptance`, `public_seams`, `context_files`, `diff_files`, and `output_directory` are
29
- required. Arrays may be empty only when the selected mode makes the absence explicit
30
- in the packet.
80
+ Every displayed top-level field is required for a current strict packet.
81
+ `admission_contract` has the exact value `ultra-review-admission-required-v2` for every
82
+ new packet.
83
+ `created_at` is RFC 3339; `head` is the
84
+ lowercase 40-hex Git commit digest; `acceptance`, `public_seams`, and `diff_files` are
85
+ non-empty; `task_ids` is non-empty in task mode.
86
+ `north_star_trace` contains exactly the six displayed fields. Its three ID arrays are
87
+ unique resolving IDs, `north_star_revision` is the accepted North Star `Revision`, and
88
+ `north_star_digest` is the lowercase 40-hex result of
89
+ `git hash-object .ultra/north-star.md`. Each `context_files` item contains exactly
90
+ `path` plus a lowercase SHA-256 `sha256`. `subject_observations` is exact and ordered:
91
+ the Change named by `north_star_trace.path`, each unique acceptance source sorted by
92
+ UTF-8 path bytes, then the canonical validator's `decision` and `snapshot`. Every item
93
+ contains exactly `role`, normalized repository-relative `path`, lowercase SHA-256, and
94
+ non-negative integer `byte_length`; each worker contains exactly the four fields shown.
95
+ Top-level extension fields may carry read-only review questions or historical
96
+ references, but they are not provenance and cannot replace a required core field.
97
+
98
+ In task mode, `context_files` is the exact ordered projection of `task_ids`: task
99
+ `<task-id>` maps to `.ultra/contexts/task-<task-id>.md`. Each recorded digest must equal
100
+ the exact current bytes. `north_star_trace.path` binds `change_id` to
101
+ `.ultra/changes/<active|archive|abandoned>/<change-id>/intent.md#north-star-trace`.
102
+ The packet producer captures the trace arrays, revision, digest, and owner-readable
103
+ acceptance claims from those sources. Each `acceptance` item is
104
+ `<repository-path>#<heading>: <captured owner-readable claim>`. Packet admission checks
105
+ that `head` is the current `git rev-parse HEAD`, reads the exact validated Change path,
106
+ every acceptance source, and both canonical validator sources as stable
107
+ repository-contained regular-file bytes, and compares each byte length and SHA-256 with
108
+ the packet. It checks the current context SHA-256 and passes the already captured North
109
+ Star bytes to the one canonical Research validator through its native stdin seam. The
110
+ report must receipt that exact path, byte count, and SHA-256, and its decision/snapshot
111
+ observations must equal the packet's final two observations. Admission then freshly
112
+ rewalks every captured subject before publication. These observations bind only paths
113
+ and bytes; they do not add a second Markdown parser or reinterpret meaning.
114
+
115
+ That current-subject validation occurs only in `packet` mode. Strict v4 `agents`,
116
+ `summary`, and Review-to-Test require the stable packet-bound `ADMISSION.json`, then
117
+ never reread mutable context, Change, acceptance, or North Star prose. Later task
118
+ completion or authority revision does not invalidate the old review; reviewing the new
119
+ subject requires a new session and packet. An immutable v4 session created before
120
+ admission receipts and lacking `admission_contract` is readable only with explicit
121
+ `--legacy-v4`; packet-absent or unmarked v3 history uses explicit `--legacy-v3`.
122
+ Either legacy flag rejects every strict v1 or v2 marker, and there is no automatic
123
+ fallback. A retained strict v1 packet instead consumes only its exact existing receipt.
124
+
125
+ The session argument must resolve to `<repo>/.ultra/reviews/<session>`, and `session`
126
+ must equal that directory name. Every designated repository path uses normalized
127
+ repository-relative POSIX syntax: no absolute path, backslash, empty segment, `.`,
128
+ `..`, or symlink escape. `output_directory` is exactly
129
+ `.ultra/reviews/<session>`. Worker records appear in canonical roster order and use
130
+ these exact bindings (a scope may select a subset, but `review-spec` is permanent and
131
+ always present):
132
+
133
+ | Agent | Axis | Lens | Output basename |
134
+ |---|---|---|---|
135
+ | `review-spec` | `spec_fidelity` | `skills/ultra-review/references/spec.md` | `review-spec.json` |
136
+ | `review-code` | `engineering_standards` | `skills/ultra-review/references/code.md` | `review-code.json` |
137
+ | `review-tests` | `engineering_standards` | `skills/ultra-review/references/tests.md` | `review-tests.json` |
138
+ | `review-errors` | `engineering_standards` | `skills/ultra-review/references/errors.md` | `review-errors.json` |
139
+ | `review-design` | `engineering_standards` | `skills/ultra-review/references/design.md` | `review-design.json` |
140
+ | `review-comments` | `engineering_standards` | `skills/ultra-review/references/comments.md` | `review-comments.json` |
141
+
142
+ The context observation used by `SUMMARY.json` is deterministic. For one context it is
143
+ that item's `sha256`. For zero or multiple contexts, sort items bytewise by `path`,
144
+ serialize the array as UTF-8 JSON with sorted object keys and no insignificant
145
+ whitespace, then SHA-256 those bytes.
31
146
 
32
147
  Give a selected worker only:
33
148
 
@@ -35,6 +150,34 @@ Give a selected worker only:
35
150
  2. `unified-schema.md`;
36
151
  3. its one lens reference.
37
152
 
38
- The worker writes only its assigned JSON artifact. Its `packet_digest` must equal the
39
- expected digest passed to `review_wait.py`; a merely well-formed digest is insufficient.
153
+ The worker writes only its assigned JSON artifact. During artifact and summary polling,
154
+ `review_wait.py` rereads the exact `WORKER-PACKET.json` bytes and requires their SHA-256
155
+ to remain unchanged. It binds the requested output stem to the declared worker and scope, requires
156
+ `scope.diff_only: true`, and rejects any `scope.files_analyzed` or finding `file`
157
+ outside `diff_files`. Packet, specialist, and summary inputs must be stable
158
+ repository-contained regular files no larger than 8 MiB; a symlink in any managed path
159
+ component, FIFO, other special file, replacement during a read, oversized file, invalid UTF-8, or invalid JSON
160
+ return typed `incomplete` diagnostics. JSON parsing and SHA-256 always consume the same
161
+ captured bytes. Finding trace IDs outside the packet arrays are invalid.
162
+ The artifact's `packet_digest` must equal the expected digest passed to the waiter; a
163
+ merely well-formed digest is insufficient.
164
+ Every strict current artifact and `SUMMARY.json` also carries `admission_digest`, the
165
+ SHA-256 of the exact retained `ADMISSION.json` bytes, and `subject_digest`, copied from
166
+ that receipt. Both must exactly match the receipt loaded at waiter start. The waiter
167
+ pins that pair across every polling and final reload, so a changed or missing receipt
168
+ makes the session `INCOMPLETE` and requires a fresh session. Pre-admission historical
169
+ v4 artifacts may omit the pair only when read with explicit `--legacy-v4`.
40
170
  The coordinator owns worker selection, synthesis, repair, and the summary.
171
+
172
+ ## Review history: one direct parent only
173
+
174
+ A task review packet may carry at most one direct parent. The sanctioned channel is
175
+ the optional top-level `review_history` object with exactly `parent_summary_ref`
176
+ (one prior session's `SUMMARY.json` path), `parent_summary_digest`, and
177
+ `unresolved_blocking_ids` — only the parent's still-unresolved current P0/P1 finding
178
+ ids. Packet admission rejects any packet whose fields or extensions reference more
179
+ than one foreign review session. Transitive summary chains, complete historical
180
+ findings, and whole-history disposition requests must not enter a new packet: a delta
181
+ review consumes the current subject, its one direct parent, and the exact evidence
182
+ refs the delta touches. The full archive stays readable under `.ultra/reviews/**` and
183
+ is read only for a dedicated incident or owner audit.