@namewta/speculo 0.8.2 → 0.8.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.
- package/README.md +2 -1
- package/package.json +1 -1
- package/template/.speculo/README.md +8 -6
- package/template/canonical/canonical-specdev-engineering-cognitive-mentor.md +1 -1
- package/template/canonical/canonical-specdev-goal-plan.md +1 -1
- package/template/canonical/canonical-specdev-grill-with-docs.md +1 -1
- package/template/canonical/canonical-specdev-spec.md +1 -1
- package/template/canonical/canonical-specdev-tickets.md +1 -1
- package/template/commands/archive-and-consolidate.md +4 -4
- package/template/commands/docs-sync.md +4 -4
- package/template/commands/git-repository-audit.md +7 -7
- package/template/commands/handoff.md +2 -2
- package/template/commands/retro.md +6 -6
- package/template/commands/status.md +4 -4
- package/template/skills/archive-and-consolidate/SKILL.md +3 -3
- package/template/skills/docs-sync/assets/state-template.json +1 -1
- package/template/skills/docs-sync/assets/workflow-scope-template.json +1 -1
- package/template/skills/docs-sync/references/git-state-contract.md +2 -2
- package/template/skills/docs-sync/references/workflow-scope-contract.md +3 -3
- package/template/skills/github-npm-ops/references/preflight-checklist.md +1 -1
- package/template/skills/github-npm-ops/references/release-notes-injection.md +1 -1
- package/template/skills/github-npm-ops/references/release-pipeline.md +4 -4
- package/template/skills/github-npm-ops/references/version-bump-flow.md +2 -2
- package/template/skills/speculo-retro/references/friction-taxonomy.md +2 -2
- package/template/skills/speculo-retro/references/issue-drafting-sop.md +5 -5
- package/template/skills/upstream-fork-sync/SKILL.md +83 -0
- package/template/skills/upstream-fork-sync/references/report-contract.md +40 -0
- package/template/skills/upstream-fork-sync/references/repository-contract.md +54 -0
- package/template/skills/upstream-fork-sync/references/state-schema.md +55 -0
- package/template/skills/upstream-fork-sync/scripts/upstream-sync.mjs +740 -0
- package/template/workflows/specdev/E-eli5/E-eli5.md +75 -15
- package/template/workflows/specdev/INDEX.md +5 -5
- package/template/workflows/specdev/common/rules/artifact-contract.md +1 -1
- package/template/workflows/specdev/common/tools/validate-specdev.mjs +50 -11
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Report Contract
|
|
2
|
+
|
|
3
|
+
## Output
|
|
4
|
+
|
|
5
|
+
每次成功 assessment 创建:
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
<Path>{roots.state}/skills/upstream-fork-sync/{change}/state.json</Path>
|
|
9
|
+
<Path>{roots.state}/skills/upstream-fork-sync/{change}/diff-report.md</Path>
|
|
10
|
+
<Path>{roots.state}/skills/upstream-fork-sync/{change}/conflict-report.md</Path>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
首份无编号,冲突时从 `-01` 选择最小未占用编号。整个 change 先在同一 state 根暂存,再原子 rename;不得覆盖或留下半成品目录。
|
|
14
|
+
|
|
15
|
+
## Diff report
|
|
16
|
+
|
|
17
|
+
每个仓库包含:
|
|
18
|
+
|
|
19
|
+
- checkpoint 来源、已集成 upstream SHA、观测 upstream SHA、product SHA、merge-base、mirror SHA 和 freshness;
|
|
20
|
+
- `integrated_upstream_sha..observed_upstream_sha` 的有序提交;
|
|
21
|
+
- 完整 name-status 与 numstat 文件清单;
|
|
22
|
+
- product 自 checkpoint 后也修改的路径;
|
|
23
|
+
- repository map 风险 glob 命中的路径;
|
|
24
|
+
- 使用冻结 SHA 的复现命令;
|
|
25
|
+
- commit/file/conflict/risk 计数和当前 disposition。
|
|
26
|
+
|
|
27
|
+
Agent 使用 customization map 和路径级 diff 增补语义结论;报告不内嵌无界完整 patch。
|
|
28
|
+
|
|
29
|
+
## Conflict report
|
|
30
|
+
|
|
31
|
+
使用 `git merge-tree --write-tree --messages <product-sha> <upstream-sha>`,不修改 index、worktree 或 refs。该命令可能在对象数据库留下不可达 tree objects。
|
|
32
|
+
|
|
33
|
+
始终分开:
|
|
34
|
+
|
|
35
|
+
1. Git confirmed conflicts;
|
|
36
|
+
2. Automatically mergeable overlaps;
|
|
37
|
+
3. Customization contract risks;
|
|
38
|
+
4. Dirty worktree overlaps。
|
|
39
|
+
|
|
40
|
+
始终生成 conflict report。零文本冲突明确写为零,并注明 merge-tree 无法证明编译、运行时、API、数据迁移、权限或业务行为安全。
|
|
@@ -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;失败不得伪装为成功。
|