@punks/cli 3.2.0 → 3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BASELINE_CHANGELOG.md +14 -1
- package/dist/CHANGELOG.md +15 -0
- package/dist/baseline/scaffold-baseline/baseline.json +5 -5
- package/dist/baseline/scaffold-baseline/data/catalog/lint-assets.json +48 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/cli/hi-cli/references/post-command-flow.md +1 -6
- package/dist/baseline/scaffold-baseline/skills/agnostic/docs/upstream/mattpocock-writing-skills.md +81 -12
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/REFERENCE.md +11 -14
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/SKILL.md +17 -14
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/references/architecture-convergence.md +98 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/references/plan-schema.md +34 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/references/planner-task-graph.md +15 -12
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/SKILL.md +6 -5
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/assets/IMPLEMENTATION-NOTES-TEMPLATE.md +10 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/architecture-conformance.md +100 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/lifecycle.md +25 -2
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/parallel-orchestration.md +17 -1
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/parallel-worker-brief.md +14 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/parallel.md +7 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/requirements-grill/SKILL.md +1 -1
- package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect-service-design/UPSTREAM.md +17 -0
- package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/review.md +9 -34
- package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/router.md +10 -16
- package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/references/phase-handoff.md +1 -19
- package/dist/baseline/scaffold-baseline/skills/phases/review-phase/AUTHORING-HANDOFF.md +11 -14
- package/dist/baseline/scaffold-baseline/skills/phases/review-phase/phases/retain-report.md +2 -9
- package/dist/baseline/scaffold-baseline/skills/phases/review-phase/phases/return-route.md +8 -6
- package/dist/baseline/scaffold-baseline/skills/phases/review-phase/phases/run-review.md +5 -8
- package/dist/baseline/scaffold-baseline/skills/phases/review-phase/references/durable-report.md +14 -29
- package/dist/baseline/scaffold-baseline/skills/phases/review-phase/references/state-graph.md +32 -45
- package/dist/baseline/scaffold-baseline/skills/phases/review-phase/references/targets.md +1 -2
- package/dist/baseline/scaffold-baseline/skills/phases/review-phase/scripts/review-contract.mjs +12 -86
- package/dist/baseline/scaffold-baseline.json +5 -5
- package/dist/baseline/scaffold-baseline.tgz +0 -0
- package/dist/index.js +5 -5
- package/dist/skills/agnostic/cli/hi-cli/references/post-command-flow.md +1 -6
- package/dist/skills/agnostic/docs/upstream/mattpocock-writing-skills.md +81 -12
- package/dist/skills/agnostic/planning/create-plan/REFERENCE.md +11 -14
- package/dist/skills/agnostic/planning/create-plan/SKILL.md +17 -14
- package/dist/skills/agnostic/planning/create-plan/references/architecture-convergence.md +98 -0
- package/dist/skills/agnostic/planning/create-plan/references/plan-schema.md +34 -0
- package/dist/skills/agnostic/planning/create-plan/references/planner-task-graph.md +15 -12
- package/dist/skills/agnostic/planning/implement-spec/SKILL.md +6 -5
- package/dist/skills/agnostic/planning/implement-spec/assets/IMPLEMENTATION-NOTES-TEMPLATE.md +10 -0
- package/dist/skills/agnostic/planning/implement-spec/references/architecture-conformance.md +100 -0
- package/dist/skills/agnostic/planning/implement-spec/references/lifecycle.md +25 -2
- package/dist/skills/agnostic/planning/implement-spec/references/parallel-orchestration.md +17 -1
- package/dist/skills/agnostic/planning/implement-spec/references/parallel-worker-brief.md +14 -0
- package/dist/skills/agnostic/planning/implement-spec/references/parallel.md +7 -0
- package/dist/skills/agnostic/requirements/requirements-grill/SKILL.md +1 -1
- package/dist/skills/frameworks/effect/effect-service-design/UPSTREAM.md +17 -0
- package/dist/skills/phases/delivery-phase/phases/review.md +9 -34
- package/dist/skills/phases/delivery-phase/phases/router.md +8 -14
- package/dist/skills/phases/delivery-phase/references/phase-handoff.md +1 -19
- package/dist/skills/phases/review-phase/AUTHORING-HANDOFF.md +11 -14
- package/dist/skills/phases/review-phase/phases/retain-report.md +2 -9
- package/dist/skills/phases/review-phase/phases/return-route.md +8 -6
- package/dist/skills/phases/review-phase/phases/run-review.md +5 -8
- package/dist/skills/phases/review-phase/references/durable-report.md +14 -29
- package/dist/skills/phases/review-phase/references/state-graph.md +5 -18
- package/dist/skills/phases/review-phase/references/targets.md +1 -2
- package/dist/skills/phases/review-phase/scripts/review-contract.mjs +11 -91
- package/package.json +1 -1
|
@@ -39,15 +39,8 @@ export const inclusiveScopeHash = (entries) =>
|
|
|
39
39
|
export const acceptedBoundsHash = (identity, scopeEntries) =>
|
|
40
40
|
hashRecord("accepted-bounds", [identity, inclusiveScopeHash(scopeEntries)]);
|
|
41
41
|
|
|
42
|
-
export const deliveryLineageId = (deliveryGoalIdentity) =>
|
|
43
|
-
|
|
44
|
-
typeof deliveryGoalIdentity !== "string" ||
|
|
45
|
-
deliveryGoalIdentity.length === 0
|
|
46
|
-
) {
|
|
47
|
-
throw new TypeError("delivery goal identity must be a non-empty string");
|
|
48
|
-
}
|
|
49
|
-
return hashRecord("delivery-lineage", [deliveryGoalIdentity]);
|
|
50
|
-
};
|
|
42
|
+
export const deliveryLineageId = (deliveryGoalIdentity) =>
|
|
43
|
+
hashRecord("delivery-lineage", [deliveryGoalIdentity]);
|
|
51
44
|
|
|
52
45
|
export const standaloneLineageId = (locator, boundsHash) =>
|
|
53
46
|
hashRecord("standalone-lineage", [locator, boundsHash]);
|
|
@@ -137,23 +130,10 @@ export const sourceSetHash = (sources) =>
|
|
|
137
130
|
.flatMap(({ path, hash }) => [path, hash]),
|
|
138
131
|
);
|
|
139
132
|
|
|
140
|
-
const assertReviewedAt = (reviewedAt, field) => {
|
|
141
|
-
const match = /^(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})Z$/u.exec(
|
|
142
|
-
reviewedAt,
|
|
143
|
-
);
|
|
144
|
-
if (!match) {
|
|
145
|
-
throw new TypeError(`${field} must use YYYYMMDDTHHMMSSZ UTC format`);
|
|
146
|
-
}
|
|
147
|
-
const [, year, month, day, hour, minute, second] = match;
|
|
148
|
-
const iso = `${year}-${month}-${day}T${hour}:${minute}:${second}.000Z`;
|
|
149
|
-
const instant = new Date(iso);
|
|
150
|
-
if (Number.isNaN(instant.valueOf()) || instant.toISOString() !== iso) {
|
|
151
|
-
throw new TypeError(`${field} must name a real UTC instant`);
|
|
152
|
-
}
|
|
153
|
-
};
|
|
154
|
-
|
|
155
133
|
export const reviewReportPath = ({ lineageId, reviewedAt, snapshotHash }) => {
|
|
156
|
-
|
|
134
|
+
if (!/^\d{8}T\d{6}Z$/u.test(reviewedAt)) {
|
|
135
|
+
throw new TypeError("reviewedAt must use YYYYMMDDTHHMMSSZ UTC format");
|
|
136
|
+
}
|
|
157
137
|
return `apps/wiki/content/docs/project/reviews/${reviewScopeSlug(lineageId)}-${reviewedAt}-${snapshot12(snapshotHash)}-review-report.md`;
|
|
158
138
|
};
|
|
159
139
|
|
|
@@ -185,35 +165,6 @@ const LENS_KEYS = [
|
|
|
185
165
|
"simplify",
|
|
186
166
|
"spec",
|
|
187
167
|
];
|
|
188
|
-
const PROTOTYPE_KEYS = new Set(["__proto__", "constructor", "prototype"]);
|
|
189
|
-
const FINDING_ROUTES = [
|
|
190
|
-
"debugging",
|
|
191
|
-
"implementation",
|
|
192
|
-
"debt_follow_up",
|
|
193
|
-
"docs_ingest",
|
|
194
|
-
];
|
|
195
|
-
|
|
196
|
-
export const deriveReviewRouting = (findings) => {
|
|
197
|
-
if (
|
|
198
|
-
!Array.isArray(findings) ||
|
|
199
|
-
findings.some(
|
|
200
|
-
(finding) =>
|
|
201
|
-
finding === null ||
|
|
202
|
-
typeof finding !== "object" ||
|
|
203
|
-
!FINDING_ROUTES.includes(finding.return_route),
|
|
204
|
-
)
|
|
205
|
-
) {
|
|
206
|
-
throw new TypeError("invalid finding return route");
|
|
207
|
-
}
|
|
208
|
-
const routes = new Set(findings.map(({ return_route: route }) => route));
|
|
209
|
-
const primary = FINDING_ROUTES.find((route) => routes.has(route)) ?? "closeout";
|
|
210
|
-
return {
|
|
211
|
-
primary,
|
|
212
|
-
secondary_architecture_follow_up:
|
|
213
|
-
routes.has("debt_follow_up") &&
|
|
214
|
-
(primary === "debugging" || primary === "implementation"),
|
|
215
|
-
};
|
|
216
|
-
};
|
|
217
168
|
|
|
218
169
|
const exactKeys = (value, keys) =>
|
|
219
170
|
value !== null &&
|
|
@@ -231,7 +182,9 @@ const sortedUniqueStrings = (values) =>
|
|
|
231
182
|
isDeepStrictEqual(values, sortUtf8(values));
|
|
232
183
|
|
|
233
184
|
const reportDate = (reviewedAt) => {
|
|
234
|
-
|
|
185
|
+
if (!/^\d{8}T\d{6}Z$/u.test(reviewedAt)) {
|
|
186
|
+
throw new TypeError("reviewed_at must use YYYYMMDDTHHMMSSZ");
|
|
187
|
+
}
|
|
235
188
|
return `${reviewedAt.slice(0, 4)}-${reviewedAt.slice(4, 6)}-${reviewedAt.slice(6, 8)}`;
|
|
236
189
|
};
|
|
237
190
|
|
|
@@ -287,14 +240,11 @@ const parseFrontmatter = (text) => {
|
|
|
287
240
|
if (!text.startsWith("---\n")) throw new TypeError("missing frontmatter");
|
|
288
241
|
const close = text.indexOf("\n---\n", 4);
|
|
289
242
|
if (close < 0) throw new TypeError("unclosed frontmatter");
|
|
290
|
-
const frontmatter =
|
|
243
|
+
const frontmatter = {};
|
|
291
244
|
for (const line of text.slice(4, close).split("\n")) {
|
|
292
245
|
const separator = line.indexOf(": ");
|
|
293
246
|
if (separator < 1) throw new TypeError("malformed frontmatter line");
|
|
294
247
|
const key = line.slice(0, separator);
|
|
295
|
-
if (PROTOTYPE_KEYS.has(key)) {
|
|
296
|
-
throw new TypeError("prototype-sensitive frontmatter key");
|
|
297
|
-
}
|
|
298
248
|
if (Object.hasOwn(frontmatter, key)) throw new TypeError("duplicate frontmatter key");
|
|
299
249
|
const raw = line.slice(separator + 2);
|
|
300
250
|
frontmatter[key] = raw === "[]" ? [] : JSON.parse(raw);
|
|
@@ -338,8 +288,6 @@ export const normalizeReviewTarget = (mode, evidence) => {
|
|
|
338
288
|
!nonemptyString(evidence.actualBaseRef) ||
|
|
339
289
|
!COMMIT_SHA.test(evidence.fixedPointSha) ||
|
|
340
290
|
!nonemptyString(evidence.headIdentity) ||
|
|
341
|
-
!Array.isArray(evidence.scopeEntries) ||
|
|
342
|
-
evidence.scopeEntries.length === 0 ||
|
|
343
291
|
!sortedUniqueStrings(sortUtf8(evidence.scopeEntries)) ||
|
|
344
292
|
!Buffer.isBuffer(evidence.canonicalPatchBytes)
|
|
345
293
|
) {
|
|
@@ -356,18 +304,11 @@ export const normalizeReviewTarget = (mode, evidence) => {
|
|
|
356
304
|
};
|
|
357
305
|
}
|
|
358
306
|
if (mode === "standalone") {
|
|
359
|
-
if (
|
|
360
|
-
!Array.isArray(evidence.scopeEntries) ||
|
|
361
|
-
evidence.scopeEntries.length === 0
|
|
362
|
-
) {
|
|
363
|
-
throw new TypeError("invalid standalone target evidence");
|
|
364
|
-
}
|
|
365
307
|
const files = orderedFiles(evidence.files);
|
|
366
308
|
const identities = files.map(({ identity }) => identity);
|
|
367
309
|
const scope = sortUtf8(evidence.scopeEntries);
|
|
368
310
|
if (
|
|
369
311
|
!nonemptyString(evidence.locator) ||
|
|
370
|
-
identities.length === 0 ||
|
|
371
312
|
!sortedUniqueStrings(identities) ||
|
|
372
313
|
!files.every(({ bytes }) => Buffer.isBuffer(bytes)) ||
|
|
373
314
|
!isDeepStrictEqual(scope, identities)
|
|
@@ -389,7 +330,6 @@ export const normalizeReviewTarget = (mode, evidence) => {
|
|
|
389
330
|
export const normalizeReviewSources = (sources) => {
|
|
390
331
|
if (
|
|
391
332
|
!Array.isArray(sources) ||
|
|
392
|
-
sources.length === 0 ||
|
|
393
333
|
sources.some(
|
|
394
334
|
({ path, bytes }) => !nonemptyString(path) || !Buffer.isBuffer(bytes),
|
|
395
335
|
) ||
|
|
@@ -482,12 +422,7 @@ const validateTargetSchema = (target, mode, errors) => {
|
|
|
482
422
|
errors.push("malformed:normalized_target_schema");
|
|
483
423
|
return;
|
|
484
424
|
}
|
|
485
|
-
if (
|
|
486
|
-
!nonemptyString(target.locator) ||
|
|
487
|
-
!Array.isArray(target.inclusive_scope) ||
|
|
488
|
-
target.inclusive_scope.length === 0 ||
|
|
489
|
-
!sortedUniqueStrings(target.inclusive_scope)
|
|
490
|
-
) {
|
|
425
|
+
if (!nonemptyString(target.locator) || !sortedUniqueStrings(target.inclusive_scope)) {
|
|
491
426
|
errors.push("malformed:normalized_target_common_fields");
|
|
492
427
|
}
|
|
493
428
|
if (mode === "delivery") {
|
|
@@ -537,7 +472,6 @@ const validateReportSemantics = (report, errors) => {
|
|
|
537
472
|
"impact",
|
|
538
473
|
"evidence",
|
|
539
474
|
"action",
|
|
540
|
-
"return_route",
|
|
541
475
|
];
|
|
542
476
|
const ids = new Set();
|
|
543
477
|
const findingLenses = new Set();
|
|
@@ -580,14 +514,6 @@ const validateReportSemantics = (report, errors) => {
|
|
|
580
514
|
typeof report.routing?.secondary_architecture_follow_up !== "boolean"
|
|
581
515
|
) {
|
|
582
516
|
errors.push("malformed:routing");
|
|
583
|
-
} else {
|
|
584
|
-
try {
|
|
585
|
-
if (!isDeepStrictEqual(report.routing, deriveReviewRouting(report.findings))) {
|
|
586
|
-
errors.push("mismatch:routing");
|
|
587
|
-
}
|
|
588
|
-
} catch {
|
|
589
|
-
errors.push("malformed:finding_return_route");
|
|
590
|
-
}
|
|
591
517
|
}
|
|
592
518
|
|
|
593
519
|
const validationKeys = [
|
|
@@ -782,13 +708,7 @@ const inspectRetainedPass = (candidate, expected) => {
|
|
|
782
708
|
) {
|
|
783
709
|
errors.push("mismatch:report_sha256");
|
|
784
710
|
}
|
|
785
|
-
if (
|
|
786
|
-
!Buffer.isBuffer(candidate.resolvedReportBytes) ||
|
|
787
|
-
!candidate.reportBytes.equals(candidate.resolvedReportBytes)
|
|
788
|
-
) {
|
|
789
|
-
errors.push("mismatch:resolved_report_bytes");
|
|
790
|
-
}
|
|
791
|
-
if (candidate.refContainsCommit !== true) errors.push("ref_missing_commit");
|
|
711
|
+
if (!candidate.refContainsCommit) errors.push("ref_missing_commit");
|
|
792
712
|
if (!COMMIT_SHA.test(candidate.reportCommitSha)) {
|
|
793
713
|
errors.push("invalid:report_commit_sha");
|
|
794
714
|
}
|