@punks/cli 4.0.3 → 4.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,6 +6,10 @@ Compatibility: `>=4.0.0 <5`
6
6
 
7
7
  ### Fixed
8
8
 
9
+ - Make the globally scaffolded `.agents/AGENTS.md` prompt exactly match the canonical shared scaffold guidance.
10
+
11
+ - Accept valid Commit Gate `lint` and `formatCheck` Quality Command Contracts before projection skip (#193).
12
+
9
13
  - Preserve nearest-config discovery and workspace-owned typed lint settings for
10
14
  generated lint configuration.
11
15
  - Repair the managed JavaScript and TypeScript post-edit hook's unused
@@ -36,6 +40,7 @@ Compatibility: `>=4.0.0 <5`
36
40
 
37
41
  ### Changed
38
42
 
43
+ - Sync canonical `wearedevpunks/skills@584ea4bddd5bcfcf780baf9fb67ff736ba7d0626`; apply the `$writing-for-agents` cleanup for bounded ordered brainstorm evidence and decision criteria, audit the PR #189 Finder entries, and keep `delivery-phase` human-only in its description and metadata.
39
44
  - Make `write-backlog` reconcile existing provider structure before mutation and project lateral Fogs into Area → Initiative → Epic → milestone-bound Story → required Task work with native blockers.
40
45
  - Keep delivery status tied to observed work and production evidence, and add approval-gated backlog Normalization without introducing CI/CD design.
41
46
  - Clarify recursive backend composition ownership and Effect Layer placement for issue #164.
package/dist/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.0.4 - 2026-09-03
4
+
5
+ ### Fixed
6
+
7
+ - Canonicalize generated sync-subagents entrypoint paths so the intended guard
8
+ runs, and stage completed prior projection-receipt evidence before candidate
9
+ synchronization validates it.
10
+
3
11
  ## 4.0.3 - 2026-09-03
4
12
 
5
13
  ### Added
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "schemaVersion": 2,
3
3
  "channel": "stable",
4
- "version": "2026.09.03-b6cc808d",
5
- "tag": "baseline/stable/2026.09.03-b6cc808d",
6
- "commit": "b6cc808d8becbe5d8ae84161c49be4eea6a580b9",
4
+ "version": "2026.09.04-b9bb213d",
5
+ "tag": "baseline/stable/2026.09.04-b9bb213d",
6
+ "commit": "b9bb213dc490753020501ef81f42978d1caee89e",
7
7
  "sha256": null,
8
8
  "compatibility": {
9
- "cliVersionRange": ">=4.0.3 <4.1.0"
9
+ "cliVersionRange": ">=4.0.4 <4.1.0"
10
10
  },
11
- "generatedAt": "2026-09-03T11:33:05.000Z"
11
+ "generatedAt": "2026-09-04T01:28:29.000Z"
12
12
  }
@@ -0,0 +1,59 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { validateCanonicalContextPlan } from "./sync-subagents.mjs";
3
+
4
+ interface CommitGateContribution {
5
+ compatibility: readonly unknown[];
6
+ contract: { formatCheck: string; lint: string };
7
+ identity: { id: string; version: string };
8
+ kind: "commit-gate";
9
+ order: number;
10
+ provenance: { revision: string; source: string };
11
+ references: readonly string[];
12
+ }
13
+
14
+ const contribution: CommitGateContribution = {
15
+ compatibility: [],
16
+ contract: { formatCheck: "bun run check:format", lint: "bun run lint" },
17
+ identity: { id: "verification", version: "1" },
18
+ kind: "commit-gate",
19
+ order: 0,
20
+ provenance: { revision: "1", source: "project" },
21
+ references: [],
22
+ };
23
+
24
+ const plan = (entry: object = contribution) => ({
25
+ scopes: [{ contributions: [entry], id: "root", packs: [] }],
26
+ version: "1",
27
+ });
28
+
29
+ type MutateContribution = (entry: CommitGateContribution) => Record<string, unknown>;
30
+
31
+ const invalidCases: readonly [string, MutateContribution][] = [
32
+ [
33
+ "missing contract",
34
+ (entry) => {
35
+ const { contract: _contract, ...invalid } = entry;
36
+ return invalid;
37
+ },
38
+ ],
39
+ ["empty lint", (entry) => ({ ...entry, contract: { ...entry.contract, lint: "" } })],
40
+ [
41
+ "empty formatCheck",
42
+ (entry) => ({ ...entry, contract: { ...entry.contract, formatCheck: "" } }),
43
+ ],
44
+ [
45
+ "extra contract field",
46
+ (entry) => ({ ...entry, contract: { ...entry.contract, extra: "unexpected" } }),
47
+ ],
48
+ ];
49
+
50
+ describe("sync-subagents context-plan validator", () => {
51
+ it("accepts commit-gate contracts with both command strings", () => {
52
+ expect(validateCanonicalContextPlan(plan())).toBeUndefined();
53
+ });
54
+
55
+ it.each(invalidCases)("rejects %s", (_label, mutate) => {
56
+ const invalid = mutate(contribution);
57
+ expect(validateCanonicalContextPlan(plan(invalid))).toMatch(/contract|fields/iu);
58
+ });
59
+ });
@@ -0,0 +1 @@
1
+ export declare const validateCanonicalContextPlan: (contextPlan: unknown) => string | undefined;
@@ -2878,6 +2878,7 @@ const contributionKinds = new Set([
2878
2878
  "lifecycle-hook",
2879
2879
  "tool-configuration",
2880
2880
  "subagent-template",
2881
+ "commit-gate",
2881
2882
  ]);
2882
2883
 
2883
2884
  const identityIssue = (identity) =>
@@ -2905,17 +2906,19 @@ const compatibilityIssue = (compatibility) =>
2905
2906
  ? undefined
2906
2907
  : "Context contribution compatibility is invalid";
2907
2908
 
2909
+ const commitGateContractIssue = (contract) =>
2910
+ exactKeys(contract, ["lint", "formatCheck"]) &&
2911
+ isNonEmptyString(contract.lint) &&
2912
+ isNonEmptyString(contract.formatCheck)
2913
+ ? undefined
2914
+ : "Commit-gate contract must contain non-empty lint and formatCheck strings";
2915
+
2908
2916
  const contributionIssue = (contribution) => {
2909
- if (
2910
- !exactKeys(contribution, [
2911
- "kind",
2912
- "identity",
2913
- "provenance",
2914
- "compatibility",
2915
- "references",
2916
- "order",
2917
- ])
2918
- ) {
2917
+ const expectedKeys =
2918
+ contribution?.kind === "commit-gate"
2919
+ ? ["kind", "identity", "provenance", "compatibility", "references", "order", "contract"]
2920
+ : ["kind", "identity", "provenance", "compatibility", "references", "order"];
2921
+ if (!exactKeys(contribution, expectedKeys)) {
2919
2922
  return "Context contribution fields are invalid";
2920
2923
  }
2921
2924
  return (
@@ -2925,6 +2928,9 @@ const contributionIssue = (contribution) => {
2925
2928
  identityIssue(contribution.identity) ??
2926
2929
  provenanceIssue(contribution.provenance) ??
2927
2930
  compatibilityIssue(contribution.compatibility) ??
2931
+ (contribution.kind === "commit-gate"
2932
+ ? commitGateContractIssue(contribution.contract)
2933
+ : undefined) ??
2928
2934
  (!Array.isArray(contribution.references) || !contribution.references.every(isNonEmptyString)
2929
2935
  ? "Context contribution references are invalid"
2930
2936
  : undefined) ??
@@ -3002,6 +3008,8 @@ function subagentManifestIssue(contextPlan) {
3002
3008
  const canonicalContextIssue = (contextPlan) =>
3003
3009
  contextPlanIssue(contextPlan) ?? subagentManifestIssue(contextPlan);
3004
3010
 
3011
+ export const validateCanonicalContextPlan = (contextPlan) => canonicalContextIssue(contextPlan);
3012
+
3005
3013
  const contextPlanVersion = (contextPlan) =>
3006
3014
  isObject(contextPlan) && typeof contextPlan.version === "string"
3007
3015
  ? contextPlan.version
@@ -3109,8 +3117,13 @@ async function main({ publicationLock } = {}) {
3109
3117
  }
3110
3118
  }
3111
3119
 
3112
- try {
3113
- await main();
3114
- } finally {
3115
- await closeMutationWorkers();
3120
+ const entrypointPath = process.argv[1] === undefined ? null : await realpath(process.argv[1]);
3121
+ const modulePath = await realpath(fileURLToPath(import.meta.url));
3122
+
3123
+ if (entrypointPath === modulePath) {
3124
+ try {
3125
+ await main();
3126
+ } finally {
3127
+ await closeMutationWorkers();
3128
+ }
3116
3129
  }
@@ -5,8 +5,14 @@ description: Brainstorm a bounded system from the operating agent’s perspectiv
5
5
 
6
6
  # Brainstorm
7
7
 
8
- Apply this to the active system boundary:
9
-
10
- think deeply about how to make this entire system as agent-intuitive, agent-ergonomic, and agent-accretive as you can possibly imagine. Put yourself in the driver's seat and imagine that YOU are the one using this system and driving it. What would most enable you to do an awesome job understanding the situation accurately and optimally controlling everything to drive the best and most accurate results possible, with the least expenditure of resources? Don't just think of the project as an assemblage of various parts or components: really try to profoundly and deeply conceptualize it as a synthetic SYSTEM that is maximally coherent, cohesive, modular, and interconnected, forming a tower of linked abstractions that are maximally legible to you as an agent. Really ruminate and meditate on all of this incredibly deeply before responding or taking any actions.
11
-
12
- Return evidence-grounded observations and unresolved decisions. They remain candidates until the caller accepts them.
8
+ 1. Bound the system, its operator, accepted constraints, and available
9
+ evidence. Mark every unsupported premise as unknown.
10
+ 2. Operate the system from the agent's seat. Trace intake, state, control,
11
+ feedback, recovery, and handoff. Account for each applicable surface or
12
+ record why it does not apply.
13
+ 3. Derive the smallest changes that make the system agent-intuitive,
14
+ agent-ergonomic, and agent-accretive. For each candidate, state its evidence,
15
+ consequence, and unresolved tradeoff.
16
+ 4. Return the evidence-grounded observations and unresolved decisions. Completion
17
+ requires every observation to trace to evidence or an explicit unknown. They
18
+ remain candidates until the caller accepts them.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: delivery-phase
3
- description: Routes a scoped delivery goal to the next lifecycle phase from current artifacts and evidence. Use when delivering, resuming, or closing a goal that may pass through spec, plan, implementation, review, debugging, docs ingest, and closeout.
3
+ description: Human-invoked router for a scoped delivery goal using current artifacts and evidence.
4
4
  disable-model-invocation: true
5
5
  ---
6
6
 
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "schemaVersion": 2,
3
3
  "channel": "stable",
4
- "version": "2026.09.03-b6cc808d",
5
- "tag": "baseline/stable/2026.09.03-b6cc808d",
6
- "commit": "b6cc808d8becbe5d8ae84161c49be4eea6a580b9",
4
+ "version": "2026.09.04-b9bb213d",
5
+ "tag": "baseline/stable/2026.09.04-b9bb213d",
6
+ "commit": "b9bb213dc490753020501ef81f42978d1caee89e",
7
7
  "archive": "scaffold-baseline.tgz",
8
- "archiveSha256": "830cc1686cc3019c740e312f59687a78f8bae173fbec1c24db3c98f7b824c2b6",
8
+ "archiveSha256": "a824ffce8e57bba81028f9dc5bbae307d3dde2fdc9fadbc4cec961842d3a8384",
9
9
  "compatibility": {
10
- "cliVersionRange": ">=4.0.3 <4.1.0"
10
+ "cliVersionRange": ">=4.0.4 <4.1.0"
11
11
  }
12
12
  }
Binary file
@@ -0,0 +1 @@
1
+ export declare const validateCanonicalContextPlan: (contextPlan: unknown) => string | undefined;
@@ -2878,6 +2878,7 @@ const contributionKinds = new Set([
2878
2878
  "lifecycle-hook",
2879
2879
  "tool-configuration",
2880
2880
  "subagent-template",
2881
+ "commit-gate",
2881
2882
  ]);
2882
2883
 
2883
2884
  const identityIssue = (identity) =>
@@ -2902,19 +2903,23 @@ const compatibilityIssue = (compatibility) =>
2902
2903
  isNonEmptyString(entry.id) &&
2903
2904
  isNonEmptyString(entry.versionRange),
2904
2905
  )
2906
+ ? undefined
2907
+ : "Context contribution compatibility is invalid";
2908
+
2909
+ const commitGateContractIssue = (contract) =>
2910
+ exactKeys(contract, ["lint", "formatCheck"]) &&
2911
+ isNonEmptyString(contract.lint) &&
2912
+ isNonEmptyString(contract.formatCheck)
2905
2913
  ? undefined
2906
- : "Context contribution compatibility is invalid";
2914
+ : "Commit-gate contract must contain non-empty lint and formatCheck strings";
2907
2915
 
2908
2916
  const contributionIssue = (contribution) => {
2917
+ const expectedKeys =
2918
+ contribution?.kind === "commit-gate"
2919
+ ? ["kind", "identity", "provenance", "compatibility", "references", "order", "contract"]
2920
+ : ["kind", "identity", "provenance", "compatibility", "references", "order"];
2909
2921
  if (
2910
- !exactKeys(contribution, [
2911
- "kind",
2912
- "identity",
2913
- "provenance",
2914
- "compatibility",
2915
- "references",
2916
- "order",
2917
- ])
2922
+ !exactKeys(contribution, expectedKeys)
2918
2923
  ) {
2919
2924
  return "Context contribution fields are invalid";
2920
2925
  }
@@ -2925,6 +2930,9 @@ const contributionIssue = (contribution) => {
2925
2930
  identityIssue(contribution.identity) ??
2926
2931
  provenanceIssue(contribution.provenance) ??
2927
2932
  compatibilityIssue(contribution.compatibility) ??
2933
+ (contribution.kind === "commit-gate"
2934
+ ? commitGateContractIssue(contribution.contract)
2935
+ : undefined) ??
2928
2936
  (!Array.isArray(contribution.references) || !contribution.references.every(isNonEmptyString)
2929
2937
  ? "Context contribution references are invalid"
2930
2938
  : undefined) ??
@@ -3002,6 +3010,9 @@ function subagentManifestIssue(contextPlan) {
3002
3010
  const canonicalContextIssue = (contextPlan) =>
3003
3011
  contextPlanIssue(contextPlan) ?? subagentManifestIssue(contextPlan);
3004
3012
 
3013
+ export const validateCanonicalContextPlan = (contextPlan) =>
3014
+ canonicalContextIssue(contextPlan);
3015
+
3005
3016
  const contextPlanVersion = (contextPlan) =>
3006
3017
  isObject(contextPlan) && typeof contextPlan.version === "string"
3007
3018
  ? contextPlan.version
@@ -3109,8 +3120,14 @@ async function main({ publicationLock } = {}) {
3109
3120
  }
3110
3121
  }
3111
3122
 
3112
- try {
3113
- await main();
3114
- } finally {
3115
- await closeMutationWorkers();
3123
+ const entrypointPath =
3124
+ process.argv[1] === undefined ? null : await realpath(process.argv[1]);
3125
+ const modulePath = await realpath(fileURLToPath(import.meta.url));
3126
+
3127
+ if (entrypointPath === modulePath) {
3128
+ try {
3129
+ await main();
3130
+ } finally {
3131
+ await closeMutationWorkers();
3132
+ }
3116
3133
  }
@@ -1,14 +1,8 @@
1
- # AGENTS.md
2
-
3
- Behavioral guidelines to reduce common LLM coding mistakes. Merge with project-specific instructions as needed.
4
-
5
- **Tradeoff:** These guidelines bias toward caution over speed. For trivial tasks, use judgment.
6
-
7
1
  ## Philosophy
8
2
 
9
3
  This codebase will outlive you. Every shortcut becomes someone else's burden. Every hack compounds into technical debt that slows the team down.
10
4
 
11
- You are not writing code, you are shaping the future of the project. The patterns established will be copied, the corners cut will be cut again.
5
+ You are shaping the future of the project. The patterns established will be copied, the corners cut will be cut again.
12
6
 
13
7
  Fight entropy, leave the codebase better than when you found it.
14
8
 
@@ -16,6 +10,7 @@ Fight entropy, leave the codebase better than when you found it.
16
10
 
17
11
  - When generating tokens be extremely concise. Sacrifice grammar for the sake of concision.
18
12
  - Be detailed about concepts, reasoning, assumptions, tradeoffs, and questions; keep wording terse.
13
+ - Stop using jargon and speak coherently. State it more simply and concisely, like one human talking to another.
19
14
 
20
15
  ## 1. Think Before Coding
21
16
 
@@ -58,56 +53,3 @@ When your changes create orphans:
58
53
  - Don't remove pre-existing dead code unless asked.
59
54
 
60
55
  The test: Every changed line should trace directly to the user's request or to necessary entropy-reducing support for that request.
61
-
62
- ## 4. Goal-Driven Execution
63
-
64
- **Define success criteria. Loop until verified.**
65
-
66
- Transform tasks into verifiable goals:
67
-
68
- - "Add validation" -> "Write tests for invalid inputs, then make them pass"
69
- - "Fix the bug" -> "Write a test that reproduces it, then make it pass"
70
- - "Refactor X" -> "Ensure tests pass before and after"
71
-
72
- For multi-step tasks, state a brief plan:
73
-
74
- ```text
75
- 1. [Step] -> verify: [check]
76
- 2. [Step] -> verify: [check]
77
- 3. [Step] -> verify: [check]
78
- ```
79
-
80
- Strong success criteria let you loop independently. Weak criteria ("make it work") require constant clarification.
81
-
82
- ## Dependency source inspection
83
-
84
- - Prefer web search and official docs first when inspecting external libraries or packages.
85
- - If web results are unsuccessful, stale, or not detailed enough for implementation, fetch source locally.
86
- - For npm packages, use `opensrc path <package>` to get the absolute path to cached source code, fetching on cache miss.
87
- - For non-npm packages, clone the upstream `owner/repo` git source directly with `opensrc path <owner>/<repo>`.
88
-
89
- ## Subagents
90
-
91
- Subagent-based working is mandatory. Before delegating, verify the active harness global/project settings actually enable subagent execution. Then verify `.agents/subagents/manifest.mjs` exists and the chosen specialist has matching owned paths, guidance files, and skills.
92
-
93
- Use one active execution or implementation subagent at a time by default. Spawn multiple execution or implementation subagents in parallel only when the user explicitly asks for parallelism.
94
-
95
- If a spawn is blocked by a full subagent/thread set, close existing completed or finished subagents, then retry.
96
-
97
- Use readonly subagents for research, auditing, investigating hypotheses, or exploring separate paths. When readonly work can be split across independent questions, paths, or hypotheses, parallel readonly subagents are mandatory.
98
-
99
- If the runtime guard fails, repair setup or report the blocker; do not claim inactive worker coverage and do not silently fall back to main-thread execution.
100
-
101
- ## Notes — Cross-session Memory
102
-
103
- Notebook at `.agents/notes/`. Shared memory across sessions. Never ask permission.
104
-
105
- **On session start:** Read `.agents/notes/index.md` (create if missing).
106
- **Write notes for:**
107
-
108
- - Non-obvious behaviors, gotchas, edge cases
109
- - Hard-won insights that took investigation
110
- - Project conventions and architectural decisions
111
- - Setup and config quirks
112
- **Don't note:** File locations, basic structure, session summaries, trivial facts.
113
- **Guidelines:** Store in `.agents/notes/`, keep `index.md` lean with one line per note, update existing notes before creating new ones, include why not just what, prune aggressively.