yaaw-se 0.3.3 → 0.3.4

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 (52) hide show
  1. package/dist/cli/commands/install.js +1 -1
  2. package/dist/cli/commands/install.js.map +1 -1
  3. package/dist/installer/status.js +74 -0
  4. package/dist/installer/status.js.map +1 -1
  5. package/dist/installer/verify.d.ts +2 -1
  6. package/dist/installer/verify.js +6 -2
  7. package/dist/installer/verify.js.map +1 -1
  8. package/dist/integrations/codex-runtime.d.ts +39 -0
  9. package/dist/integrations/codex-runtime.js +89 -0
  10. package/dist/integrations/codex-runtime.js.map +1 -1
  11. package/dist/integrations/codex.js +103 -16
  12. package/dist/integrations/codex.js.map +1 -1
  13. package/dist/payload/integrations/codex/yaaw-runtime.md +38 -10
  14. package/dist/payload/payload-files.json +95 -55
  15. package/dist/payload/payload.json +1 -1
  16. package/dist/payload/yaaw-core/system/core/context-loading.md +12 -8
  17. package/dist/payload/yaaw-core/system/core/dispatch-execution.md +18 -2
  18. package/dist/payload/yaaw-core/system/core/execution-context.md +31 -23
  19. package/dist/payload/yaaw-core/system/core/invalidation.md +29 -12
  20. package/dist/payload/yaaw-core/system/core/io-contract.md +8 -0
  21. package/dist/payload/yaaw-core/system/core/lifecycle.md +11 -16
  22. package/dist/payload/yaaw-core/system/core/routing.md +7 -7
  23. package/dist/payload/yaaw-core/system/core/transitions.md +2 -5
  24. package/dist/payload/yaaw-core/system/registries/handoff-policy.json +85 -0
  25. package/dist/payload/yaaw-core/system/roles/orchestrator.md +16 -14
  26. package/dist/payload/yaaw-core/system/rules/repository-identity.md +31 -17
  27. package/dist/payload/yaaw-core/system/schemas/evidence-v1.schema.json +28 -0
  28. package/dist/payload/yaaw-core/system/schemas/evidence-v2.schema.json +19 -0
  29. package/dist/payload/yaaw-core/system/schemas/evidence.schema.json +20 -31
  30. package/dist/payload/yaaw-core/system/schemas/repository-identity.schema.json +47 -0
  31. package/dist/payload/yaaw-core/system/schemas/review-v1.schema.json +19 -0
  32. package/dist/payload/yaaw-core/system/schemas/review-v2.schema.json +17 -0
  33. package/dist/payload/yaaw-core/system/schemas/review.schema.json +26 -13
  34. package/dist/payload/yaaw-core/system/templates/evidence.json +19 -2
  35. package/dist/payload/yaaw-core/system/templates/handoff.json +9 -15
  36. package/dist/payload/yaaw-core/system/templates/observed-state.json +13 -1
  37. package/dist/payload/yaaw-core/system/templates/review.md +14 -5
  38. package/dist/payload/yaaw-core/system/tools/orchestration-runtime.mjs +689 -0
  39. package/dist/payload/yaaw-core/system/tools/repository-identity.mjs +92 -0
  40. package/dist/payload/yaaw-core/system/workflows/implementation/implement-ticket.md +4 -0
  41. package/dist/payload/yaaw-core/system/workflows/implementation/repair-ticket.md +4 -0
  42. package/dist/payload/yaaw-core/system/workflows/implementation/verify-ticket.md +3 -0
  43. package/dist/payload/yaaw-core/system/workflows/orchestration/determine-next-action.md +15 -15
  44. package/dist/payload/yaaw-core/system/workflows/orchestration/dispatch.md +22 -16
  45. package/dist/payload/yaaw-core/system/workflows/orchestration/inspect-state.md +12 -15
  46. package/dist/payload/yaaw-core/system/workflows/orchestration/recover-interruption.md +4 -0
  47. package/dist/payload/yaaw-core/system/workflows/orchestration/route.md +19 -11
  48. package/dist/payload/yaaw-core/system/workflows/planning/replan.md +4 -0
  49. package/dist/payload/yaaw-core/system/workflows/review/inspect-change.md +4 -1
  50. package/dist/tui/configuration-updates.js +12 -1
  51. package/dist/tui/configuration-updates.js.map +1 -1
  52. package/package.json +1 -1
@@ -0,0 +1,92 @@
1
+ #!/usr/bin/env node
2
+ import { createHash } from "node:crypto";
3
+ import { lstatSync, readFileSync, readlinkSync } from "node:fs";
4
+ import { resolve } from "node:path";
5
+ import { spawnSync } from "node:child_process";
6
+
7
+ const ALGORITHM = "yaaw-worktree-v2";
8
+ const CONTROL_OUTPUT_EXCLUDES = [
9
+ ".yaaw-core/runtime/**",
10
+ ".yaaw-core/project/state.json",
11
+ ".yaaw-core/project/evidence/**",
12
+ ".yaaw-core/project/reviews/**"
13
+ ];
14
+ const EXCLUDE_PATHSPECS = CONTROL_OUTPUT_EXCLUDES.map(path => `:(exclude)${path}`);
15
+ const hash = value => createHash("sha256").update(value).digest("hex");
16
+ function stable(value) {
17
+ if (Array.isArray(value)) return value.map(stable);
18
+ if (value && typeof value === "object") return Object.fromEntries(Object.keys(value).sort().map(k => [k, stable(value[k])]));
19
+ return value;
20
+ }
21
+ const canonicalJson = value => JSON.stringify(stable(value));
22
+ function fail(status, message) {
23
+ process.stdout.write(JSON.stringify({
24
+ schema:"yaaw.repository-identity/v2", algorithm:null, status, workspace_scope:".",
25
+ git_root_relation:status==="UNVERSIONED"?"none":"unknown", head_commit:null, dirty:null,
26
+ worktree_digest:null, components:null, changed_paths:[], error:message
27
+ })+"\n");
28
+ process.exitCode=2;
29
+ }
30
+ function git(workspace,args) {
31
+ const r=spawnSync("git",["-C",workspace,...args],{encoding:null,windowsHide:true,maxBuffer:64*1024*1024});
32
+ if(r.error) throw r.error;
33
+ if(r.status!==0) throw new Error((r.stderr??Buffer.alloc(0)).toString("utf8").trim()||`git ${args.join(" ")} exited ${r.status}`);
34
+ return r.stdout??Buffer.alloc(0);
35
+ }
36
+ const nulPaths=buf=>buf.toString("utf8").split("\0").filter(Boolean).map(p=>p.replaceAll("\\","/")).sort();
37
+ function untrackedRecord(workspace,path) {
38
+ const absolute=resolve(workspace,path);
39
+ const stat=lstatSync(absolute);
40
+ if(stat.isSymbolicLink()) return {path,kind:"symlink",sha256:hash(Buffer.from(readlinkSync(absolute),"utf8"))};
41
+ if(stat.isFile()) return {path,kind:"file",sha256:hash(readFileSync(absolute))};
42
+ throw new Error(`unsupported untracked filesystem object: ${path}`);
43
+ }
44
+
45
+ const args=process.argv.slice(2);
46
+ let workspaceArg=".";
47
+ for(let i=0;i<args.length;i+=1){
48
+ if(args[i]==="--workspace" && args[i+1]) {workspaceArg=args[i+1]; i+=1;}
49
+ else {process.stderr.write("usage: repository-identity.mjs [--workspace <path>]\n"); process.exit(2);}
50
+ }
51
+ const workspace=resolve(workspaceArg);
52
+ let workspacePrefix;
53
+ try {
54
+ const inside=git(workspace,["rev-parse","--is-inside-work-tree"]).toString("utf8").trim();
55
+ if(inside!=="true") throw new Error("workspace is not inside a Git work tree");
56
+ workspacePrefix=git(workspace,["rev-parse","--show-prefix"]).toString("utf8").trim().replaceAll("\\","/");
57
+ }
58
+ catch(error){ fail("UNVERSIONED",error instanceof Error?error.message:String(error)); }
59
+
60
+ if(workspacePrefix !== undefined){
61
+ try {
62
+ const head=git(workspace,["rev-parse","HEAD"]).toString("utf8").trim();
63
+ const scoped=[".",...EXCLUDE_PATHSPECS];
64
+ const status=git(workspace,["status","--porcelain=v1","-z","--untracked-files=all","--",...scoped]);
65
+ const unstaged=git(workspace,["diff","--binary","--no-ext-diff","--no-textconv","HEAD","--",...scoped]);
66
+ const staged=git(workspace,["diff","--cached","--binary","--no-ext-diff","--no-textconv","HEAD","--",...scoped]);
67
+ const untracked=nulPaths(git(workspace,["ls-files","--others","--exclude-standard","-z","--",...scoped])).map(p=>untrackedRecord(workspace,p));
68
+ const tracked=new Set([
69
+ ...nulPaths(git(workspace,["diff","--name-only","-z","HEAD","--",...scoped])),
70
+ ...nulPaths(git(workspace,["diff","--cached","--name-only","-z","HEAD","--",...scoped]))
71
+ ]);
72
+ const components={
73
+ status_sha256:hash(status),
74
+ unstaged_diff_sha256:hash(unstaged),
75
+ staged_diff_sha256:hash(staged),
76
+ untracked_manifest_sha256:hash(Buffer.from(canonicalJson(untracked),"utf8"))
77
+ };
78
+ const payload={algorithm:ALGORITHM,workspace_scope:".",head_commit:head,excluded:CONTROL_OUTPUT_EXCLUDES,...components,untracked};
79
+ const changed_paths=[
80
+ ...[...tracked].sort().map(path=>({path,kind:"tracked"})),
81
+ ...untracked.map(x=>({path:x.path,kind:"untracked",sha256:x.sha256}))
82
+ ].sort((a,b)=>a.path.localeCompare(b.path));
83
+ process.stdout.write(JSON.stringify({
84
+ schema:"yaaw.repository-identity/v2",algorithm:ALGORITHM,status:"READY",workspace_scope:".",
85
+ git_root_relation:workspacePrefix?"ancestor":"same",head_commit:head,dirty:status.length>0,
86
+ worktree_digest:"sha256:"+hash(Buffer.from(canonicalJson(payload),"utf8")),
87
+ components,changed_paths,error:null
88
+ })+"\n");
89
+ } catch(error) {
90
+ if(process.exitCode!==2) fail("IDENTITY_FAILED",error instanceof Error?error.message:String(error));
91
+ }
92
+ }
@@ -20,3 +20,7 @@ Repository status is `READY`. One ticket must be admitted as `READY`, dependenci
20
20
 
21
21
  ## Output
22
22
  Reviewable implementation plus evidence, or explicit replan/blocker state.
23
+
24
+ ## Evidence identity
25
+
26
+ Use the canonical repository identity utility for implementation evidence. Do not implement a private worktree digest. Changeability requirements remain in force.
@@ -16,3 +16,7 @@ Ticket is `REPAIR_REQUIRED` and latest review result is `REPAIR` against the sam
16
16
 
17
17
  ## Output
18
18
  Repaired reviewable implementation or replan/blocker result.
19
+
20
+ ## Repair identity
21
+
22
+ After bounded repair and verification, bind evidence to the canonical repository identity and return `REVIEW_REQUIRED`. Changeability requirements remain in force.
@@ -15,3 +15,6 @@ Ticket requirements/tests, changed surface, project tooling/rules, current repos
15
15
 
16
16
  ## Output
17
17
  Evidence record(s). Verification never transitions a ticket to PASS; only Reviewer can accept.
18
+
19
+ ## Verification identity
20
+ After verification commands finish, invoke `.yaaw-core/system/tools/repository-identity.mjs` and record that exact output in `yaaw.evidence/v2`. Do not reserialize it through a second digest implementation. Replaceable `.yaaw-core/runtime/**` coordination files are excluded by canonical `yaaw-worktree-v2`; all semantic/project/application changes remain in the basis. Changeability requirements remain in force.
@@ -1,24 +1,24 @@
1
1
  # Determine next action
2
2
 
3
3
  ## Purpose
4
- Turn reconciled observed reality into one explicit, fresh dispatch contract.
5
-
6
- ## Inputs
7
- Current observed-state snapshot, reconciled state, `.yaaw-core/system/core/routing.md`, workflow/execution/artifact/role-I/O/expertise registries, and optional current intent.
4
+ Expose the deterministic route/handoff preparation contract without duplicating routing logic in the Orchestrator model.
8
5
 
9
6
  ## Procedure
10
- 1. Require the current observed framework integrity status to be `HEALTHY`. Otherwise return the typed framework stop and write no executable handoff.
11
- 2. Choose exactly one next canonical workflow or terminal state using explicit routing precedence. Do not load candidate workflow bodies while choosing.
12
- 3. Resolve its repository requirement from `.yaaw-core/system/registries/execution-policy.json`.
13
- 4. If requirement is `IDENTITY` and repository status is not `READY`, return `PRECONDITION_UNSATISFIED:REPOSITORY_IDENTITY_UNAVAILABLE` or `BLOCKED` as appropriate; do not dispatch.
14
- 5. Resolve exact read/write/forbidden-write artifact classes from `.yaaw-core/system/registries/role-io.json` and exact current artifact references.
15
- 6. Select only YAAW expertise relevant to the selected workflow/artifact. Host expertise is admitted only through `.yaaw-core/system/rules/research-admission.md`.
16
- 7. Write `.yaaw-core/runtime/handoff.json` conforming to handoff v2 with desired intent, role, workflow ID, exact references/revisions, read/write sets, expertise, expected output/result vocabulary, repository requirement/basis, and transition sequence.
17
- 8. If the result is human-input, BLOCKED, or COMPLETE, write no executable handoff and return the stop result.
7
+ Normal orchestration satisfies this workflow by executing:
8
+
9
+ ```text
10
+ node .yaaw-core/system/tools/orchestration-runtime.mjs --workspace <WORKSPACE_ROOT>
11
+ ```
12
+
13
+ The runtime reads the machine routing/execution/role-I/O/handoff policies, current durable metadata, framework basis, and canonical repository identity; it then returns exactly one typed result and, only for a dispatchable non-Orchestrator semantic workflow, persists one `yaaw.handoff/v2`.
14
+
15
+ - `DISPATCH_READY`: consume the persisted handoff; do not rebuild it.
16
+ - `RECONCILE_REQUIRED`: execute only `orchestration.reconcile-state` before preparing again.
17
+ - `ROOT_ACTION`: execute only the selected Orchestrator recovery workflow.
18
+ - `TERMINAL`/`BLOCKED`/`FRAMEWORK_STOP`: write no executable handoff.
18
19
 
19
20
  ## Boundary
20
- Do not perform target role semantic work here.
21
+ Do not perform target-role semantic work here. Do not hand-serialize a handoff or select expertise outside the deterministic handoff policy.
21
22
 
22
23
  ## Framework write guard
23
-
24
- Before persisting a handoff, verify that its write set is a subset of the selected role's canonical artifact writes and contains no installer-managed artifact or `.yaaw-core/system/**` path. A framework defect is a stop condition, never a target workflow.
24
+ The runtime verifies selected reads/writes against `role-io.json`; an unauthorized artifact class or missing machine contract is `FRAMEWORK_CONTRACT_INCONSISTENCY`, never a semantic reroute.
@@ -4,26 +4,32 @@
4
4
  Execute exactly one already-selected canonical workflow. This file is not the orchestration loop.
5
5
 
6
6
  ## Inputs
7
- `.yaaw-core/runtime/handoff.json` created by `orchestration.determine-next-action`.
7
+ `.yaaw-core/runtime/handoff.json` produced by the deterministic orchestration runtime.
8
8
 
9
9
  ## Procedure
10
- 1. Re-run the framework integrity gate and require `HEALTHY`; compare its manifest basis with the handoff framework basis. If package integrity changed, discard the handoff and return the typed framework stop before loading target semantics.
11
- 2. Validate handoff schema, workflow registry entry, execution policy, role I/O, source artifact revisions, transition-sequence basis, and repository basis.
12
- 3. Enforce repository requirement: `NONE` needs no Git prerequisite; `INSPECT` may proceed with a represented `UNVERSIONED` workspace; `IDENTITY` requires repository status `READY`.
13
- 4. If any basis is stale or unsatisfied, discard the handoff and return a typed stale/prerequisite result to `orchestration.route`; do not execute it.
14
- 5. Resolve the handoff's execution-context policy from `execution-policy.json` and `.yaaw-core/system/core/dispatch-execution.md`.
15
- 6. If the target is an Orchestrator workflow or policy is `ROOT_ONLY`, execute in the current root context.
16
- 7. Otherwise request the active host adapter's isolated-worker mechanism. When isolation is available, execute this one handoff in a fresh worker with minimal bootstrap context and without relying on inherited parent conversation.
17
- 8. If isolation is unavailable or a named worker cannot be selected before child creation, follow the configured host fallback policy. If a child was already created and then failed, do **not** blindly retry; return to reality inspection first.
18
- 9. For Implementer or Reviewer, consult `.yaaw-core/runtime/dispatch-failures.json` after inspection. If the unchanged handoff basis has reached the host-configured execution-failure threshold, request the host capability-fallback worker/profile for this attempt. The semantic role/workflow and handoff remain unchanged. If the fallback itself already failed with no progress on this basis, return `BLOCKED:AUTHORITY_EXECUTION_FAILED`.
19
- 10. The executing context loads only the target role contract, selected workflow contract, exact handoff reads, selected expertise, and minimal relevant repository context.
20
- 11. Execute the target workflow once. A worker may not route or spawn another YAAW authority role.
21
- 12. Require the expected durable output/state/evidence or an explicit legal typed stop/prerequisite result.
22
- 13. Treat any child response only as an execution signal; do not accept it as project truth without re-inspection.
23
- 14. Mark/remove the consumed runtime handoff and return control to `orchestration.route`.
10
+ 1. Immediately before loading target semantics, execute:
11
+
12
+ ```text
13
+ node .yaaw-core/system/tools/orchestration-runtime.mjs --workspace <WORKSPACE_ROOT> --check-handoff
14
+ ```
15
+
16
+ 2. Require `HANDOFF_FRESH`. `FRAMEWORK_STOP`, `RECONCILE_REQUIRED`, `ROOT_ACTION`, `TERMINAL`, `BLOCKED`, or `HANDOFF_STALE` returns control to `orchestration.route`; do not execute the stale target. This single freshness check reuses the same framework, repository-identity, artifact, routing, and handoff serialization implementation that created the handoff.
17
+ 3. Resolve the handoff's execution-context policy from `execution-policy.json` and `.yaaw-core/system/core/dispatch-execution.md`.
18
+ 4. If the target is an Orchestrator workflow or policy is `ROOT_ONLY`, execute in the current root context.
19
+ 5. Otherwise ask the active host adapter to resolve the selected authority's required effective execution profile. This is host execution metadata; do not write provider model/reasoning identifiers into the canonical handoff.
20
+ 6. Prefer the adapter's exact named authority worker when available. If named selection is unavailable before child creation, the adapter may choose a generic isolated mechanism only after proving profile equivalence or authoritatively correcting every mismatched profile dimension.
21
+ 7. If an isolated mechanism exists but cannot guarantee the required profile, return `BLOCKED:HOST_EXECUTION_PROFILE_UNAVAILABLE`. If strict isolation is required and no isolated mechanism exists at all, return `BLOCKED:HOST_ISOLATION_UNAVAILABLE`.
22
+ 8. In an adapter `auto` mode, inline fallback is legal only when the adapter proves the inline/root execution profile equivalent to the required authority profile. A deliberately selected adapter `inline` mode is an explicit opt-out from per-role model isolation.
23
+ 9. If a child was already created and then failed, do **not** switch mechanisms or retry blindly; return to deterministic reality preparation first.
24
+ 10. For Implementer or Reviewer, consult `.yaaw-core/runtime/dispatch-failures.json` only after inspection. If the unchanged handoff basis has reached the host-configured execution-failure threshold, request the configured host capability-fallback profile for this attempt. Resolve and preserve that fallback profile using the same fidelity rules. If the fallback itself already failed with no progress on this basis, return `BLOCKED:AUTHORITY_EXECUTION_FAILED`.
25
+ 11. A pre-execution `HOST_EXECUTION_PROFILE_UNAVAILABLE` or `HOST_ISOLATION_UNAVAILABLE` stop does not increment the execution-failure ledger because no authority child executed.
26
+ 12. The executing context loads only the target role contract, selected workflow contract, exact handoff reads, selected expertise, and minimal relevant repository context.
27
+ 13. Execute the target workflow once. A worker may not route or spawn another YAAW authority role.
28
+ 14. Require the expected durable output/state/evidence or an explicit legal typed stop/prerequisite result.
29
+ 15. Treat any child response only as an execution signal; do not accept it as project truth without re-inspection.
30
+ 16. Mark/remove the consumed runtime handoff and return control to `orchestration.route`.
24
31
 
25
32
  Never recursively dispatch `orchestration.dispatch` as its own target. A target role never dispatches a peer.
26
33
 
27
34
  ## Package boundary
28
-
29
35
  Dispatch rejects any handoff whose writes include installer-managed artifacts or `.yaaw-core/system/**`. An admitted application-file write never authorizes package framework mutation.
@@ -1,22 +1,19 @@
1
1
  # Inspect state
2
2
 
3
3
  ## Purpose
4
- Create a non-mutating observed-reality snapshot that separates claims from evidence and classifies repository capability safely.
5
-
6
- ## Inputs
7
- Resolved workspace root, installation manifest/framework-integrity result, `.yaaw-core/project/state.json`, product/engineering/research/spec/ticket/review/evidence/runtime files, project rules, and available repository/application reality.
4
+ Create a non-mutating observed-reality snapshot using the same deterministic runtime implementation used by normal orchestration.
8
5
 
9
6
  ## Procedure
10
- 1. Resolve `WORKSPACE_ROOT` using `.yaaw-core/system/core/execution-context.md`; never trust ambient CWD.
11
- 2. Execute `.yaaw-core/system/tools/framework-integrity.mjs --workspace <WORKSPACE_ROOT>` and record its status plus current manifest basis. If status is not `HEALTHY`, record the framework failure, invalidate any executable handoff candidate, write only the replaceable observation when safe, and stop inspection before semantic project reconciliation.
12
- 3. Probe Git only with root-anchored commands such as `git -C <WORKSPACE_ROOT> rev-parse --show-toplevel`.
13
- 4. Classify repository status using `.yaaw-core/system/rules/repository-identity.md`. A failed `rev-parse` becomes `UNVERSIONED` or another explicit status; do not leak a raw Git fatal error as successful identity.
14
- 5. When status is `READY`, compute workspace-scoped repository identity. If Git root is an ancestor, scope status/diff/untracked hashing to the workspace.
15
- 6. Read machine-readable artifact metadata and active durable artifacts.
16
- 7. Compare state claims with artifact/repository/review evidence without repairing yet.
17
- 8. Reconcile the replaceable dispatch-failure ledger. For Implementer/Reviewer worker execution failures, compare the prior failure basis with the current role, workflow, active artifact, revisions, transition sequence, and repository basis. Increment only when the prior attempt made no durable progress and the basis is unchanged. Reset/remove the ledger after legal workflow completion, durable progress, a basis change, or when routing leaves that work item.
18
- 9. List inconsistencies, stale artifacts/handoffs, blockers, and candidate next states.
19
- 10. Write replaceable `.yaaw-core/runtime/observed-state.json` conforming to observed-state v2.
7
+ 1. Resolve `WORKSPACE_ROOT` using `.yaaw-core/system/core/execution-context.md`.
8
+ 2. Execute:
9
+
10
+ ```text
11
+ node .yaaw-core/system/tools/orchestration-runtime.mjs --workspace <WORKSPACE_ROOT> --inspect-only
12
+ ```
13
+
14
+ 3. Consume `.yaaw-core/runtime/observed-state.json` and the typed `INSPECTED`/framework-stop result.
15
+ 4. The runtime compares current product/engineering/spec/ticket revisions and, for accepted work, current review/verification presence and repository identity so stale acceptance becomes a reconciliation input rather than a direct terminal route.
16
+ 5. Do not independently invoke Git, calculate `worktree_digest`, discover artifact locations, or serialize a second observation.
20
17
 
21
18
  ## Output
22
- Observed-state snapshot only; no semantic or ticket-state mutation.
19
+ Observed-state snapshot only; no semantic/ticket-state mutation and no executable handoff construction in `--inspect-only` mode.
@@ -15,3 +15,7 @@ Active/recent artifact, state claims, runtime caches, repository identity/histor
15
15
  6. Return control to `orchestration.route` for normal next-action selection.
16
16
 
17
17
  Never repeat destructive work merely because a context ended.
18
+
19
+ ## Acceptance recovery
20
+
21
+ A source-current stale `PASS` is recovered through `REVIEW_REQUIRED`. Do not dispatch Planner unless contract invalidation is independently proven.
@@ -3,24 +3,32 @@
3
3
  ## Purpose
4
4
  Continuously restore project reality and execute one safe canonical workflow at a time until a true stop condition.
5
5
 
6
- ## Progressive routing
7
- Selection is metadata-first. Do not preload candidate target workflow bodies, templates, or expertise before `orchestration.determine-next-action` chooses exactly one workflow.
6
+ ## Deterministic preparation
7
+ Normal routing uses one command per basis:
8
+
9
+ ```text
10
+ node .yaaw-core/system/tools/orchestration-runtime.mjs --workspace <WORKSPACE_ROOT>
11
+ ```
12
+
13
+ This command performs framework integrity, canonical repository identity, durable metadata inspection, route selection, and handoff construction together. Do not separately reconstruct those stages in shell/Python/model reasoning.
8
14
 
9
15
  ## Procedure
10
16
  Repeat:
11
- 1. execute `orchestration.inspect-state`;
12
- 2. if framework integrity is not `HEALTHY`, invalidate executable handoffs and stop with the typed framework failure; do not reconcile project lifecycle state;
13
- 3. execute `orchestration.reconcile-state` when project inconsistencies exist;
14
- 4. execute `orchestration.determine-next-action`;
15
- 5. if terminal/blocked/human-input/framework stop condition is returned, stop;
16
- 6. execute `orchestration.dispatch` for the one persisted handoff;
17
+ 1. run deterministic preparation once;
18
+ 2. on `FRAMEWORK_STOP`, invalidate executable handoffs and stop with the typed framework failure;
19
+ 3. on `RECONCILE_REQUIRED`, execute `orchestration.reconcile-state` only, then return to step 1;
20
+ 4. on `ROOT_ACTION`, execute the returned Orchestrator workflow only, then return to step 1;
21
+ 5. on `TERMINAL` or `BLOCKED`, stop;
22
+ 6. on `DISPATCH_READY`, execute `orchestration.dispatch` for the persisted handoff;
17
23
  7. require the dispatched execution to persist its authorized durable output or legal typed prerequisite/stop result;
18
- 8. whether dispatch reports success, failure, interruption, or no response, discard/validate the consumed handoff as appropriate and return to step 1 before loading another target workflow.
24
+ 8. whether dispatch reports success, failure, interruption, or no response, return to step 1 before another semantic workflow.
25
+
26
+ `orchestration.inspect-state` and `orchestration.determine-next-action` remain canonical compatibility/debug workflows, but the normal loop does not execute them as separate model-driven reconstruction passes.
19
27
 
20
28
  There is no direct `worker A result -> worker B` authority chain. Reality reconstruction always sits between authority-role dispatches.
21
29
 
22
30
  ## Loop safety
23
- If the same repository capability/identity, state, handoff, and expected output repeat without any durable mutation/evidence change, stop as `BLOCKED` with `no_progress` rather than spinning.
31
+ If the same repository basis, lifecycle state, route, and expected output repeat without durable mutation/evidence change, stop as `BLOCKED` with `no_progress` rather than spinning.
24
32
 
25
33
  ## Stop conditions
26
- Framework integrity unavailable/unhealthy; framework contract inconsistency; Human product/engineering answer required; evidence/permission unavailable; target workflow requires repository `IDENTITY` but status is not `READY`; active host/runtime policy blocks required isolation; host requires approval for consequential action; or accepted scope is terminal `COMPLETE`.
34
+ Framework integrity unavailable/unhealthy; framework contract inconsistency; Human product/engineering answer required; evidence/permission unavailable; target workflow requires repository `IDENTITY` but status is not `READY`; active host/runtime policy blocks required isolation/profile fidelity; host requires approval for consequential action; or accepted scope is terminal `COMPLETE`.
@@ -16,3 +16,7 @@ Repository evidence, product revision, review finding, or invalidation has made
16
16
 
17
17
  ## Output
18
18
  Current engineering contract plus updated downstream admission state.
19
+
20
+ ## Admission guard
21
+
22
+ Repository identity change alone is not sufficient reason to replan. Require stale source/contract revisions or Reviewer `REPLAN` evidence.
@@ -9,9 +9,12 @@ Current ticket/spec/product/engineering revisions, repository status `READY` plu
9
9
  ## Procedure
10
10
  1. If repository status is not `READY`, return `BLOCKED`/`PRECONDITION_UNSATISFIED:REPOSITORY_IDENTITY_UNAVAILABLE`; do not review against ambiguous identity.
11
11
  2. Revalidate source revisions and reject stale review inputs.
12
- 3. Compute/record repository identity using `rules/repository-identity.md`.
12
+ 3. Compute/record repository identity using `rules/repository-identity.md` and the canonical utility.
13
13
  4. Inspect actual diff/files/tests/evidence; ignore implementation summaries when they conflict with observed work.
14
14
  5. Identify acceptance criteria, failure paths, regressions, and domain-specific requirements that must be checked.
15
15
 
16
16
  ## Output
17
17
  Review inspection tied to exact repository and contract identity.
18
+
19
+ ## Repository basis
20
+ Obtain repository identity from `.yaaw-core/system/tools/repository-identity.mjs`. Do not whitelist `.codex`, `.agents`, provider directories, or project/application files merely by path ownership. Only replaceable `.yaaw-core/runtime/**` coordination caches are excluded by the canonical identity algorithm so orchestration cannot invalidate its own handoff basis.
@@ -1,9 +1,20 @@
1
1
  import * as p from "@clack/prompts";
2
+ const CODEX_FAILURE_FALLBACK_CHANGE = "codex-authority-failure-fallback";
3
+ function preservationNotice(update) {
4
+ const lines = [
5
+ " Quick Update installed support for these capabilities without changing your existing provider setup.",
6
+ " Your current configuration and selected profile were preserved."
7
+ ];
8
+ if (update.integrationId === "codex" && update.changes.some(change => change.id === CODEX_FAILURE_FALLBACK_CHANGE)) {
9
+ lines.push(" Astra fallback is available, but Quick Update did not enable it or replace your current Codex settings.", " To enable it: run `yaaw config codex` and choose Recommended, or choose Custom and configure Failure fallback.");
10
+ }
11
+ return lines;
12
+ }
2
13
  export function formatConfigurationUpdates(updates) {
3
14
  return updates.flatMap(update => [
4
15
  update.displayName,
5
16
  ...update.changes.map(change => ` ${change.title}: ${change.summary}`),
6
- " Current configuration was preserved.",
17
+ ...preservationNotice(update),
7
18
  ` Review: ${update.command}`,
8
19
  ""
9
20
  ]).join("\n").trim();
@@ -1 +1 @@
1
- {"version":3,"file":"configuration-updates.js","sourceRoot":"","sources":["../../src/tui/configuration-updates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,gBAAgB,CAAC;AAIpC,MAAM,UAAU,0BAA0B,CAAC,OAA8B;IACvE,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC/B,MAAM,CAAC,WAAW;QAClB,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,MAAM,CAAC,KAAK,KAAK,MAAM,CAAC,OAAO,EAAE,CAAC;QACvE,wCAAwC;QACxC,aAAa,MAAM,CAAC,OAAO,EA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QAAQ,EAAE,KAAK,EAAE,qBAAqB,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;KACjG,CAAC,CAAC;IACH,IAAI,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,KAAK,OAAO;QAAE,OAAO,EAAE,CAAC;IACxD,MAAM,QAAQ,GAAG,MAAM,CAAC,CAAC,WAAW,CAAC;QACnC,OAAO,EAAE,0CAA0C;QACnD,QAAQ,EAAE,KAAK;QACf,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,aAAa,EAAE,KAAK,EAAE,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC;KAC7F,CAAC,CAAC;IACH,OAAO,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAA2B,CAAC;AACjE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yaaw-se",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "description": "Artifact-first autonomous software engineering workflow installer.",
5
5
  "type": "module",
6
6
  "bin": {