@hecer/yoke 1.5.1 → 1.6.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 (129) hide show
  1. package/.claude-plugin/plugin.json +13 -13
  2. package/.codex-plugin/plugin.json +7 -7
  3. package/CHANGELOG.md +280 -259
  4. package/README.md +855 -834
  5. package/TODOS.md +5 -5
  6. package/agents/docs.toml +6 -6
  7. package/agents/implementer.toml +6 -6
  8. package/agents/reviewer.toml +6 -6
  9. package/agents/security.toml +6 -6
  10. package/bench/README.md +86 -86
  11. package/bench/RESULTS.md +35 -35
  12. package/bench/output-compaction.mjs +65 -65
  13. package/bench/result-schema.mjs +12 -12
  14. package/bench/results/claude-2026-07-27T18-03-26.json +50 -50
  15. package/bench/results/codex-unavailable-1785175418318.json +15 -15
  16. package/bench/results/gemini-2026-07-27T18-03-44.json +46 -46
  17. package/bench/run-matrix.mjs +26 -26
  18. package/bench/run.mjs +106 -106
  19. package/canon/AGENTS.md +30 -30
  20. package/canon/context/DECISIONS.md +4 -4
  21. package/canon/context/GLOSSARY.md +11 -0
  22. package/canon/context/KNOWLEDGE.md +4 -4
  23. package/canon/context/PROJECT.md +15 -15
  24. package/canon/loop/loop-spec.md +65 -65
  25. package/canon/loop/prd.schema.md +43 -43
  26. package/canon/manifest.yaml +59 -53
  27. package/canon/policy/gates.md +7 -7
  28. package/canon/policy/roles.md +9 -9
  29. package/canon/skills/ATTRIBUTION.md +99 -71
  30. package/canon/skills/authoring-prd/SKILL.md +58 -58
  31. package/canon/skills/brainstorming/SKILL.md +164 -164
  32. package/canon/skills/codebase-design/DEEPENING.md +15 -0
  33. package/canon/skills/codebase-design/DESIGN-IT-TWICE.md +12 -0
  34. package/canon/skills/codebase-design/SKILL.md +39 -0
  35. package/canon/skills/dispatching-parallel-agents/SKILL.md +182 -182
  36. package/canon/skills/document-release/SKILL.md +302 -297
  37. package/canon/skills/domain-modeling/ADR-FORMAT.md +19 -0
  38. package/canon/skills/domain-modeling/CONTEXT-FORMAT.md +39 -0
  39. package/canon/skills/domain-modeling/SKILL.md +35 -0
  40. package/canon/skills/executing-plans/SKILL.md +70 -70
  41. package/canon/skills/finishing-a-development-branch/SKILL.md +200 -200
  42. package/canon/skills/health/SKILL.md +177 -177
  43. package/canon/skills/maintaining-context/SKILL.md +34 -34
  44. package/canon/skills/minimal-code/SKILL.md +21 -21
  45. package/canon/skills/no-ai-slop/SKILL.md +103 -0
  46. package/canon/skills/no-ai-slop/eval.md +43 -0
  47. package/canon/skills/plan-ceo-review/SKILL.md +541 -541
  48. package/canon/skills/plan-eng-review/SKILL.md +362 -362
  49. package/canon/skills/receiving-code-review/SKILL.md +213 -213
  50. package/canon/skills/requesting-code-review/SKILL.md +105 -105
  51. package/canon/skills/resolving-merge-conflicts/SKILL.md +18 -0
  52. package/canon/skills/retro/SKILL.md +397 -397
  53. package/canon/skills/review/SKILL.md +246 -246
  54. package/canon/skills/ship/SKILL.md +691 -691
  55. package/canon/skills/subagent-driven-development/SKILL.md +277 -277
  56. package/canon/skills/systematic-debugging/SKILL.md +296 -296
  57. package/canon/skills/tdd/SKILL.md +371 -371
  58. package/canon/skills/unslop-ui/SKILL.md +34 -34
  59. package/canon/skills/using-git-worktrees/SKILL.md +218 -218
  60. package/canon/skills/verification-before-completion/SKILL.md +139 -139
  61. package/canon/skills/visual-verification/SKILL.md +54 -54
  62. package/canon/skills/workflow/SKILL.md +22 -22
  63. package/canon/skills/writing-for-agents/SKILL-MECHANICS.md +27 -0
  64. package/canon/skills/writing-for-agents/SKILL.md +42 -0
  65. package/canon/skills/writing-plans/SKILL.md +152 -152
  66. package/canon/skills/writing-skills/SKILL.md +655 -655
  67. package/canon/skills/yoke-retrofit/SKILL.md +26 -26
  68. package/canon/skills/yoke-workflow/SKILL.md +20 -20
  69. package/canon/tools/codex-rtk-hook.mjs +35 -35
  70. package/canon/tools/graphify.md +3 -3
  71. package/canon/tools/playwright-mcp.md +3 -3
  72. package/canon/tools/rtk.md +7 -7
  73. package/canon/tools/serena.md +6 -6
  74. package/dist/agents/process.js +3 -0
  75. package/dist/canon/manifest.js +2 -0
  76. package/dist/canon/skill-package.js +113 -0
  77. package/dist/canon/validate.js +16 -1
  78. package/dist/context/command.js +4 -1
  79. package/dist/context/context.js +6 -0
  80. package/dist/loop/dispatcher.js +1 -1
  81. package/dist/loop/loop.js +26 -0
  82. package/dist/loop/parallel-command.js +3 -0
  83. package/dist/loop/run-command.js +11 -0
  84. package/dist/loop/watchdog.js +28 -11
  85. package/dist/loop/worker.js +11 -0
  86. package/dist/prd/command.js +17 -17
  87. package/dist/retrofit/apply.js +22 -7
  88. package/dist/retrofit/command.js +4 -1
  89. package/dist/retrofit/config.js +4 -0
  90. package/dist/retrofit/context-actions.js +1 -1
  91. package/dist/retrofit/detect.js +2 -0
  92. package/dist/retrofit/planners/claude.js +16 -20
  93. package/dist/retrofit/planners/codex.js +3 -7
  94. package/dist/retrofit/planners/gemini.js +11 -1
  95. package/dist/retrofit/preserve.js +2 -2
  96. package/dist/retrofit/report.js +5 -0
  97. package/dist/retrofit/skill-actions.js +66 -0
  98. package/dist/retrofit/ui-detect.js +83 -0
  99. package/dist/scan/gate.js +36 -0
  100. package/docs/MIGRATING-TO-1.0.md +33 -33
  101. package/docs/MIGRATING-TO-1.1.md +27 -27
  102. package/docs/MIGRATING-TO-1.4.md +70 -70
  103. package/docs/PUBLISHING.md +91 -91
  104. package/docs/superpowers/plans/2026-06-28-baustein-e-context-layer.md +981 -981
  105. package/docs/superpowers/plans/2026-06-29-baustein-f-routing.md +258 -258
  106. package/docs/superpowers/plans/2026-06-29-baustein-g-loop-observability.md +1006 -1006
  107. package/docs/superpowers/plans/2026-06-29-baustein-h-loop-robustness.md +374 -374
  108. package/docs/superpowers/plans/2026-06-30-baustein-i-visual-design-verification.md +450 -450
  109. package/docs/superpowers/plans/2026-07-02-baustein-k-zero-to-100-bootstrap.md +1024 -1024
  110. package/docs/superpowers/plans/2026-07-02-baustein-m-flow-smoke-proofs.md +574 -574
  111. package/docs/superpowers/plans/2026-08-13-gauntlet-quality-loop.md +537 -537
  112. package/docs/superpowers/plans/2026-08-16-artifact-backed-output-compaction.md +329 -329
  113. package/docs/superpowers/plans/2026-08-20-automatic-ui-design-gate.md +59 -0
  114. package/docs/superpowers/plans/2026-08-20-capability-skills-and-context.md +51 -0
  115. package/docs/superpowers/plans/2026-08-20-complete-skill-packages-and-invocation.md +59 -0
  116. package/docs/superpowers/plans/2026-08-20-windows-reliability-and-release.md +67 -0
  117. package/docs/superpowers/specs/2026-06-28-baustein-e-context-layer-design.md +146 -146
  118. package/docs/superpowers/specs/2026-06-29-baustein-f-routing-design.md +106 -106
  119. package/docs/superpowers/specs/2026-06-29-baustein-g-loop-observability-design.md +186 -186
  120. package/docs/superpowers/specs/2026-06-29-baustein-h-loop-robustness-design.md +113 -113
  121. package/docs/superpowers/specs/2026-06-30-baustein-i-visual-design-verification-design.md +98 -98
  122. package/docs/superpowers/specs/2026-07-02-baustein-k-zero-to-100-bootstrap-design.md +200 -200
  123. package/docs/superpowers/specs/2026-07-02-baustein-m-flow-smoke-proofs-design.md +155 -155
  124. package/docs/superpowers/specs/2026-08-13-gauntlet-quality-loop-design.md +422 -422
  125. package/docs/superpowers/specs/2026-08-16-artifact-backed-output-compaction-design.md +166 -166
  126. package/docs/superpowers/specs/2026-08-20-skill-capabilities-and-reliability-design.md +391 -0
  127. package/gemini-extension.json +6 -6
  128. package/hooks/hooks.json +19 -19
  129. package/package.json +84 -84
@@ -0,0 +1,59 @@
1
+ # Automatic UI Design Gate Implementation Plan
2
+
3
+ > **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan.
4
+
5
+ **Goal:** Automatically run Yoke's existing design scanner inside configured UI-project loops while preserving current behavior for non-UI and already-configured projects.
6
+
7
+ **Architecture:** Add one deterministic local detector, one default-preserving config section, and a small verifier adapter over the existing scanner. Thread that verifier through the serial and parallel loop gate contracts in the same position and evidence model as existing mechanical gates.
8
+
9
+ **Tech Stack:** TypeScript, Zod, Vitest, existing design scanner and loop abstractions.
10
+
11
+ ---
12
+
13
+ ## Task 1: Detect UI projects with explained evidence
14
+
15
+ **Files:** `src/retrofit/ui-detect.ts`, `src/retrofit/detect.ts`, `tests/retrofit/ui-detect.test.ts`, `tests/retrofit/detect.test.ts`
16
+
17
+ 1. Add failing tests for supported dependencies, `.tsx`, `.jsx`, `.vue`, `.svelte`, `.astro`, an existing smoke-flow config, non-UI TypeScript, and ignored dependency/generated/fixture/Yoke directories.
18
+ 2. Implement bounded traversal of normal source roots and package manifests. Return `{ detected, signals }` with stable, human-readable signals.
19
+ 3. Attach UI evidence to Retrofit detection without changing existing agent detection semantics.
20
+ 4. Run the detector tests.
21
+
22
+ ## Task 2: Add default-preserving design configuration
23
+
24
+ **Files:** `src/retrofit/config.ts`, `src/retrofit/command.ts`, `tests/retrofit/config.test.ts`, `tests/retrofit/integration.test.ts`
25
+
26
+ 1. Add failing schema tests for `mode: off|auto|on`, positive integer `max`, invalid values, and omitted design config.
27
+ 2. Add optional `design` to the config type and schema. Do not place it in the universal legacy default.
28
+ 3. During new/retrofit setup, write `{ mode: 'auto', max: 4 }` only when UI detection succeeds and no user design choice exists.
29
+ 4. Include the detector's evidence in setup output and test that an existing `off`, `on`, or custom budget is preserved.
30
+ 5. Run config and Retrofit integration tests.
31
+
32
+ ## Task 3: Adapt design scan results to a mechanical gate
33
+
34
+ **Files:** `src/scan/gate.ts`, `src/scan/design.ts`, `src/cli.ts`, `tests/scan/gate.test.ts`, `tests/scan/design.test.ts`
35
+
36
+ 1. Add failing tests for pass/fail at a configured budget, stable finding names, bounded preview text, and a full artifact path for overflow details.
37
+ 2. Extract only shared result formatting from the standalone command; do not change its public output or scanner weights.
38
+ 3. Implement a verifier adapter that runs `scanDir`, returns the existing verify-result contract, and writes full findings through the existing artifact helper.
39
+ 4. Run scan tests and a CLI design-scan regression test.
40
+
41
+ ## Task 4: Thread the gate through serial and parallel loops
42
+
43
+ **Files:** `src/loop/run-command.ts`, `src/loop/loop.ts`, `src/loop/worker-contracts.ts`, `src/loop/worker.ts`, `src/loop/parallel-command.ts`, `src/loop/parallel.ts`, `src/loop/dispatcher.ts`, `src/loop/parallel-adapters.ts`, `src/output/types.ts`, matching `tests/loop/*.test.ts`
44
+
45
+ 1. Add failing serial tests showing order `criteria -> verify -> design -> perf -> audit` and proving omitted or `off` design leaves the old call sequence unchanged.
46
+ 2. Add failing worker and dispatcher tests for design evidence, stage-specific failure, retry/quality-rerun behavior, and cancellation.
47
+ 3. Extend gate stage unions, callbacks, evidence, and output phases with `design`; make the verifier optional throughout.
48
+ 4. Construct the verifier in `run-command` for `on`, for detected `auto`, and never for `off` or missing config.
49
+ 5. Run all loop tests, then `rtk npm run lint`.
50
+
51
+ ## Task 5: Verify setup-to-loop behavior
52
+
53
+ **Files:** `tests/retrofit/integration.test.ts`, `tests/loop/run-command.test.ts`
54
+
55
+ 1. Add an integration fixture for a detected UI project and one for a non-UI project.
56
+ 2. Prove Retrofit writes auto config only to the UI fixture and the next loop run selects the design verifier only there.
57
+ 3. Prove `mode: on` overrides failed detection and `mode: off` overrides successful detection.
58
+ 4. Run `rtk npm exec -- vitest run tests/retrofit tests/scan tests/loop`.
59
+
@@ -0,0 +1,51 @@
1
+ # Capability Skills and Context Implementation Plan
2
+
3
+ > **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan.
4
+
5
+ **Goal:** Add the prose, domain, codebase-design, merge-resolution, and agent-writing capabilities identified in the source review, with durable terminology context and clear attribution.
6
+
7
+ **Architecture:** Keep capabilities as independent Canon packages selected through the manifest. Use resource files for evaluation material, keep `.yoke/context` as the durable project source of truth, and connect prose review to documentation workflows without making style a release gate.
8
+
9
+ **Tech Stack:** Markdown skill packages, TypeScript context loader, YAML manifest, Vitest, provenance audit tools.
10
+
11
+ ---
12
+
13
+ ## Task 1: Import and adapt `no-ai-slop`
14
+
15
+ **Files:** `canon/skills/no-ai-slop/SKILL.md`, `canon/skills/no-ai-slop/eval.md`, `canon/ATTRIBUTION.md`, `canon/manifest.yaml`, `tests/canon/real-canon.test.ts`
16
+
17
+ 1. Run a read-only provenance audit on the upstream package and record unknown signals as unknown.
18
+ 2. Add failing real-Canon assertions for the package, its `eval.md` reference, auto invocation, and Peter Yang/MIT attribution.
19
+ 3. Import the upstream workflow and evaluation checklist. Adapt only the trigger wording, Yoke paths, and the precise-domain-term exception; preserve Edit and Detect modes and prohibit authorship guesses.
20
+ 4. Run the package tests and a second read-only provenance audit on the local package.
21
+
22
+ ## Task 2: Add the four complementary capabilities
23
+
24
+ **Files:** `canon/skills/domain-modeling/SKILL.md`, `canon/skills/codebase-design/SKILL.md`, `canon/skills/resolving-merge-conflicts/SKILL.md`, `canon/skills/writing-for-agents/SKILL.md`, `canon/ATTRIBUTION.md`, `canon/manifest.yaml`, `tests/canon/real-canon.test.ts`
25
+
26
+ 1. Add failing assertions for all four skill ids, frontmatter, auto invocation, and source attribution where material is adapted from Matt Pocock's repository.
27
+ 2. Write `domain-modeling` around terminology discovery, scenario checks, code comparison, glossary updates, and the existing ADR threshold.
28
+ 3. Write `codebase-design` around deep modules, small interfaces, real seams, public-interface tests, and local change.
29
+ 4. Write `resolving-merge-conflicts` around current-operation discovery, commit/spec evidence, preservation of both compatible intents, scoped checks, and no implicit abort.
30
+ 5. Write `writing-for-agents` around observable outcomes, concrete paths and commands, bounded context, explicit triggers, and deduplicated durable instructions.
31
+ 6. Validate Canon and run the real-Canon tests.
32
+
33
+ ## Task 3: Add glossary-aware project context
34
+
35
+ **Files:** `canon/context/GLOSSARY.md`, `src/retrofit/context-actions.ts`, `src/context/context.ts`, `src/context/command.ts`, `tests/retrofit/context-actions.test.ts`, `tests/context/context.test.ts`, `tests/context/command.test.ts`
36
+
37
+ 1. Add failing tests that Retrofit introduces `GLOSSARY.md` with `ifAbsent`, existing context is unchanged, and `CONTEXT-MAP.md` is loaded only when present.
38
+ 2. Add a concise glossary template for canonical terms, aliases, rejected terms, and concrete examples.
39
+ 3. Extend context loading and formatted prompt context with bounded glossary content and optional bounded context-map content.
40
+ 4. Extend context status output so required glossary state and optional context-map state are distinguishable.
41
+ 5. Run the context and context-action tests.
42
+
43
+ ## Task 4: Connect prose quality to documentation workflows
44
+
45
+ **Files:** `canon/skills/document-release/SKILL.md`, `canon/roles/docs.yaml`, `CONTRIBUTING.md`, `tests/canon/real-canon.test.ts`
46
+
47
+ 1. Add failing assertions that documentation release guidance invokes `no-ai-slop` evaluation without turning it into a mechanical pass/fail gate.
48
+ 2. Update the skill and docs role to request minimal voice-preserving edits and explicit reporting of observed patterns.
49
+ 3. Use the new skill in Detect mode on changed prose, then Edit mode only where a listed pattern is actually present.
50
+ 4. Run Canon validation and provenance-audit the changed documentation set.
51
+
@@ -0,0 +1,59 @@
1
+ # Complete Skill Packages and Invocation Implementation Plan
2
+
3
+ > **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan.
4
+
5
+ **Goal:** Install every Canon skill as a complete, safe resource package and preserve explicit automatic or manual invocation intent across Claude, Codex, and Gemini.
6
+
7
+ **Architecture:** Extend the parsed Canon manifest with a defaulted invocation policy, enumerate package files once behind a fail-closed boundary, and make every provider planner consume the same normalized package model. Extend Retrofit actions only enough to preserve byte content and executable intent; provider-specific policy remains generated output, not Canon source.
8
+
9
+ **Tech Stack:** TypeScript, Zod, YAML, Vitest, Node filesystem APIs.
10
+
11
+ ---
12
+
13
+ ## Task 1: Add invocation policy to the manifest contract
14
+
15
+ **Files:** `src/canon/manifest.ts`, `tests/canon/manifest.test.ts`, `tests/canon/real-canon.test.ts`, `canon/manifest.yaml`
16
+
17
+ 1. Add failing tests proving omitted `invocation` parses as `auto`, `manual` parses, and unknown values fail.
18
+ 2. Add `InvocationSchema = z.enum(['auto', 'manual'])` and default `invocation` to `auto` on each skill entry.
19
+ 3. Add explicit `invocation` values to every real Canon skill and assert the real manifest has no implicit entries.
20
+ 4. Run `rtk npm exec -- vitest run tests/canon/manifest.test.ts tests/canon/real-canon.test.ts`.
21
+
22
+ ## Task 2: Enumerate and validate complete skill packages
23
+
24
+ **Files:** `src/canon/skill-package.ts`, `src/canon/validate.ts`, `tests/canon/skill-package.test.ts`, `tests/canon/validate.test.ts`
25
+
26
+ 1. Write failing tests for stable relative-path ordering, nested Markdown and binary resources, executable metadata, symlink rejection, path escape rejection, unsupported node types, duplicate normalized targets, and missing relative Markdown references.
27
+ 2. Implement `enumerateSkillPackage(canonDir, skill)` returning immutable records with `relativePath`, `content: Buffer`, and `executable`.
28
+ 3. Normalize separators to `/`, resolve every candidate beneath the skill root, use `lstat` to reject links and special files, and never follow a path outside the root.
29
+ 4. Extend Canon validation to enumerate each package and validate local relative Markdown links without fetching HTTP links or validating anchors.
30
+ 5. Run `rtk npm exec -- vitest run tests/canon/skill-package.test.ts tests/canon/validate.test.ts` and `rtk npm run yoke -- validate canon`.
31
+
32
+ ## Task 3: Let Retrofit actions preserve package bytes and executable intent
33
+
34
+ **Files:** `src/retrofit/plan.ts`, `src/retrofit/apply.ts`, `tests/retrofit/apply.test.ts`
35
+
36
+ 1. Add failing tests for a binary action, unchanged binary content, and executable-mode preservation where the platform supports it.
37
+ 2. Change write actions to accept `string | Uint8Array` and optional `executable`; retain string-only JSON merge and carry-preserved behavior with explicit guards.
38
+ 3. Compare and write buffers without UTF-8 conversion. Apply executable bits on non-Windows after the atomic content write.
39
+ 4. Run `rtk npm exec -- vitest run tests/retrofit/apply.test.ts`.
40
+
41
+ ## Task 4: Generate provider-specific skill outputs
42
+
43
+ **Files:** `src/retrofit/skill-actions.ts`, `src/retrofit/planners/claude.ts`, `src/retrofit/planners/codex.ts`, `src/retrofit/planners/gemini.ts`, `tests/retrofit/planners/claude.test.ts`, `tests/retrofit/planners/codex.test.ts`, `tests/retrofit/planners/gemini.test.ts`
44
+
45
+ 1. Add fixtures containing nested Markdown and a binary resource, plus one manual skill.
46
+ 2. Add failing Claude tests for complete package copying and `disable-model-invocation: true` only on generated manual `SKILL.md` frontmatter.
47
+ 3. Add failing Codex tests for complete copying and generated or merged `agents/openai.yaml` with `policy.allow_implicit_invocation` matching the manifest.
48
+ 4. Add failing Gemini tests for copied resources, unchanged command generation, manual command-only behavior, and a compact auto-skill index that excludes manual skills.
49
+ 5. Implement shared action generation from the package enumerator. Ensure generated policy files cannot silently conflict with a Canon-provided file.
50
+ 6. Run all three planner test files.
51
+
52
+ ## Task 5: Prove backward compatibility end to end
53
+
54
+ **Files:** `tests/retrofit/integration.test.ts`, `tests/canon/real-canon.test.ts`
55
+
56
+ 1. Add an integration test that an existing one-file skill installs byte-for-byte as before.
57
+ 2. Add an integration test that one resource-bearing skill installs its referenced resource for all three agents.
58
+ 3. Run `rtk npm exec -- vitest run tests/canon tests/retrofit` and `rtk npm run lint`.
59
+
@@ -0,0 +1,67 @@
1
+ # Windows Reliability and 1.6.0 Release Implementation Plan
2
+
3
+ > **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan.
4
+
5
+ **Goal:** Make provider-process termination and cleanup reliable under Windows suite load, then document, package, and publish the verified 1.6.0 release.
6
+
7
+ **Architecture:** Preserve scoped PID ownership and fail-closed records. Treat `taskkill` success as a termination request, then confirm that the recorded PID is gone with a bounded wait before removing ownership evidence or allowing cleanup. Release only one commit through the documented GitHub and npm channels.
8
+
9
+ **Tech Stack:** Node child processes, Windows `taskkill`, Vitest, npm, GitHub CLI, Git.
10
+
11
+ ---
12
+
13
+ ## Task 1: Reproduce and pin the Windows race
14
+
15
+ **Files:** `tests/agents/provider-process.test.ts`, `tests/agents/provider-process-record-failure.test.ts`, `tests/loop/watchdog.test.ts`
16
+
17
+ 1. Record the isolated baseline: both provider-process files pass together, establishing that the failure depends on suite load rather than basic semantics.
18
+ 2. Run the affected files repeatedly and run the full suite with verbose failure output. Capture whether time is spent before `close`, during `taskkill`, or in temporary-directory removal.
19
+ 3. Add a failing watchdog unit test where `taskkill` returns zero while the injected liveness probe remains true for two polls; termination must not yet be confirmed.
20
+ 4. Add a failing provider test that completion after cancellation leaves neither a live recorded PID nor a removable-directory race.
21
+
22
+ ## Task 2: Confirm termination before releasing ownership
23
+
24
+ **Files:** `src/loop/watchdog.ts`, `src/agents/process.ts`, `tests/loop/watchdog.test.ts`, `tests/agents/provider-process.test.ts`
25
+
26
+ 1. Extend `killProcessTreeForCleanup` on Windows with an injectable liveness probe and bounded 25 ms polling after successful `taskkill`.
27
+ 2. Return `true` only when the PID is confirmed absent; return `false` when the bounded confirmation expires. Keep POSIX process-group behavior unchanged.
28
+ 3. In `startProviderProcess`, preserve the ownership record whenever confirmation is false; remove it only on natural close without requested termination or confirmed termination.
29
+ 4. Ensure stdin is closed before the first termination request and force escalation remains bounded and PID-scoped.
30
+ 5. Run watchdog and provider-process tests ten times. Do not add a process-name kill or unconditional record deletion.
31
+
32
+ ## Task 3: Run the complete quality ladder
33
+
34
+ **Files:** all changed source and tests
35
+
36
+ 1. Run focused Canon, Retrofit, context, scan, loop, and agent suites.
37
+ 2. Run `rtk npm run lint` and `rtk npm run yoke -- validate canon`.
38
+ 3. Run `rtk npm test` at least twice on Windows and check for remaining `yoke-provider-*` temporary directories or owned provider processes after each run.
39
+ 4. Fix only attributable failures and repeat the narrowest failing test before returning to the full suite.
40
+
41
+ ## Task 4: Update release documentation with the new prose skills
42
+
43
+ **Files:** `README.md`, `CONTRIBUTING.md`, `CHANGELOG.md`, `docs/PUBLISHING.md`
44
+
45
+ 1. Update README behavior, examples, skill count/table, complete-package installation, invocation policy, `unslop-ui` versus `no-ai-slop`, UI auto detection, and glossary context.
46
+ 2. Document package resources and invocation-policy authoring in CONTRIBUTING; add a 1.6.0 changelog entry and only adjust publishing guidance when the actual workflow changed.
47
+ 3. Run `no-ai-slop` Detect mode over changed prose, make only supported voice-preserving edits, then run the global read-only provenance audit.
48
+ 4. Run `rtk npm run docs:update` and `rtk npm run docs:check`.
49
+
50
+ ## Task 5: Synchronize and verify 1.6.0 metadata
51
+
52
+ **Files:** `package.json`, `package-lock.json`, `canon/manifest.yaml`, `.claude-plugin/plugin.json`, `.codex-plugin/plugin.json`, `gemini-extension.json`, generated README metadata
53
+
54
+ 1. Set every documented release field to `1.6.0` and regenerate lock and documentation metadata through project scripts.
55
+ 2. Run `rtk npm run prepublishOnly` and inspect `npm pack --dry-run` output for required skill resources, especially `no-ai-slop/eval.md`.
56
+ 3. Review `rtk git diff --check`, `rtk git status`, and the release diff; exclude `.omo/` and unrelated user files.
57
+ 4. Commit the verified implementation and metadata on `main`.
58
+
59
+ ## Task 6: Publish and verify both channels
60
+
61
+ **Files:** no further source edits after the release commit
62
+
63
+ 1. Push `main`, create annotated tag `v1.6.0` at the verified commit, and push the tag.
64
+ 2. Create the GitHub Release from that tag and verify its URL and commit.
65
+ 3. Publish `@hecer/yoke@1.6.0` to npm. If npm alone requires an operator OTP, stop that channel and report it precisely.
66
+ 4. Verify `git ls-remote`, the GitHub Release, `npm view @hecer/yoke version`, and package contents all resolve to 1.6.0.
67
+
@@ -1,146 +1,146 @@
1
- # Baustein E — Context Layer (durable cross-session context)
2
-
3
- **Status:** Design approved 2026-06-28
4
- **Component:** Yoke (🐂)
5
- **Relates to:** [[harness-project-goal]], [[harness-stack-decisions]], [[harness-loop-technique]]
6
-
7
- ## Problem & Goal
8
-
9
- The dev.to article ("A Claude Code Skills Stack") frames a three-layer division of labor:
10
- **gstack decides → GSD stabilizes context → Superpowers executes.** Yoke today has the
11
- Decision layer (ported gstack roles) and a strong Execution layer (superpowers methodology +
12
- the Ralph loop), but it never built the **Context layer** — GSD's actual contribution:
13
- durable, cross-session artifacts that prevent specification drift.
14
-
15
- Concretely, the loop's [`buildClaudePrompt`](../../../src/loop/runner.ts) injects **only the
16
- current story + its acceptance criteria**. Every fresh-context iteration starts blind to the
17
- project's overall goal, the decisions already made, and the gotchas already learned. Over many
18
- iterations this is exactly where drift leaks in. The user's own auto-memory does this job by
19
- hand; the harness should give its users the same thing.
20
-
21
- **Goal:** a durable Context layer — three markdown files under `.yoke/context/` that the loop
22
- **reads before each iteration** and **writes decisions back to**, plus a skill so interactive
23
- (non-loop) sessions honor the same files. This closes the spec-drift hole and completes the
24
- third leg of the article's model.
25
-
26
- ## Key Decisions (locked)
27
-
28
- | Decision | Choice |
29
- |---|---|
30
- | Scope | Loop **and** interactive sessions (retrofit scaffolds for all 3 agents) |
31
- | Write-back | **Hybrid**: loop deterministically auto-logs decisions; agents enrich `DECISIONS`/`KNOWLEDGE` via the skill |
32
- | Files location | `.yoke/context/` (agent-agnostic shared state, like `.yoke/prd.yaml`) |
33
- | Config | None new — injection auto-on when files present; prompt bound is a constant |
34
- | Backwards-compat | No `.yoke/context/` → loop prompt is byte-identical to today |
35
- | Out of scope | Routing/priority fix (separate Baustein F), structured decision schema, cross-file linking |
36
-
37
- ## The three files — `.yoke/context/`
38
-
39
- | File | Role | Writer |
40
- |------|------|--------|
41
- | `PROJECT.md` | North star: goal, constraints, **non-goals**, success criteria | Human/brainstorm authored; retrofit scaffolds a template. Read-only input. |
42
- | `DECISIONS.md` | Append-only ADR ledger | Loop auto-appends per completed+verified story; agents append in interactive work. |
43
- | `KNOWLEDGE.md` | Gotchas, conventions, reusable learnings | Agent/human maintained via the skill. |
44
-
45
- The files are plain markdown — no schema, no required structure beyond `DECISIONS.md`'s
46
- append format (so the loop can append unambiguously). Missing or partial files are valid:
47
- the layer degrades gracefully (an absent file contributes nothing to the prompt).
48
-
49
- ## Architecture
50
-
51
- ### New module — `src/context/context.ts`
52
- Pure and unit-testable, structured like `src/loop/prd.ts`:
53
-
54
- - `loadContext(dir): ProjectContext` — read the three files if present; missing → empty strings. Never throws on absence.
55
- - `formatForPrompt(ctx, maxChars): string` — render a "Project context" block, **tail-bounding** each file to `maxChars` (constant, ~2 KB) so a large ledger can't blow up the prompt. Returns `''` when all three are empty.
56
- - `appendDecision(dir, entry): { rollback: () => void }` — append a `DECISIONS.md` entry and return a rollback that restores the prior file content (captured before the write). Creates the file if absent.
57
-
58
- `ProjectContext = { project: string; decisions: string; knowledge: string }`.
59
-
60
- A decision entry is formatted as:
61
- ```
62
- ## <YYYY-MM-DD> — <story-id>: <title>
63
- <one-line summary>
64
- ```
65
- The date comes from the Node runtime at loop time (the loop is normal Node, not a Workflow
66
- script — `Date` is available).
67
-
68
- ### Loop read — `src/loop/runner.ts`
69
- `buildClaudePrompt(story, context?)` and `buildReviewPrompt(story, context?)` gain an optional
70
- pre-formatted `context` string. When present, a "Project context" section is inserted **ahead
71
- of** the story block. The reviewer gets the north star too (so it reviews against goals, not
72
- just acceptance criteria). When `context` is undefined/empty, the prompts are unchanged.
73
-
74
- The loop loads + formats context once per iteration (`.yoke/context/` resolved relative to
75
- `targetDir`) and threads it through the runner/review call.
76
-
77
- ### Loop write-back — `src/loop/loop.ts`
78
- After verify (and optional review) passes, **before the commit**:
79
-
80
- 1. `appendDecision(contextDir, { storyId, title, summary })` → keep the returned `rollback`.
81
- 2. `savePrd(passes:true)`.
82
- 3. `commitAll(...)` — now also stages `DECISIONS.md`, so the decision and the `passes:true`
83
- flip land in the **same atomic commit**.
84
-
85
- If the commit throws, revert **both**: `savePrd(prior stories)` *and* `rollback()` for the
86
- decision file. This preserves the existing invariant — *`passes:true` never persists without a
87
- commit* — and extends it to the decision ledger (no orphan decision without a commit).
88
-
89
- In `--isolate` mode the append happens inside the worktree before the worktree commit, so
90
- `integrate` fast-forwards the decision back into the main tree along with the code.
91
-
92
- ### Retrofit scaffolding — `src/retrofit/`
93
- A retrofit action writes `.yoke/context/{PROJECT,DECISIONS,KNOWLEDGE}.md` from
94
- `canon/context/*.md` templates **only if absent** (non-destructive + idempotent, the same rule
95
- as every other artifact). Agent-agnostic — one set under `.yoke/` serves claude/codex/gemini,
96
- so it is emitted once regardless of `--agent`. The report lists the scaffolded files.
97
-
98
- ### Skill — `canon/skills/maintaining-context/SKILL.md`
99
- Agent-facing, flows to all three agents via the existing planners + `manifest.yaml`:
100
- > Before substantial work, read `.yoke/context/PROJECT.md` for the north star and
101
- > `KNOWLEDGE.md` for known gotchas. When you make a non-obvious decision, append it to
102
- > `DECISIONS.md`. When you learn a reusable fact or gotcha, append it to `KNOWLEDGE.md`.
103
-
104
- This is what extends drift-protection from the loop to interactive sessions.
105
-
106
- ### CLI — `src/cli.ts`
107
- - `yoke context init` — scaffold the three files standalone (idempotent, non-destructive).
108
- - `yoke context status` — show presence, byte sizes, and the last decision heading.
109
-
110
- ## Data flow (loop iteration)
111
-
112
- ```
113
- load PRD ─► pick story ─► load+format .yoke/context ─► runner(prompt + context)
114
- ─► verify ─► [review] ─► appendDecision() ─► savePrd(passes:true) ─► commitAll(+DECISIONS.md)
115
- └── on commit failure: rollback() + savePrd(prior) ──► blocked
116
- ```
117
-
118
- ## Error handling
119
-
120
- - Missing/partial context files: treated as empty; no error, prompt simply omits that part.
121
- - Oversized files: tail-bounded to a constant per file; never unbounded.
122
- - `appendDecision` before commit + rollback on commit failure: no orphan decisions.
123
- - Isolate mode: decision written in the worktree, carried back only on successful integrate.
124
- - `yoke context init` over existing files: skips them (reports "exists"), never overwrites.
125
-
126
- ## Testing (subagent-driven TDD, like A–D)
127
-
128
- **context.ts units:** load with all/none/partial files present; `formatForPrompt` bounding +
129
- empty-returns-`''`; `appendDecision` format correctness + rollback restores prior content +
130
- creates file when absent.
131
-
132
- **loop:** prompt includes the context block when `.yoke/context/` present; prompt unchanged
133
- when absent; decision appended on success; **not** appended on a blocked story; both PRD and
134
- decision reverted on commit failure; isolate path carries the decision back via integrate.
135
-
136
- **retrofit:** scaffolds the three files; idempotent on re-run; non-destructive over existing
137
- files; emitted once for `--agent=all`.
138
-
139
- **canon:** `maintaining-context` present in `manifest.yaml`; `yoke validate canon` stays green.
140
-
141
- ## Non-goals (YAGNI)
142
-
143
- - No new config keys (injection is automatic; bound is a constant).
144
- - No structured/parsed decision schema — markdown append only.
145
- - No cross-file linking or decision superseding.
146
- - Routing/priority arbitration is **Baustein F**, not this spec.
1
+ # Baustein E — Context Layer (durable cross-session context)
2
+
3
+ **Status:** Design approved 2026-06-28
4
+ **Component:** Yoke (🐂)
5
+ **Relates to:** [[harness-project-goal]], [[harness-stack-decisions]], [[harness-loop-technique]]
6
+
7
+ ## Problem & Goal
8
+
9
+ The dev.to article ("A Claude Code Skills Stack") frames a three-layer division of labor:
10
+ **gstack decides → GSD stabilizes context → Superpowers executes.** Yoke today has the
11
+ Decision layer (ported gstack roles) and a strong Execution layer (superpowers methodology +
12
+ the Ralph loop), but it never built the **Context layer** — GSD's actual contribution:
13
+ durable, cross-session artifacts that prevent specification drift.
14
+
15
+ Concretely, the loop's [`buildClaudePrompt`](../../../src/loop/runner.ts) injects **only the
16
+ current story + its acceptance criteria**. Every fresh-context iteration starts blind to the
17
+ project's overall goal, the decisions already made, and the gotchas already learned. Over many
18
+ iterations this is exactly where drift leaks in. The user's own auto-memory does this job by
19
+ hand; the harness should give its users the same thing.
20
+
21
+ **Goal:** a durable Context layer — three markdown files under `.yoke/context/` that the loop
22
+ **reads before each iteration** and **writes decisions back to**, plus a skill so interactive
23
+ (non-loop) sessions honor the same files. This closes the spec-drift hole and completes the
24
+ third leg of the article's model.
25
+
26
+ ## Key Decisions (locked)
27
+
28
+ | Decision | Choice |
29
+ |---|---|
30
+ | Scope | Loop **and** interactive sessions (retrofit scaffolds for all 3 agents) |
31
+ | Write-back | **Hybrid**: loop deterministically auto-logs decisions; agents enrich `DECISIONS`/`KNOWLEDGE` via the skill |
32
+ | Files location | `.yoke/context/` (agent-agnostic shared state, like `.yoke/prd.yaml`) |
33
+ | Config | None new — injection auto-on when files present; prompt bound is a constant |
34
+ | Backwards-compat | No `.yoke/context/` → loop prompt is byte-identical to today |
35
+ | Out of scope | Routing/priority fix (separate Baustein F), structured decision schema, cross-file linking |
36
+
37
+ ## The three files — `.yoke/context/`
38
+
39
+ | File | Role | Writer |
40
+ |------|------|--------|
41
+ | `PROJECT.md` | North star: goal, constraints, **non-goals**, success criteria | Human/brainstorm authored; retrofit scaffolds a template. Read-only input. |
42
+ | `DECISIONS.md` | Append-only ADR ledger | Loop auto-appends per completed+verified story; agents append in interactive work. |
43
+ | `KNOWLEDGE.md` | Gotchas, conventions, reusable learnings | Agent/human maintained via the skill. |
44
+
45
+ The files are plain markdown — no schema, no required structure beyond `DECISIONS.md`'s
46
+ append format (so the loop can append unambiguously). Missing or partial files are valid:
47
+ the layer degrades gracefully (an absent file contributes nothing to the prompt).
48
+
49
+ ## Architecture
50
+
51
+ ### New module — `src/context/context.ts`
52
+ Pure and unit-testable, structured like `src/loop/prd.ts`:
53
+
54
+ - `loadContext(dir): ProjectContext` — read the three files if present; missing → empty strings. Never throws on absence.
55
+ - `formatForPrompt(ctx, maxChars): string` — render a "Project context" block, **tail-bounding** each file to `maxChars` (constant, ~2 KB) so a large ledger can't blow up the prompt. Returns `''` when all three are empty.
56
+ - `appendDecision(dir, entry): { rollback: () => void }` — append a `DECISIONS.md` entry and return a rollback that restores the prior file content (captured before the write). Creates the file if absent.
57
+
58
+ `ProjectContext = { project: string; decisions: string; knowledge: string }`.
59
+
60
+ A decision entry is formatted as:
61
+ ```
62
+ ## <YYYY-MM-DD> — <story-id>: <title>
63
+ <one-line summary>
64
+ ```
65
+ The date comes from the Node runtime at loop time (the loop is normal Node, not a Workflow
66
+ script — `Date` is available).
67
+
68
+ ### Loop read — `src/loop/runner.ts`
69
+ `buildClaudePrompt(story, context?)` and `buildReviewPrompt(story, context?)` gain an optional
70
+ pre-formatted `context` string. When present, a "Project context" section is inserted **ahead
71
+ of** the story block. The reviewer gets the north star too (so it reviews against goals, not
72
+ just acceptance criteria). When `context` is undefined/empty, the prompts are unchanged.
73
+
74
+ The loop loads + formats context once per iteration (`.yoke/context/` resolved relative to
75
+ `targetDir`) and threads it through the runner/review call.
76
+
77
+ ### Loop write-back — `src/loop/loop.ts`
78
+ After verify (and optional review) passes, **before the commit**:
79
+
80
+ 1. `appendDecision(contextDir, { storyId, title, summary })` → keep the returned `rollback`.
81
+ 2. `savePrd(passes:true)`.
82
+ 3. `commitAll(...)` — now also stages `DECISIONS.md`, so the decision and the `passes:true`
83
+ flip land in the **same atomic commit**.
84
+
85
+ If the commit throws, revert **both**: `savePrd(prior stories)` *and* `rollback()` for the
86
+ decision file. This preserves the existing invariant — *`passes:true` never persists without a
87
+ commit* — and extends it to the decision ledger (no orphan decision without a commit).
88
+
89
+ In `--isolate` mode the append happens inside the worktree before the worktree commit, so
90
+ `integrate` fast-forwards the decision back into the main tree along with the code.
91
+
92
+ ### Retrofit scaffolding — `src/retrofit/`
93
+ A retrofit action writes `.yoke/context/{PROJECT,DECISIONS,KNOWLEDGE}.md` from
94
+ `canon/context/*.md` templates **only if absent** (non-destructive + idempotent, the same rule
95
+ as every other artifact). Agent-agnostic — one set under `.yoke/` serves claude/codex/gemini,
96
+ so it is emitted once regardless of `--agent`. The report lists the scaffolded files.
97
+
98
+ ### Skill — `canon/skills/maintaining-context/SKILL.md`
99
+ Agent-facing, flows to all three agents via the existing planners + `manifest.yaml`:
100
+ > Before substantial work, read `.yoke/context/PROJECT.md` for the north star and
101
+ > `KNOWLEDGE.md` for known gotchas. When you make a non-obvious decision, append it to
102
+ > `DECISIONS.md`. When you learn a reusable fact or gotcha, append it to `KNOWLEDGE.md`.
103
+
104
+ This is what extends drift-protection from the loop to interactive sessions.
105
+
106
+ ### CLI — `src/cli.ts`
107
+ - `yoke context init` — scaffold the three files standalone (idempotent, non-destructive).
108
+ - `yoke context status` — show presence, byte sizes, and the last decision heading.
109
+
110
+ ## Data flow (loop iteration)
111
+
112
+ ```
113
+ load PRD ─► pick story ─► load+format .yoke/context ─► runner(prompt + context)
114
+ ─► verify ─► [review] ─► appendDecision() ─► savePrd(passes:true) ─► commitAll(+DECISIONS.md)
115
+ └── on commit failure: rollback() + savePrd(prior) ──► blocked
116
+ ```
117
+
118
+ ## Error handling
119
+
120
+ - Missing/partial context files: treated as empty; no error, prompt simply omits that part.
121
+ - Oversized files: tail-bounded to a constant per file; never unbounded.
122
+ - `appendDecision` before commit + rollback on commit failure: no orphan decisions.
123
+ - Isolate mode: decision written in the worktree, carried back only on successful integrate.
124
+ - `yoke context init` over existing files: skips them (reports "exists"), never overwrites.
125
+
126
+ ## Testing (subagent-driven TDD, like A–D)
127
+
128
+ **context.ts units:** load with all/none/partial files present; `formatForPrompt` bounding +
129
+ empty-returns-`''`; `appendDecision` format correctness + rollback restores prior content +
130
+ creates file when absent.
131
+
132
+ **loop:** prompt includes the context block when `.yoke/context/` present; prompt unchanged
133
+ when absent; decision appended on success; **not** appended on a blocked story; both PRD and
134
+ decision reverted on commit failure; isolate path carries the decision back via integrate.
135
+
136
+ **retrofit:** scaffolds the three files; idempotent on re-run; non-destructive over existing
137
+ files; emitted once for `--agent=all`.
138
+
139
+ **canon:** `maintaining-context` present in `manifest.yaml`; `yoke validate canon` stays green.
140
+
141
+ ## Non-goals (YAGNI)
142
+
143
+ - No new config keys (injection is automatic; bound is a constant).
144
+ - No structured/parsed decision schema — markdown append only.
145
+ - No cross-file linking or decision superseding.
146
+ - Routing/priority arbitration is **Baustein F**, not this spec.