@namewta/speculo 0.7.6 → 0.8.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 (42) hide show
  1. package/README.md +5 -6
  2. package/dist/src/cli.js +18 -13
  3. package/dist/src/cli.js.map +1 -1
  4. package/dist/src/config.d.ts +20 -0
  5. package/dist/src/config.js +94 -0
  6. package/dist/src/config.js.map +1 -0
  7. package/dist/src/index.d.ts +3 -2
  8. package/dist/src/index.js +56 -27
  9. package/dist/src/index.js.map +1 -1
  10. package/dist/src/manifest.d.ts +20 -0
  11. package/dist/src/manifest.js +57 -0
  12. package/dist/src/manifest.js.map +1 -0
  13. package/dist/src/refresh.d.ts +30 -0
  14. package/dist/src/refresh.js +465 -0
  15. package/dist/src/refresh.js.map +1 -0
  16. package/dist/src/structured.d.ts +12 -0
  17. package/dist/src/structured.js +236 -0
  18. package/dist/src/structured.js.map +1 -0
  19. package/package.json +2 -2
  20. package/template/.speculo/README.md +12 -11
  21. package/template/.speculo/refresh-contract.json +30 -0
  22. package/template/canonical/canonical-specdev-engineering-cognitive-mentor.md +1 -0
  23. package/template/canonical/canonical-specdev-goal-plan.md +1 -0
  24. package/template/canonical/canonical-specdev-grill-with-docs.md +1 -0
  25. package/template/canonical/canonical-specdev-spec.md +1 -0
  26. package/template/canonical/canonical-specdev-tickets.md +1 -0
  27. package/template/skills/github-npm-ops/references/preflight-checklist.md +1 -1
  28. package/template/workflows/person/runtime-contract.json +9 -0
  29. package/template/workflows/specdev/E-eli5/E-eli5.md +35 -0
  30. package/template/workflows/specdev/I-init-setup/I-init-setup.md +1 -1
  31. package/template/workflows/specdev/INDEX.md +15 -12
  32. package/template/workflows/specdev/common/rules/artifact-contract.md +1 -0
  33. package/template/workflows/specdev/common/tools/README.md +1 -1
  34. package/template/workflows/specdev/common/tools/validate-specdev.mjs +28 -0
  35. package/template/workflows/specdev/runtime-contract.json +26 -0
  36. package/dist/src/migrations.d.ts +0 -23
  37. package/dist/src/migrations.js +0 -1202
  38. package/dist/src/migrations.js.map +0 -1
  39. package/template/commands/migrate-runtime-state.md +0 -43
  40. package/template/skills/migrate-runtime-state/SKILL.md +0 -93
  41. package/template/skills/migrate-runtime-state/references/migration-contract.md +0 -64
  42. package/template/skills/migrate-runtime-state/scripts/migrate-runtime-state.mjs +0 -916
@@ -34,6 +34,7 @@ const EXPECTED_WORKS = new Set([
34
34
  "A-archive-and-consolidate",
35
35
  "C-code-review",
36
36
  "D-diagnose-bugs",
37
+ "E-eli5",
37
38
  "E-engineering-cognitive-mentor",
38
39
  "G-grill-with-docs",
39
40
  "I-implement",
@@ -98,6 +99,7 @@ const VALID_STAGES = new Set([
98
99
  "triage",
99
100
  "diagnosis",
100
101
  "grill",
102
+ "eli5",
101
103
  "spec",
102
104
  "tickets",
103
105
  "goal-plan",
@@ -167,6 +169,7 @@ const STATE_ARTIFACT_BASENAMES = new Set([
167
169
  "source.md",
168
170
  "architecture-review.md",
169
171
  "architecture-review.html",
172
+ "eli5.html",
170
173
  "wayfinder-map.md",
171
174
  "design-tree.json",
172
175
  ]);
@@ -820,6 +823,13 @@ function capabilityChecks(root) {
820
823
  ["一个问题", "Logic", "UI", "临时 branch/worktree", "promotion target", "main"],
821
824
  ],
822
825
  ],
826
+ [
827
+ "eli5",
828
+ [
829
+ join(root, "E-eli5", "E-eli5.md"),
830
+ ["五岁", "$ARGUMENTS", "大图", "少字", "eli5.html"],
831
+ ],
832
+ ],
823
833
  [
824
834
  "wayfinder",
825
835
  [
@@ -1225,6 +1235,23 @@ function validatePrototypes(change, required, errors) {
1225
1235
  return paths;
1226
1236
  }
1227
1237
 
1238
+ function validateEli5(change, required, errors) {
1239
+ const path = join(change, "eli5.html");
1240
+ if (!isFile(path)) {
1241
+ if (required) errors.push("eli5 stage requires eli5.html");
1242
+ return null;
1243
+ }
1244
+
1245
+ const html = readText(path);
1246
+ for (const marker of ["<!doctype html", "<html", "<head", "<title", "<body"]) {
1247
+ if (!html.toLowerCase().includes(marker)) errors.push(`eli5.html: missing '${marker}'`);
1248
+ }
1249
+ if (!/<(?:img|picture|svg|canvas)\b|\brole=["']img["']/i.test(html)) {
1250
+ errors.push("eli5.html: requires a picture, SVG, canvas, or element with role=img");
1251
+ }
1252
+ return path;
1253
+ }
1254
+
1228
1255
  function validateSpec(path, errors, warnings) {
1229
1256
  if (!isFile(path)) {
1230
1257
  warnings.push("Spec is missing; contract traceability cannot be fully checked");
@@ -2085,6 +2112,7 @@ function validateChange(change, stage = null, repoRoot = null) {
2085
2112
  }
2086
2113
  validateReviews(change, stage === "review", errors);
2087
2114
  validatePrototypes(change, stage === "prototype", errors);
2115
+ validateEli5(change, stage === "eli5", errors);
2088
2116
 
2089
2117
  const specRequired = new Set(["spec", "tickets", "goal-plan", "implement", "complete"]).has(stage);
2090
2118
  const specPath = join(change, "spec.md");
@@ -0,0 +1,26 @@
1
+ {
2
+ "schema_version": 1,
3
+ "workflow": "specdev",
4
+ "config": {
5
+ "path": ".speculo/specdev/config.json",
6
+ "template": "workflows/specdev/I-init-setup/config-template.json",
7
+ "baseline": ".speculo/baselines/workflows/specdev/config.json",
8
+ "schema_version": 5,
9
+ "optional": true,
10
+ "additional_properties": {
11
+ "": false,
12
+ "git": false,
13
+ "execution": false,
14
+ "verification": true,
15
+ "planning": true
16
+ }
17
+ },
18
+ "structured_state": [
19
+ ".speculo/specdev/status.json",
20
+ ".speculo/specdev/changes/*/.status.json",
21
+ ".speculo/specdev/archive/*/*/.status.json",
22
+ ".speculo/specdev/changes/*/goal-plan.md",
23
+ ".speculo/specdev/archive/*/*/goal-plan.md"
24
+ ],
25
+ "opaque_default": "preserve-byte-for-byte"
26
+ }
@@ -1,23 +0,0 @@
1
- export type MigrationStatus = "not-required" | "migrated" | "pending";
2
- export type MigrationBlocker = {
3
- code: string;
4
- path: string;
5
- message: string;
6
- };
7
- export type RuntimeMigrationResult = {
8
- status: MigrationStatus;
9
- sourceVersion: string | null;
10
- targetVersion: string;
11
- backupPath: string | null;
12
- blockers: MigrationBlocker[];
13
- };
14
- export type RuntimeMigrationOptions = {
15
- packageRoot: string;
16
- previousRoot: string;
17
- stagedRoot: string;
18
- selectedWorkflowIds: string[];
19
- unselectedWorkflowIds: string[];
20
- };
21
- export declare function assertNoPendingMigration(previousRoot: string): Promise<void>;
22
- export declare function migrateRuntimeState(options: RuntimeMigrationOptions): Promise<RuntimeMigrationResult>;
23
- export declare function initializeRuntimeManifest(packageRoot: string, stagedRoot: string, workflowIds: string[]): Promise<RuntimeMigrationResult>;