@punks/cli 3.1.9 → 3.1.11

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 (44) hide show
  1. package/dist/BASELINE_CHANGELOG.md +67 -0
  2. package/dist/CHANGELOG.md +48 -0
  3. package/dist/data/subagents/manifest.mjs +11 -6
  4. package/dist/index.js +32 -29
  5. package/dist/skills/agnostic/cli/hi-cli/references/post-command-flow.md +5 -0
  6. package/dist/skills/agnostic/docs/writing-great-skills/GLOSSARY.md +69 -0
  7. package/dist/skills/agnostic/docs/writing-great-skills/SKILL.md +63 -0
  8. package/dist/skills/agnostic/planning/create-plan/REFERENCE.md +1 -1
  9. package/dist/skills/agnostic/planning/create-plan/SKILL.md +19 -7
  10. package/dist/skills/agnostic/planning/create-plan/references/plan-schema.md +19 -0
  11. package/dist/skills/agnostic/planning/create-plan/references/planner-task-graph.md +27 -10
  12. package/dist/skills/agnostic/planning/implement-spec/SKILL.md +6 -2
  13. package/dist/skills/agnostic/planning/implement-spec/assets/IMPLEMENTATION-NOTES-TEMPLATE.md +22 -6
  14. package/dist/skills/agnostic/planning/implement-spec/references/lifecycle.md +12 -0
  15. package/dist/skills/agnostic/planning/implement-spec/references/parallel-orchestration.md +10 -2
  16. package/dist/skills/agnostic/planning/implement-spec/references/parallel-worker-brief.md +10 -1
  17. package/dist/skills/agnostic/planning/implement-spec/references/parallel.md +2 -0
  18. package/dist/skills/agnostic/quality/autoreview/SKILL.md +11 -2
  19. package/dist/skills/agnostic/quality/review/SKILL.md +16 -11
  20. package/dist/skills/frameworks/effect/effect-service-design/LICENSE +21 -0
  21. package/dist/skills/frameworks/effect/effect-service-design/SKILL.md +124 -0
  22. package/dist/skills/frameworks/effect/effect-service-design/references/AUDIT.md +98 -0
  23. package/dist/skills/frameworks/nestjs/nestjs-best-practices/.gitignore +29 -0
  24. package/dist/skills/languages/python/python-backend-structure/SKILL.md +91 -0
  25. package/dist/skills/languages/python/python-backend-structure/agents/openai.yaml +4 -0
  26. package/dist/skills/languages/python/python-design-patterns/SKILL.md +93 -69
  27. package/dist/skills/languages/python/python-project-structure/SKILL.md +4 -247
  28. package/dist/skills/phases/delivery-phase/SKILL.md +13 -4
  29. package/dist/skills/phases/delivery-phase/phases/closeout.md +3 -0
  30. package/dist/skills/phases/delivery-phase/phases/debug.md +8 -1
  31. package/dist/skills/phases/delivery-phase/phases/implement.md +11 -2
  32. package/dist/skills/phases/delivery-phase/phases/review.md +50 -29
  33. package/dist/skills/phases/delivery-phase/phases/router.md +56 -36
  34. package/dist/skills/phases/delivery-phase/references/artifact-state.md +8 -2
  35. package/dist/skills/phases/delivery-phase/references/phase-handoff.md +60 -10
  36. package/dist/skills/phases/finder-phase/references/root-routing.md +6 -1
  37. package/dist/skills/phases/review-phase/REFERENCE.md +83 -145
  38. package/dist/skills/phases/review-phase/SKILL.md +41 -45
  39. package/dist/skills/phases/review-phase/agents/openai.yaml +2 -0
  40. package/dist/skills/phases/review-phase/references/durable-report.md +172 -0
  41. package/dist/skills/phases/review-phase/references/state-graph.md +69 -0
  42. package/dist/skills/phases/review-phase/references/targets.md +156 -0
  43. package/dist/skills/phases/review-phase/scripts/review-contract.mjs +819 -0
  44. package/package.json +9 -63
@@ -0,0 +1,156 @@
1
+ # Review Target And Identity Contract
2
+
3
+ Validate accepted bounds and normalize a supported target before mode-specific
4
+ budget evaluation. Both target forms then enter the same review graph, lens
5
+ composition, report, routing, and freshness contracts.
6
+
7
+ ## Scope
8
+
9
+ Record the smallest certain inclusive scope. Full-repository expansion requires
10
+ an explicit caller request. Unsupported targets or invalid accepted bounds enter
11
+ `review_failed` with exact evidence, no report, and no counter change, including
12
+ when a delivery counter is already 3.
13
+
14
+ ## Delivery Git/Diff Adapter
15
+
16
+ Freeze and record:
17
+
18
+ - locator
19
+ - actual base ref
20
+ - merge-base or fixed-point SHA
21
+ - head or dirty-worktree identity
22
+ - inclusive scope
23
+ - canonical patch hash
24
+
25
+ Use the actual PR base when a PR exists. Record the exact bounded diff command
26
+ and environment. `canonical_patch_hash` is SHA-256 of its unmodified output
27
+ bytes.
28
+
29
+ The normalized object has exactly these keys:
30
+
31
+ ```text
32
+ kind: delivery-git-diff
33
+ locator:
34
+ actual_base_ref:
35
+ fixed_point_sha:
36
+ head_identity:
37
+ inclusive_scope: [sorted unique paths]
38
+ canonical_patch_hash: <64 lowercase hex>
39
+ ```
40
+
41
+ The validator receives the same primitive locator/base/fixed-point/head/scope
42
+ evidence plus the canonical patch bytes, hashes those bytes itself, and rejects
43
+ any missing, extra, malformed, or inconsistent normalized field.
44
+
45
+ ## Standalone Artifact Adapter
46
+
47
+ Plans, specs, and documentation freeze exact selected file bytes into one
48
+ deterministic ordered bundle. Sort file identities by their UTF-8 bytes. Hash
49
+ each file's raw bytes, then hash alternating identity/content-hash fields with
50
+ the canonical record below. Record:
51
+
52
+ - locator
53
+ - ordered file identities
54
+ - inclusive scope
55
+ - ordered bundle content hash
56
+ - explicit absence of a Git fixed point
57
+
58
+ The normalized target does not embed raw selected bytes. Standalone mode never
59
+ reads, increments, resets, or persists delivery counters.
60
+
61
+ The normalized object has exactly these keys:
62
+
63
+ ```text
64
+ kind: standalone-artifact
65
+ locator:
66
+ ordered_file_identities: [sorted unique paths]
67
+ inclusive_scope: [the same sorted unique paths]
68
+ ordered_bundle_content_hash: <64 lowercase hex>
69
+ git_fixed_point: null
70
+ ```
71
+
72
+ The validator receives primitive file identities and bytes, recomputes the
73
+ ordered bundle, and rejects any missing, extra, malformed, or inconsistent
74
+ normalized field.
75
+
76
+ ## Canonical Hash Record
77
+
78
+ All identities use lowercase hexadecimal SHA-256. The executable reference is
79
+ [`../scripts/review-contract.mjs`](../scripts/review-contract.mjs).
80
+
81
+ `record(label, fields)` is this exact byte sequence:
82
+
83
+ 1. UTF-8 bytes `review-identity-v1\n`.
84
+ 2. `frame(label)`.
85
+ 3. One `frame(value)` for each field in the stated fixed order.
86
+
87
+ `frame(value)` is the ASCII decimal UTF-8 byte length with no leading zero,
88
+ then ASCII `:`, then the exact UTF-8 bytes. Inputs receive no JSON encoding,
89
+ Unicode normalization, case folding, or newline rewriting. Sort set-like path
90
+ lists by unsigned UTF-8 byte order before framing. Hash raw file or patch bytes
91
+ directly before placing their lowercase hash in a record.
92
+
93
+ ## Derived Identities
94
+
95
+ Use these labels and field orders exactly:
96
+
97
+ - `inclusive_scope_hash = hash(record("inclusive-scope", sorted scope entries))`
98
+ - `accepted_bounds_hash = hash(record("accepted-bounds", [accepted_bounds_identity, inclusive_scope_hash]))`
99
+ - `delivery_snapshot_hash = hash(record("delivery-snapshot", [locator, actual_base_ref, fixed_point_sha, head_identity, inclusive_scope_hash, canonical_patch_hash]))`
100
+ - `ordered_bundle_content_hash = hash(record("artifact-bundle", [file_1_identity, file_1_raw_sha256, ...]))`
101
+ - `ordered_file_identities_hash = hash(record("ordered-files", [file_1_identity, ...]))`
102
+ - `standalone_snapshot_hash = hash(record("standalone-snapshot", [locator, ordered_file_identities_hash, inclusive_scope_hash, ordered_bundle_content_hash, "no-git-fixed-point"]))`
103
+ - `source_set_hash = hash(record("source-set", [source_1_path, source_1_blob_sha256, ...]))`, with sources sorted by path bytes
104
+ - `delivery_review_lineage_id = hash(record("delivery-lineage", [delivery_goal_identity]))`
105
+ - `standalone_review_lineage_id = hash(record("standalone-lineage", [locator, accepted_bounds_hash]))`
106
+ - `delivery_review_run_id = hash(record("delivery-run", [review_lineage_id, decimal_ordinal]))`
107
+ - `standalone_review_run_id = hash(record("standalone-run", [review_lineage_id, snapshot12]))`
108
+
109
+ `snapshot12` is the first 12 lowercase hexadecimal characters of the mode's
110
+ 64-character snapshot hash. `review-scope-slug` is `review-` plus the first 20
111
+ characters of `review_lineage_id`. Report UTC uses `YYYYMMDDTHHMMSSZ`.
112
+
113
+ Delivery lineage derives only from stable delivery-goal identity. Accepted-
114
+ bounds identity and hash do not enter delivery lineage. Standalone lineage
115
+ derives from target locator plus accepted-bounds hash. Delivery run identity
116
+ derives from lineage plus decimal ordinal; standalone run identity derives from
117
+ lineage plus `snapshot12`; the filename slug derives from lineage. Delivery preallocates ordinal
118
+ `recovered review_count + 1` only on explicit entry to `review_running`.
119
+ Standalone mode has no delivery-budget guard.
120
+
121
+ ## Fixed Vectors
122
+
123
+ These values detect serialization drift:
124
+
125
+ - Delivery goal `goal:HI-104`, bounds identity `bounds:v1:HI-104`, scope
126
+ `apps/cli/src/a.ts` plus `apps/wiki/spec.md`:
127
+ - scope hash: `5fb7f4cd0577ad89de00916c8c18b122b264e50fb61df0c79249b88aba23a306`
128
+ - bounds hash: `90dddda98e886e9b2ef511790f32d1d359847af24f5950361d25aedfe729bd8a`
129
+ - lineage: `291c26957263b22b0cd5ad8a209415ff2992cc9a645f0018ed46ac4ba48de33b`
130
+ - With locator `repo:wearedevpunks/harness-intelligence`, base `origin/main`,
131
+ fixed point `1111111111111111111111111111111111111111`, head
132
+ `2222222222222222222222222222222222222222`, patch hash of 64 `a`
133
+ characters, and ordinal 2:
134
+ - snapshot: `f116049b650180523f8dd9ee48b900394f090a425ca8a1d7f369c56ca9d5998b`
135
+ - run id: `9b164c914a883778fd5d4a3e242aaa2d261a44ce7601df10d1530bd9dd777e32`
136
+ - slug: `review-291c26957263b22b0cd5`
137
+ - report suffix identity: `20260811T120000Z-f116049b6501`
138
+ - Standalone locator `artifact:spec-v1`, bounds identity
139
+ `bounds:v1:artifact`, files `docs/b.md` containing `beta\n` and `docs/a.md`
140
+ containing `alpha\n`:
141
+ - bundle hash: `107ee7c127b10e1826bf2d2899a36cc21291392ee6702af8d9e39b3e13553cb7`
142
+ - bounds hash: `8dfde7eafe7f68b6ee5f763d23d01310f414fd5b7fca6393d5e92e90d963aa7f`
143
+ - lineage: `ba4a5082445cac8ab133b533cfb090f936d69915266728bc9c6bd4b5b786f95a`
144
+ - snapshot: `d4c43491a0aef9aaeb604dc224792222d0fb6c85caec76d03ff763896563a58a`
145
+ - run id: `f165ab99100afe180bea68b41eb730fd2b61b2122347be0e50c91549140629d4`
146
+ - slug: `review-ba4a5082445cac8ab133`
147
+
148
+ ## Resume And Freshness
149
+
150
+ Delivery recovery keys on lineage and unique valid retained passes. Reconcile
151
+ the handoff projection from their highest ordinal. Separately recompute target,
152
+ accepted-bounds, and governing source hashes and select the highest fresh pass.
153
+
154
+ Standalone resume matches lineage, bounds, normalized target, and inclusive
155
+ scope; recomputes freshness; and selects the most recent unique valid report by
156
+ `reviewed_at`. It changes no delivery counter.