@namewta/speculo 0.8.3 → 0.8.5

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 +2 -1
  2. package/package.json +1 -1
  3. package/template/.speculo/README.md +10 -7
  4. package/template/commands/archive-and-consolidate.md +4 -4
  5. package/template/commands/docs-sync.md +4 -4
  6. package/template/commands/git-repository-audit.md +7 -7
  7. package/template/commands/handoff.md +2 -2
  8. package/template/commands/retro.md +6 -6
  9. package/template/commands/status.md +4 -4
  10. package/template/skills/archive-and-consolidate/SKILL.md +3 -3
  11. package/template/skills/docs-sync/assets/state-template.json +1 -1
  12. package/template/skills/docs-sync/assets/workflow-scope-template.json +1 -1
  13. package/template/skills/docs-sync/references/git-state-contract.md +2 -2
  14. package/template/skills/docs-sync/references/workflow-scope-contract.md +3 -3
  15. package/template/skills/github-npm-ops/references/preflight-checklist.md +1 -1
  16. package/template/skills/github-npm-ops/references/release-notes-injection.md +1 -1
  17. package/template/skills/github-npm-ops/references/release-pipeline.md +4 -4
  18. package/template/skills/github-npm-ops/references/version-bump-flow.md +2 -2
  19. package/template/skills/speculo-retro/references/friction-taxonomy.md +2 -2
  20. package/template/skills/speculo-retro/references/issue-drafting-sop.md +5 -5
  21. package/template/skills/upstream-fork-sync/SKILL.md +83 -0
  22. package/template/skills/upstream-fork-sync/references/report-contract.md +40 -0
  23. package/template/skills/upstream-fork-sync/references/repository-contract.md +54 -0
  24. package/template/skills/upstream-fork-sync/references/state-schema.md +55 -0
  25. package/template/skills/upstream-fork-sync/scripts/upstream-sync.mjs +740 -0
  26. package/template/workflows/specdev/A-archive-and-consolidate/A-archive-and-consolidate.md +2 -0
  27. package/template/workflows/specdev/C-code-review/C-code-review.md +2 -0
  28. package/template/workflows/specdev/D-diagnose-bugs/D-diagnose-bugs.md +2 -0
  29. package/template/workflows/specdev/E-eli5/E-eli5.md +3 -1
  30. package/template/workflows/specdev/E-engineering-cognitive-mentor/E-engineering-cognitive-mentor.md +2 -0
  31. package/template/workflows/specdev/G-grill-with-docs/G-grill-with-docs.md +2 -0
  32. package/template/workflows/specdev/I-implement/I-implement.md +2 -0
  33. package/template/workflows/specdev/I-init-setup/I-init-setup.md +3 -1
  34. package/template/workflows/specdev/INDEX.md +7 -239
  35. package/template/workflows/specdev/P-goal-plan/P-goal-plan.md +2 -0
  36. package/template/workflows/specdev/P-prototype/P-prototype.md +2 -0
  37. package/template/workflows/specdev/R-review-architecture/R-review-architecture.md +2 -0
  38. package/template/workflows/specdev/README.md +249 -0
  39. package/template/workflows/specdev/S-spec/S-spec.md +2 -0
  40. package/template/workflows/specdev/T-tickets/T-tickets.md +2 -0
  41. package/template/workflows/specdev/T-triage/T-triage.md +3 -1
  42. package/template/workflows/specdev/W-wayfinder/W-wayfinder.md +2 -0
@@ -0,0 +1,54 @@
1
+ # Repository Contract
2
+
3
+ ## Repository map
4
+
5
+ `<Path>{roots.state}/skills/upstream-fork-sync/repository-map.json</Path>` 是稳定、项目专属的 Git ref 配置:
6
+
7
+ ```json
8
+ {
9
+ "schema_version": 1,
10
+ "repositories": [
11
+ {
12
+ "id": "app",
13
+ "path": ".",
14
+ "product_ref": "refs/heads/main",
15
+ "origin_ref": "refs/remotes/origin/main",
16
+ "origin_remote": "origin",
17
+ "upstream_ref": "refs/remotes/upstream/main",
18
+ "upstream_remote": "upstream",
19
+ "mirror_ref": null,
20
+ "baseline_ref": null,
21
+ "risk_paths": ["src/auth/**", "package.json"]
22
+ }
23
+ ]
24
+ }
25
+ ```
26
+
27
+ - `id` 使用唯一小写 kebab-case。
28
+ - `path` 是项目根 POSIX 相对 Git worktree 路径,`.` 表示项目根;不得绝对、包含 `..` 或指向符号链接目录。
29
+ - `product_ref` 与 `upstream_ref` 必填且使用完整 `refs/...`。
30
+ - `origin_ref`、`origin_remote`、`mirror_ref`、`baseline_ref` 可以为 `null`;配置 remote 时对应 ref 必须存在。
31
+ - `risk_paths` 是项目确认的 glob;它补充稳定 customization map,不取代 Agent 的语义复核。
32
+
33
+ ## Ref invariants
34
+
35
+ - Product ref 包含二次开发;mirror 只表示本地上游镜像。
36
+ - 配置 baseline 时,它必须同时是 product 与 observed upstream 的祖先;配置 mirror 时,它必须是 observed upstream 的祖先。任一关系不成立时停止评估。
37
+ - Fetch 只更新 remote-tracking refs。Skill 不自动 stash、reset、clean、rebase、force-update、删除、commit、merge、push、tag 或更新 submodule pointer。
38
+ - Dirty worktree 不影响基于 commit 的评估,但必须独立报告。
39
+ - `--fetch` 逐仓库刷新配置的 upstream remote,并在配置时刷新 origin remote;失败仓库使用现存 refs 且标记 `stale`,不得称为最新。
40
+
41
+ ## Checkpoint discovery
42
+
43
+ 没有有效保存 checkpoint 时:
44
+
45
+ 1. 若配置 baseline,从 baseline 到 product ref 的 first-parent merges 逆序检查;否则检查 product ref 的 first-parent merges。
46
+ 2. 选择最新一个其非第一父节点属于当前 upstream 历史的 merge。
47
+ 3. 记录该 upstream 父节点及 merge commit。
48
+ 4. 没有合格 merge 时,仅在 product/upstream 有唯一 merge-base 时使用它,且 merge commit 为 `null`。
49
+
50
+ Mirror tip 不能推导已集成 checkpoint;cherry-pick patch equivalence 也不能推进 graph checkpoint。
51
+
52
+ ## Stable customization map
53
+
54
+ `<Path>{roots.state}/skills/upstream-fork-sync/customization-map.md</Path>` 只保存长期 fork 不变量、领域约束和审查热点。当前 SHAs、fetch 结果、changed files、conflicts、dirty paths 和一次运行结论属于 change 报告。
@@ -0,0 +1,55 @@
1
+ # State Schema
2
+
3
+ ## Root state
4
+
5
+ `<Path>{roots.state}/skills/upstream-fork-sync/state.json</Path>` 使用 schema v1:
6
+
7
+ ```json
8
+ {
9
+ "schema_version": 1,
10
+ "updated_at": "RFC-3339 timestamp",
11
+ "current_change": "YYYY-MM-DD-ascii-kebab-topic",
12
+ "repositories": {
13
+ "app": {
14
+ "integrated_upstream_sha": "full SHA",
15
+ "main_merge_sha": "full SHA or null",
16
+ "observed_upstream_sha": "full SHA"
17
+ }
18
+ }
19
+ }
20
+ ```
21
+
22
+ 根 state 只是当前同步索引。它不保存 ref 配置、run history、dirty paths、文件清单、conflicts、fetch details 或 verification logs。
23
+
24
+ ## Change state
25
+
26
+ 每个 `<Path>{roots.state}/skills/upstream-fork-sync/{change}/state.json</Path>` 包含:
27
+
28
+ ```json
29
+ {
30
+ "schema_version": 1,
31
+ "created_at": "RFC-3339 timestamp",
32
+ "repository_map_sha256": "sha256",
33
+ "repositories": {
34
+ "app": {
35
+ "product_sha": "full SHA",
36
+ "upstream_sha": "full SHA",
37
+ "integrated_upstream_sha": "full SHA",
38
+ "main_merge_sha": null,
39
+ "recorded_at": null,
40
+ "verification": []
41
+ }
42
+ }
43
+ }
44
+ ```
45
+
46
+ 只列出存在 upstream delta 的仓库。`record-integration` 填写 `main_merge_sha`、`recorded_at` 和 verification,并推进根 checkpoint;assessment、fetch、mirror observation 和报告生成都不能推进 `integrated_upstream_sha`。
47
+
48
+ ## Update rules
49
+
50
+ - 发布 change 的全部文件后才替换根 state。
51
+ - 未知 schema、额外字段、非法 repository id 和 SHA 类型全部拒绝。
52
+ - 保存 checkpoint 必须仍在 product 与 upstream 历史中。
53
+ - `record-integration` 要求精确匹配 change 的冻结 upstream target。
54
+ - 旧 change 的冻结 target 不得回退或分叉当前根 checkpoint。
55
+ - 状态写入使用同目录临时文件、fsync 和 rename;失败不得伪装为成功。