yaaw-se 0.3.7 → 0.3.8

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 (81) hide show
  1. package/README.md +6 -2
  2. package/dist/installer/migrations/index.d.ts +2 -2
  3. package/dist/installer/migrations/index.js +2 -2
  4. package/dist/installer/migrations/project/index.js +2 -2
  5. package/dist/installer/migrations/project/index.js.map +1 -1
  6. package/dist/installer/migrations/project/v1-to-v2.d.ts +2 -0
  7. package/dist/installer/migrations/project/v1-to-v2.js +64 -0
  8. package/dist/installer/migrations/project/v1-to-v2.js.map +1 -0
  9. package/dist/installer/project-state.js +1 -0
  10. package/dist/installer/project-state.js.map +1 -1
  11. package/dist/installer/transaction.js +5 -0
  12. package/dist/installer/transaction.js.map +1 -1
  13. package/dist/installer/types.d.ts +5 -0
  14. package/dist/payload/bootstrap/claude-code.md +1 -1
  15. package/dist/payload/bootstrap/cline.md +1 -1
  16. package/dist/payload/bootstrap/codex.md +1 -1
  17. package/dist/payload/bootstrap/gemini-cli.md +1 -1
  18. package/dist/payload/integrations/codex/yaaw-runtime.md +1 -1
  19. package/dist/payload/payload-files.json +146 -111
  20. package/dist/payload/payload.json +1 -1
  21. package/dist/payload/skills/yaaw-create-spec/SKILL.md +6 -2
  22. package/dist/payload/skills/yaaw-create-ticket/SKILL.md +6 -2
  23. package/dist/payload/skills/yaaw-create-tickets/SKILL.md +6 -2
  24. package/dist/payload/skills/yaaw-implement/SKILL.md +6 -2
  25. package/dist/payload/skills/yaaw-orchestrator/SKILL.md +6 -2
  26. package/dist/payload/skills/yaaw-planner/SKILL.md +6 -2
  27. package/dist/payload/skills/yaaw-planning-review/SKILL.md +6 -2
  28. package/dist/payload/skills/yaaw-prd/SKILL.md +6 -2
  29. package/dist/payload/skills/yaaw-refine-prd/SKILL.md +6 -2
  30. package/dist/payload/skills/yaaw-repair/SKILL.md +6 -2
  31. package/dist/payload/skills/yaaw-review/SKILL.md +6 -2
  32. package/dist/payload/skills/yaaw-revise-prd/SKILL.md +6 -2
  33. package/dist/payload/yaaw-core/system/core/dispatch-execution.md +16 -53
  34. package/dist/payload/yaaw-core/system/core/invalidation.md +7 -38
  35. package/dist/payload/yaaw-core/system/core/io-contract.md +12 -45
  36. package/dist/payload/yaaw-core/system/core/lifecycle.md +11 -18
  37. package/dist/payload/yaaw-core/system/core/recovery.md +12 -26
  38. package/dist/payload/yaaw-core/system/core/routing.md +16 -31
  39. package/dist/payload/yaaw-core/system/core/state-model.md +7 -27
  40. package/dist/payload/yaaw-core/system/registries/handoff-policy.json +41 -59
  41. package/dist/payload/yaaw-core/system/registries/reconciliation-policy.json +17 -0
  42. package/dist/payload/yaaw-core/system/registries/role-io.json +15 -144
  43. package/dist/payload/yaaw-core/system/registries/skills.json +108 -12
  44. package/dist/payload/yaaw-core/system/roles/implementer.md +10 -13
  45. package/dist/payload/yaaw-core/system/roles/orchestrator.md +12 -17
  46. package/dist/payload/yaaw-core/system/roles/planner.md +9 -18
  47. package/dist/payload/yaaw-core/system/roles/reviewer.md +9 -14
  48. package/dist/payload/yaaw-core/system/schemas/engineering-v1.schema.json +15 -0
  49. package/dist/payload/yaaw-core/system/schemas/engineering-v2.schema.json +59 -0
  50. package/dist/payload/yaaw-core/system/schemas/engineering.schema.json +9 -12
  51. package/dist/payload/yaaw-core/system/schemas/evidence-v3.schema.json +111 -0
  52. package/dist/payload/yaaw-core/system/schemas/evidence.schema.json +3 -0
  53. package/dist/payload/yaaw-core/system/schemas/handoff.schema.json +3 -60
  54. package/dist/payload/yaaw-core/system/schemas/intent.schema.json +63 -8
  55. package/dist/payload/yaaw-core/system/schemas/observed-state.schema.json +55 -61
  56. package/dist/payload/yaaw-core/system/schemas/project-state-v1.schema.json +74 -0
  57. package/dist/payload/yaaw-core/system/schemas/project-state-v2.schema.json +251 -0
  58. package/dist/payload/yaaw-core/system/schemas/project-state.schema.json +9 -71
  59. package/dist/payload/yaaw-core/system/templates/engineering-research.md +2 -2
  60. package/dist/payload/yaaw-core/system/templates/engineering.md +2 -1
  61. package/dist/payload/yaaw-core/system/templates/evidence.json +2 -1
  62. package/dist/payload/yaaw-core/system/templates/handoff.json +7 -8
  63. package/dist/payload/yaaw-core/system/templates/intent.json +4 -3
  64. package/dist/payload/yaaw-core/system/templates/observed-state.json +6 -13
  65. package/dist/payload/yaaw-core/system/templates/project-state.json +2 -2
  66. package/dist/payload/yaaw-core/system/templates/review.md +4 -4
  67. package/dist/payload/yaaw-core/system/templates/spec.md +2 -2
  68. package/dist/payload/yaaw-core/system/templates/ticket.md +3 -3
  69. package/dist/payload/yaaw-core/system/tools/orchestration-engine.mjs +187 -0
  70. package/dist/payload/yaaw-core/system/tools/orchestration-runtime.mjs +46 -688
  71. package/dist/payload/yaaw-core/system/workflows/implementation/implement-ticket.md +9 -17
  72. package/dist/payload/yaaw-core/system/workflows/implementation/repair-ticket.md +7 -12
  73. package/dist/payload/yaaw-core/system/workflows/implementation/verify-ticket.md +9 -10
  74. package/dist/payload/yaaw-core/system/workflows/orchestration/reconcile-state.md +10 -13
  75. package/dist/payload/yaaw-core/system/workflows/orchestration/recover-interruption.md +9 -12
  76. package/dist/payload/yaaw-core/system/workflows/orchestration/route.md +14 -21
  77. package/dist/payload/yaaw-core/system/workflows/planning/create-spec.md +3 -0
  78. package/dist/payload/yaaw-core/system/workflows/planning/create-tickets.md +3 -0
  79. package/dist/payload/yaaw-core/system/workflows/planning/decision-frontier.md +3 -0
  80. package/dist/payload/yaaw-core/system/workflows/planning/replan.md +2 -0
  81. package/package.json +4 -3
@@ -2,9 +2,13 @@
2
2
  name: yaaw-prd
3
3
  description: Create or continue YAAW product definition, challenge material product assumptions, and route clarification or revision work.
4
4
  ---
5
- # YAAW PRD
5
+ # yaaw-prd
6
6
  ROLE: `prd`
7
7
  WORKFLOW: `prd.route`
8
+ INTENT: `CONTINUE_PRODUCT`
8
9
 
9
10
  ## Execute
10
- Load `.yaaw-core/system/roles/prd.md`, resolve `prd.route` through `.yaaw-core/system/registries/workflows.json`, then execute that canonical workflow. Keep semantic behavior in `.yaaw-core/system/`; this skill is only an entrypoint.
11
+ Resolve the YAAW workspace root, then invoke:
12
+ `node .yaaw-core/system/tools/orchestration-runtime.mjs --workspace <WORKSPACE_ROOT> --invoke-skill yaaw-prd`
13
+
14
+ Follow `orchestration.route` until `PRODUCT_READY` is satisfied or a human-input, BLOCKED, or framework stop occurs. Do not execute prd semantics directly from this wrapper; every semantic execution requires the exact runtime handoff.
@@ -2,9 +2,13 @@
2
2
  name: yaaw-refine-prd
3
3
  description: Improve clarity and completeness of a YAAW product artifact without changing accepted product meaning.
4
4
  ---
5
- # YAAW Refine PRD
5
+ # yaaw-refine-prd
6
6
  ROLE: `prd`
7
7
  WORKFLOW: `prd.refine`
8
+ INTENT: `REFINE_PRODUCT`
8
9
 
9
10
  ## Execute
10
- Load `.yaaw-core/system/roles/prd.md`, resolve `prd.refine` through `.yaaw-core/system/registries/workflows.json`, then execute that canonical workflow. Keep semantic behavior in `.yaaw-core/system/`; this skill is only an entrypoint.
11
+ Resolve the YAAW workspace root, then invoke:
12
+ `node .yaaw-core/system/tools/orchestration-runtime.mjs --workspace <WORKSPACE_ROOT> --invoke-skill yaaw-refine-prd`
13
+
14
+ Follow `orchestration.route` until `PRODUCT_REFINED` is satisfied or a human-input, BLOCKED, or framework stop occurs. Do not execute prd semantics directly from this wrapper; every semantic execution requires the exact runtime handoff.
@@ -2,9 +2,13 @@
2
2
  name: yaaw-repair
3
3
  description: Repair a YAAW ticket in REPAIR_REQUIRED state while preserving its accepted product and engineering contract.
4
4
  ---
5
- # YAAW Repair
5
+ # yaaw-repair
6
6
  ROLE: `implementer`
7
7
  WORKFLOW: `implementation.repair-ticket`
8
+ INTENT: `REPAIR`
8
9
 
9
10
  ## Execute
10
- Load `.yaaw-core/system/roles/implementer.md`, resolve `implementation.repair-ticket` through `.yaaw-core/system/registries/workflows.json`, then execute that canonical workflow. Keep semantic behavior in `.yaaw-core/system/`; this skill is only an entrypoint.
11
+ Resolve the YAAW workspace root, then invoke:
12
+ `node .yaaw-core/system/tools/orchestration-runtime.mjs --workspace <WORKSPACE_ROOT> --invoke-skill yaaw-repair`
13
+
14
+ Follow `orchestration.route` until `TICKET_REVIEW_REQUIRED` is satisfied or a human-input, BLOCKED, or framework stop occurs. Do not execute implementer semantics directly from this wrapper; every semantic execution requires the exact runtime handoff.
@@ -2,9 +2,13 @@
2
2
  name: yaaw-review
3
3
  description: Independently review actual YAAW implementation and classify PASS, REPAIR, REPLAN, or BLOCKED against current evidence.
4
4
  ---
5
- # YAAW Review
5
+ # yaaw-review
6
6
  ROLE: `reviewer`
7
7
  WORKFLOW: `review.review-ticket`
8
+ INTENT: `REVIEW`
8
9
 
9
10
  ## Execute
10
- Load `.yaaw-core/system/roles/reviewer.md`, resolve `review.review-ticket` through `.yaaw-core/system/registries/workflows.json`, then execute that canonical workflow. Keep semantic behavior in `.yaaw-core/system/`; this skill is only an entrypoint.
11
+ Resolve the YAAW workspace root, then invoke:
12
+ `node .yaaw-core/system/tools/orchestration-runtime.mjs --workspace <WORKSPACE_ROOT> --invoke-skill yaaw-review`
13
+
14
+ Follow `orchestration.route` until `TICKET_REVIEW_APPLIED` is satisfied or a human-input, BLOCKED, or framework stop occurs. Do not execute reviewer semantics directly from this wrapper; every semantic execution requires the exact runtime handoff.
@@ -2,9 +2,13 @@
2
2
  name: yaaw-revise-prd
3
3
  description: Change accepted YAAW product intent and invalidate downstream engineering contracts whose basis became stale.
4
4
  ---
5
- # YAAW Revise PRD
5
+ # yaaw-revise-prd
6
6
  ROLE: `prd`
7
7
  WORKFLOW: `prd.revise`
8
+ INTENT: `REVISE_PRODUCT`
8
9
 
9
10
  ## Execute
10
- Load `.yaaw-core/system/roles/prd.md`, resolve `prd.revise` through `.yaaw-core/system/registries/workflows.json`, then execute that canonical workflow. Keep semantic behavior in `.yaaw-core/system/`; this skill is only an entrypoint.
11
+ Resolve the YAAW workspace root, then invoke:
12
+ `node .yaaw-core/system/tools/orchestration-runtime.mjs --workspace <WORKSPACE_ROOT> --invoke-skill yaaw-revise-prd`
13
+
14
+ Follow `orchestration.route` until `PRODUCT_REVISION_ADVANCED` is satisfied or a human-input, BLOCKED, or framework stop occurs. Do not execute prd semantics directly from this wrapper; every semantic execution requires the exact runtime handoff.
@@ -1,65 +1,28 @@
1
1
  # Dispatch execution contract
2
2
 
3
- Dispatch is a semantic request to execute exactly one already-selected YAAW handoff using the strongest context-isolation mechanism the active host can safely provide.
3
+ Dispatch executes exactly one already-selected semantic handoff.
4
4
 
5
5
  ## Canonical rules
6
- 1. Orchestrator selects exactly one canonical workflow.
7
- 2. Orchestrator persists one valid `.yaaw-core/runtime/handoff.json`.
8
- 3. Under orchestrated operation, a non-Orchestrator semantic role should execute in a fresh isolated worker when the host provides that capability.
9
- 4. The worker receives minimal bootstrap context: workspace root, semantic role, handoff path, and instructions to resolve the canonical role/workflow from YAAW registries.
10
- 5. The worker reads durable YAAW state instead of depending on inherited planning conversation.
11
- 6. One dispatch executes exactly one handoff.
12
- 7. A worker may not route, spawn, or command another YAAW authority role.
13
- 8. The worker persists the required durable artifact/state/evidence before returning.
14
- 9. The worker returns only a legal typed result from the handoff/workflow contract.
15
- 10. A worker message is an execution signal, not project truth.
16
- 11. After worker completion, failure, interruption, or lost response, Orchestrator re-enters `orchestration.inspect-state` before selecting another semantic workflow.
17
- 12. If the preferred execution mechanism is unavailable, the active host adapter may use an alternate mechanism only when it can preserve the configured effective authority execution profile; otherwise dispatch fails closed.
6
+ 1. Public skills first become durable runtime intent.
7
+ 2. Orchestrator validates framework health, applies at most one reconciliation, validates source currency, and persists one exact handoff.
8
+ 3. A non-Orchestrator authority executes that handoff using the active host adapter's supported isolation/profile mechanism.
9
+ 4. The authority writes its durable semantic output and returns one allowed typed result.
10
+ 5. A worker message is an execution signal, not project truth. After success, failure, interruption, or lost response, Orchestrator observes reality again before routing.
18
11
 
19
- ## Direct invocation
20
- A user who directly invokes PRD, Planner, Implementer, or Reviewer has intentionally selected that role/workflow and may execute it in the current context. Isolation policy here governs **Orchestrator dispatch**, not the existence of direct public entrypoints.
21
-
22
- ## Execution-context policy
23
- `.yaaw-core/system/registries/execution-policy.json` declares one of:
24
- - `ROOT_ONLY`: run in the active root Orchestrator context.
25
- - `ISOLATED_PREFERRED`: prefer a fresh worker; host fallback may run through another mechanism only when the adapter establishes execution-profile equivalence. A deliberately selected host `inline` mode is an explicit opt-out from per-role isolation.
26
- - `INLINE_ALLOWED`: current-context execution is explicitly acceptable.
27
-
28
- A future `ISOLATED_REQUIRED` value may be introduced only with a schema/version update. Host adapters may still expose a stricter local runtime mode that blocks instead of falling back.
12
+ ## Public invocation
13
+ Direct public invocation does not bypass Orchestrator. For example, `yaaw-implement` means desired outcome `IMPLEMENT`; missing product/planning/spec/ticket prerequisites are resolved first, and the shortcut completes at `REVIEW_REQUIRED` rather than automatically reviewing.
29
14
 
30
15
  ## Fresh-context invariant
31
- An orchestrated Implementer execution context must never become the Reviewer execution context for the same work. Reviewer acceptance is an independent dispatch.
32
-
33
- ## Failure and retry invariant
34
- If a worker started and later failed or disappeared, do not blindly start the same authority worker again. Inspect durable reality first because the worker may already have mutated the repository or written evidence.
35
-
36
- ## Capability fallback invariant
37
- For Implementer and Reviewer only, a host adapter may declare a bounded capability fallback after repeated **execution** failures. This is not a semantic reroute.
38
-
39
- The Orchestrator owns `.yaaw-core/runtime/dispatch-failures.json` and updates it only after re-entering reality inspection. A failure counts only when:
40
- - a child started and failed, was interrupted, returned no response, or returned an unusable/illegal result;
41
- - post-failure inspection shows no durable progress attributable to that attempt; and
42
- - role, workflow, active artifact, source revisions, transition sequence, and repository basis are unchanged.
43
-
44
- Legal workflow results such as `REPAIR`, `REPLAN`, `BLOCKED`, or a real precondition result do not count as execution failures. Any durable progress or basis change resets the counter.
45
-
46
- When a configured threshold is reached, the next attempt may use the host's stronger fallback execution profile while preserving the exact role and handoff. The fallback receives one attempt on an unchanged basis. If that attempt also fails with no progress, stop with `BLOCKED:AUTHORITY_EXECUTION_FAILED` rather than entering an unbounded retry loop.
16
+ An orchestrated Implementer execution context must never become the Reviewer execution context for the same work. A dead worker is not retried blindly; durable progress is inspected first.
47
17
 
48
18
  ## Authority execution profile fidelity invariant
49
- A host adapter owns provider/model execution selection, but it may not silently substitute a different effective authority profile.
50
-
51
- - The canonical handoff remains provider-neutral: role, workflow, artifacts, basis, and allowed results do not carry provider model identifiers.
52
- - Before dispatch, the adapter resolves the required effective execution profile for the selected authority and, when applicable, the configured capability-fallback variant.
53
- - Changing named worker -> generic worker is legal only when the generic path is already profile-equivalent or every mismatched profile dimension can be authoritatively corrected by the active spawn mechanism.
54
- - Changing worker -> inline execution is legal only when the current/root execution profile is provably equivalent to the required authority profile. A user-selected host inline mode is the explicit exception because it deliberately opts out of per-role model isolation.
55
- - Model and reasoning dimensions are compared independently. A matching dimension needs no override; a mismatched dimension requires an authoritative override for that dimension.
56
- - Unknown inherited values remain symbolic. The adapter may treat two paths as equivalent when both resolve through the same `HOST_INHERIT` chain, but it must never guess that a concrete value equals an unknown inherited value.
57
- - If isolation exists but the host cannot guarantee the configured model/reasoning profile, stop with `BLOCKED:HOST_EXECUTION_PROFILE_UNAVAILABLE`.
58
- - If strict isolation is required and the host cannot create any isolated worker at all, stop with `BLOCKED:HOST_ISOLATION_UNAVAILABLE`.
59
- - A profile/isolation stop that occurs before child creation is a host precondition failure, not an authority execution failure. It must not increment `.yaaw-core/runtime/dispatch-failures.json` or trigger capability escalation.
60
- - Capability fallback uses the same resolver and fidelity rules as primary execution. If fallback selects a stronger profile, that exact effective profile must be preserved or dispatch blocks.
19
+ Provider/model execution selection belongs to the active host adapter, but changing execution mechanism may not silently change the configured effective authority profile.
61
20
 
62
- The Orchestrator may route a configured profile through the adapter; it may not invent, weaken, or replace that profile.
21
+ - `HOST_INHERIT` remains symbolic; unknown inherited model/reasoning values are never guessed.
22
+ - If an execution mechanism exists but cannot guarantee the required profile, return `BLOCKED:HOST_EXECUTION_PROFILE_UNAVAILABLE`.
23
+ - If strict isolation is required and no isolated mechanism exists, return `BLOCKED:HOST_ISOLATION_UNAVAILABLE`.
24
+ - A profile/isolation stop before child creation means no authority worker ran and must not increment the execution-failure ledger.
25
+ - Implementer/Reviewer capability fallback preserves the exact semantic role and handoff and is subject to the same profile-fidelity rule.
63
26
 
64
27
  ## Provider boundary
65
- This contract is provider-neutral. Names of host tools, agent types, provider directories, model identifiers, and provider-specific spawning schemas belong only to integration adapters.
28
+ Provider/model mechanics remain adapter-owned. The canonical semantic path is provider-neutral and identical across supported host adapters.
@@ -1,44 +1,13 @@
1
1
  # Invalidation propagation
2
2
 
3
- Accepted artifacts are historical records, not eternally valid truth. Prior reviews remain immutable historical evidence; current authority may become `STALE` without rewriting history.
3
+ Prior reviews remain immutable historical evidence; current authority may become STALE without rewriting history.
4
4
 
5
- ## Permanent rule
5
+ ## Contract staleness
6
+ For executable ticket states `READY`, `IN_PROGRESS`, `REVIEW_REQUIRED`, `REPAIR_REQUIRED`, and `PASS`, compare ticket product/engineering/spec revisions to current adopted sources before dispatch. Stable causes are `PRODUCT_SOURCE_STALE`, `ENGINEERING_SOURCE_STALE`, `SPEC_SOURCE_STALE`, `TICKET_SOURCE_STALE`, and `CONTRACT_INVALIDATED`. Their route is read from `routing-policy.json`; the current contract route is `REPLAN_REQUIRED`, and Orchestrator does not hard-code a second destination.
6
7
 
7
- **A stale contract and stale acceptance are not the same thing.**
8
+ ## Acceptance staleness
9
+ When source meaning remains current but current PASS verification/review repository identity is missing, stale, or legacy-unverifiable, preserve history and return current lifecycle authority to `REVIEW_REQUIRED`. Stable causes are `REVIEW_MISSING`, `REVIEW_REPOSITORY_STALE`, `VERIFICATION_MISSING`, `VERIFICATION_REPOSITORY_STALE`, and `LEGACY_IDENTITY_UNVERIFIABLE`.
8
10
 
9
- ## Acceptance invalidation
10
- If product/engineering/spec/ticket meaning remains current but review or verification proof is missing, repository-stale, or cannot be reproduced, preserve historical reviews and reconcile current acceptance to `REVIEW_REQUIRED`.
11
+ Repository identity mismatch alone never proves an architecture replan is required.
11
12
 
12
- Repository identity mismatch alone does not establish `REPLAN_REQUIRED`. Reviewer may return `PASS`, `REPAIR`, `REPLAN`, or `BLOCKED`.
13
-
14
- Stable acceptance causes: `REVIEW_MISSING`, `REVIEW_REPOSITORY_STALE`, `VERIFICATION_MISSING`, `VERIFICATION_REPOSITORY_STALE`, `LEGACY_IDENTITY_UNVERIFIABLE`.
15
-
16
- ## Framework integrity is not project invalidation
17
- Package-managed framework drift is neither contract invalidation nor acceptance invalidation. It means the execution engine is untrusted. Stop orchestration with the typed framework failure and use installer repair. Do not route framework drift to Planner or Reviewer and do not change ticket lifecycle state to encode it.
18
-
19
- Result: `PASS -> REPLAN_REQUIRED`.
20
-
21
- Next semantic owner: Planner.
22
-
23
- ### Acceptance invalidation
24
- The source contract remains current, but review or verification proof is missing, repository-stale, or cannot be reproduced under the canonical identity algorithm.
25
-
26
- Result: `PASS -> REVIEW_REQUIRED`.
27
-
28
- Next semantic owner: Reviewer.
29
-
30
- Repository identity mismatch alone does not establish `REPLAN_REQUIRED`. The Orchestrator may mechanically invalidate trust, but it must not decide that current code satisfies the contract or that architecture is invalid.
31
-
32
- Reviewer may then return `PASS`, `REPAIR`, `REPLAN`, or `BLOCKED`.
33
-
34
- ## Stable cause IDs
35
-
36
- Contract causes: `PRODUCT_SOURCE_STALE`, `ENGINEERING_SOURCE_STALE`, `SPEC_SOURCE_STALE`, `TICKET_SOURCE_STALE`, `CONTRACT_INVALIDATED`.
37
-
38
- Acceptance causes: `REVIEW_MISSING`, `REVIEW_REPOSITORY_STALE`, `VERIFICATION_MISSING`, `VERIFICATION_REPOSITORY_STALE`, `LEGACY_IDENTITY_UNVERIFIABLE`.
39
-
40
- Every invalidation records a stable cause plus human-readable evidence. Runtime-looking paths are not automatically acceptance-irrelevant.
41
-
42
- ## Framework integrity is not acceptance invalidation
43
-
44
- Package-managed framework drift is neither contract invalidation nor acceptance invalidation. It means the execution engine is not trusted. Stop orchestration with the typed framework failure and use installer repair. Do not route framework drift to Planner or Reviewer and do not change ticket lifecycle state to encode it.
13
+ Framework drift is neither contract nor acceptance invalidation. It stops orchestration fail-closed for installer repair.
@@ -1,56 +1,23 @@
1
1
  # Role I/O and communication contract
2
2
 
3
- YAAW roles communicate through durable artifacts, exact Orchestrator handoffs, and typed results. Roles do not privately command peer roles.
3
+ YAAW roles communicate through durable artifacts, exact Orchestrator handoffs, and typed results. Roles never privately command peer roles.
4
4
 
5
5
  ## Machine truth
6
- - `.yaaw-core/system/registries/artifacts.json` defines canonical artifact classes, locations, durability, and semantic ownership.
7
- - `.yaaw-core/system/registries/role-io.json` defines each role's default read/write authority.
8
- - `.yaaw-core/system/registries/workflows.json` maps canonical workflow IDs to one role/workflow contract.
9
- - `.yaaw-core/system/registries/execution-policy.json` defines repository requirements, execution-context policy, and context/research admission for every workflow.
10
- - `.yaaw-core/runtime/handoff.json` resolves those contracts to one exact dispatch.
11
- - `.yaaw-core/runtime/intent.json` may preserve the public entrypoint's desired destination while prerequisites are resolved.
6
+ Registries define artifact ownership, role I/O, workflow mapping, execution policy, public intent, reconciliation policy, and exact handoff construction.
12
7
 
13
- ## Dispatch contract
14
- Every semantic-role handoff records exact reads, writes, forbidden writes, current revisions, selected expertise, repository requirement/basis, desired intent, expected durable output, and allowed result vocabulary.
15
-
16
- The role reads the handoff, then its role contract, resolves `handoff.workflow` through the workflow registry, and only then loads the selected workflow and exact admitted context.
17
-
18
- A role must not search the repository for alternate YAAW artifact locations when a canonical input is missing. Missing or stale canonical prerequisites produce a typed result to Orchestrator.
19
-
20
- Host execution transport is separate from semantic communication. A semantic role may run in another fresh host context, but authority still flows only through durable YAAW artifacts and typed results.
8
+ ## Public-entry invariant
9
+ Every public skill is an intent entrypoint. It invokes `orchestration-runtime.mjs --invoke-skill <skill>`; it does not execute semantic role logic directly. Intent may prefer a destination, but it never bypasses framework health, reconciliation, source-current checks, repository policy, or handoff construction.
21
10
 
22
11
  ## Communication topology
23
12
  ```text
24
- PRD / Planner / Implementer / Reviewer
25
- ↓ durable output + typed result
26
- Orchestrator
27
- ↓ inspect reality
28
- ↓ exactly one next dispatch
13
+ public intent
14
+ -> Orchestrator observes/reconciles
15
+ -> one exact handoff
16
+ -> PRD / Planner / Implementer / Reviewer durable output
17
+ -> Orchestrator observes again
29
18
  ```
30
19
 
31
- Roles never spawn or command peer roles. **Roles report reality; Orchestrator decides routing.**
32
-
33
- A worker's textual success message is not semantic truth. Orchestrator verifies the expected artifact, revision, repository/evidence basis, and legal state transition after every dispatched execution.
34
-
35
- ## Typed results
36
- Common results include `SUCCESS`, `READY`, `HUMAN_INPUT_REQUIRED`, `PRECONDITION_UNSATISFIED`, `REVIEW_REQUIRED`, `REPLAN_REQUIRED`, `BLOCKED`, `PASS`, `REPAIR`, `REPLAN`, and `COMPLETE`.
37
-
38
- Framework-level stop results are `FRAMEWORK_INTEGRITY_VIOLATION`, `FRAMEWORK_INTEGRITY_UNKNOWN`, and `FRAMEWORK_CONTRACT_INCONSISTENCY`. They are installation/runtime trust failures, not ticket lifecycle states, and must not be represented by fabricating a ticket transition.
39
-
40
- Host-execution stop results are `HOST_ISOLATION_UNAVAILABLE`, `HOST_EXECUTION_PROFILE_UNAVAILABLE`, and `AUTHORITY_EXECUTION_FAILED`. They describe execution transport/capability failures, not semantic workflow outcomes or ticket lifecycle states.
41
-
42
- - `HOST_ISOLATION_UNAVAILABLE`: strict isolation was required, but the host could not create an isolated worker.
43
- - `HOST_EXECUTION_PROFILE_UNAVAILABLE`: an execution mechanism existed, but the host could not guarantee the configured effective authority model/reasoning profile.
44
- - `AUTHORITY_EXECUTION_FAILED`: the correct authority execution actually started and failed under the bounded retry/fallback policy.
45
-
46
- A host isolation/profile stop raised before child creation is a pre-execution host failure: no authority worker ran, so it must not be counted as an authority execution failure.
47
-
48
- `PRECONDITION_UNSATISFIED` includes a reason such as `NO_PRODUCT`, `PLANNING_UNREADY`, `SPEC_MISSING`, `NO_READY_TICKET`, `STALE_SOURCE`, or `REPOSITORY_IDENTITY_UNAVAILABLE`.
49
-
50
- A missing ticket never authorizes Implementer to create one. Implementer returns `PRECONDITION_UNSATISFIED:NO_READY_TICKET`; Orchestrator routes Planner.
51
-
52
- ## Framework write invariant
53
- No semantic-role handoff may admit `.yaaw-core/system/**` as a write surface. If a role discovers a contradiction in the package-managed framework, it returns a typed framework failure to Orchestrator. Installer repair is the only supported package mutation path.
20
+ Worker text is an execution signal, not project truth. Filesystem access never grants semantic authority.
54
21
 
55
- ## Authority invariant
56
- Filesystem access never grants semantic authority. A role may detect an invalid upstream contract but returns control to its owner instead of rewriting it.
22
+ ## Host-execution typed stops
23
+ `HOST_EXECUTION_PROFILE_UNAVAILABLE` means an execution mechanism existed, but it could not guarantee the configured authority profile. `HOST_ISOLATION_UNAVAILABLE` means strict isolation was required but unavailable. When either stop happens before child creation, no authority worker ran, so it is not an authority execution failure.
@@ -1,28 +1,21 @@
1
1
  # Lifecycle contract
2
2
 
3
- YAAW advances only through evidence-backed workflow boundaries.
3
+ YAAW advances only through durable facts adopted by Orchestrator.
4
4
 
5
5
  ```text
6
6
  product missing/unready -> PRD
7
7
  product ready, planning unresolved -> Planner
8
- planning ready, spec missing -> create spec
9
- spec accepted, tickets missing -> create tickets
10
- READY -> Implementer
11
- IN_PROGRESS -> recovery/continue
12
- REVIEW_REQUIRED -> Reviewer
13
- REPAIR_REQUIRED -> Implementer repair -> REVIEW_REQUIRED
14
- REPLAN_REQUIRED -> Planner
15
- PASS -> next admitted work
16
- all accepted scope current -> COMPLETE
8
+ planning ready, spec missing -> create/adopt spec
9
+ spec accepted, tickets missing -> create/register tickets
10
+ READY -> implementation_start fact -> IN_PROGRESS
11
+ IN_PROGRESS -> PASS verification fact -> REVIEW_REQUIRED
12
+ REVIEW_REQUIRED -> immutable Reviewer result -> PASS | REPAIR_REQUIRED | REPLAN_REQUIRED | BLOCKED
13
+ REPAIR_REQUIRED -> fresh PASS verification -> REVIEW_REQUIRED
14
+ PASS + scope_status OPEN/UNKNOWN -> Planner
15
+ all current tickets PASS/CANCELLED + scope_status COMPLETE -> COMPLETE
17
16
  ```
18
17
 
19
- ## Accepted-but-stale
20
- A historical `PASS` whose source contract is still current but whose acceptance proof is stale becomes `REVIEW_REQUIRED`, not `REPLAN_REQUIRED`.
21
-
22
- ## PASS meaning
23
- `PASS` means the currently observed repository/worktree state satisfies the current accepted ticket contract according to an independent Reviewer.
24
-
25
- It does not inherently mean committed, pushed, merged, or deployed. When accepted state is dirty, reporting must distinguish acceptance from persistence and disclose that the review basis is the current worktree.
18
+ One reconciliation is applied per observation cycle; recovery never jumps directly from `READY` to `REVIEW_REQUIRED`.
26
19
 
27
20
  ## Fresh-context invariant
28
- Every workflow must be resumable from durable artifacts and repository evidence without previous chat history.
21
+ Conversation may disappear at any point. Durable artifacts and repository evidence must still identify the correct next boundary.
@@ -1,29 +1,15 @@
1
- # Recovery policy
1
+ # Recovery contract
2
2
 
3
- Recovery compares claimed state with observed reality and returns to the last trustworthy boundary.
3
+ Recovery reconstructs the last trustworthy durable boundary; conversation loss is never permission to repeat semantic work.
4
4
 
5
- ## Framework precondition
6
- Framework integrity is checked before project recovery. If `.yaaw-core/system/core/framework-integrity.md` is not `HEALTHY`, stop with `FRAMEWORK_INTEGRITY_VIOLATION`, `FRAMEWORK_INTEGRITY_UNKNOWN`, or `FRAMEWORK_CONTRACT_INCONSISTENCY` as appropriate. Do not repair project lifecycle state while the governing package is untrusted, and never edit package-managed framework files as a recovery action. Resolve the workspace root first and use only root-anchored, workspace-scoped repository evidence from `.yaaw-core/system/core/execution-context.md`.
5
+ - Accepted current spec not reflected in state -> adopt exactly that spec; multiple candidates block.
6
+ - Current ticket file absent from state -> register one ticket per reconciliation cycle.
7
+ - `READY` plus valid implementation-start evidence -> `IN_PROGRESS`.
8
+ - `IN_PROGRESS` plus current PASS verification -> `REVIEW_REQUIRED`.
9
+ - `IN_PROGRESS` plus start evidence but no PASS verification -> `implementation.verify-ticket`.
10
+ - `REVIEW_REQUIRED` plus a valid current immutable review -> adopt its result before another Reviewer dispatch.
11
+ - Source drift -> use routing-policy invalidation, normally `REPLAN_REQUIRED`.
12
+ - Source-current acceptance/repository drift -> `REVIEW_REQUIRED`.
13
+ - Missing proof -> exact `BLOCKED`, never guessing.
7
14
 
8
- ## Evidence authority
9
- - Product intent: current accepted `product.md` revision.
10
- - Engineering decisions: current `engineering.md` decisions and accepted non-stale specs.
11
- - Implementation reality: repository contents plus repository identity/diff history.
12
- - Acceptance: fresh review evidence tied to the exact ticket/spec revisions and repository identity.
13
- - Routing cache: `state.json`, reconciled against stronger evidence.
14
-
15
- ## Rules
16
- - Never reimplement solely because state is stale.
17
- - `IN_PROGRESS` + implementation + required verification evidence + no review -> reconcile to `REVIEW_REQUIRED`.
18
- - `READY` + implementation already present -> inspect/recover rather than duplicate the change.
19
- - `PASS` + source/contract revision mismatch -> reconcile to `REPLAN_REQUIRED`.
20
- - `PASS` + source-current missing/stale/unreproducible review or verification basis -> reconcile to `REVIEW_REQUIRED`.
21
- - Repository identity mismatch alone invalidates acceptance proof, not planning meaning. Never route a source-current PASS to Planner solely because repository identity changed.
22
- - A stale `.yaaw-core/runtime/handoff.json` is discarded, not executed.
23
- - If repository identity is required but status is not `READY`, return `PRECONDITION_UNSATISFIED:REPOSITORY_IDENTITY_UNAVAILABLE` or `BLOCKED` with exact missing proof.
24
- - If a dispatched worker ends unexpectedly, returns no response, loses its context, or its response is lost, treat that as an ordinary context interruption: inspect durable artifacts/repository/evidence and route from reality.
25
- - Never blindly retry a worker that was successfully created; first determine whether it already produced durable effects.
26
- - Do not persist host worker/session IDs into durable project memory. Replaceable coordination data, if ever required, belongs under `.yaaw-core/runtime/`.
27
- - If the last trustworthy boundary cannot be proven, return `BLOCKED` with exact missing proof.
28
-
29
- Every reconciliation uses a legal transition and records its reason/evidence in state provenance.
15
+ Each observation applies at most one legal reconciliation and increments transition provenance once.
@@ -1,36 +1,21 @@
1
1
  # Routing contract
2
2
 
3
- Routing chooses exactly one next canonical workflow from observed reality. Explicit state beats broad heuristics. Workflow selection is metadata-first; target workflow bodies are loaded only after selection.
3
+ Routing chooses exactly one next canonical workflow from observed durable reality. Production semantics live in `.yaaw-core/system/tools/orchestration-engine.mjs`; `orchestration-runtime.mjs` is the filesystem/CLI shell.
4
4
 
5
- The machine implementation of this precedence is `.yaaw-core/system/tools/orchestration-runtime.mjs`, driven by `.yaaw-core/system/registries/routing-policy.json`. Orchestrator consumes the tool's typed route instead of manually replaying the precedence with shell commands or model reasoning.
6
-
7
- Before any semantic routing, require framework integrity `HEALTHY` under `.yaaw-core/system/core/framework-integrity.md`. Framework drift is not repository drift and never routes to Planner, Implementer, or Reviewer. It stops execution until installer repair restores the package boundary.
8
-
9
- Before dispatch, enforce the selected workflow repository requirement from `.yaaw-core/system/registries/execution-policy.json`. `IDENTITY` workflows require repository status `READY`; `INSPECT` workflows may represent an `UNVERSIONED` workspace; `NONE` workflows do not require Git.
5
+ Before semantic routing:
6
+ 1. framework integrity must be `HEALTHY`;
7
+ 2. apply at most one highest-priority reconciliation, then observe again;
8
+ 3. validate ticket source currency;
9
+ 4. enforce repository requirement;
10
+ 5. consider public intent only as a destination preference.
10
11
 
11
12
  ## Priority
12
- 1. Stop on unhealthy/unknown framework integrity or canonical framework-contract inconsistency.
13
- 2. Resolve material state inconsistency or incomplete recovery before creating a semantic handoff.
14
- 3. If accepted product intent is missing or newly invalidated, route to PRD.
15
- 4. If a ticket is `REPLAN_REQUIRED`, route to `planning.replan`.
16
- 5. If current engineering frontier is unresolved, route through `planning.route`.
17
- 6. If a ready frontier lacks an accepted spec, route to `planning.create-spec`.
18
- 7. If an accepted spec lacks executable tickets, route to `planning.create-tickets`.
19
- 8. If a ticket is `REPAIR_REQUIRED`, route to `implementation.repair-ticket`.
20
- 9. If a ticket is `REVIEW_REQUIRED`, route to `review.review-ticket`.
21
- 10. If a ticket is `IN_PROGRESS`, use recovery evidence to continue safely or reconcile to the next proven boundary; never restart blindly.
22
- 11. If a dependency-satisfied ticket is `READY`, route to `implementation.implement-ticket`.
23
- 12. If all current tickets are `PASS`/`CANCELLED` but accepted product scope remains, route to `planning.route` for the next frontier.
24
- 13. Declare `COMPLETE` only when the durable phase is complete and accepted scope is covered by fresh, non-stale acceptance evidence.
25
-
26
- ## Tie breaking
27
- - Never review a `REPAIR_REQUIRED` ticket before repair.
28
- - Never implement a `REPLAN_REQUIRED` ticket.
29
- - Never preserve `PASS` after its acceptance basis becomes stale.
30
- - Never convert repository drift into replan without independent contract invalidation evidence.
31
- - When evidence is insufficient to choose safely, route to recovery and ultimately `BLOCKED` rather than guessing.
32
-
33
- ## Conformance rule
34
- Behavioral fixtures and the deterministic runtime may reconcile/route only transitions explicitly justified by durable/repository evidence. They must never make product or architecture decisions.
35
-
36
- The Orchestrator selects/consumes the route; the target role owns semantic work inside it.
13
+ 1. If a ticket is `REPLAN_REQUIRED`, route Planner.
14
+ 2. If a ticket is `REPAIR_REQUIRED`, route bounded repair.
15
+ 3. If a ticket is `REVIEW_REQUIRED`, route Reviewer unless a valid durable review result must first be adopted.
16
+ 4. If a ticket is `IN_PROGRESS`, current PASS verification is adopted; otherwise valid start evidence routes standalone verification, never blind reimplementation.
17
+ 5. If a dependency-satisfied ticket is `READY`, route Implementer.
18
+ 6. Missing current spec/tickets route Planner prerequisites.
19
+ 7. When all current tickets are `PASS`/`CANCELLED`, `scope_status COMPLETE` permits completion; `OPEN` or `UNKNOWN` routes Planner.
20
+
21
+ Intent never skips these rules. `yaaw-implement` from an idea-only project can therefore route PRD -> planning -> spec -> tickets -> implementation while preserving desired outcome IMPLEMENT.
@@ -1,34 +1,14 @@
1
1
  # State model
2
2
 
3
- Canonical machine-readable project state is `.yaaw-core/project/state.json` using `yaaw.project-state/v1`.
3
+ Canonical project state is `.yaaw-core/project/state.json` using `yaaw.project-state/v2`.
4
4
 
5
- State is a routing cache and claim ledger. It is never trusted blindly over stronger domain evidence.
6
-
7
- ## Lifecycle authority
8
- For routing and workflow preconditions, `.yaaw-core/project/state.json` `tickets[TASK-NNN]` is the current lifecycle ledger. Ticket frontmatter `status` is artifact metadata/admission history and may retain an earlier value after later lifecycle transitions; it does not override the reconciled state ledger.
9
-
10
- Roles whose workflow depends on lifecycle status must receive `state` in their read set. Orchestrator reconciles the ledger against stronger artifact, review, evidence, and repository reality before dispatch.
5
+ State is a routing/adoption ledger, not semantic authority. Ticket frontmatter is admission/history metadata and never overrides the reconciled ticket lifecycle value in state.
11
6
 
12
7
  ## State writer
13
- Orchestrator is the physical writer of `state.json`. A transition's role owner remains the semantic decision authority. Reviewer decides `PASS`/`REPAIR`/`REPLAN`/`BLOCKED` in an immutable review; Orchestrator validates that durable result and records exactly the corresponding lifecycle transition and provenance. Orchestrator may not substitute its own acceptance judgment.
14
-
15
- ## Ticket states
16
- `DRAFT`, `READY`, `IN_PROGRESS`, `REVIEW_REQUIRED`, `REPAIR_REQUIRED`, `REPLAN_REQUIRED`, `BLOCKED`, `PASS`, `CANCELLED`.
17
-
18
- ## Project phases
19
- `product`, `planning`, `implementation`, `complete`, `blocked`.
20
-
21
- ## Required provenance
22
- Every mutation increments `transition_sequence` and writes `last_transition` with:
23
- - subject (`project` or `TASK-NNN`);
24
- - from/to state;
25
- - canonical workflow ID;
26
- - reason;
27
- - evidence references;
28
- - observed repository commit when available.
29
-
30
- `BLOCKED` state records a blocker summary and exact missing evidence/decision.
8
+ Orchestrator is the only physical writer of `state.json`. Semantic roles create durable facts: Planner creates engineering/spec/ticket facts, Implementer creates start/verification evidence, Reviewer creates immutable review results. Orchestrator validates and adopts those facts through legal transitions.
31
9
 
32
- `.yaaw-core/runtime/observed-state.json` and `.yaaw-core/runtime/handoff.json` are replaceable caches used to survive interruption inside orchestration. Their bases must be revalidated before use.
10
+ ## Planning completion
11
+ `planning.scope_status` mirrors Planner-owned `engineering.md`: `UNKNOWN`, `OPEN`, or `COMPLETE`. Orchestrator never infers COMPLETE from absence of runnable tickets.
33
12
 
34
- Legal transitions are defined in `core/transitions.md`.
13
+ ## Provenance
14
+ Every adopted mutation increments `transition_sequence` and records subject, from/to, workflow, reason, evidence, and observed commit.