yaaw-se 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/README.md +10 -0
  2. package/dist/cli/commands/doctor.d.ts +1 -0
  3. package/dist/cli/commands/doctor.js +1 -1
  4. package/dist/cli/commands/doctor.js.map +1 -1
  5. package/dist/cli/commands/install.d.ts +2 -1
  6. package/dist/cli/commands/install.js +8 -4
  7. package/dist/cli/commands/install.js.map +1 -1
  8. package/dist/cli/commands/status.d.ts +19 -0
  9. package/dist/cli/commands/status.js +5 -0
  10. package/dist/cli/commands/status.js.map +1 -1
  11. package/dist/cli/main.js +4 -2
  12. package/dist/cli/main.js.map +1 -1
  13. package/dist/installer/migrations/index.d.ts +1 -1
  14. package/dist/installer/migrations/index.js +1 -1
  15. package/dist/installer/plan.js +10 -0
  16. package/dist/installer/plan.js.map +1 -1
  17. package/dist/installer/status.d.ts +19 -0
  18. package/dist/installer/status.js +52 -2
  19. package/dist/installer/status.js.map +1 -1
  20. package/dist/installer/transaction.js +2 -1
  21. package/dist/installer/transaction.js.map +1 -1
  22. package/dist/installer/types.d.ts +4 -0
  23. package/dist/installer/verify.js +3 -1
  24. package/dist/installer/verify.js.map +1 -1
  25. package/dist/payload/payload-files.json +67 -57
  26. package/dist/payload/payload.json +1 -1
  27. package/dist/payload/yaaw-core/system/core/artifact-model.md +7 -1
  28. package/dist/payload/yaaw-core/system/core/authority.md +6 -0
  29. package/dist/payload/yaaw-core/system/core/execution-context.md +10 -0
  30. package/dist/payload/yaaw-core/system/core/framework-integrity.md +60 -0
  31. package/dist/payload/yaaw-core/system/core/invalidation.md +9 -2
  32. package/dist/payload/yaaw-core/system/core/io-contract.md +5 -0
  33. package/dist/payload/yaaw-core/system/core/recovery.md +7 -2
  34. package/dist/payload/yaaw-core/system/core/routing.md +17 -13
  35. package/dist/payload/yaaw-core/system/core/state-model.md +8 -0
  36. package/dist/payload/yaaw-core/system/core/transitions.md +6 -1
  37. package/dist/payload/yaaw-core/system/registries/role-io.json +148 -5
  38. package/dist/payload/yaaw-core/system/registries/routing-policy.json +63 -6
  39. package/dist/payload/yaaw-core/system/registries/transitions.json +171 -22
  40. package/dist/payload/yaaw-core/system/roles/implementer.md +3 -0
  41. package/dist/payload/yaaw-core/system/roles/orchestrator.md +11 -10
  42. package/dist/payload/yaaw-core/system/roles/planner.md +3 -0
  43. package/dist/payload/yaaw-core/system/roles/prd.md +3 -0
  44. package/dist/payload/yaaw-core/system/roles/reviewer.md +3 -0
  45. package/dist/payload/yaaw-core/system/schemas/handoff.schema.json +210 -25
  46. package/dist/payload/yaaw-core/system/schemas/observed-state.schema.json +160 -15
  47. package/dist/payload/yaaw-core/system/templates/handoff.json +21 -2
  48. package/dist/payload/yaaw-core/system/templates/observed-state.json +12 -0
  49. package/dist/payload/yaaw-core/system/tools/framework-integrity.mjs +151 -0
  50. package/dist/payload/yaaw-core/system/workflows/orchestration/determine-next-action.md +12 -7
  51. package/dist/payload/yaaw-core/system/workflows/orchestration/dispatch.md +17 -12
  52. package/dist/payload/yaaw-core/system/workflows/orchestration/inspect-state.md +9 -8
  53. package/dist/payload/yaaw-core/system/workflows/orchestration/reconcile-state.md +6 -0
  54. package/dist/payload/yaaw-core/system/workflows/orchestration/route.md +8 -7
  55. package/dist/payload/yaaw-core/system/workflows/review/record-review.md +8 -7
  56. package/dist/payload/yaaw-core/system/workflows/review/review-ticket.md +5 -1
  57. package/package.json +1 -1
@@ -7,17 +7,22 @@ Execute exactly one already-selected canonical workflow. This file is not the or
7
7
  `.yaaw-core/runtime/handoff.json` created by `orchestration.determine-next-action`.
8
8
 
9
9
  ## Procedure
10
- 1. Validate handoff schema, workflow registry entry, execution policy, role I/O, source artifact revisions, transition-sequence basis, and repository basis.
11
- 2. Enforce repository requirement: `NONE` needs no Git prerequisite; `INSPECT` may proceed with a represented `UNVERSIONED` workspace; `IDENTITY` requires repository status `READY`.
12
- 3. If any basis is stale or unsatisfied, discard the handoff and return a typed stale/prerequisite result to `orchestration.route`; do not execute it.
13
- 4. Resolve the handoff's execution-context policy from `execution-policy.json` and `.yaaw-core/system/core/dispatch-execution.md`.
14
- 5. If the target is an Orchestrator workflow or policy is `ROOT_ONLY`, execute in the current root context.
15
- 6. 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.
16
- 7. 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.
17
- 8. The executing context loads only the target role contract, selected workflow contract, exact handoff reads, selected expertise, and minimal relevant repository context.
18
- 9. Execute the target workflow once. A worker may not route or spawn another YAAW authority role.
19
- 10. Require the expected durable output/state/evidence or an explicit legal typed stop/prerequisite result.
20
- 11. Treat any child response only as an execution signal; do not accept it as project truth without re-inspection.
21
- 12. Mark/remove the consumed runtime handoff and return control to `orchestration.route`.
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. The executing context loads only the target role contract, selected workflow contract, exact handoff reads, selected expertise, and minimal relevant repository context.
19
+ 10. Execute the target workflow once. A worker may not route or spawn another YAAW authority role.
20
+ 11. Require the expected durable output/state/evidence or an explicit legal typed stop/prerequisite result.
21
+ 12. Treat any child response only as an execution signal; do not accept it as project truth without re-inspection.
22
+ 13. Mark/remove the consumed runtime handoff and return control to `orchestration.route`.
22
23
 
23
24
  Never recursively dispatch `orchestration.dispatch` as its own target. A target role never dispatches a peer.
25
+
26
+ ## Package boundary
27
+
28
+ Dispatch rejects any handoff whose writes include installer-managed artifacts or `.yaaw-core/system/**`. An admitted application-file write never authorizes package framework mutation.
@@ -4,17 +4,18 @@
4
4
  Create a non-mutating observed-reality snapshot that separates claims from evidence and classifies repository capability safely.
5
5
 
6
6
  ## Inputs
7
- Resolved workspace root, `.yaaw-core/project/state.json`, product/engineering/research/spec/ticket/review/evidence/runtime files, project rules, and available repository/application reality.
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.
8
8
 
9
9
  ## Procedure
10
10
  1. Resolve `WORKSPACE_ROOT` using `.yaaw-core/system/core/execution-context.md`; never trust ambient CWD.
11
- 2. Probe Git only with root-anchored commands such as `git -C <WORKSPACE_ROOT> rev-parse --show-toplevel`.
12
- 3. 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.
13
- 4. When status is `READY`, compute workspace-scoped repository identity. If Git root is an ancestor, scope status/diff/untracked hashing to the workspace.
14
- 5. Read machine-readable artifact metadata and active durable artifacts.
15
- 6. Compare state claims with artifact/repository/review evidence without repairing yet.
16
- 7. List inconsistencies, stale artifacts/handoffs, blockers, and candidate next states.
17
- 8. Write replaceable `.yaaw-core/runtime/observed-state.json` conforming to observed-state v2.
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. List inconsistencies, stale artifacts/handoffs, blockers, and candidate next states.
18
+ 9. Write replaceable `.yaaw-core/runtime/observed-state.json` conforming to observed-state v2.
18
19
 
19
20
  ## Output
20
21
  Observed-state snapshot only; no semantic or ticket-state mutation.
@@ -14,3 +14,9 @@ Current observed-state snapshot, state claims, artifact revisions, repository/ev
14
14
 
15
15
  ## Output
16
16
  Reconciled state or `BLOCKED` when the last trustworthy boundary cannot be proven.
17
+
18
+ ## Framework boundary
19
+
20
+ Reconciliation is forbidden when the observed framework integrity status is not `HEALTHY`. Return the typed framework stop without changing ticket/project lifecycle state. A contradiction among canonical framework contracts is `FRAMEWORK_CONTRACT_INCONSISTENCY`; do not resolve it by editing the governing files.
21
+
22
+ Reviewer-owned acceptance results are applied to `state.json` by Orchestrator only after the immutable review artifact is fresh and valid. Orchestrator records exactly the target implied by the review result and never invents an acceptance result.
@@ -9,12 +9,13 @@ Selection is metadata-first. Do not preload candidate target workflow bodies, te
9
9
  ## Procedure
10
10
  Repeat:
11
11
  1. execute `orchestration.inspect-state`;
12
- 2. execute `orchestration.reconcile-state` when inconsistencies exist;
13
- 3. execute `orchestration.determine-next-action`;
14
- 4. if terminal/blocked/human-input stop condition is returned, stop;
15
- 5. execute `orchestration.dispatch` for the one persisted handoff;
16
- 6. require the dispatched execution to persist its artifact/state/evidence output or legal typed prerequisite/stop result;
17
- 7. 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.
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
+ 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.
18
19
 
19
20
  There is no direct `worker A result -> worker B` authority chain. Reality reconstruction always sits between authority-role dispatches.
20
21
 
@@ -22,4 +23,4 @@ There is no direct `worker A result -> worker B` authority chain. Reality recons
22
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.
23
24
 
24
25
  ## Stop conditions
25
- 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`.
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`.
@@ -1,18 +1,19 @@
1
1
  # Record review
2
2
 
3
3
  ## Purpose
4
- Persist immutable acceptance history and update current ticket state legally.
4
+ Persist immutable Reviewer-owned acceptance history and return the authorized lifecycle outcome to Orchestrator without writing the state ledger directly.
5
5
 
6
6
  ## Procedure
7
7
  1. Create the next immutable `.yaaw-core/project/reviews/TASK-NNN-RK.md` from the review template.
8
8
  2. Frontmatter records ticket/review round, result, ticket/spec revisions, reviewed repository identity, and evidence references.
9
9
  3. Body records findings, verification, evidence interpretation, and next action.
10
10
  4. Never overwrite prior review rounds.
11
- 5. Apply exactly one legal transition:
12
- - `PASS` -> ticket `PASS`;
13
- - `REPAIR` -> `REPAIR_REQUIRED`;
14
- - `REPLAN` -> `REPLAN_REQUIRED`;
15
- - `BLOCKED` -> `BLOCKED`.
16
- 6. Write state-transition provenance.
11
+ 5. Select exactly one legal semantic outcome:
12
+ - `PASS` authorizes target ticket state `PASS`;
13
+ - `REPAIR` authorizes `REPAIR_REQUIRED`;
14
+ - `REPLAN` authorizes `REPLAN_REQUIRED`;
15
+ - `BLOCKED` authorizes `BLOCKED`.
16
+ 6. Reviewer writes only the immutable review artifact and returns the typed result. Reviewer does not edit `.yaaw-core/project/state.json`.
17
+ 7. Orchestrator re-inspects the new review, validates source/repository/evidence freshness, and records exactly the authorized transition plus provenance in `state.json`. Orchestrator may not substitute a different acceptance outcome.
17
18
 
18
19
  A prior PASS remains historical but becomes stale when repository/source revisions invalidate its basis.
@@ -4,7 +4,11 @@
4
4
  Independently determine whether current implementation satisfies the current ticket contract.
5
5
 
6
6
  ## Preconditions
7
- Ticket is `REVIEW_REQUIRED`; source revisions and evidence are current enough to review.
7
+ `.yaaw-core/project/state.json` is admitted read-only context. Its `tickets[TASK-NNN]` lifecycle value is authoritative for workflow admission and is `REVIEW_REQUIRED`, unless Orchestrator explicitly admitted a source-current stale-`PASS` acceptance revalidation.
8
+
9
+ Ticket frontmatter `status` is artifact metadata/admission history and may still say `READY` or another earlier value after later lifecycle transitions. It does not override the reconciled state ledger. Source revisions and evidence must still be current enough to review.
10
+
11
+ If state and stronger source/repository/evidence reality materially conflict, return `BLOCKED` with the exact conflict for Orchestrator reconciliation. Do not edit state.
8
12
 
9
13
  ## Procedure
10
14
  1. Use a fresh review context when practical.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yaaw-se",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Artifact-first autonomous software engineering workflow installer.",
5
5
  "type": "module",
6
6
  "bin": {