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
@@ -1,88 +1,139 @@
1
1
  ---
2
2
  name: ultra-research
3
- description: Turn owner claims and specification gaps into cited product and architecture evidence, then refresh the canonical specifications and research distillate. Use when initialization, brownfield adoption, or an active Change contains claims that must be verified before planning.
3
+ description: Turn a raw Project Brief or scoped evidence gap into an accepted North Star, domain language, cited product and architecture specifications, and a hash-bound synthesis. Use after initialization, for brownfield baselining, or inside an active Change whose consequential claims are not yet evidenced.
4
4
  ---
5
5
 
6
- # Verify claims and fill the specification gaps they control
6
+ # Mature a project outline into an evidence-backed baseline
7
7
 
8
- Research owns evidence and synthesis. The owner chooses material scope and accepts the
9
- three conclusions that change what later research does. Files are written immediately,
10
- so interruption loses no completed investigation.
8
+ Research is the first semantic writer of North Star v2 and owns the first accepted
9
+ baseline plus later evidence-backed corrections. Web
10
+ search is one evidence source, not the workflow: repository files, Git, tests, runtime,
11
+ maintained documentation, owner decisions, and current primary sources all count.
11
12
 
12
13
  ## Before you start
13
14
 
14
- 1. Read `.ultra/tasks.json`; if it names unfinished work, read its `context_file` and
15
- closing `## Resume Note` before choosing research scope.
16
- 2. Read `CONTEXT.md` for vocabulary and relevant `.ultra/decisions/` entries.
17
- 3. Read `.ultra/north-star.md`, the active Change intent if any, and specification
18
- sections carrying `[NEEDS CLARIFICATION]`.
15
+ 1. If model-selected, verify the live execution grant in `../ultra-change/references/execution-grant.md` — a current session-local activation or a stably verified durable work-package grant; without either, stop.
16
+ 2. Resolve at most one active `change_id`, then read `.ultra/tasks.json` plus the
17
+ `context_file` and `## Resume Note` of unfinished tasks whose `change_id` matches it,
18
+ if any. Archived or abandoned unfinished rows are history, not the current frontier.
19
+ 3. Read `.ultra/project-brief.md`. For a legacy project without it, treat the exact
20
+ `.ultra/north-star.md` `## One-line` as raw intake until a brief is preserved.
21
+ 4. Read existing `.ultra/north-star.md`, specifications, `CONTEXT.md`, relevant
22
+ `.ultra/decisions/`, active Change intent, evidence, Git state, and maintained docs.
23
+ Run `node <ultra-research-skill-dir>/scripts/validate_north_star.cjs
24
+ .ultra/north-star.md`; this entry captures one bounded regular non-symlink snapshot
25
+ and returns a typed repair diagnostic instead of following, blocking on, or validating
26
+ a changing path. Treat `unresearched` as an empty destination and `legacy_unadopted`
27
+ as preserved intake for explicit adoption, not accepted v2 truth.
19
28
 
20
29
  ## Definition of done
21
30
 
22
- - Every selected area has a cited report under `.ultra/research/<run-id>/` and its
23
- mapped specification section reflects the current conclusion.
24
- - `99-synthesis.md` states what entered a specification or decision, and what remains
25
- unknown or deferred.
26
- - `.ultra/specs/research-distillate.md` records the Git blob hash of each specification
27
- it summarizes; a hash mismatch makes the distillate stale, never authoritative.
28
- - Material omissions and `[UNVERIFIED: no web access]` findings stay visible.
29
-
30
- ## Select the coverage once
31
-
32
- Scan unresolved specification headings, map them to the seventeen focused references,
33
- and recommend the smallest sufficient profile: Full, Product Only, Feature Only,
34
- Architecture Change, or Custom. Confirm the list once with the owner. Load one reference
35
- at a time; holding several step prompts together defeats progressive disclosure.
36
-
37
- The three checkpoints are `04-product-strategy`, `21-features-scope`, and
38
- `99-synthesis`: each conclusion changes what comes next. Present its evidence and
39
- recommendation, wait for the owner's decision, then continue. Other areas write their
40
- report and mapped section immediately without another ceremony.
41
-
42
- Areas sitting between two checkpoints are independent and may run in parallel through
43
- the host's native bounded subagents, each loading exactly one reference. That
44
- strengthens progressive disclosure rather than breaking it — the parent holds no step
45
- prompt at all. The checkpoints stay barriers: nothing after one starts until the owner
46
- has answered it, because its conclusion changes what the later areas are even asking.
47
-
48
- ## Investigate and write
49
-
50
- For each selected area:
51
-
52
- 1. Search current primary sources and inspect relevant source, tests, runtime and docs.
53
- 2. Separate Observed, Evidence, Inference and Unknowns; cite every external claim.
54
- 3. For solution strategy and building blocks, cite at least one real implementation in
55
- a comparable maintained project, not only an opinion article.
56
- 4. Write `.ultra/research/<run-id>/<area>.md`, then replace the mapped specification
57
- section rather than appending a second version. Git keeps the history.
58
- 5. Follow `../ultra-domain-modeling/SKILL.md` when evidence settles a domain term. Use
59
- `../ultra-think/SKILL.md` when a consequential trade-off meets the decision criteria.
60
-
61
- If web search is unavailable, write `[UNVERIFIED: no web access]` and continue. Lack of
62
- a tool lowers confidence; it does not create a dead end.
63
-
64
- ## Synthesize
65
-
66
- Load `references/99-synthesis.md` after the selected reports are on disk. Write which
67
- claims were confirmed, overturned, deferred, or converted into decisions. Update the
68
- specification balances, then write the distillate and its three source blob hashes.
69
- Read all changed files back and report the exact unresolved headings.
70
-
71
- Recommend the next explicit capability from the resulting files; do not invoke it.
31
+ - Every selected lens has a cited `.ultra/research/<run-id>/<area>.md` report and its
32
+ canonical specification section contains the current conclusion and North Star relation.
33
+ - The accepted North Star, shared vocabulary, product baseline, and architecture
34
+ baseline are sufficient for the current planning boundary; unknowns stay explicit.
35
+ - The North Star follows `references/north-star-v2.md`; all `FP-*`, `NS-*`, and `HC-*`
36
+ definitions and references pass the structural validator without making that result
37
+ a semantic verdict.
38
+ - `99-synthesis.md` names what was promoted, overturned, deferred, or left blocking.
39
+ - `.ultra/specs/research-distillate.md` stores the Git blob hash of each specification
40
+ it summarizes. A mismatch makes the distillate stale, never authoritative.
41
+
42
+ ## Find the path before collecting evidence
43
+
44
+ When coverage spans several lenses or the path itself is unclear, read
45
+ `references/wayfinding.md` and write `.ultra/research/<run-id>/brief.md`. Skip that file
46
+ for one already-bounded evidence question. Wayfinding selects the smallest useful
47
+ coverage; it does not create workflow state or another semantic authority.
48
+
49
+ Map the brief and unresolved specification sections to seventeen focused evidence
50
+ lenses. Confirm the proposed coverage once with the owner. Load one reference
51
+ at a time; the parent holds the question map, not every step prompt.
52
+
53
+ The first six lenses have real semantic dependencies:
54
+
55
+ - `00-problem-validation` runs before `01-opportunity-discovery` because an opportunity must trace to a problem.
56
+ - `02-market-assessment` and `03-alternatives` are conditional lenses and may run in parallel once the boundary is known.
57
+ - `04-product-strategy` is the first owner checkpoint and consumes the relevant conclusions from `00` through `03`.
58
+ - `05-assumptions-validation` extracts load-bearing assumptions from `00` through `04` after the strategy decision.
59
+
60
+ The later groups turn that premise into product behavior (`10` through `22`), then an
61
+ architecture and operating baseline (`30` through `41`). The three owner checkpoints
62
+ remain `04-product-strategy`, `21-features-scope`, and `99-synthesis`.
63
+ At each checkpoint, use `../ultra-think/SKILL.md` for an adversarial challenge of the
64
+ working candidate before asking the owner to accept direction, scope, or synthesis.
65
+
66
+ Only areas with satisfied inputs may fan out through native bounded subagents. Never
67
+ parallelize a lens whose question depends on an unresolved earlier conclusion.
68
+
69
+ ## Investigate, ask, and decide
70
+
71
+ For each selected lens:
72
+
73
+ 1. Inspect reachable facts before asking. Search current primary sources when a claim
74
+ depends on current external reality.
75
+ 2. Separate Observed, Verified, Decided, Inference, and Unknown; cite external claims.
76
+ Record `north_star_effect: supports | refines | contradicts | independent` and
77
+ `north_star_claim: <the evidenced causal relation>` in the area report.
78
+ 3. Follow `../ultra-grilling/SKILL.md` when a required owner field is missing. The lens
79
+ supplies what to ask; Grilling supplies the one-question interaction loop.
80
+ 4. Follow `../ultra-think/SKILL.md` for one consequential trade-off, not for mapping the
81
+ whole research frontier.
82
+ 5. Follow `../ultra-domain-modeling/SKILL.md` when evidence settles a shared term. The
83
+ first such term creates `CONTEXT.md`; later calls sharpen it.
84
+ 6. Write the area report, then replace the mapped specification section instead of
85
+ appending a second version. Git retains history.
86
+
87
+ For scoped Research inside an active Change, answer only its recorded `Research
88
+ Disposition` question and produce the named exit evidence. Research writes reports and
89
+ the mapped canonical baseline sections; it does not silently rewrite Change acceptance.
90
+ Return the evidence paths so `ultra-change` can reconcile the accepted intent before
91
+ planning when that contract must change.
92
+
93
+ If web access is unavailable, record `[UNVERIFIED: no web access]` and continue with
94
+ other evidence. Missing tooling lowers confidence; it does not manufacture a blocker.
95
+
96
+ ## Synthesize the accepted baseline
97
+
98
+ `04-product-strategy` proposes problem reality and falsifiable first-principle
99
+ propositions. `22-success-metrics` determines whether a
100
+ single North Star metric is justified or whether an observable outcome plus guardrails
101
+ is more honest. Follow `references/north-star-v2.md`: validate a mutable candidate while
102
+ the last accepted revision remains current, show the owner the semantic delta and
103
+ unresolved contradictions, and preserve one stable `.ultra/decisions/<id>.md` acceptance
104
+ record with the owner's exact words, conversation scope, the model's responsibility for
105
+ final wording, and no invented timestamp or inheritance by a future revision. Only after
106
+ the owner accepts the candidate, atomically replace `.ultra/north-star.md`, then update the three
107
+ specifications, domain language, qualifying decisions, and distillate for the first
108
+ baseline. A scoped Research run updates only its mapped specification sections and then
109
+ refreshes the distillate's three source hashes.
110
+
111
+ When an accepted revision supersedes another, preserve prior evidence and report every
112
+ active Change whose recorded revision or digest differs as a stale observation requiring
113
+ Change reconciliation. Supersession never deletes evidence, rewrites a Change silently,
114
+ or grants execution.
115
+
116
+ Load `references/99-synthesis.md` only after selected reports exist. Read every promoted
117
+ file back, verify trace anchors and source hashes, and report exact unresolved gaps.
118
+ Recommend the next explicit public workflow from the resulting files; do not invoke it.
72
119
 
73
120
  ## When the owner decides
74
121
 
75
- The owner chooses coverage, resolves the three checkpoints, and accepts any material
76
- deferral. Evidence facts are yours to establish. A conclusion that removes an existing
77
- commitment follows the REDUCTION boundary and waits for explicit authority.
122
+ The owner chooses coverage, resolves the three checkpoints, accepts a North Star and
123
+ material deferrals, and authorizes any REDUCTION. The model establishes evidence facts,
124
+ selects methods, and updates accepted files inside that frame.
78
125
 
79
126
  ## References
80
127
 
128
+ - `references/wayfinding.md` — read only for multi-lens or unclear research paths.
81
129
  - `references/00-problem-validation.md` through `references/05-assumptions-validation.md`
82
- — product premise and strategy; load only a selected area.
83
- - `references/10-user-personas.md` through `references/22-success-metrics.md` — users,
84
- stories, scope and measurable outcomes; load only a selected area.
130
+ — product premise and strategy; load only a selected lens.
131
+ - `references/10-user-personas.md` through `references/22-success-metrics.md` — actors,
132
+ behavior, scope, and measurements.
85
133
  - `references/30-architecture-context.md` through `references/41-quality-risks.md` —
86
- system boundary, implementation evidence, deployment and risk.
134
+ system boundary, implementation evidence, operations, and risk.
87
135
  - `references/99-synthesis.md` — load last, after selected reports exist.
88
- - `../ultra-think/references/autonomy-boundary.md` — read before a specification shrinks.
136
+ - `references/north-star-v2.md` — exact semantic structure, adoption, validation, and
137
+ supersession contract.
138
+ - `../ultra-change/references/execution-grant.md` — read only for grant-activated continuation.
139
+ - `../ultra-think/references/autonomy-boundary.md` — read before reducing authority.
@@ -1,25 +1,25 @@
1
- # Competitive landscape
1
+ # Alternatives
2
2
 
3
- Use for workflow step `03-competitive-landscape`.
3
+ Use for workflow step `03-alternatives`.
4
4
 
5
5
  ## Objective
6
6
 
7
7
  Identify the alternatives actors actually use and the consequences for strategy.
8
- Alternatives may include direct products, adjacent tools, manual workflows, or doing
9
- nothing.
8
+ Alternatives include direct products, adjacent tools, manual workflows, or doing
9
+ nothing; a competitor-only frame is too narrow.
10
10
 
11
11
  ## Evidence
12
12
 
13
13
  - Use current product documentation, pricing, repositories, filings, or observed user
14
14
  workflows.
15
15
  - Evaluate only criteria that change the decision at hand.
16
- - Do not create a ceremonial matrix, fixed competitor count, or unsupported claim of
16
+ - Do not create a ceremonial matrix, fixed alternative count, or unsupported claim of
17
17
  superiority.
18
18
  - Distinguish a verified capability from marketing language and inference.
19
19
 
20
20
  ## Record
21
21
 
22
- Update `discovery.md` with the relevant alternatives, evidence, meaningful differences,
22
+ Update `discovery.md` with relevant alternatives, evidence, meaningful differences,
23
23
  switching constraints, and durable strategy implications. Record an unknown when a
24
24
  credible alternative cannot be verified.
25
25
 
@@ -4,8 +4,8 @@ Use for workflow step `04-product-strategy`.
4
4
 
5
5
  ## Objective
6
6
 
7
- Turn accepted evidence into a product direction, target boundary, value proposition,
8
- and explicit tradeoffs.
7
+ Turn accepted evidence into problem reality, falsifiable first-principle propositions,
8
+ a product direction, target boundary, value proposition, and explicit tradeoffs.
9
9
 
10
10
  ## Evidence and decisions
11
11
 
@@ -13,6 +13,8 @@ and explicit tradeoffs.
13
13
  - Ask the owner when a scope, customer, business, or risk decision is load-bearing.
14
14
  - Do not infer an MVP, reduced scope, release phase, or commercial posture.
15
15
  - Record exclusions only when the owner or an accepted constraint establishes them.
16
+ - For each proposed `FP-*`, record evidence, causal consequence, and the falsifier or
17
+ revisit trigger. The ID becomes canonical only in an owner-accepted synthesis.
16
18
 
17
19
  ## Record
18
20
 
@@ -22,6 +24,7 @@ Update `discovery.md` with:
22
24
  - value delivered through observable behavior;
23
25
  - chosen tradeoffs and their rationale;
24
26
  - constraints, exclusions, and unresolved decisions;
27
+ - the candidate `FP-* -> capability -> behavior -> outcome` causal chain;
25
28
  - any defensibility claim with its supporting evidence.
26
29
 
27
30
  Complete the step with decision and evidence references plus the updated output path.
@@ -30,3 +33,9 @@ Complete the step with decision and evidence references plus the updated output
30
33
 
31
34
  In the area report, record `tradeoff` and `rationale`, then link the decision file or
32
35
  specification anchor to the problems, opportunities, or constraints that support it.
36
+
37
+ ## Adversarial challenge
38
+
39
+ Before the owner checkpoint, challenge whether the proposed direction follows from the
40
+ underlying problem and first principles, steel-man the best conflicting direction, and
41
+ name evidence that would overturn the working North Star candidate.
@@ -13,6 +13,8 @@ excluded, deferred, or unresolved.
13
13
  - Never infer an MVP, reduced version, phase label, or omission from implementation
14
14
  convenience.
15
15
  - Trace included capabilities to requirements and observable outcomes.
16
+ - Trace each included capability to candidate `FP-*` and `NS-*` IDs, and name every
17
+ candidate `HC-*` it could breach, without copying North Star prose.
16
18
  - Record dependencies, migrations, compatibility, and operational obligations inside
17
19
  the capability that owns them.
18
20
  - Keep speculative future ideas outside the active scope unless selected.
@@ -28,3 +30,9 @@ Complete the step with decision evidence and the updated output path.
28
30
 
29
31
  In the area report, record `requirement_ids`, `scope_status`, and `rationale`, then link
30
32
  the capability heading in `product.md`.
33
+
34
+ ## Adversarial challenge
35
+
36
+ Before the owner checkpoint, challenge whether every included capability causally serves
37
+ the working North Star, whether an exclusion breaks that outcome or a hard constraint,
38
+ and whether the proposed scope can optimize a proxy while missing delivered value.
@@ -12,13 +12,18 @@ including signals that would reveal harmful optimization.
12
12
  - Derive measurements from accepted outcomes and available instrumentation.
13
13
  - State definition, source, observation window, owner, and decision use.
14
14
  - Separate current measurements, target decisions, and unavailable telemetry.
15
- - Do not invent baselines, targets, or a single north-star metric.
15
+ - Propose one or more stable `NS-*` outcomes when justified by delivered value and a
16
+ credible observation contract. Each records observation method, baseline, target or
17
+ expected change, horizon, and anti-metric.
18
+ - Do not force a single metric, or invent baselines and targets, when guardrails plus an
19
+ observable outcome represent the product more honestly.
16
20
 
17
21
  ## Record
18
22
 
19
- Update `product.md` with outcome measures, operational measures, guardrails, evidence
20
- availability, and unresolved instrumentation needs. A metric that cannot be observed
21
- must be recorded as a gap or explicit future change.
23
+ Update `product.md` with supporting outcome measures, operational measures, guardrails,
24
+ evidence availability, and unresolved instrumentation needs. Propose the canonical
25
+ `NS-*` entries for `north-star.md`; they become authority only through accepted synthesis.
26
+ A metric that cannot be observed is a gap or explicit future Change.
22
27
 
23
28
  Complete the step with evidence references and the updated output path.
24
29
 
@@ -17,12 +17,30 @@ creating a second condensed authority.
17
17
  - Documentation conflicts, known failures, and load-bearing unknowns are in the gap
18
18
  ledger with owners or explicit decisions.
19
19
  - Verification commands and observed results are current.
20
+ - Every accepted `FP-*` has evidence, causal consequence, and a falsifier or revisit
21
+ trigger; every `NS-*` has an observation contract and anti-metric; every `HC-*` names
22
+ the protected value or threat, authority, and revisit condition.
20
23
 
21
24
  ## Record
22
25
 
26
+ Follow `north-star-v2.md`. Validate the complete mutable candidate with
27
+ `scripts/validate_north_star.cjs` while the previous accepted revision remains current.
28
+ Only after the owner accepts this checkpoint and exact semantic delta, record the owner
29
+ acceptance source and atomically replace `.ultra/north-star.md` with accepted problem
30
+ reality, `FP-*` propositions, causal chains, `NS-*` outcomes, `HC-*` constraints,
31
+ exclusions, uncertainties, revisit triggers, and Research trace.
32
+
33
+ If this supersedes an accepted revision, preserve its Git and downstream evidence.
34
+ Report dependent active Change traces as stale observations until Change reconciliation;
35
+ do not silently rewrite intent or infer new execution authority.
36
+ Keep raw owner wording in `project-brief.md`; do not process it in place.
37
+
23
38
  Write `research-distillate.md` as a navigation and traceability artifact containing
24
39
  baseline ids, source document anchors, accepted decisions, blockers, gaps, verification
25
- evidence, and the exact planning entry. Do not duplicate the specifications' prose.
40
+ evidence, the exact planning entry, and the current Git blob hash from
41
+ `git hash-object` for `product.md`, `architecture.md`, and `discovery.md`. Do not
42
+ duplicate the specifications' prose. A later mismatch marks the distillate stale; it
43
+ does not make the old synthesis authoritative.
26
44
 
27
45
  Write the final `99-synthesis.md` report, link all three specification paths, the
28
46
  distillate path, and the evidence used for synthesis. Read those files back before
@@ -33,3 +51,9 @@ reporting convergence.
33
51
  Record one verified chain through `problem_id`, `scenario_id`, `requirement_ids`,
34
52
  `architecture_path_ids`, and `verification_refs`. Every referenced id must exist in an
35
53
  earlier selected area report or specification heading.
54
+
55
+ ## Adversarial challenge
56
+
57
+ Before acceptance, challenge the strongest premise, Goodhart or proxy failure, and a
58
+ scenario where every stated output passes while the claimed delivered value still fails.
59
+ Record what would change the conclusion and every unresolved contradiction.
@@ -0,0 +1,168 @@
1
+ # North Star v2 contract
2
+
3
+ Use this contract when Research proposes the first steering authority or a replacement
4
+ revision. Init creates only the packaged `unresearched` placeholder.
5
+
6
+ ## Agency boundary
7
+
8
+ Research selects evidence, synthesizes causal propositions, and proposes language. The
9
+ owner accepts the problem boundary, `FP-*`, `NS-*`, `HC-*`, exclusions, and material
10
+ uncertainty. The validator observes headings, fields, IDs, and references; it never
11
+ decides whether a proposition is true, an outcome is valuable, or a constraint is wise.
12
+
13
+ Keep the last accepted file current while a replacement is drafted. Validation failure
14
+ returns diagnostics and leaves the draft mutable. Only explicit owner acceptance permits
15
+ an atomic replacement of `.ultra/north-star.md`.
16
+
17
+ ## Exact top-level headings
18
+
19
+ 1. `## Acceptance and Revision`
20
+ 2. `## Problem Reality`
21
+ 3. `## First-Principle Propositions`
22
+ 4. `## Value Causal Chain`
23
+ 5. `## North Star Outcomes`
24
+ 6. `## Hard Constraints`
25
+ 7. `## Explicit Exclusions`
26
+ 8. `## Uncertainties and Revisit Triggers`
27
+ 9. `## Research Trace`
28
+
29
+ `Acceptance and Revision` records `Schema`, `Status`, `Revision`, `Owner acceptance
30
+ source`, `Acceptance time`, and `Supersedes`. Do not invent a timestamp: use
31
+ `not-recorded` when the authoritative owner source has none. `Status` is exactly
32
+ `unresearched` for the empty Init placeholder, `draft` for a mutable candidate, or
33
+ `accepted` after owner acceptance. A draft may define semantic IDs but must use
34
+ `Owner acceptance source: none`; every First-Principle Proposition in an accepted
35
+ revision has `Status: accepted`.
36
+
37
+ The `unresearched` form is one exact packaged byte sequence, not a looser shape. Its
38
+ title, authority and adoption preamble, all six acceptance fields, all eight later
39
+ sentinel bodies, interstitial whitespace, and trailing newline must match
40
+ `.ultra-template/north-star.md`. Any mutation is invalid and Init stops before publication
41
+ with an `ultra-init-error-v1` payload: `code: north_star_template_invalid`, plus the full
42
+ canonical validator `diagnostics`, including `invalid_unresearched_placeholder` for an
43
+ exact-byte mismatch. This checksum-backed grammar prevents Init from becoming a hidden
44
+ semantic writer; it does not judge any researched proposition.
45
+
46
+ ## Stable semantic entries
47
+
48
+ Define accepted entries with level-three headings. IDs are stable within project
49
+ history, unique, and never silently recycled.
50
+
51
+ ```markdown
52
+ ### FP-1 — Short name
53
+ - Proposition:
54
+ - Evidence:
55
+ - Causal consequence:
56
+ - Falsifier or revisit trigger:
57
+ - Status: `accepted`
58
+
59
+ ### NS-1 — Short name
60
+ - Outcome:
61
+ - Observation method:
62
+ - Baseline:
63
+ - Target or expected change:
64
+ - Horizon:
65
+ - Anti-metric:
66
+
67
+ ### HC-1 — Short name
68
+ - Protected value or threat:
69
+ - Constraint:
70
+ - Authority or evidence:
71
+ - Revisit condition:
72
+ ```
73
+
74
+ Do not impose a maximum count. Prefer the smallest set that explains the accepted
75
+ boundary, but let Research and the owner decide semantic sufficiency.
76
+
77
+ The Value Causal Chain references definitions instead of repeating them:
78
+
79
+ ```text
80
+ FP-* -> capability -> observable behavior -> NS-*
81
+ ```
82
+
83
+ In a draft or accepted revision every pipe-delimited causal-chain row has exactly five
84
+ cells. Header and separator rows use that same width; each data row carries a `VC-*`, a
85
+ resolving `FP-*`, nonempty capability and behavior, and a resolving `NS-*`. A malformed
86
+ row remains invalid even when another row is valid. Every one of the nine required
87
+ sections is nonempty for accepted publication; these are exact structural observations,
88
+ not a mechanical claim that the content is semantically sufficient.
89
+
90
+ Supporting product behavior, actors, requirements, measurements, and architecture stay
91
+ in specifications. Shared vocabulary stays in `CONTEXT.md`. Change-local outcome,
92
+ non-goals, acceptance, risk, and recovery stay in the active intent.
93
+
94
+ ## Validation and adoption
95
+
96
+ Callers that already own a bounded stable no-symlink snapshot pass those exact bytes
97
+ through stdin while identifying the canonical absolute path:
98
+
99
+ ```bash
100
+ node <ultra-research-skill-dir>/scripts/validate_north_star.cjs --stdin --path <canonical-absolute-path>
101
+ ```
102
+
103
+ Research and manual callers may instead use the direct path entry:
104
+
105
+ ```bash
106
+ node <ultra-research-skill-dir>/scripts/validate_north_star.cjs <candidate-path>
107
+ ```
108
+
109
+ Path mode applies the same 8 MiB ceiling itself. It requires a regular non-symlink file,
110
+ opens with `O_NONBLOCK` and `O_NOFOLLOW`, binds the pre-read `lstat` to the open
111
+ descriptor, and rechecks descriptor/path identity, size, and the retained-byte digest
112
+ after the bounded read. An oversized file, symlink, special file, read failure, or
113
+ observable ordinary replacement returns `input_too_large`, `input_symlink`,
114
+ `input_not_regular`, `read_error`, or `input_changed`; preserve the current path and
115
+ retry after cooperative workspace writes settle. No typed input failure is a semantic
116
+ judgment or a promise to defeat a malicious operating-system-level writer.
117
+
118
+ Every verdict over a completed byte snapshot carries `input.path`, `input.byte_length`,
119
+ and `input.sha256` for those bytes. A capture failure keeps the same keys but uses null
120
+ for any byte length or digest it could not safely observe. Markdown headings, grammar
121
+ fields, causal rows, and decision-record fields count only rendered lines outside
122
+ backtick or tilde fences; acceptance binding still hashes the exact raw bytes.
123
+ SessionStart applies the same 8 MiB stable no-symlink snapshot limit and validates those
124
+ same bytes, rather than reopening a different path snapshot.
125
+
126
+ The command emits `ultra-north-star-validation-v1`. The actual v0.26 shape containing
127
+ `Project Direction`, `North Star Outcome`, and `Hard Constraints`, and the older
128
+ `## One-line` form, are reported as `legacy_unadopted` with an advisory. A candidate
129
+ combining v2 markers with a legacy semantic heading is reported with
130
+ `kind: "north-star-v2"`, its parsed v2 `status`, `classification: "mixed"`, and
131
+ `valid: false`; appending a legacy heading cannot bypass v2 validation. Other malformed
132
+ shapes are `unknown` and invalid. Research must migrate legacy input through an
133
+ owner-accepted replacement rather than mutating it in place.
134
+
135
+ Init consumes a preserved North Star from the same stable descriptor/path identity and
136
+ SHA-256 snapshot used for classification, and rechecks that snapshot before staging,
137
+ before publication, and before success. Under the cooperative-workspace contract, any
138
+ observable authority-path or byte drift preserves the current bytes and returns the
139
+ typed retryable `preserved_north_star_changed` diagnostic. Other preserved or newly
140
+ published Init paths use the same recovery rule and the typed retryable
141
+ `initialization_snapshot_changed` diagnostic. This is detectable-drift protection, not
142
+ a promise that Node filesystem calls can defend against a malicious operating-system-
143
+ level replacement.
144
+
145
+ For an accepted replacement:
146
+
147
+ 1. preserve the current accepted file while drafting and validating the candidate;
148
+ 2. challenge premise, falsifiers, causal chain, proxy failure, exclusions, and hard
149
+ constraints independently;
150
+ 3. show the owner the semantic delta and unresolved contradictions;
151
+ 4. preserve a stable decision record with the owner's exact words, conversation scope,
152
+ the model's responsibility for final wording, and a rule that future revisions do not
153
+ inherit acceptance; record no timestamp the owner source did not provide;
154
+ 5. atomically replace the canonical file;
155
+ 6. record that dependent active Change traces are stale observations until Change
156
+ reconciliation maps old `FP/NS/HC` references to the new revision.
157
+
158
+ The cited decision fragment resolves exactly one rendered Markdown heading outside fenced
159
+ code. That section carries each of these list fields exactly once with a nonempty value:
160
+ `Conversation scope`, `Exact raw owner acceptance`, `Agency boundary`, `Time boundary`,
161
+ and `Revision boundary`. The validator observes only their anchored presence, uniqueness,
162
+ and nonempty bytes. It does not decide whether the quoted acceptance is genuine,
163
+ sufficiently informed, or semantically adequate; those judgments remain with the owner
164
+ and model.
165
+
166
+ Never delete old task, review, Test, or delivery evidence because of supersession. Git
167
+ preserves the old North Star revision; canonical consumers retain their historical
168
+ revision and digest while current execution waits for explicit reconciliation.
@@ -0,0 +1,50 @@
1
+ # Research wayfinding
2
+
3
+ Use this method when Research spans several lenses or the path itself is unclear. Skip
4
+ it for one bounded evidence question whose destination is already known.
5
+
6
+ ## Objective
7
+
8
+ Turn fog into a small question map without turning the map into workflow authority.
9
+ Select the smallest sufficient coverage that can establish the current baseline or
10
+ unlock the active Change.
11
+
12
+ ## Inspect first
13
+
14
+ Read the Project Brief, accepted authority, unresolved specification sections, current
15
+ repository evidence, active Change, and owner statements already present. Do not ask a
16
+ question whose answer is reachable in those sources.
17
+
18
+ ## Write the run brief
19
+
20
+ Write `.ultra/research/<run-id>/brief.md` with:
21
+
22
+ - entry question and planning boundary;
23
+ - known facts and their sources;
24
+ - unknowns, each with the decision it can change;
25
+ - selected lenses, semantic dependencies, and explicit omissions;
26
+ - likely evidence sources and current freshness limits;
27
+ - owner decisions and the checkpoint that owns each one;
28
+ - a stop condition stated as an observable artifact or resolved decision.
29
+
30
+ ## North Star Working Candidate
31
+
32
+ In the same brief, keep the current candidate outcome, `FP-*` propositions, causal chain,
33
+ evidence, counter-evidence, and the accepted `.ultra/north-star.md` revision and digest it
34
+ began from. Update
35
+ this section as lenses refine or contradict it. It is derived navigation and not semantic
36
+ authority; only accepted synthesis can replace the canonical North Star.
37
+
38
+ The brief is derived navigation, not semantic authority. Specifications, the North Star,
39
+ `CONTEXT.md`, and accepted decisions remain canonical. Rebuild or discard the map when
40
+ evidence changes; never add a completion flag merely to route another Skill.
41
+
42
+ ## Keep the frontier small
43
+
44
+ Prefer one load-bearing question over a speculative tree. Add a branch only when a
45
+ viable answer would change selected evidence, product direction, scope, or architecture.
46
+ Questions that cannot change the current boundary belong in explicit deferred work, not
47
+ the active map.
48
+
49
+ Wayfinding chooses where to investigate. Each evidence lens defines what to establish;
50
+ Grilling defines how to ask the owner; Think resolves one consequential decision.