musubix3 0.1.20 → 0.1.21

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 (63) hide show
  1. package/.github/plugin/marketplace.json +2 -2
  2. package/.github/skills/sdd-change/SKILL.md +28 -45
  3. package/CHANGELOG.md +88 -0
  4. package/README-ja.md +103 -3
  5. package/README.md +113 -3
  6. package/dist/packages/analysis/src/approval.d.ts +51 -0
  7. package/dist/packages/analysis/src/approval.js +341 -2
  8. package/dist/packages/analysis/src/approval.js.map +1 -1
  9. package/dist/packages/analysis/src/attestation.js +4 -0
  10. package/dist/packages/analysis/src/attestation.js.map +1 -1
  11. package/dist/packages/analysis/src/change-evidence.d.ts +56 -13
  12. package/dist/packages/analysis/src/change-evidence.js +142 -81
  13. package/dist/packages/analysis/src/change-evidence.js.map +1 -1
  14. package/dist/packages/analysis/src/change-waiver.d.ts +37 -13
  15. package/dist/packages/analysis/src/change-waiver.js +425 -174
  16. package/dist/packages/analysis/src/change-waiver.js.map +1 -1
  17. package/dist/packages/analysis/src/change.d.ts +1 -0
  18. package/dist/packages/analysis/src/change.js +176 -23
  19. package/dist/packages/analysis/src/change.js.map +1 -1
  20. package/dist/packages/analysis/src/evidence-merge-guard.d.ts +5 -0
  21. package/dist/packages/analysis/src/evidence-merge-guard.js +15 -0
  22. package/dist/packages/analysis/src/evidence-merge-guard.js.map +1 -1
  23. package/dist/packages/analysis/src/evidence-merge.d.ts +2 -0
  24. package/dist/packages/analysis/src/evidence-merge.js +173 -38
  25. package/dist/packages/analysis/src/evidence-merge.js.map +1 -1
  26. package/dist/packages/analysis/src/evidence-writer-lock.d.ts +9 -2
  27. package/dist/packages/analysis/src/evidence-writer-lock.js +75 -21
  28. package/dist/packages/analysis/src/evidence-writer-lock.js.map +1 -1
  29. package/dist/packages/analysis/src/files.js +5 -0
  30. package/dist/packages/analysis/src/files.js.map +1 -1
  31. package/dist/packages/analysis/src/gate.d.ts +1 -1
  32. package/dist/packages/analysis/src/gate.js +17 -4
  33. package/dist/packages/analysis/src/gate.js.map +1 -1
  34. package/dist/packages/analysis/src/index.d.ts +1 -0
  35. package/dist/packages/analysis/src/index.js +1 -0
  36. package/dist/packages/analysis/src/index.js.map +1 -1
  37. package/dist/packages/analysis/src/order.d.ts +16 -1
  38. package/dist/packages/analysis/src/order.js +6 -0
  39. package/dist/packages/analysis/src/order.js.map +1 -1
  40. package/dist/packages/analysis/src/quality-refresh.d.ts +18 -0
  41. package/dist/packages/analysis/src/quality-refresh.js +312 -0
  42. package/dist/packages/analysis/src/quality-refresh.js.map +1 -0
  43. package/dist/packages/analysis/src/tdd.d.ts +84 -3
  44. package/dist/packages/analysis/src/tdd.js +589 -50
  45. package/dist/packages/analysis/src/tdd.js.map +1 -1
  46. package/dist/packages/analysis/src/trace.d.ts +24 -0
  47. package/dist/packages/analysis/src/trace.js +95 -3
  48. package/dist/packages/analysis/src/trace.js.map +1 -1
  49. package/dist/packages/analysis/src/workflow-waiver.d.ts +6 -2
  50. package/dist/packages/analysis/src/workflow-waiver.js +9 -5
  51. package/dist/packages/analysis/src/workflow-waiver.js.map +1 -1
  52. package/dist/packages/analysis/src/workflow.d.ts +1 -1
  53. package/dist/packages/analysis/src/workflow.js +4 -4
  54. package/dist/packages/analysis/src/workflow.js.map +1 -1
  55. package/dist/packages/cli/src/install.js +27 -4
  56. package/dist/packages/cli/src/install.js.map +1 -1
  57. package/dist/packages/cli/src/main.js +77 -18
  58. package/dist/packages/cli/src/main.js.map +1 -1
  59. package/dist/packages/domain/src/design.js +8 -1
  60. package/dist/packages/domain/src/design.js.map +1 -1
  61. package/dist/packages/domain/src/types.d.ts +1 -0
  62. package/package.json +7 -2
  63. package/plugin.json +1 -1
@@ -3,13 +3,13 @@
3
3
  "owner": { "name": "nahisaho" },
4
4
  "metadata": {
5
5
  "description": "GitHub Copilot CLI specification-driven development skills",
6
- "version": "0.1.20"
6
+ "version": "0.1.21"
7
7
  },
8
8
  "plugins": [
9
9
  {
10
10
  "name": "musubix3",
11
11
  "source": ".",
12
- "version": "0.1.20",
12
+ "version": "0.1.21",
13
13
  "description": "Evidence-driven SDD without duplicating native Copilot capabilities."
14
14
  }
15
15
  ]
@@ -7,68 +7,51 @@ description: "Use as the MANDATORY first Skill for requests to develop, build, c
7
7
  * @implements REQ-SESSION-SCOPED-DEVELOPMENT-001 REQ-SESSION-SCOPED-DEVELOPMENT-002
8
8
  * @design DES-SESSION-SCOPED-DEVELOPMENT-001
9
9
  */
10
+ /* @id CODE-SDD-CHANGE-OPS-IMPROVEMENTS-001
11
+ * @implements REQ-SDD-CHANGE-OPS-IMPROVEMENTS-001 REQ-SDD-CHANGE-OPS-IMPROVEMENTS-002 REQ-SDD-CHANGE-OPS-IMPROVEMENTS-003 REQ-SDD-CHANGE-OPS-IMPROVEMENTS-004 REQ-SDD-CHANGE-OPS-IMPROVEMENTS-005 REQ-SDD-CHANGE-OPS-IMPROVEMENTS-006
12
+ * @design DES-SDD-CHANGE-OPS-IMPROVEMENTS-001 DES-SDD-CHANGE-OPS-IMPROVEMENTS-002 DES-SDD-CHANGE-OPS-IMPROVEMENTS-003
13
+ */
10
14
  Mandatory entrypoint: every new natural-language development request is a new change, even in an existing Copilot session; never reuse prior requirements, approvals, TDD, or change evidence unless the user explicitly names the existing change ID and asks to continue it. never start implementation before validating requirements/design; skip only for verified approved artifacts of that explicitly continued change.
11
15
  Never infer approval; show `approval prepare <stage>` and record only its reviewed hash with `approval record <stage> --approver <name> --artifact-sha256 <hash> --confirm`.
12
- Whenever an AI deliverable is documentation (requirements, design, ADRs, the CHANGE document, or release/quality evidence), run Copilot's native `rubber-duck` review agent on it before that phase's human approval, fixing every issue and re-reviewing until none remain.
16
+ Whenever an AI deliverable is documentation (requirements, design, ADRs, the CHANGE document, or release/quality evidence), run Copilot's native `rubber-duck` review agent on it before that phase's human approval. Run automated validators first, build a quick traceability/self-check matrix, review related requirements/design/ADR artifacts together in one pass when appropriate, scope the request to logic/contradiction/acceptance/consistency issues, pre-state known constraints/decisions, and embed the stop condition in the request itself. Use at most 3 rounds total for one artifact set: round 1 may review the full artifact set, rounds 2-3 must be diff-only, and each round's findings must be fixed in one batch before re-review. If blocking findings remain after round 3, summarize them, ask a human whether to continue with fixes or proceed as-is, and stop instead of looping indefinitely.
13
17
  Follow the user's input language. Use native Copilot planning, editing, research, review, security review and subagents.
14
18
  Record exactly one final invocation outcome with `npx musubix3 workflow-record sdd-change complete --status <status>`; `change-record` separately proves phases.
15
- Run `workflow-sanitize <copilot.jsonl> <safe.jsonl>` before review, then
16
- `workflow-verify <safe.jsonl>`; it validates source-order lifecycles without
17
- assuming globally monotonic clocks unless `maxEventSkewMs` is explicitly set.
19
+ Run `workflow-sanitize <copilot.jsonl> <safe.jsonl>` before review, then `workflow-verify <safe.jsonl>`; it validates source-order lifecycles without assuming globally monotonic clocks unless `maxEventSkewMs` is explicitly set.
18
20
  Baseline-protect transcript byte limits; never truncate/edit to bypass them.
19
21
  For strict evidence, bind an expected UUID; GitHub origin needs strict OIDC.
20
22
  Never record multiple declarations per invocation; use only the configured CLI.
21
23
  For broad work, use short stages: initialize, requirements, requirements approval, design, design approval, real Red, Green, integration, trace/formal, quality, release approval. Report each result before the next prompt.
22
24
  For a staged change, run `change-record <CHANGE-ID> <phase> --requirement <REQ-ID...>` after each phase in this exact order: `impact`, `requirements`, `design`, `red`, `implementation`, `green`, `quality`.
23
25
  `impact`/`requirements`/`design`/`quality` always use the full requirement ID set; `red`/`implementation`/`green` may instead use a non-empty subset as an independent per-requirement batch for an interleaved Red-Implementation-Green loop; `quality` still needs full cumulative Green coverage.
24
- List only requirements whose statement/acceptance changes, classify each, and
25
- document other impacts separately. Each needs fresh Red and Green.
26
+ After Quality, record a new corrective subset Red/Implementation/Green batch and invoke full-set `quality` again; schema v2 retains prior checkpoints in `qualityHistory`, and `change quality-recover` recovers interruptions.
27
+ Refresh errors are `CHANGE_QUALITY_REFRESH_LINEAGE_INVALID`, `CHANGE_QUALITY_REFRESH_GREEN_MISSING`, `CHANGE_QUALITY_REFRESH_NOT_NEEDED`, and `CHANGE_QUALITY_REFRESH_RECOVERY_REQUIRED`; an already-used corrective subset requires a new reviewed staged change.
28
+ List only requirements whose statement/acceptance changes, classify each, and document other impacts separately. Each needs fresh Red and Green.
26
29
  The CHANGE document must contain `Requirements:` with exactly those normative IDs.
27
30
  Persisted monotonic order, not wall-clock time, proves these phase boundaries.
28
31
  ## 1. Classify and inspect / 分類と事前確認
29
- 1. Classify the request as a feature, behavior change, defect correction,
30
- refactoring, or documentation-only change. For a new program/feature, create
31
- a fresh feature slug and CHANGE artifact; prior session context is not approval.
32
+ 1. Classify the request as a feature, behavior change, defect correction, refactoring, or documentation-only change. For a new program/feature, create a fresh feature slug and CHANGE artifact; prior session context is not approval. For documentation-only changes, still run impact/requirements/design/quality evidence and record the reason when TDD is omitted by policy.
32
33
  2. Read the constitution and relevant requirements, designs, ADRs, code and tests, but treat prior-session artifacts as historical context unless continuation is explicit.
33
34
  3. Run `trace impact`; when code exists run `graph index` and `graph impact`.
34
- 4. Separate confirmed intent, assumptions and open questions. When material context is missing, ask exactly one highest-priority question, wait, then repeat; never batch questions or finalize requirements, design or code while blockers remain.
35
+ 4. In long-lived or parallel worktrees, periodically run `git fetch`, inspect both `git log origin/main..HEAD` and `git log HEAD..origin/main` (or an equivalent symmetric divergence check), refresh against `origin/main` before release time, and rebase onto `origin/main` especially around other in-flight changes merging to `main`, so evidence/hash-chain conflicts are corrected early instead of at release time.
36
+ 5. Separate confirmed intent, assumptions and open questions. When material context is missing, ask exactly one highest-priority question, wait, then repeat; never batch questions or finalize requirements, design or code while blockers remain.
35
37
  ## 2. Update specifications first / 仕様を先に更新
36
- 1. For new or changed observable behavior, add or revise EARS requirements and
37
- measurable acceptance criteria before implementation. Preserve stable IDs
38
- when meaning remains the same; create new IDs when obligations are distinct.
39
- 2. For a bug where implementation violates an existing requirement, keep that
40
- requirement and record that no specification change is needed. Never rewrite
41
- a requirement merely to make incorrect behavior appear compliant.
42
- 3. Run requirements and constitution validation; stop on invalid artifacts
43
- instead of continuing with unapproved assumptions.
44
- 4. Run a `rubber-duck` review (Copilot's native review agent) of `requirements.md`, fixing every issue and re-reviewing until none remain, then stop for explicit current `requirements` approval before design. An edit to `requirements.md` re-opens approval and requires re-review.
45
- 5. Update design responsibilities/interfaces/constraints/links and ADRs, run design validation, then run the same rubber-duck review/fix loop on `design.md`/ADRs before stopping for explicit current `design` approval before Red/implementation. An edit re-opens approval and requires re-review.
38
+ 1. For new or changed observable behavior, add or revise EARS requirements and measurable acceptance criteria before implementation. Preserve stable IDs when meaning remains the same; create new IDs when obligations are distinct.
39
+ 2. For a bug where implementation violates an existing requirement, keep that requirement and record that no specification change is needed. Never rewrite a requirement merely to make incorrect behavior appear compliant.
40
+ 3. Run requirements and constitution validation; stop on invalid artifacts instead of continuing with unapproved assumptions.
41
+ 4. Before `requirements` approval, run a bounded `rubber-duck` review of `requirements.md`: validate first, build a REQ↔acceptance self-check matrix, include related design/ADR context in the same review when cross-document consistency matters, scope the prompt to logic/contradiction/acceptance/consistency issues (not style), pre-state known constraints/decisions, state the round number and "stop after round 3 and summarize unresolved findings" condition in the request itself, fix all findings from a round in one batch, and use only diff-only follow-up reviews for rounds 2-3. After round 3, stop for a human continue-vs-proceed decision instead of auto-retrying. An edit to `requirements.md` re-opens approval and requires this bounded review loop again.
42
+ 5. Update design responsibilities/interfaces/constraints/links and ADRs, run design validation, then apply the same bounded rubber-duck protocol to `design.md`/ADRs before explicit current `design` approval: validate first, build a REQ↔DES↔ADR traceability/self-check table, review related artifacts together when appropriate, scope the prompt to logic/contradiction/acceptance/consistency issues, pre-state known constraints/decisions, batch-fix each round, embed the capped stop condition in the request, use one full-artifact pass plus diff-only rounds 2-3, and stop after round 3 for human decision if blocking findings remain. An edit re-opens approval and requires the bounded review loop again.
46
43
  ## 3. Implement and prove coverage / 実装と網羅性
47
- 1. For observable behavior changes and defect fixes, write the smallest meaningful
48
- test first. Include its `TEST-*` ID in the test name/output and link it to the
49
- requirement with `@verifies`. Configure the command's `tddArgs` with
50
- `{testId}` or `{testPath}` so only that test is selected. Configure
51
- `tddReport` and make the runner write a fresh `musubix-json` result containing
52
- exactly the target test with `failed` or `passed` status, or select a built-in
53
- test adapter. For deterministic performance requirements, use a passing
54
- instrumented `operations` report with command/report/run/exit provenance;
55
- native adapters cannot emit app counters, and elapsed time is insufficient.
56
- 2. Run `npx musubix3 tdd red <TEST-ID> --requirement <REQ-ID> --command <name>`.
44
+ 1. For observable behavior changes and defect fixes, write the smallest meaningful test first. Include its `TEST-*` ID in the test name/output and link it to the requirement with `@verifies`. Configure the command's `tddArgs` with `{testId}` or `{testPath}` so only that test is selected. Configure `tddReport` and make the runner write a fresh `musubix-json` result containing exactly the target test with `failed` or `passed` status, or select a built-in test adapter. For deterministic performance requirements, use a passing instrumented `operations` report with command/report/run/exit provenance; native adapters cannot emit app counters, and elapsed time is insufficient.
45
+ 2. **Strict order checklist for every requirement batch (never reorder or batch ahead):** `tdd red` → `change-record red` → implementation edit → `change-record implementation` → `tdd green` → `change-record green`. Treat this as the highest-priority ordering safeguard in the skill. Do not run `tdd green` before `change-record implementation`. Never batch `tdd green` calls ahead of `change-record implementation`.
46
+ 3. Run `npx musubix3 tdd red <TEST-ID> --requirement <REQ-ID> --command <name>`.
57
47
  Do not edit implementation code until this records the expected failing test.
58
- 3. Implement the smallest complete change, preserving the test, then run
59
- `tdd green` with the same IDs and command. Refactor only after Green and record
60
- `tdd refactor` after the refactored code passes.
61
- 4. Maintain unique IDs and trace annotations in authoritative files; never add
62
- proxies for coverage. Links locate evidence, not proof.
63
- 5. Run focused tests, then configured typecheck, build and complete test commands.
64
- Documentation/prototypes may omit TDD only when policy allows; record the reason.
48
+ 4. Implement the smallest complete change, preserving the test, then run `tdd green` with the same IDs and command. Refactor only after Green and record `tdd refactor` after the refactored code passes.
49
+ 5. Maintain unique IDs and trace annotations in authoritative files; never add proxies for coverage. Links locate evidence, not proof.
50
+ 6. Run focused tests, then configured typecheck, build and complete test commands.
51
+ Documentation/prototypes may omit TDD only when policy allows; record the reason in the CHANGE document and quality evidence instead of inventing retroactive or proxy TDD cycles.
65
52
  ## 4. Rebuild evidence and finish / 根拠更新と完了
66
53
  1. Run `trace build`, `trace check --strict`, `graph index`, and `graph gate`.
67
- 2. Run `formal check` when changed requirements fit its documented abstraction;
68
- use strict `Formal:` JSON for explicit conditional, numeric, temporal or
69
- transition semantics; report unsupported prose rather than claiming proof.
70
- A required `formal` check enforces modeled fraction and configured solver.
71
- 3. Run `gate --changed --json` and `status --json`. Repair failures, dangling links and stale evidence; never weaken requirements or policy to obtain green. If `workflow` fails, run `workflow-verify` compatible mode against this session's live transcript, then `workflow waiver record-all` (bulk, all-or-nothing) for remaining declaration-scoped diagnostics (it cannot clear `WORKFLOW_INVOCATION_UNVERIFIED`), then rerun gate/status.
72
- 4. Treat the first otherwise-passing gate as the release candidate. Run a `rubber-duck` review of the release/quality evidence summary and the CHANGE document; fix every reported issue and re-review until zero issues remain. Before any release operation, prepare/show its exact hash, ask one human approve/reject question and wait; record only that hash, then rerun gate/status.
73
- 5. Complete only when required checks pass and `status.gate.ready` is true;
74
- otherwise report blockers. One-phase work must state downstream work.
54
+ 2. Run `formal check` when changed requirements fit its documented abstraction; use strict `Formal:` JSON for explicit conditional, numeric, temporal or transition semantics; report unsupported prose rather than claiming proof. A required `formal` check enforces modeled fraction and configured solver.
55
+ 3. Use `gate --changed --json` plus `status --json` for intermediate confidence during iterative work. Repair failures, dangling links and stale evidence; never weaken requirements or policy to obtain green. If `workflow` fails, run `workflow-verify` compatible mode against this session's live transcript, then `workflow waiver record-all` (bulk, all-or-nothing) for remaining declaration-scoped diagnostics (it cannot clear `WORKFLOW_INVOCATION_UNVERIFIED`), then rerun the changed-scope gate/status.
56
+ 4. Treat the first otherwise-passing `gate --changed --json` run as the release-candidate checkpoint. Confirm the `CHANGELOG.md` entry was added before release approval. Confirm the `CHANGELOG.md` entry was added before the change is treated as release-ready. Confirm the `CHANGELOG.md` entry was added in the quality checklist. Then run a bounded `rubber-duck` review of the release/quality evidence summary and the CHANGE document using the same 3-round cap: validators first, full-artifact round 1, diff-only rounds 2-3, explicit stop condition in the request, batch-fix each round, and human escalation if blocking findings remain after round 3. Reserve the full `gate --json` for final release-candidate confirmation only. After the changed-scope release-candidate check passes, run the full `gate --json` once as the final confirmation before any release approval step. Before any release operation, prepare/show its exact hash, ask one human approve/reject question and wait; record only that hash, then rerun gate/status.
57
+ 5. Complete only when required checks pass and `status.gate.ready` is true; otherwise report blockers. One-phase work must state downstream work.
package/CHANGELOG.md CHANGED
@@ -1,7 +1,95 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.21 - 2026-10-07
4
+
5
+ - Remove the development-only `sprintf-js` advisory chain using the single
6
+ reviewed `js-yaml: "^5.4.3"` override. Pin that exact override and npm-generated
7
+ root metadata, reject graph/evidence drift offline, retain a full zero-finding
8
+ audit bound to the current lockfile, and verify YAML/native Jest/package
9
+ compatibility without changing production dependencies or the package version
10
+ (CHANGE-0052).
11
+
12
+ - Add a `--diff-only` option to `approval prepare <requirements|design|release>`
13
+ that additionally reports a `changedFiles` array: only the artifact paths
14
+ whose content differs from that same stage's (and domain's, when
15
+ applicable) last recorded approval, or every current path tagged
16
+ `diffOnlyBaseline: "none"` when no prior approval exists yet. The full,
17
+ unfiltered `artifactSha256` and `artifacts` manifest used by
18
+ `approval record` are computed identically with or without the flag, so the
19
+ cryptographic integrity guarantee is never weakened — `--diff-only` only
20
+ makes the already-required full review easier to perform by letting a human
21
+ reviewer see at a glance which files are new since their own last approval,
22
+ instead of manually diffing against `origin/main` for every requirements/
23
+ design/release approval request (#68).
24
+ - Reject `tdd red`/`tdd green` with a new `CHANGE_RECORD_PHASE_PRECONDITION`
25
+ error, before any TDD evidence is appended, when the requirement's staged
26
+ change has not yet recorded the `design` phase (for `red`) or the `red`/
27
+ `implementation` phases (for `green`) in the correct order; the error names
28
+ the exact `change-record <id> <phase> --requirement <id>` command to run
29
+ first (or, when no staged change references the requirement at all, that a
30
+ staged change must record `design` first). This is a fail-fast,
31
+ complementary guard alongside the existing post-hoc `hasValidTddCycle`
32
+ validation — not a replacement for it — so an out-of-order `tdd green`
33
+ (one recorded before its requirement's `change-record red`/
34
+ `implementation` phases) can never corrupt the append-only, hash-chained
35
+ TDD evidence log in the first place, eliminating the manual hash-chain
36
+ recovery this exact scenario required during CHANGE-0047/Issue #55 (#67).
37
+ - Exclude a fixed, source-hardcoded scratch-file naming convention
38
+ (untracked files at or beneath `.musubix/scratch/`, and untracked files
39
+ whose basename matches `*.scratch.<ext>`) from the untracked candidates
40
+ that `approval prepare release`'s manifest hashes, so an operator's own
41
+ scratch/debug inspection output written into the worktree no longer
42
+ silently changes the release-manifest hash on every inspection. The
43
+ exclusion is applied only as a final post-filter on the untracked
44
+ candidate set, after (never before) the existing nested-workspace and
45
+ generated-directory structural exclusion scan runs against the complete,
46
+ unfiltered candidate set, and it never removes a tracked file by name, so
47
+ the cryptographic integrity guarantee that every tracked artifact is
48
+ always included is preserved (#66).
49
+ - Add `assertWaiverStaleSeverityFix` to the `pack:check` release-packaging
50
+ verification script so the packaged `change-waiver.js`'s `CHANGE_WAIVER_STALE`
51
+ severity-downgrade behavior (already present in source since CHANGE-0028/0029)
52
+ is also verified against the actually built and packaged distribution before
53
+ release, preventing a regression in the published package from silently
54
+ reintroducing the "waiver stale deadlock" (a stale waiver for a diagnostic
55
+ whose root cause has since been fixed cannot be re-recorded and has no way
56
+ to be cleared) that Issue #55 describes (#55).
57
+ - Exclude validly archived TDD cycles from the Red-phase order window that
58
+ `validateChangeEvidence`'s `CHANGE_ORDER_MIGRATION_REQUIRED` diagnostic
59
+ uses, mirroring the existing exclusion already applied to validly voided
60
+ cycles, so a dangling cycle correctly rejected by `tdd red`'s
61
+ forced-failure check and cleaned up with `tdd archive` can never be
62
+ selected as a requirement's "current" cycle or falsely trigger the
63
+ diagnostic (#64).
64
+ - Tighten the bundled `sdd-change` operational guidance for documentation and
65
+ review work: it now makes the Red → change-record Red → implementation →
66
+ change-record implementation → Green → change-record Green ordering
67
+ checklist explicit, adds symmetric `origin/main` freshness checks for
68
+ long-lived parallel worktrees, caps rubber-duck review loops at three
69
+ rounds with diff-only follow-up reviews and explicit stop conditions,
70
+ requires confirming the `CHANGELOG.md` entry during quality review, and
71
+ distinguishes iterative `gate --changed --json` runs from the single final
72
+ full `gate --json` confirmation (#61).
73
+ - Keep `CHANGE_RECORD_MISSING` waivers stable when the operator appends the
74
+ waiver's own final `## Debt Remediation Approval` note to the staged
75
+ `CHANGE-*.md` document, while keeping the stale check fail-closed for
76
+ mismatched approval metadata, extra content, non-final sections, or any
77
+ substantive edit outside that tightly structured carve-out (#58).
78
+
3
79
  ## 0.1.20 - 2026-09-22
4
80
 
81
+ - Add `CHANGE_PHASE_ORDER` as a thirteenth waivable code (`WAIVABLE_CODES`),
82
+ with `phase:<name>` detail scoping for the two change-level transitions
83
+ (`requirements`, `design`) and `batch:<name>:<batchKey>` detail scoping for
84
+ the four per-batch transitions (`red`, `implementation`, `green`,
85
+ `quality`). This provides a documented, human-approved safety net for a
86
+ corrective Red/Implementation/Green batch recorded after Quality that has
87
+ not yet been resolved by a Quality re-recording (#56).
88
+ - Add repeatable Quality checkpoints after complete post-Quality corrective
89
+ batches. Schema version 2 retains ordinal Quality history, validation and
90
+ evidence merge pair every checkpoint deterministically, and
91
+ `change quality-recover` recovers the dedicated atomic `order.json` /
92
+ `changes.json` refresh transaction (#36).
5
93
  - Add `evidence merge` for append-only consolidation of `order.json`,
6
94
  `tdd.json`, `changes.json`, and `change-waivers.json` from another project
7
95
  root, with dry-run planning, crash-safe journaling, deterministic conflict
package/README-ja.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # musubix3
2
2
 
3
- **最新リリース v0.1.20 · GitHub Copilot CLI 専用 · Node.js ≥20 · TypeScript · MIT**
3
+ **最新リリース v0.1.21 · GitHub Copilot CLI 専用 · Node.js ≥20 · TypeScript · MIT**
4
4
 
5
5
  [English](README.md)
6
6
 
@@ -339,7 +339,7 @@ npx musubix3 tdd green TEST-EXAMPLE-002 --requirement REQ-EXAMPLE-002 --command
339
339
  | `constitution validate [file]` | 版・原則・測定可能な規則の定義検査 |
340
340
  | `design validate <file>` | 必須項目・要求ID・既存ADRの参照検査 |
341
341
  | `design c4 <file>` | 明示的なコンポーネントと依存から Mermaid 図 |
342
- | `approval prepare <requirements\|design\|release>` | 人間が確認する決定的manifestとhashを表示 |
342
+ | `approval prepare <requirements\|design\|release> [--diff-only]` | 人間が確認する決定的manifestとhashを表示。`--diff-only`はそのステージの直近の記録済み承認からハッシュが変化したファイルパスのみを`changedFiles`として追加表示(未承認なら`diffOnlyBaseline: "none"`で現在の全ファイルを表示)。`artifactSha256`/`artifacts`自体は変化しない |
343
343
  | `approval record <stage> --approver <name> --artifact-sha256 <hash> --confirm` | 確認済みhashが現在も一致するときだけ承認を記録 |
344
344
  | `approval validate` | 各承認をapproved・missing・staleとして表示し、検証結果から承認を推測しない |
345
345
  | `trace build` | リポジトリ全体のグラフと機能別コピーを生成 |
@@ -373,6 +373,7 @@ npx musubix3 tdd green TEST-EXAMPLE-002 --requirement REQ-EXAMPLE-002 --command
373
373
  | `attestation payload --provider <name> --run-id <id> --key-id <id> [--public-key-file <pem>] [--github-oidc-token-file <jwt>]` | 外部署名用の正規化CI payloadを出力 |
374
374
  | `attestation verify` | 静的鍵またはGitHub OIDC認可済みEd25519 provenanceを検証 |
375
375
  | `change-record <CHANGE-ID> <phase> --requirement <REQ-ID...>` | 段階的変更の成果物・TDD指紋を順序付きで記録。複数batchが同じrequirementを含む場合、検証はRedの`order`が最新のbatchを使用し、後発batchが未完了でも古い完了済み証跡へ暗黙にフォールバックしない |
376
+ | `change quality-recover [--json]` | 中断したQuality refreshの2ファイルtransactionを復旧する。Quality後に新しい完全なcorrective batchがある場合、full-set Qualityを再記録すると以前のcheckpointをschema version 2の`qualityHistory`へ保持する。不完全・不要なrefreshは安定した`CHANGE_QUALITY_REFRESH_*`エラーで拒否する |
376
377
  | `config lint` | `args`が存在しないrepository相対パスを参照する設定済みコマンドを報告 |
377
378
  | `config scaffold` | 検出したGo/Rust/Maven/Python/Nodeツールチェーン向けのnative test-command候補を`.musubix/config.json`へ書き込まずに提案 |
378
379
  | `gate [--changed] [--feature <name>]` | 検証・実コマンドを集約し品質根拠を保存。`--feature`は requirements/design/trace/tdd/change-history/change-completeness の検査を1機能へ限定する診断用途で、repository全体のgateの代替ではない |
@@ -389,6 +390,12 @@ fileへ書込み・flushした後、排他的hard linkで公開するため、ca
389
390
  空または部分的な状態で見えることはありません。このatomic publicationを
390
391
  提供できないfilesystemでは`EVIDENCE_WRITER_LOCK_ACQUIRE_FAILED`となり、
391
392
  非atomicなfallbackは行いません。
393
+ staging fileの同期とatomic publicationまたは検証済みreleaseが成功した後、
394
+ Windows の directory synchronization が EPERM、EINVAL、ENOTSUP
395
+ のいずれかを返す場合に限り、そのdirectory entryのdurability操作を未対応
396
+ capabilityとして扱います。file同期、publication、metadata、unlink、
397
+ open/close、その他のerror、およびWindows以外のplatformはfail-closedの
398
+ ままです。
392
399
 
393
400
  status、approval prepare/validate、trace/graph inspection、knowledge query、
394
401
  TDD validate、attestation payload/verify、merge dry-runなどのcoordinated
@@ -403,7 +410,8 @@ musubix3外からproject fileを直接変更するprogramはcoordination対象
403
410
  自動復旧は現在Linux限定で、hostname、boot identity、PID namespaceが一致し、
404
411
  owner PIDが確実に存在しない場合だけ削除します。live、PID再利用、別host、
405
412
  不正・変更済みmetadata、未対応platform、判定不能なlockは正確なpathと確認手順を
406
- 表示して保持し、force modeはありません。canonical lockと
413
+ 表示して保持し、force modeはありません。必要なidentity probeを提供できないため、
414
+ Windows と macOS の自動復旧は inspection-only です。canonical lockと
407
415
  `.writer-lock.<transactionId>.json` staging fileはGitおよび生成入力から除外
408
416
  されます。関連processが存在しないことを確認した後に限り、残存staging fileを
409
417
  正確なpath指定で削除できます。
@@ -665,11 +673,31 @@ evidence/reportのpath(`tddReport`/`testReport`/`mutationReport`、
665
673
  なります。承認fileはstage、approver、`approvedAt`、artifactごとのSHA-256、決定的
666
674
  manifest SHA-256を保持します。release記録はcache済みquality evidenceを信頼せずgateを
667
675
  再計算し、承認以外の必須checkがすべてpassした場合だけ成功します。
676
+ `approval prepare <stage> --diff-only`は、同じ決定的manifestから計算した
677
+ `changedFiles`(そのstageの直近の*記録済み*承認とハッシュが異なるartifact pathのみ。
678
+ ライブな`git diff`ではない)を追加表示します。`artifactSha256`と`artifacts`自体は
679
+ 常に従来通り返り、整合性検証は一切弱まりません。`diffOnlyBaseline`は、直近の承認と
680
+ 比較できた場合は`"approved"`、そのstageが一度も承認されたことがない場合は`"none"`
681
+ (現在の全pathを表示)になります。`--domain`指定時はそのdomainの直近承認に限定して
682
+ 比較します。直近の承認fileが存在してもschema検証に失敗する場合、`approval validate`
683
+ と同じ`Invalid <stage> approval evidence.`エラーで即座に失敗し、壊れた証拠を
684
+ 「未承認」として黙って扱うことはありません。`--diff-only`なしの非JSON出力は従来通り
685
+ 変化せず、`--diff-only`かつ`--json`なしの場合のconsole要約は全artifact一覧ではなく
686
+ 変更pathのみと簡潔なbaseline注記を表示します。
668
687
  approver文字列は明示的なlocal証拠であり、認証済みidentityではありません。
669
688
  独立identityが必要なrepositoryではprotected review、CODEOWNERS、CI/OIDCも併用します。
670
689
  local承認証拠は明示的な意思を記録しますが、承認者の暗号学的な本人確認ではありません。
671
690
  release権限はrepository review、CODEOWNERS/branch protection、またはCI/OIDC attestationで
672
691
  保護してください。
692
+ `approval prepare release`のmanifestは、固定でsourceに埋め込まれたscratch file命名規則を
693
+ untracked candidateから除外します:`.musubix/scratch/`配下のuntracked path、および
694
+ basenameが`*.scratch.<ext>`に一致するuntracked file(例:`debug.scratch.json`)です。
695
+ 確認用のscratch/debug出力はこの命名規則で書くことで、確認のたびにrelease manifestの
696
+ hashが変化することを防げます。この除外はconfigurableな設定ではなく固定・version管理
697
+ された一覧です:untracked candidateにのみ適用され(同名のtracked fileは引き続き含まれ
698
+ ます)、manifestの最終出力に対する後段filterとしてのみ適用され、構造的なnested
699
+ workspace/生成directory除外のscanより前には適用されません。そのため、実際のtracked
700
+ 変更を隠すために範囲を広げることはできません。
673
701
  `tdd.redPreflightCommands`にはformatter等のplain command名を指定でき、
674
702
  Redのtest fingerprintを取得する前に成功が必須です。
675
703
  通常ファイルの`pyvenv.cfg`を含む`.venv`と`venv`に加え、生成された
@@ -943,6 +971,14 @@ CLI検証を呼び出す前に削除します。短命JWTは署名済みattestat
943
971
  - Core CIはNode 22をLinux、Windows、macOSで実行し、LinuxではNode 20と
944
972
  Node 24の互換性も追加確認します。native adapterとformal solverの統合は、
945
973
  固定toolchainを使ってLinuxで実行します。
974
+ - **GitHub-hosted runner ポリシー:** portability matrix は意図的に
975
+ `ubuntu-latest`、`windows-latest`、`macos-latest` を使用し、それ以外の
976
+ CI job、Release workflow、npm publish workflow は `ubuntu-latest` を
977
+ 使用します。これらは固定 image ではなく GitHub-hosted の floating label
978
+ です。選択される hosted runner image が変更された場合は、toolchain 導入、
979
+ typecheck、build、test、package check、release preparation、provenance、
980
+ publication control を再検証します。Action 自体の Node.js 24 runtime は、
981
+ package が検証する Node.js 20/22/24 とは別のものです。
946
982
  Windowsの実行ラッパーとprocess tree停止にはplatform固有の差があります。
947
983
  ESLintは追加せず、strict TypeScript と既存テストで検証します。
948
984
 
@@ -958,6 +994,48 @@ npm run pack:check
958
994
  npm run pack:smoke
959
995
  ```
960
996
 
997
+ ### 依存関係auditポリシー
998
+
999
+ 導入時またはrelease preparationで依存関係advisoryが報告された場合は、
1000
+ すべてのseverityと開発時依存を含むroot workspaceの
1001
+ `npm run audit:report`(`npm audit --json`)を実行します。advisory ID、すべての依存経路、
1002
+ production/build/testへの到達可能性、maintained fixの有無、remediation判断、
1003
+ 残存リスクまたはmonitoring義務を記録します。開発時依存または現在到達不能で
1004
+ あることはexposureを下げますが、maintained fixが存在する場合のremediation
1005
+ にはなりません。記録したclean resultはその時点の証拠であり、将来のauditも
1006
+ cleanであることの証明として扱いません。
1007
+ `.github/workflows/dependency-audit.yml`は週次および手動dispatchでfull reportを
1008
+ 再実行します。失敗したrunはrelease前にreviewし、remediationしてください。
1009
+
1010
+ レビュー済みの依存例外は root `overrides` の
1011
+ `{"js-yaml":"^5.4.3"}` だけです(CHANGE-0052)。オフライン検査は異なる値・
1012
+ 追加override・`sprintf-js` 再混入を拒否し、保存audit証拠は現在lockfileの
1013
+ bytesに一致させます。Vitestへの一般的なoverride許可や開発時脆弱性の容認ではありません。
1014
+
1015
+ ビルド前に、機械管理されるすべてのリリース version を同期します。
1016
+
1017
+ ```sh
1018
+ npm run --silent release:version -- 1.2.3
1019
+ npm run --silent release:version -- --check 1.2.3
1020
+ # 同等の直接実行:
1021
+ node scripts/release-version.mjs 1.2.3
1022
+ node scripts/release-version.mjs --check 1.2.3
1023
+ ```
1024
+
1025
+ npm entrypoint では stdout をJSON reportだけにするため `--silent` を指定します。
1026
+ tag の `v` prefix と build metadata を含まない SemVer を指定します。
1027
+ リリース順序は version 同期、`CHANGELOG.md` の内容レビュー、`npm run build`、
1028
+ package 検査、明示的な release 承認、commit、一致する `v<version>` tag、
1029
+ 最後に準備処理です。
1030
+ 強制されるリリース順序は、最終リリースメタデータと `CHANGELOG.md`、
1031
+ 検証とビルド、明示的な release 承認、commit と変更されていない `v<version>` tag の作成、
1032
+ 最後に `release:prepare` です。承認後にcommit済みの
1033
+ release入力を変更した場合は、新しいtagを準備する前に検証と release 承認をやり直す必要があります。
1034
+ `release:prepare` は出力ディレクトリを変更する前に、すべての同期対象、
1035
+ tag が指すcommit、および承認済みtag manifestを検証します。Release workflowを
1036
+ 手動実行する場合はworkflowのref selectorで対象tagを選び、同じtagを
1037
+ `release_tag`へ入力します。
1038
+
961
1039
  `packages/domain` は純粋な検証、`packages/analysis` は根拠・コンパイラ・
962
1040
  ファイルシステム、`packages/cli` はコマンドと配置を担当します。
963
1041
  ビルド出力は `dist/packages/**`。npm パッケージには隠しSkills、プラグイン定義、
@@ -979,6 +1057,28 @@ secretも利用できます。npm publishがpendingまたは失敗してもGitHu
979
1057
  workflow refとして選び、同じ値を`release_tag`へ指定します。tagがOIDCに束縛された
980
1058
  `GITHUB_SHA`を指していなければworkflowは拒否します。
981
1059
 
1060
+ npm publishはstableな`vMAJOR.MINOR.PATCH` tagだけを受け付けます。保護された
1061
+ 2つのGitHub Actions publish経路は、そのtagをcheckoutし、non-draftのGitHub
1062
+ Releaseを新しい空ディレクトリへdownloadしてから、共通validatorを通してnpm
1063
+ provenance publishを実行します。validatorはhistorical assetや追加assetを拒否し、
1064
+ SHA256SUMSの厳密な形式、tarball内の`musubix3` package version、全local fileと
1065
+ 現在のuploaded GitHub Release asset digestの一致を検証します。`release:prepare`
1066
+ の直接出力には後段のstrict CI attestationがないためpublishできません。
1067
+
1068
+ local operatorは同じreleaseを検証できますが、provenance publishはできません。
1069
+
1070
+ ```bash
1071
+ gh auth status
1072
+ mkdir release-assets-verify
1073
+ gh release download v1.2.3 --repo nahisaho/musubix3 --dir release-assets-verify
1074
+ npm run --silent release:publish -- --verify-only --tag v1.2.3 \
1075
+ --repository nahisaho/musubix3 --directory release-assets-verify
1076
+ ```
1077
+
1078
+ release asset出力に`digest`と`state`を含むGitHub CLIを使用してください。
1079
+ provenance publishは保護された`npm-publish` GitHub Actions environmentだけで
1080
+ 実行されます。
1081
+
982
1082
  release attestationは、ephemeral Ed25519公開鍵をcustom audienceへ束縛した
983
1083
  GitHub Actions OIDC tokenを使用します。署名対象にはrepository、Git commit、
984
1084
  run ID、workflow/ref identity、workspace snapshot、存在するmusubix evidence headが
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # musubix3
2
2
 
3
- **Latest release v0.1.20 · GitHub Copilot CLI only · Node.js ≥20 · TypeScript · MIT**
3
+ **Latest release v0.1.21 · GitHub Copilot CLI only · Node.js ≥20 · TypeScript · MIT**
4
4
 
5
5
  [日本語](README-ja.md)
6
6
 
@@ -389,7 +389,7 @@ validation/gate or requested solver failure, **2** usage, I/O or malformed confi
389
389
  | `design validate <file>` | Fields, global requirement IDs, existing ADR references |
390
390
  | `design scaffold <slug>` | Create `.musubix/features/<slug>/design.md` from a fixed placeholder template; never overwrites an existing file, and does not require a pre-existing `requirements.md` |
391
391
  | `design c4 <file>` | Mermaid component/dependency diagram from explicit fields |
392
- | `approval prepare <requirements\|design\|release>` | Display the exact deterministic manifest and hash for human review |
392
+ | `approval prepare <requirements\|design\|release> [--diff-only]` | Display the exact deterministic manifest and hash for human review; `--diff-only` additionally reports `changedFiles` (only paths whose content differs from the last recorded approval for that stage; all current paths with `diffOnlyBaseline: "none"` when no prior approval exists) without altering `artifactSha256`/`artifacts` |
393
393
  | `approval record <stage> --approver <name> --artifact-sha256 <hash> --confirm` | Record approval only if the reviewed hash is still current |
394
394
  | `approval validate` | Report each approval as approved, missing, or stale; never infer approval from validation |
395
395
  | `trace build` | Generate global trace snapshot and feature copies |
@@ -413,7 +413,8 @@ validation/gate or requested solver failure, **2** usage, I/O or malformed confi
413
413
  | `mutation validate` | Revalidate requirement-scoped schema-v1 killed-mutant evidence |
414
414
  | `mutation identity <REQ-ID> <TEST-ID> <sourcePath> <operator> <line> <column>` | Print the deterministic `MUT-*` identity a mutation report must declare |
415
415
  | `tdd validate` | Validate persisted Red/Green/Refactor order, fingerprints, durations, and hash-chain evidence |
416
- | `tdd red\|green\|refactor <TEST-ID> --requirement <REQ-ID> --command <name>` | Execute and record a verified TDD phase. Recording the project's **first** `tdd` cycle (any `red` call while `.musubix/evidence/tdd.json` has zero cycles) makes `gate`'s `tdd` check required **project-wide**, for every mandatory requirement, not just the ones touched by the current change; each uncovered requirement then surfaces as `TDD_REQUIREMENT_UNCOVERED`. `approval record release` always runs the full (non-`--changed`) gate, so it is blocked by any resulting `TDD_REQUIREMENT_UNCOVERED` diagnostics. `tdd migrate` cannot be used to bulk-onboard previously-uncovered requirements: it only re-fingerprints a requirement that already has a valid Green cycle. `tdd red` prints/returns a `TDD_ADOPTION_PROJECT_WIDE` warning (in a `warnings` array, separate from `diagnostics`) the moment this first cycle is persisted, listing every other still-uncovered mandatory requirement. |
416
+ | `tdd red\|green\|refactor <TEST-ID> --requirement <REQ-ID> --command <name>` | Execute and record a verified TDD phase. Recording the project's **first** `tdd` cycle (any `red` call while `.musubix/evidence/tdd.json` has zero cycles) activates `gate`'s `tdd` coverage evaluation **project-wide**, for every mandatory requirement, not just the ones touched by the current change; each uncovered requirement then surfaces as `TDD_REQUIREMENT_UNCOVERED`. If `tdd` was not already required for another configured reason, that same first cycle is also what makes the check required. `approval record release` always runs the full (non-`--changed`) gate, so it is blocked by any resulting `TDD_REQUIREMENT_UNCOVERED` diagnostics. `tdd migrate` cannot be used to bulk-onboard previously-uncovered requirements: it only reuses already-covered valid Green-backed evidence. `tdd red` prints/returns a `TDD_ADOPTION_PROJECT_WIDE` warning (in a `warnings` array, separate from `diagnostics`) the moment this first cycle is persisted, listing every other still-uncovered mandatory requirement. |
417
+ | `tdd migrate <test-id>` / `tdd migrate <old-id> <new-id>` | Relink already-covered evidence without fabricating a fresh Red/Green cycle. `tdd migrate <test-id>` preserves the existing fingerprint-migration mode for a single covered test whose current declaration still matches the stored evidence under the superseded fingerprinting algorithm. `tdd migrate <old-id> <new-id>` relinks a pure identifier rename when the current authoritative `new-id` declaration differs from `old-id` only in its `@id` annotation and adapter-matched test identity string, the non-test `sourceFingerprint` is unchanged, and the renamed test remains the sole authoritative declaration at the same test path. |
417
418
  | `workflow-record <skill> <phase> --status <status>` | Record a compact self-reported workflow declaration |
418
419
  | `workflow waiver record <code> --skill <skill> --phase <phase> --recorded-at <timestamp> [--index <n>] --approver <name> --reason <text> --confirm` | Record an audited, bounded downgrade of one declaration-scoped workflow reconciliation diagnostic (`WORKFLOW_SKILL_NOT_INVOKED`, `WORKFLOW_INVOCATION_ORDER`, `WORKFLOW_INVOCATION_INCOMPLETE`, `WORKFLOW_INVOCATION_FAILED`, or `WORKFLOW_INVOCATION_REUSED`) to a non-blocking waived status; a paired `WORKFLOW_BINDING_MISSING` diagnostic sharing the same declaration scope is downgraded together with it. It cannot waive `WORKFLOW_INVOCATION_UNVERIFIED`, which only `workflow-verify` having actually run this session can resolve |
419
420
  | `workflow waiver record-all --approver <name> --reason <text> --confirm` | Bulk variant of `workflow waiver record`: waives every currently-outstanding waivable declaration-scoped diagnostic across the whole reconciliation report in one all-or-nothing call, instead of one `record` invocation per diagnostic. Rejects (recording nothing) if any bulk waiver precondition fails first — malformed waiver evidence, an invalid waiver chain, a blank `--approver`/`--reason`, or a `WORKFLOW_INVOCATION_UNVERIFIED` diagnostic (which `workflow-verify` must resolve first; no per-declaration or bulk waiver can substitute for `workflow-verify` never having run). Each waived declaration-scoped diagnostic's paired `WORKFLOW_BINDING_MISSING` is downgraded together with it, identically to the existing single-record command. With zero remaining candidates (already waived, or none present) it succeeds idempotently and records nothing |
@@ -423,6 +424,7 @@ validation/gate or requested solver failure, **2** usage, I/O or malformed confi
423
424
  | `attestation payload --provider <name> --run-id <id> --key-id <id> [--public-key-file <pem>] [--github-oidc-token-file <jwt>]` | Emit canonical unsigned CI payload for external signing |
424
425
  | `attestation verify` | Verify static-key or GitHub OIDC-authorized Ed25519 provenance |
425
426
  | `change-record <CHANGE-ID> <phase> --requirement <REQ-ID...> [--allow-unchanged] [--dry-run]` | Record ordered artifact/TDD fingerprints for a staged change. `impact`/`requirements`/`design`/`quality` require the change's full requirement ID set; `red`/`implementation`/`green` also accept a proper non-empty subset, recorded as an independent per-requirement batch, so a multi-requirement change can be completed with an interleaved per-requirement Red-Implementation-Green loop instead of one global batch. When multiple batches contain the same requirement, validation uses the batch with the latest Red `order`; a later incomplete batch supersedes older evidence and must be completed rather than silently falling back. Rejects with a non-zero exit and a stable `*_UNCHANGED_AT_RECORD` diagnostic (leaving `changes.json`/`order.json` untouched) when a phase's fingerprint is byte-identical to the immediately preceding phase's, since that mistake is otherwise only caught much later by `trace check --strict`/`gate`, at which point the append-only evidence store makes it unfixable. `--allow-unchanged` bypasses this check for the `requirements` phase only (the one case `sdd-change` documents as legitimate: a defect fix that intentionally leaves its requirement unchanged) and persists a durable marker so later validation does not re-flag it. `--dry-run` previews the exact success/rejection outcome, including every existing check, without persisting anything. Each recorded phase/batch stores both `order` (the verified, `gate`-checked logical append sequence from `order.json` — the only field guaranteed correct and monotonic per change) and `recordedAt` (an independently captured wall-clock timestamp with no ordering guarantee relative to `order`); `gate` reports a non-blocking `CHANGE_RECORDEDAT_OUT_OF_ORDER` warning when a change's `recordedAt` values disagree with its `order` sequence |
427
+ | `change quality-recover [--json]` | Recover an interrupted atomic Quality refresh. A repeated full-set Quality after a newer complete corrective batch retains earlier checkpoints in schema-version-2 `qualityHistory`; incomplete/current or unnecessary refreshes fail with stable `CHANGE_QUALITY_REFRESH_*` errors. |
426
428
  | `config lint` | Report configured commands whose `args` reference repository-relative paths that do not exist |
427
429
  | `config scaffold` | Propose native test-command entries for detected Go/Rust/Maven/Python/Node toolchains without writing `.musubix/config.json` |
428
430
  | `gate [--changed] [--feature <name>]` | Fresh full checks plus actual configured commands; persist evidence. `--feature` scopes requirements/design/trace/tdd/change-history/change-completeness checks to one feature as a diagnostic view; never a substitute for the repository-wide gate |
@@ -438,6 +440,12 @@ Complete owner metadata is staged, flushed, and published with a same-directory
438
440
  exclusive hard link, so the canonical lock is never visible as empty or partial.
439
441
  Filesystems that cannot provide this atomic publication fail with
440
442
  `EVIDENCE_WRITER_LOCK_ACQUIRE_FAILED`; there is no non-atomic fallback.
443
+ When Windows directory synchronization rejects EPERM, EINVAL, or ENOTSUP after
444
+ successful staging-file synchronization and atomic publication or verified
445
+ release, musubix3 treats only that directory-entry durability operation as an
446
+ unsupported capability. File synchronization, publication, metadata, unlink,
447
+ open/close, every other error, and every non-Windows platform remain
448
+ fail-closed.
441
449
 
442
450
  Coordinated readers such as status, approval preparation/validation, trace and
443
451
  graph inspection, knowledge queries, TDD validation, attestation payload/verify,
@@ -454,6 +462,7 @@ recovery is currently Linux-only and requires matching hostname, boot identity,
454
462
  PID namespace, and a demonstrably absent owner PID. Live, PID-reused,
455
463
  cross-host, malformed, changed, unsupported, or indeterminate locks are left
456
464
  untouched with the exact path and inspection guidance. There is no force mode.
465
+ Because the required identity probes are unavailable, automatic recovery remains inspection-only on Windows and macOS.
457
466
  The canonical lock and `.writer-lock.<transactionId>.json` staging files are
458
467
  ignored and excluded from generated inputs. After confirming no related process
459
468
  is active, an abandoned staging file may be removed by its exact path.
@@ -712,12 +721,39 @@ SHA-256. Run `approval prepare` before review and pass that exact hash to
712
721
  `approval record`; an intervening change is rejected and later changes become
713
722
  stale. Release recording recomputes the gate and requires every required
714
723
  non-approval check to pass rather than trusting cached quality evidence.
724
+ `approval prepare <stage> --diff-only` additionally reports `changedFiles`:
725
+ only the artifact paths whose content differs from that stage's last
726
+ *recorded* approval (not a live `git diff`), computed from the same
727
+ deterministic manifest used for `artifactSha256` — the full hash and
728
+ `artifacts` map are always still returned unchanged, so integrity verification
729
+ is never weakened. `diffOnlyBaseline` is `"approved"` when compared against a
730
+ prior recorded approval, or `"none"` (with every current path listed) when
731
+ this stage has never been approved before. With `--domain`, the comparison is
732
+ scoped to that domain's prior approval, matching normal domain-scoped approval
733
+ semantics. If the last recorded approval file for that stage exists but fails
734
+ schema validation, `approval prepare --diff-only` fails fast with the same
735
+ `Invalid <stage> approval evidence.` error `approval validate` reports,
736
+ rather than silently treating corrupted evidence as "no prior approval".
737
+ Without `--diff-only`, non-JSON output is unchanged; with `--diff-only` and no
738
+ `--json`, the console summary prints only the changed paths and a short
739
+ baseline note instead of the full artifact listing.
715
740
  The approver string is explicit local evidence, not authenticated identity;
716
741
  repositories that require independent identity must also use protected review,
717
742
  CODEOWNERS, or CI/OIDC controls.
718
743
  Local approval evidence records explicit intent but does not cryptographically
719
744
  authenticate the approver; protect release authorization with repository review,
720
745
  CODEOWNERS/branch protection, or CI/OIDC attestation.
746
+ `approval prepare release`'s manifest excludes a fixed, source-hardcoded
747
+ scratch-file convention from its untracked candidates: any untracked path at
748
+ or beneath `.musubix/scratch/`, and any untracked file whose basename matches
749
+ `*.scratch.<ext>` (for example `debug.scratch.json`). Write ad hoc
750
+ inspection/debug output using this convention so it never changes the
751
+ release-manifest hash on repeated inspection. This exclusion is a fixed,
752
+ version-controlled list, not a configurable setting: it applies only to
753
+ untracked candidates (a tracked file named this way is still included), and
754
+ only as a final filter on the manifest's output, never before the structural
755
+ nested-workspace/generated-directory exclusion scan, so it cannot be widened
756
+ to quietly hide a real tracked change.
721
757
  Use `tdd.redPreflightCommands` to reference plain configured formatter commands;
722
758
  they must pass before Red captures the authoritative test fingerprint.
723
759
  Conventional `.venv` and `venv` Python environments containing a regular
@@ -1133,6 +1169,14 @@ transcript/session fields into the Ed25519 signature.
1133
1169
  - Core CI covers Node 22 on Linux, Windows, and macOS, with additional Node 20
1134
1170
  and Node 24 Linux compatibility checks. Native adapters and formal solvers run
1135
1171
  once on Linux with pinned toolchains.
1172
+ - **GitHub-hosted runner policy:** the portability matrix intentionally uses
1173
+ `ubuntu-latest`, `windows-latest`, and `macos-latest`; every other CI job and
1174
+ the Release and npm publication workflows use `ubuntu-latest`. These are
1175
+ floating GitHub-hosted labels, not pinned images. When the selected hosted
1176
+ runner image changes, revalidate toolchain installation, typecheck, build,
1177
+ tests, package checks, release preparation, provenance, and publication
1178
+ controls. The actions' Node.js 24 implementation runtime is independent of
1179
+ the Node.js 20/22/24 versions tested for this package.
1136
1180
  No formatting/lint framework is bundled; strict TypeScript and tests are used.
1137
1181
 
1138
1182
  ## Development and release checks
@@ -1147,6 +1191,49 @@ npm run pack:check
1147
1191
  npm run pack:smoke
1148
1192
  ```
1149
1193
 
1194
+ ### Dependency audit policy
1195
+
1196
+ When installation or release preparation reports a dependency advisory, run
1197
+ root-workspace `npm run audit:report` (`npm audit --json`) with all severities and development
1198
+ dependencies included. Record the advisory ID, every dependency path,
1199
+ production/build/test reachability, maintained fix availability, remediation
1200
+ decision, and residual risk or monitoring obligation. Development-only or
1201
+ currently unreachable code lowers exposure but is not remediation when a
1202
+ maintained fix is available. A recorded clean result is time-bound and must not
1203
+ be treated as proof that future audits remain clean.
1204
+ `.github/workflows/dependency-audit.yml` repeats the full report weekly and on
1205
+ manual dispatch; review and remediate any failing run before release.
1206
+
1207
+ The reviewed dependency exception is exactly `{"js-yaml":"^5.4.3"}` in root
1208
+ `overrides` (CHANGE-0052). The offline remediation checker rejects different or
1209
+ additional overrides and reintroduced `sprintf-js`; retained audit evidence
1210
+ must match the current lockfile bytes. This is not general permission to override
1211
+ Vitest packages or to accept development-only vulnerabilities.
1212
+
1213
+ Synchronize every mechanically managed release-version surface before building:
1214
+
1215
+ ```sh
1216
+ npm run --silent release:version -- 1.2.3
1217
+ npm run --silent release:version -- --check 1.2.3
1218
+ # Equivalent direct entrypoints:
1219
+ node scripts/release-version.mjs 1.2.3
1220
+ node scripts/release-version.mjs --check 1.2.3
1221
+ ```
1222
+
1223
+ Use `--silent` with the npm entrypoint so stdout contains only its JSON report.
1224
+ Supply a bare SemVer version, without the tag's `v` prefix or build metadata.
1225
+ The release order is version synchronization, authored `CHANGELOG.md` review,
1226
+ `npm run build`, package validation, explicit release approval, commit, and the
1227
+ matching `v<version>` tag before preparation.
1228
+ The enforced release order is final release metadata and `CHANGELOG.md`,
1229
+ validation and build, explicit release approval, commit and create the unchanged `v<version>` tag,
1230
+ then `release:prepare`. Any committed release-input change
1231
+ after approval requires renewed validation and release approval before a new tag
1232
+ is prepared. `release:prepare` validates every synchronized surface, the tag
1233
+ commit, and the approved tagged manifest before changing its output directory.
1234
+ For a manual Release workflow dispatch, select the target tag in the workflow
1235
+ ref selector and enter that identical tag as `release_tag`.
1236
+
1150
1237
  Workspaces: `packages/domain` (pure validators), `packages/analysis` (evidence,
1151
1238
  compiler and filesystem services), `packages/cli` (thin command/installation layer).
1152
1239
  One build emits `dist/packages/**`. Published contents explicitly include hidden
@@ -1171,6 +1258,29 @@ For manual dispatch, select the release tag as the workflow ref and provide the
1171
1258
  same value as `release_tag`; the workflow rejects tags that do not point to the
1172
1259
  OIDC-bound `GITHUB_SHA`.
1173
1260
 
1261
+ npm publishing accepts stable `vMAJOR.MINOR.PATCH` tags only. Both protected
1262
+ GitHub Actions publish paths check out that tag, download its non-draft GitHub
1263
+ Release into a new empty directory, and use the shared validator before npm
1264
+ provenance publishing. The validator rejects historical or additional assets,
1265
+ verifies the exact SHA256SUMS syntax and embedded `musubix3` package version,
1266
+ and requires every local file digest to match the current uploaded GitHub
1267
+ Release asset digest. Direct `release:prepare` output is not publishable because
1268
+ the strict CI attestation is added later.
1269
+
1270
+ Local operators can verify, but cannot provenance-publish, the same release:
1271
+
1272
+ ```bash
1273
+ gh auth status
1274
+ mkdir release-assets-verify
1275
+ gh release download v1.2.3 --repo nahisaho/musubix3 --dir release-assets-verify
1276
+ npm run --silent release:publish -- --verify-only --tag v1.2.3 \
1277
+ --repository nahisaho/musubix3 --directory release-assets-verify
1278
+ ```
1279
+
1280
+ Use a GitHub CLI version whose release asset output includes `digest` and
1281
+ `state`. Provenance-enabled publishing remains restricted to the protected
1282
+ `npm-publish` GitHub Actions environment.
1283
+
1174
1284
  The release attestation uses a real GitHub Actions OIDC token whose custom
1175
1285
  audience binds an ephemeral Ed25519 public key. Its signature covers repository,
1176
1286
  Git commit, run ID, workflow/ref identity, current workspace snapshot, and any