@hunter-harness/workflow-harness 0.2.13 → 0.2.15
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/harness/bundles/general/claude-code/.harness-build.json +1 -1
- package/harness/bundles/general/claude-code/harness-archive/SKILL.md +1 -1
- package/harness/bundles/general/claude-code/harness-codebase-map/SKILL.md +1 -1
- package/harness/bundles/general/claude-code/harness-knowledge-ingest/SKILL.md +1 -1
- package/harness/bundles/general/claude-code/harness-knowledge-query/SKILL.md +1 -1
- package/harness/bundles/general/claude-code/harness-plan/SKILL.md +1 -1
- package/harness/bundles/general/claude-code/harness-review/SKILL.md +1 -1
- package/harness/bundles/general/claude-code/harness-run/SKILL.md +1 -1
- package/harness/bundles/general/claude-code/harness-run/reference.md +3 -1
- package/harness/bundles/general/claude-code/harness-submit/SKILL.md +2 -2
- package/harness/bundles/general/claude-code/harness-submit/checklist.md +1 -1
- package/harness/bundles/general/claude-code/harness-sync/SKILL.md +1 -1
- package/harness/bundles/general/claude-code/harness-test/SKILL.md +1 -1
- package/harness/bundles/general/claude-code/scripts/harness_archive.py +204 -0
- package/harness/bundles/general/claude-code/scripts/harness_change.py +310 -16
- package/harness/bundles/general/claude-code/scripts/harness_deploy.py +177 -0
- package/harness/bundles/general/claude-code/scripts/harness_events.py +113 -1
- package/harness/bundles/general/claude-code/scripts/harness_gate.py +57 -4
- package/harness/bundles/general/claude-code/scripts/harness_integration.py +67 -7
- package/harness/bundles/general/claude-code/scripts/harness_ledger.py +15 -3
- package/harness/bundles/general/claude-code/scripts/harness_plan_finalize.py +85 -0
- package/harness/bundles/general/claude-code/scripts/harness_preflight.py +193 -77
- package/harness/bundles/general/claude-code/scripts/harness_state.py +12 -4
- package/harness/bundles/general/claude-code/scripts/harness_test_guard.py +86 -13
- package/harness/bundles/general/codebuddy/.harness-build.json +1 -1
- package/harness/bundles/general/codebuddy/harness-archive/SKILL.md +1 -1
- package/harness/bundles/general/codebuddy/harness-codebase-map/SKILL.md +1 -1
- package/harness/bundles/general/codebuddy/harness-knowledge-ingest/SKILL.md +1 -1
- package/harness/bundles/general/codebuddy/harness-knowledge-query/SKILL.md +1 -1
- package/harness/bundles/general/codebuddy/harness-plan/SKILL.md +1 -1
- package/harness/bundles/general/codebuddy/harness-review/SKILL.md +1 -1
- package/harness/bundles/general/codebuddy/harness-run/SKILL.md +1 -1
- package/harness/bundles/general/codebuddy/harness-run/reference.md +3 -1
- package/harness/bundles/general/codebuddy/harness-submit/SKILL.md +2 -2
- package/harness/bundles/general/codebuddy/harness-submit/checklist.md +1 -1
- package/harness/bundles/general/codebuddy/harness-sync/SKILL.md +1 -1
- package/harness/bundles/general/codebuddy/harness-test/SKILL.md +1 -1
- package/harness/bundles/general/codebuddy/scripts/harness_archive.py +204 -0
- package/harness/bundles/general/codebuddy/scripts/harness_change.py +310 -16
- package/harness/bundles/general/codebuddy/scripts/harness_deploy.py +177 -0
- package/harness/bundles/general/codebuddy/scripts/harness_events.py +113 -1
- package/harness/bundles/general/codebuddy/scripts/harness_gate.py +57 -4
- package/harness/bundles/general/codebuddy/scripts/harness_integration.py +67 -7
- package/harness/bundles/general/codebuddy/scripts/harness_ledger.py +15 -3
- package/harness/bundles/general/codebuddy/scripts/harness_plan_finalize.py +85 -0
- package/harness/bundles/general/codebuddy/scripts/harness_preflight.py +193 -77
- package/harness/bundles/general/codebuddy/scripts/harness_state.py +12 -4
- package/harness/bundles/general/codebuddy/scripts/harness_test_guard.py +86 -13
- package/harness/bundles/general/codex/.harness-build.json +1 -1
- package/harness/bundles/general/codex/harness-archive/SKILL.md +1 -1
- package/harness/bundles/general/codex/harness-codebase-map/SKILL.md +1 -1
- package/harness/bundles/general/codex/harness-knowledge-ingest/SKILL.md +1 -1
- package/harness/bundles/general/codex/harness-knowledge-query/SKILL.md +1 -1
- package/harness/bundles/general/codex/harness-plan/SKILL.md +1 -1
- package/harness/bundles/general/codex/harness-review/SKILL.md +1 -1
- package/harness/bundles/general/codex/harness-run/SKILL.md +1 -1
- package/harness/bundles/general/codex/harness-run/reference.md +3 -1
- package/harness/bundles/general/codex/harness-submit/SKILL.md +2 -2
- package/harness/bundles/general/codex/harness-submit/checklist.md +1 -1
- package/harness/bundles/general/codex/harness-sync/SKILL.md +1 -1
- package/harness/bundles/general/codex/harness-test/SKILL.md +1 -1
- package/harness/bundles/general/codex/scripts/harness_archive.py +204 -0
- package/harness/bundles/general/codex/scripts/harness_change.py +310 -16
- package/harness/bundles/general/codex/scripts/harness_deploy.py +177 -0
- package/harness/bundles/general/codex/scripts/harness_events.py +113 -1
- package/harness/bundles/general/codex/scripts/harness_gate.py +57 -4
- package/harness/bundles/general/codex/scripts/harness_integration.py +67 -7
- package/harness/bundles/general/codex/scripts/harness_ledger.py +15 -3
- package/harness/bundles/general/codex/scripts/harness_plan_finalize.py +85 -0
- package/harness/bundles/general/codex/scripts/harness_preflight.py +193 -77
- package/harness/bundles/general/codex/scripts/harness_state.py +12 -4
- package/harness/bundles/general/codex/scripts/harness_test_guard.py +86 -13
- package/harness/bundles/general/cursor/.harness-build.json +1 -1
- package/harness/bundles/general/cursor/harness-archive/SKILL.md +1 -1
- package/harness/bundles/general/cursor/harness-codebase-map/SKILL.md +1 -1
- package/harness/bundles/general/cursor/harness-knowledge-ingest/SKILL.md +1 -1
- package/harness/bundles/general/cursor/harness-knowledge-query/SKILL.md +1 -1
- package/harness/bundles/general/cursor/harness-plan/SKILL.md +1 -1
- package/harness/bundles/general/cursor/harness-review/SKILL.md +1 -1
- package/harness/bundles/general/cursor/harness-run/SKILL.md +1 -1
- package/harness/bundles/general/cursor/harness-run/reference.md +3 -1
- package/harness/bundles/general/cursor/harness-submit/SKILL.md +2 -2
- package/harness/bundles/general/cursor/harness-submit/checklist.md +1 -1
- package/harness/bundles/general/cursor/harness-sync/SKILL.md +1 -1
- package/harness/bundles/general/cursor/harness-test/SKILL.md +1 -1
- package/harness/bundles/general/cursor/scripts/harness_archive.py +204 -0
- package/harness/bundles/general/cursor/scripts/harness_change.py +310 -16
- package/harness/bundles/general/cursor/scripts/harness_deploy.py +177 -0
- package/harness/bundles/general/cursor/scripts/harness_events.py +113 -1
- package/harness/bundles/general/cursor/scripts/harness_gate.py +57 -4
- package/harness/bundles/general/cursor/scripts/harness_integration.py +67 -7
- package/harness/bundles/general/cursor/scripts/harness_ledger.py +15 -3
- package/harness/bundles/general/cursor/scripts/harness_plan_finalize.py +85 -0
- package/harness/bundles/general/cursor/scripts/harness_preflight.py +193 -77
- package/harness/bundles/general/cursor/scripts/harness_state.py +12 -4
- package/harness/bundles/general/cursor/scripts/harness_test_guard.py +86 -13
- package/harness/bundles/java/claude-code/.harness-build.json +1 -1
- package/harness/bundles/java/claude-code/harness-apidoc/SKILL.md +1 -1
- package/harness/bundles/java/claude-code/harness-archive/SKILL.md +1 -1
- package/harness/bundles/java/claude-code/harness-codebase-map/SKILL.md +1 -1
- package/harness/bundles/java/claude-code/harness-knowledge-ingest/SKILL.md +1 -1
- package/harness/bundles/java/claude-code/harness-knowledge-query/SKILL.md +1 -1
- package/harness/bundles/java/claude-code/harness-package/SKILL.md +1 -1
- package/harness/bundles/java/claude-code/harness-plan/SKILL.md +1 -1
- package/harness/bundles/java/claude-code/harness-review/SKILL.md +1 -1
- package/harness/bundles/java/claude-code/harness-run/SKILL.md +1 -1
- package/harness/bundles/java/claude-code/harness-submit/SKILL.md +2 -2
- package/harness/bundles/java/claude-code/harness-submit/checklist.md +1 -1
- package/harness/bundles/java/claude-code/harness-sync/SKILL.md +1 -1
- package/harness/bundles/java/claude-code/harness-test/SKILL.md +1 -1
- package/harness/bundles/java/claude-code/scripts/harness_archive.py +204 -0
- package/harness/bundles/java/claude-code/scripts/harness_change.py +310 -16
- package/harness/bundles/java/claude-code/scripts/harness_deploy.py +177 -0
- package/harness/bundles/java/claude-code/scripts/harness_events.py +113 -1
- package/harness/bundles/java/claude-code/scripts/harness_gate.py +57 -4
- package/harness/bundles/java/claude-code/scripts/harness_integration.py +67 -7
- package/harness/bundles/java/claude-code/scripts/harness_ledger.py +15 -3
- package/harness/bundles/java/claude-code/scripts/harness_plan_finalize.py +85 -0
- package/harness/bundles/java/claude-code/scripts/harness_preflight.py +193 -77
- package/harness/bundles/java/claude-code/scripts/harness_state.py +12 -4
- package/harness/bundles/java/claude-code/scripts/harness_test_guard.py +86 -13
- package/harness/bundles/java/codebuddy/.harness-build.json +1 -1
- package/harness/bundles/java/codebuddy/harness-apidoc/SKILL.md +1 -1
- package/harness/bundles/java/codebuddy/harness-archive/SKILL.md +1 -1
- package/harness/bundles/java/codebuddy/harness-codebase-map/SKILL.md +1 -1
- package/harness/bundles/java/codebuddy/harness-knowledge-ingest/SKILL.md +1 -1
- package/harness/bundles/java/codebuddy/harness-knowledge-query/SKILL.md +1 -1
- package/harness/bundles/java/codebuddy/harness-package/SKILL.md +1 -1
- package/harness/bundles/java/codebuddy/harness-plan/SKILL.md +1 -1
- package/harness/bundles/java/codebuddy/harness-review/SKILL.md +1 -1
- package/harness/bundles/java/codebuddy/harness-run/SKILL.md +1 -1
- package/harness/bundles/java/codebuddy/harness-submit/SKILL.md +2 -2
- package/harness/bundles/java/codebuddy/harness-submit/checklist.md +1 -1
- package/harness/bundles/java/codebuddy/harness-sync/SKILL.md +1 -1
- package/harness/bundles/java/codebuddy/harness-test/SKILL.md +1 -1
- package/harness/bundles/java/codebuddy/scripts/harness_archive.py +204 -0
- package/harness/bundles/java/codebuddy/scripts/harness_change.py +310 -16
- package/harness/bundles/java/codebuddy/scripts/harness_deploy.py +177 -0
- package/harness/bundles/java/codebuddy/scripts/harness_events.py +113 -1
- package/harness/bundles/java/codebuddy/scripts/harness_gate.py +57 -4
- package/harness/bundles/java/codebuddy/scripts/harness_integration.py +67 -7
- package/harness/bundles/java/codebuddy/scripts/harness_ledger.py +15 -3
- package/harness/bundles/java/codebuddy/scripts/harness_plan_finalize.py +85 -0
- package/harness/bundles/java/codebuddy/scripts/harness_preflight.py +193 -77
- package/harness/bundles/java/codebuddy/scripts/harness_state.py +12 -4
- package/harness/bundles/java/codebuddy/scripts/harness_test_guard.py +86 -13
- package/harness/bundles/java/codex/.harness-build.json +1 -1
- package/harness/bundles/java/codex/harness-apidoc/SKILL.md +1 -1
- package/harness/bundles/java/codex/harness-archive/SKILL.md +1 -1
- package/harness/bundles/java/codex/harness-codebase-map/SKILL.md +1 -1
- package/harness/bundles/java/codex/harness-knowledge-ingest/SKILL.md +1 -1
- package/harness/bundles/java/codex/harness-knowledge-query/SKILL.md +1 -1
- package/harness/bundles/java/codex/harness-package/SKILL.md +1 -1
- package/harness/bundles/java/codex/harness-plan/SKILL.md +1 -1
- package/harness/bundles/java/codex/harness-review/SKILL.md +1 -1
- package/harness/bundles/java/codex/harness-run/SKILL.md +1 -1
- package/harness/bundles/java/codex/harness-submit/SKILL.md +2 -2
- package/harness/bundles/java/codex/harness-submit/checklist.md +1 -1
- package/harness/bundles/java/codex/harness-sync/SKILL.md +1 -1
- package/harness/bundles/java/codex/harness-test/SKILL.md +1 -1
- package/harness/bundles/java/codex/scripts/harness_archive.py +204 -0
- package/harness/bundles/java/codex/scripts/harness_change.py +310 -16
- package/harness/bundles/java/codex/scripts/harness_deploy.py +177 -0
- package/harness/bundles/java/codex/scripts/harness_events.py +113 -1
- package/harness/bundles/java/codex/scripts/harness_gate.py +57 -4
- package/harness/bundles/java/codex/scripts/harness_integration.py +67 -7
- package/harness/bundles/java/codex/scripts/harness_ledger.py +15 -3
- package/harness/bundles/java/codex/scripts/harness_plan_finalize.py +85 -0
- package/harness/bundles/java/codex/scripts/harness_preflight.py +193 -77
- package/harness/bundles/java/codex/scripts/harness_state.py +12 -4
- package/harness/bundles/java/codex/scripts/harness_test_guard.py +86 -13
- package/harness/bundles/java/cursor/.harness-build.json +1 -1
- package/harness/bundles/java/cursor/harness-apidoc/SKILL.md +1 -1
- package/harness/bundles/java/cursor/harness-archive/SKILL.md +1 -1
- package/harness/bundles/java/cursor/harness-codebase-map/SKILL.md +1 -1
- package/harness/bundles/java/cursor/harness-knowledge-ingest/SKILL.md +1 -1
- package/harness/bundles/java/cursor/harness-knowledge-query/SKILL.md +1 -1
- package/harness/bundles/java/cursor/harness-package/SKILL.md +1 -1
- package/harness/bundles/java/cursor/harness-plan/SKILL.md +1 -1
- package/harness/bundles/java/cursor/harness-review/SKILL.md +1 -1
- package/harness/bundles/java/cursor/harness-run/SKILL.md +1 -1
- package/harness/bundles/java/cursor/harness-submit/SKILL.md +2 -2
- package/harness/bundles/java/cursor/harness-submit/checklist.md +1 -1
- package/harness/bundles/java/cursor/harness-sync/SKILL.md +1 -1
- package/harness/bundles/java/cursor/harness-test/SKILL.md +1 -1
- package/harness/bundles/java/cursor/scripts/harness_archive.py +204 -0
- package/harness/bundles/java/cursor/scripts/harness_change.py +310 -16
- package/harness/bundles/java/cursor/scripts/harness_deploy.py +177 -0
- package/harness/bundles/java/cursor/scripts/harness_events.py +113 -1
- package/harness/bundles/java/cursor/scripts/harness_gate.py +57 -4
- package/harness/bundles/java/cursor/scripts/harness_integration.py +67 -7
- package/harness/bundles/java/cursor/scripts/harness_ledger.py +15 -3
- package/harness/bundles/java/cursor/scripts/harness_plan_finalize.py +85 -0
- package/harness/bundles/java/cursor/scripts/harness_preflight.py +193 -77
- package/harness/bundles/java/cursor/scripts/harness_state.py +12 -4
- package/harness/bundles/java/cursor/scripts/harness_test_guard.py +86 -13
- package/harness/manifests/general/claude-code.json +25 -25
- package/harness/manifests/general/codebuddy.json +25 -25
- package/harness/manifests/general/codex.json +25 -25
- package/harness/manifests/general/cursor.json +25 -25
- package/harness/manifests/java/claude-code.json +26 -26
- package/harness/manifests/java/codebuddy.json +26 -26
- package/harness/manifests/java/codex.json +26 -26
- package/harness/manifests/java/cursor.json +26 -26
- package/hunter-workflow-family.json +2 -2
- package/package.json +15 -15
|
@@ -29,6 +29,7 @@ if hasattr(sys.stderr, "reconfigure"):
|
|
|
29
29
|
sys.stderr.reconfigure(encoding="utf-8")
|
|
30
30
|
|
|
31
31
|
|
|
32
|
+
import harness_change as hc # noqa: E402
|
|
32
33
|
import harness_profile as hprof # noqa: E402
|
|
33
34
|
|
|
34
35
|
|
|
@@ -69,6 +70,52 @@ def cmd_check(project: Path) -> dict[str, Any]:
|
|
|
69
70
|
return result
|
|
70
71
|
|
|
71
72
|
|
|
73
|
+
def check_concurrency(project: Path) -> dict[str, Any]:
|
|
74
|
+
"""Report the configured concurrency mode and active Change landscape.
|
|
75
|
+
|
|
76
|
+
Retro §5.2: preflight must surface concurrencyMode, activeChanges, and
|
|
77
|
+
allowedParallelLevels so agents don't have to guess whether parallel
|
|
78
|
+
Changes are supported.
|
|
79
|
+
"""
|
|
80
|
+
mode = hc.read_concurrency_mode(project)
|
|
81
|
+
active = hc.list_active_changes(project)
|
|
82
|
+
shared_conflicts: list[dict[str, Any]] = []
|
|
83
|
+
# In isolated-multi-active, surface any shared-state conflicts (e.g. same
|
|
84
|
+
# worktree path) so callers know isolation is incomplete.
|
|
85
|
+
if mode == "isolated-multi-active" and len(active) > 1:
|
|
86
|
+
seen_worktrees: dict[str, str] = {}
|
|
87
|
+
for entry in active:
|
|
88
|
+
change_dir = Path(entry["path"])
|
|
89
|
+
worktree_meta = change_dir / "meta" / "worktree.json"
|
|
90
|
+
if not worktree_meta.is_file():
|
|
91
|
+
continue
|
|
92
|
+
try:
|
|
93
|
+
meta = json.loads(worktree_meta.read_text(encoding="utf-8"))
|
|
94
|
+
except (OSError, json.JSONDecodeError):
|
|
95
|
+
continue
|
|
96
|
+
wt = meta.get("path") if isinstance(meta, dict) else None
|
|
97
|
+
if isinstance(wt, str) and wt:
|
|
98
|
+
if wt in seen_worktrees:
|
|
99
|
+
shared_conflicts.append({
|
|
100
|
+
"kind": "worktree",
|
|
101
|
+
"path": wt,
|
|
102
|
+
"changes": [seen_worktrees[wt], entry["changeId"]],
|
|
103
|
+
})
|
|
104
|
+
else:
|
|
105
|
+
seen_worktrees[wt] = entry["changeId"]
|
|
106
|
+
levels = ["change-internal"] if mode == "single-active" else [
|
|
107
|
+
"change-internal",
|
|
108
|
+
"multi-change",
|
|
109
|
+
]
|
|
110
|
+
return {
|
|
111
|
+
"ok": True,
|
|
112
|
+
"concurrencyMode": mode,
|
|
113
|
+
"activeChanges": active,
|
|
114
|
+
"sharedStateConflicts": shared_conflicts,
|
|
115
|
+
"allowedParallelLevels": levels,
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
|
|
72
119
|
# ---------------------------------------------------------------------------
|
|
73
120
|
# record-quirk — 适配 v2 commands(source=user override)
|
|
74
121
|
# ---------------------------------------------------------------------------
|
|
@@ -320,10 +367,41 @@ def _resolve_agents_root(skills_root: Path, agents_root: Path | None) -> tuple[P
|
|
|
320
367
|
if skills_root.name == "skills" and skills_root.parent.name in (".claude", ".codebuddy"):
|
|
321
368
|
return (skills_root.parent / "agents").resolve(), None
|
|
322
369
|
if skills_root.name == "skills" and skills_root.parent.name in (".agents", ".cursor"):
|
|
323
|
-
|
|
370
|
+
# These adapters (Codex/Cursor) may provide agent roles via host
|
|
371
|
+
# capability manifest rather than local .md files. Return None without
|
|
372
|
+
# a hard error; the caller checks runtime.json for host capabilities.
|
|
373
|
+
return None, None
|
|
324
374
|
return (skills_root / "agents").resolve(), None
|
|
325
375
|
|
|
326
376
|
|
|
377
|
+
def _read_host_capabilities(skills_root: Path) -> set[str]:
|
|
378
|
+
"""Read agent capabilities declared by the host adapter (retro §5.3).
|
|
379
|
+
|
|
380
|
+
Adapter installs may declare available agent roles in
|
|
381
|
+
`meta/runtime.json` under `agentCapabilities` (list of role names).
|
|
382
|
+
Returns an empty set if the file or field is absent.
|
|
383
|
+
"""
|
|
384
|
+
# runtime.json lives in the change's meta/ dir, but agent capabilities are
|
|
385
|
+
# project-level. Check the adapter's runtime.json at the project root.
|
|
386
|
+
candidates = [
|
|
387
|
+
skills_root.parent / "runtime.json",
|
|
388
|
+
skills_root / "runtime.json",
|
|
389
|
+
]
|
|
390
|
+
for path in candidates:
|
|
391
|
+
if not path.is_file():
|
|
392
|
+
continue
|
|
393
|
+
try:
|
|
394
|
+
data = json.loads(path.read_text(encoding="utf-8-sig"))
|
|
395
|
+
except (OSError, json.JSONDecodeError):
|
|
396
|
+
continue
|
|
397
|
+
if not isinstance(data, dict):
|
|
398
|
+
continue
|
|
399
|
+
caps = data.get("agentCapabilities")
|
|
400
|
+
if isinstance(caps, list):
|
|
401
|
+
return {str(c) for c in caps if isinstance(c, str)}
|
|
402
|
+
return set()
|
|
403
|
+
|
|
404
|
+
|
|
327
405
|
def cmd_check_agents(
|
|
328
406
|
skills_root: Path,
|
|
329
407
|
agent: str,
|
|
@@ -341,98 +419,136 @@ def cmd_check_agents(
|
|
|
341
419
|
"reason": "agent name is empty",
|
|
342
420
|
}
|
|
343
421
|
|
|
344
|
-
resolved_agents_root,
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
422
|
+
resolved_agents_root, _ = _resolve_agents_root(skills_root, agents_root)
|
|
423
|
+
host_capabilities = _read_host_capabilities(skills_root)
|
|
424
|
+
host_callable = agent_name in host_capabilities
|
|
425
|
+
|
|
426
|
+
# Three independent fields (retro §5.3):
|
|
427
|
+
# - definitionPresent: local .md file exists
|
|
428
|
+
# - hostCallable: host adapter declares this agent role
|
|
429
|
+
# - toolContractValid: tools declaration is valid (non-empty list)
|
|
430
|
+
definition_present = False
|
|
431
|
+
tool_contract_valid = False
|
|
432
|
+
agent_path: Path | None = None
|
|
433
|
+
meta: dict[str, Any] | None = None
|
|
434
|
+
|
|
435
|
+
if resolved_agents_root is not None:
|
|
436
|
+
filename = agent_name if agent_name.endswith(".md") else f"{agent_name}.md"
|
|
437
|
+
agent_path = resolved_agents_root / filename
|
|
438
|
+
definition_present = agent_path.is_file()
|
|
439
|
+
|
|
440
|
+
# If no local definition and host doesn't declare the role, we can't
|
|
441
|
+
# determine usability. Distinguish "host says no" from "unknown".
|
|
442
|
+
if not definition_present and not host_callable:
|
|
443
|
+
# Check if this adapter is known to not support custom agents
|
|
444
|
+
adapter_name = skills_root.parent.name
|
|
445
|
+
if adapter_name in (".agents", ".cursor"):
|
|
446
|
+
# Codex/Cursor: may support via host manifest. If runtime.json
|
|
447
|
+
# has agentCapabilities but this role isn't listed, it's a
|
|
448
|
+
# genuine "not available". If no agentCapabilities field at all,
|
|
449
|
+
# we can't know — return UNKNOWN.
|
|
450
|
+
runtime_path = skills_root.parent / "runtime.json"
|
|
451
|
+
if not runtime_path.is_file():
|
|
452
|
+
return {
|
|
453
|
+
"ok": True,
|
|
454
|
+
"action": "check-agents",
|
|
455
|
+
"agent": agent_name,
|
|
456
|
+
"usable": False,
|
|
457
|
+
"definitionPresent": False,
|
|
458
|
+
"hostCallable": False,
|
|
459
|
+
"toolContractValid": False,
|
|
460
|
+
"reasonCode": "UNKNOWN",
|
|
461
|
+
"reason": (
|
|
462
|
+
"no local agent definition and no host capability manifest; "
|
|
463
|
+
"cannot determine agent availability"
|
|
464
|
+
),
|
|
465
|
+
}
|
|
363
466
|
return {
|
|
364
467
|
"ok": False,
|
|
365
468
|
"action": "check-agents",
|
|
366
469
|
"agent": agent_name,
|
|
367
|
-
"path": str(agent_path),
|
|
368
|
-
"agentsRoot": str(resolved_agents_root),
|
|
470
|
+
"path": str(agent_path) if agent_path else None,
|
|
471
|
+
"agentsRoot": str(resolved_agents_root) if resolved_agents_root else None,
|
|
369
472
|
"usable": False,
|
|
370
|
-
"
|
|
371
|
-
"
|
|
473
|
+
"definitionPresent": False,
|
|
474
|
+
"hostCallable": False,
|
|
475
|
+
"toolContractValid": False,
|
|
372
476
|
"reasonCode": "AGENT_DEFINITION_NOT_FOUND",
|
|
373
|
-
"reason": f"agent file not found: {
|
|
477
|
+
"reason": f"agent file not found and host does not declare role: {agent_name}",
|
|
374
478
|
}
|
|
375
479
|
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
480
|
+
# If definition present, validate frontmatter and tools
|
|
481
|
+
if definition_present and agent_path is not None:
|
|
482
|
+
try:
|
|
483
|
+
text = agent_path.read_text(encoding="utf-8")
|
|
484
|
+
except OSError as exc:
|
|
485
|
+
return {
|
|
486
|
+
"ok": False,
|
|
487
|
+
"action": "check-agents",
|
|
488
|
+
"agent": agent_name,
|
|
489
|
+
"path": str(agent_path),
|
|
490
|
+
"usable": False,
|
|
491
|
+
"definitionPresent": True,
|
|
492
|
+
"hostCallable": host_callable,
|
|
493
|
+
"toolContractValid": False,
|
|
494
|
+
"reason": f"cannot read agent file: {exc}",
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
meta, err = parse_frontmatter(text)
|
|
498
|
+
if err or meta is None:
|
|
499
|
+
return {
|
|
500
|
+
"ok": False,
|
|
501
|
+
"action": "check-agents",
|
|
502
|
+
"agent": agent_name,
|
|
503
|
+
"path": str(agent_path),
|
|
504
|
+
"usable": False,
|
|
505
|
+
"definitionPresent": True,
|
|
506
|
+
"hostCallable": host_callable,
|
|
507
|
+
"toolContractValid": False,
|
|
508
|
+
"reason": f"frontmatter parse failed: {err or 'unknown'}",
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
tools = meta.get("tools")
|
|
512
|
+
if tools is None:
|
|
513
|
+
tool_contract_valid = False
|
|
514
|
+
elif isinstance(tools, list) and len(tools) > 0:
|
|
515
|
+
tool_contract_valid = True
|
|
516
|
+
else:
|
|
517
|
+
tool_contract_valid = False
|
|
387
518
|
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
"agent": agent_name,
|
|
394
|
-
"path": str(agent_path),
|
|
395
|
-
"usable": False,
|
|
396
|
-
"reason": f"frontmatter parse failed: {err or 'unknown'}",
|
|
397
|
-
}
|
|
519
|
+
# usable = hostCallable (host provides the agent role, tools validated by host)
|
|
520
|
+
# OR definitionPresent AND toolContractValid (definition-based adapters)
|
|
521
|
+
usable = host_callable or (
|
|
522
|
+
definition_present and tool_contract_valid
|
|
523
|
+
)
|
|
398
524
|
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
"path": str(agent_path),
|
|
406
|
-
"usable": False,
|
|
407
|
-
"reason": "tools declaration missing",
|
|
408
|
-
"frontmatter": meta,
|
|
409
|
-
}
|
|
410
|
-
if not isinstance(tools, list) or len(tools) == 0:
|
|
411
|
-
return {
|
|
412
|
-
"ok": False,
|
|
413
|
-
"action": "check-agents",
|
|
414
|
-
"agent": agent_name,
|
|
415
|
-
"path": str(agent_path),
|
|
416
|
-
"usable": False,
|
|
417
|
-
"reason": "tools declaration empty or invalid",
|
|
418
|
-
"frontmatter": meta,
|
|
419
|
-
}
|
|
525
|
+
name_field = meta.get("name") if meta else None
|
|
526
|
+
tools_field = meta.get("tools") if meta else None
|
|
527
|
+
|
|
528
|
+
reason_code = "READY" if usable else "AGENT_DEFINITION_NOT_FOUND"
|
|
529
|
+
if not definition_present and host_callable:
|
|
530
|
+
reason_code = "DEFINITION_NOT_FOUND_HOST_CAPABLE"
|
|
420
531
|
|
|
421
|
-
name_field = meta.get("name")
|
|
422
532
|
return {
|
|
423
533
|
"ok": True,
|
|
424
534
|
"action": "check-agents",
|
|
425
535
|
"agent": agent_name,
|
|
426
|
-
"path": str(agent_path),
|
|
427
|
-
"agentsRoot": str(resolved_agents_root),
|
|
428
|
-
"usable":
|
|
429
|
-
"
|
|
430
|
-
"
|
|
431
|
-
"
|
|
432
|
-
"
|
|
536
|
+
"path": str(agent_path) if agent_path else None,
|
|
537
|
+
"agentsRoot": str(resolved_agents_root) if resolved_agents_root else None,
|
|
538
|
+
"usable": usable,
|
|
539
|
+
"definitionPresent": definition_present,
|
|
540
|
+
"hostCallable": host_callable,
|
|
541
|
+
"toolContractValid": tool_contract_valid,
|
|
542
|
+
"reasonCode": reason_code,
|
|
543
|
+
"reason": (
|
|
544
|
+
"agent available; "
|
|
545
|
+
f"definition={'present' if definition_present else 'absent'}, "
|
|
546
|
+
f"hostCallable={host_callable}, "
|
|
547
|
+
f"tools={'valid' if tool_contract_valid else 'invalid'}"
|
|
548
|
+
),
|
|
433
549
|
"name": name_field,
|
|
434
|
-
"tools":
|
|
435
|
-
"frontmatterKeys": sorted(meta.keys()),
|
|
550
|
+
"tools": tools_field,
|
|
551
|
+
"frontmatterKeys": sorted(meta.keys()) if meta else [],
|
|
436
552
|
}
|
|
437
553
|
|
|
438
554
|
|
|
@@ -268,6 +268,7 @@ def capture_current_state(
|
|
|
268
268
|
changed: list[str] = []
|
|
269
269
|
baseline_created = previous is None
|
|
270
270
|
unresolved: list[str] = []
|
|
271
|
+
unresolved_reasons: list[dict[str, str]] = []
|
|
271
272
|
if previous:
|
|
272
273
|
old_segments = previous.get("segments") or {}
|
|
273
274
|
for name, segment in fresh["segments"].items():
|
|
@@ -276,13 +277,17 @@ def capture_current_state(
|
|
|
276
277
|
segment["capturedAt"] = old.get("capturedAt", segment["capturedAt"])
|
|
277
278
|
else:
|
|
278
279
|
changed.append(name)
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
280
|
+
# First observation establishes the baseline; it is not evidence that
|
|
281
|
+
# segments changed, nor that they are "unresolved". Segments are only
|
|
282
|
+
# unresolved when they genuinely fail to read/compute (retro §5.6).
|
|
283
|
+
# On first capture, all successfully-captured segments are baseline,
|
|
284
|
+
# not unresolved.
|
|
283
285
|
fresh["baselineCreated"] = baseline_created
|
|
284
286
|
fresh["changedSegments"] = sorted(changed)
|
|
285
287
|
fresh["unresolvedSegments"] = unresolved
|
|
288
|
+
fresh["unresolvedReasons"] = unresolved_reasons
|
|
289
|
+
fresh["comparisonAvailable"] = not baseline_created
|
|
290
|
+
fresh["baselineStatus"] = "created" if baseline_created else "reused"
|
|
286
291
|
write_snapshot(change_dir, fresh)
|
|
287
292
|
return fresh, changed
|
|
288
293
|
|
|
@@ -325,7 +330,10 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
325
330
|
- set(snapshot.get("unresolvedSegments") or [])
|
|
326
331
|
),
|
|
327
332
|
"baselineCreated": bool(snapshot.get("baselineCreated")),
|
|
333
|
+
"baselineStatus": snapshot.get("baselineStatus", "reused"),
|
|
334
|
+
"comparisonAvailable": bool(snapshot.get("comparisonAvailable", True)),
|
|
328
335
|
"unresolvedSegments": list(snapshot.get("unresolvedSegments") or []),
|
|
336
|
+
"unresolvedReasons": list(snapshot.get("unresolvedReasons") or []),
|
|
329
337
|
"git": snapshot["git"],
|
|
330
338
|
}
|
|
331
339
|
if args.json:
|
|
@@ -448,9 +448,18 @@ def _validate_existing_manifest(
|
|
|
448
448
|
tracked_now = _git(
|
|
449
449
|
project, "ls-files", "--error-unmatch", "--", rel
|
|
450
450
|
).returncode == 0
|
|
451
|
-
|
|
451
|
+
checkpointed = not item["trackedBefore"] and tracked_now
|
|
452
|
+
if (
|
|
453
|
+
item["trackedBefore"] != tracked_now and not checkpointed
|
|
454
|
+
) or (
|
|
455
|
+
item["ignored"] != ignored_now and not checkpointed
|
|
456
|
+
):
|
|
452
457
|
return "MANIFEST_INVALID", {}
|
|
453
|
-
|
|
458
|
+
normalized_item = dict(item)
|
|
459
|
+
if checkpointed:
|
|
460
|
+
normalized_item["trackedBefore"] = True
|
|
461
|
+
normalized_item["ignored"] = ignored_now
|
|
462
|
+
validated[rel] = normalized_item
|
|
454
463
|
return None, validated
|
|
455
464
|
|
|
456
465
|
|
|
@@ -734,11 +743,26 @@ def _stage_locked(
|
|
|
734
743
|
error, entries = validator(project_root, manifest, require_files=True)
|
|
735
744
|
if error:
|
|
736
745
|
return _result(False, action, error, [])
|
|
737
|
-
rels = [
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
746
|
+
rels: list[str] = []
|
|
747
|
+
for rel, entry in entries.items():
|
|
748
|
+
if is_v2:
|
|
749
|
+
if entry.get("commitScope") == "current-change":
|
|
750
|
+
rels.append(rel)
|
|
751
|
+
continue
|
|
752
|
+
if not entry["trackedBefore"]:
|
|
753
|
+
rels.append(rel)
|
|
754
|
+
continue
|
|
755
|
+
changed = _git(project_root, "diff", "--quiet", "HEAD", "--", rel)
|
|
756
|
+
if changed.returncode == 1:
|
|
757
|
+
rels.append(rel)
|
|
758
|
+
elif changed.returncode != 0:
|
|
759
|
+
return _result(
|
|
760
|
+
False,
|
|
761
|
+
action,
|
|
762
|
+
"GIT_DIFF_FAILED",
|
|
763
|
+
[rel],
|
|
764
|
+
error=changed.stderr.strip(),
|
|
765
|
+
)
|
|
742
766
|
if not rels:
|
|
743
767
|
return _result(True, action, "STAGED", [])
|
|
744
768
|
|
|
@@ -925,9 +949,22 @@ def close(project: Path | str, change_dir: Path | str) -> dict[str, Any]:
|
|
|
925
949
|
if (
|
|
926
950
|
not isinstance(snapshot, dict)
|
|
927
951
|
or snapshot.get("schemaVersion") != SCHEMA_VERSION
|
|
928
|
-
or snapshot.get("projectRoot") != str(project_root)
|
|
929
952
|
):
|
|
930
953
|
return _result(False, action, "SNAPSHOT_INVALID", [])
|
|
954
|
+
# Execution-root contract (retro §5.10): a snapshot captured against a
|
|
955
|
+
# different project root must fail with EXECUTION_ROOT_MISMATCH before
|
|
956
|
+
# the generic SNAPSHOT_INVALID, so callers can distinguish "wrong root"
|
|
957
|
+
# from "corrupt snapshot".
|
|
958
|
+
snapshot_root = snapshot.get("projectRoot")
|
|
959
|
+
if snapshot_root is not None and snapshot_root != str(project_root):
|
|
960
|
+
return _result(
|
|
961
|
+
False,
|
|
962
|
+
action,
|
|
963
|
+
"EXECUTION_ROOT_MISMATCH",
|
|
964
|
+
[],
|
|
965
|
+
expectedRoot=snapshot_root,
|
|
966
|
+
actualRoot=str(project_root),
|
|
967
|
+
)
|
|
931
968
|
|
|
932
969
|
before_entries = snapshot.get("files")
|
|
933
970
|
if not isinstance(before_entries, list):
|
|
@@ -963,15 +1000,51 @@ def close(project: Path | str, change_dir: Path | str) -> dict[str, Any]:
|
|
|
963
1000
|
if before[rel]["sha256"] != digest:
|
|
964
1001
|
touched.append((rel, "test-updated"))
|
|
965
1002
|
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
1003
|
+
for reason in ("tdd-created", "test-updated"):
|
|
1004
|
+
rels = [rel for rel, item_reason in touched if item_reason == reason]
|
|
1005
|
+
if not rels:
|
|
1006
|
+
continue
|
|
1007
|
+
result = record(
|
|
1008
|
+
project_root,
|
|
1009
|
+
change_root,
|
|
1010
|
+
[str(project_root / rel) for rel in rels],
|
|
1011
|
+
reason,
|
|
1012
|
+
)
|
|
969
1013
|
if not result.get("ok"):
|
|
970
1014
|
code = result.get("code", "RECORD_FAILED")
|
|
971
1015
|
if code == "TEST_PATH_NOT_ALLOWED":
|
|
972
|
-
return _result(False, action, "UNCLASSIFIABLE_TEST",
|
|
1016
|
+
return _result(False, action, "UNCLASSIFIABLE_TEST", rels)
|
|
973
1017
|
return result
|
|
974
|
-
|
|
1018
|
+
|
|
1019
|
+
recorded = [rel for rel, _ in touched]
|
|
1020
|
+
|
|
1021
|
+
# Cross-check (retro §5.10): if the manifest has active entries for this
|
|
1022
|
+
# change but close computed recordedCount=0, the snapshot/manifest/diff
|
|
1023
|
+
# are inconsistent. Fail closed instead of silently returning success.
|
|
1024
|
+
manifest_path = _manifest_path(change_root)
|
|
1025
|
+
if manifest_path is not None and manifest_path.is_file():
|
|
1026
|
+
try:
|
|
1027
|
+
manifest = _read_json(manifest_path)
|
|
1028
|
+
except (OSError, json.JSONDecodeError):
|
|
1029
|
+
manifest = None
|
|
1030
|
+
if isinstance(manifest, dict):
|
|
1031
|
+
manifest_files = manifest.get("files")
|
|
1032
|
+
if isinstance(manifest_files, list):
|
|
1033
|
+
active_entries = [
|
|
1034
|
+
f for f in manifest_files
|
|
1035
|
+
if isinstance(f, dict)
|
|
1036
|
+
and f.get("reason") in ("tdd-created", "test-updated", "stale-test-repair")
|
|
1037
|
+
]
|
|
1038
|
+
if active_entries and not recorded:
|
|
1039
|
+
return _result(
|
|
1040
|
+
False,
|
|
1041
|
+
action,
|
|
1042
|
+
"MANIFEST_DIFF_HASH_MISMATCH",
|
|
1043
|
+
[],
|
|
1044
|
+
manifestEntries=len(active_entries),
|
|
1045
|
+
recordedCount=0,
|
|
1046
|
+
detail="manifest has active entries but close computed 0 recorded tests",
|
|
1047
|
+
)
|
|
975
1048
|
|
|
976
1049
|
return _result(
|
|
977
1050
|
True,
|
|
@@ -3,7 +3,7 @@ name: harness-archive
|
|
|
3
3
|
description: 归档所有变更产出(计划/测试报告/审查/SQL/API文档)到
|
|
4
4
|
.harness/archive/,含归档元数据和可视化最终总结。使用场景:归档、完成归档、收尾、打包产出物
|
|
5
5
|
---
|
|
6
|
-
<!-- generated by harness_deploy.py; core=
|
|
6
|
+
<!-- generated by harness_deploy.py; core=6232f66fbf691292; overlay=none; agent=codebuddy; do not edit -->
|
|
7
7
|
# harness-archive — 变更归档
|
|
8
8
|
|
|
9
9
|
## Purpose
|
|
@@ -3,7 +3,7 @@ name: harness-codebase-map
|
|
|
3
3
|
description: 分析现有代码库并生成 .harness/codebase/map/
|
|
4
4
|
下的结构化代码库地图。用于陌生项目理解、重大改造前梳理、harness-sync 提示 map 过期后的人工刷新。
|
|
5
5
|
---
|
|
6
|
-
<!-- generated by harness_deploy.py; core=
|
|
6
|
+
<!-- generated by harness_deploy.py; core=6232f66fbf691292; overlay=none; agent=codebuddy; do not edit -->
|
|
7
7
|
# harness-codebase-map — 代码库地图
|
|
8
8
|
|
|
9
9
|
## Purpose
|
|
@@ -3,7 +3,7 @@ name: harness-knowledge-ingest
|
|
|
3
3
|
description: 从 .harness/archive 归档整理、同步和维护项目知识索引。适用场景:ingest knowledge、sync
|
|
4
4
|
knowledge、rebuild knowledge index、promote knowledge、确认知识条目、检查知识库是否过期。
|
|
5
5
|
---
|
|
6
|
-
<!-- generated by harness_deploy.py; core=
|
|
6
|
+
<!-- generated by harness_deploy.py; core=6232f66fbf691292; overlay=none; agent=codebuddy; do not edit -->
|
|
7
7
|
# harness-knowledge-ingest
|
|
8
8
|
|
|
9
9
|
从 `.harness/archive/**/reports/final/summary-data.json` 抽取项目知识,生成并维护本地 `.harness/knowledge/` 索引。
|
|
@@ -3,7 +3,7 @@ name: harness-knowledge-query
|
|
|
3
3
|
description: 根据新需求、设计任务、代码修改请求或问题排查,在规划和编码前查询 .harness/knowledge
|
|
4
4
|
历史上下文。适用场景:query knowledge、查找历史需求、根据归档理解需求、继续之前类似开发、生成需求上下文包。
|
|
5
5
|
---
|
|
6
|
-
<!-- generated by harness_deploy.py; core=
|
|
6
|
+
<!-- generated by harness_deploy.py; core=6232f66fbf691292; overlay=none; agent=codebuddy; do not edit -->
|
|
7
7
|
# harness-knowledge-query
|
|
8
8
|
|
|
9
9
|
并行 change 中查询必须传 `--change <change-id>`;成功后以该 change 的 `meta/knowledge-context.json` 为稳定指针。全局 `context-packs/latest.json` 仅向后兼容,不得用于判断多个 active change 的上下文归属。
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: harness-plan
|
|
3
3
|
description: 将需求转化为设计文档+实施计划+完整测试场景表,必须在编码前完成。使用场景:需求分析、feature plan、技术方案设计、实现方案规划
|
|
4
4
|
---
|
|
5
|
-
<!-- generated by harness_deploy.py; core=
|
|
5
|
+
<!-- generated by harness_deploy.py; core=6232f66fbf691292; overlay=none; agent=codebuddy; do not edit -->
|
|
6
6
|
# harness-plan — 需求规划
|
|
7
7
|
|
|
8
8
|
## Purpose
|
|
@@ -3,7 +3,7 @@ name: harness-review
|
|
|
3
3
|
description: 6维度代码审查(架构/安全/规范/兼容/测试/性能),对照项目规则(见
|
|
4
4
|
.harness/context-index.json)和测试场景表,在隔离上下文运行。使用场景:代码审查、提交前检查、合并评审
|
|
5
5
|
---
|
|
6
|
-
<!-- generated by harness_deploy.py; core=
|
|
6
|
+
<!-- generated by harness_deploy.py; core=6232f66fbf691292; overlay=none; agent=codebuddy; do not edit -->
|
|
7
7
|
# harness-review — 代码审查
|
|
8
8
|
|
|
9
9
|
## Purpose
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: harness-run
|
|
3
3
|
description: 按变更簇执行 TDD 编码循环(RED→GREEN→REFACTOR→编译验证),逐变更簇实现计划中的任务。使用场景:开始编码、实现功能、写代码、TDD 编码
|
|
4
4
|
---
|
|
5
|
-
<!-- generated by harness_deploy.py; core=
|
|
5
|
+
<!-- generated by harness_deploy.py; core=6232f66fbf691292; overlay=none; agent=codebuddy; do not edit -->
|
|
6
6
|
# harness-run — 需求编码
|
|
7
7
|
|
|
8
8
|
## Purpose
|
|
@@ -52,7 +52,7 @@ requested=true + path missing
|
|
|
52
52
|
先执行 runtime doctor,并从 `meta/runtime.json` 读取 adapter 的 `path`、`branch` 以及 PowerShell `argvPrefix`;不要依赖裸 `python`/`powershell.exe`,也不要硬编码 Claude 路径。
|
|
53
53
|
|
|
54
54
|
```powershell
|
|
55
|
-
& <powershell-argv-prefix> -Command "git worktree add
|
|
55
|
+
& <powershell-argv-prefix> -Command "git worktree add -b '<adapter-branch>' -- '<adapter-worktree-path>'"
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
如果分支已存在:
|
|
@@ -61,6 +61,8 @@ requested=true + path missing
|
|
|
61
61
|
& <powershell-argv-prefix> -Command "git worktree add -- '<adapter-worktree-path>' '<adapter-branch>'"
|
|
62
62
|
```
|
|
63
63
|
|
|
64
|
+
> ⚠️ **argv 顺序**(复盘 §5.11):`-b <branch>` 必须在 `--` 之前;`git worktree add -- <path> -b <branch>` 中 `--` 后的 `-b` 会被 Git 视为位置参数,命令直接失败。等价 argv 数组:`["git","worktree","add","-b",branch,"--",path]`。
|
|
65
|
+
|
|
64
66
|
验证:
|
|
65
67
|
|
|
66
68
|
```powershell
|
|
@@ -3,7 +3,7 @@ name: harness-submit
|
|
|
3
3
|
description: 最终提交封装:验证→中文 commit→提交/推送;worktree 模式含 --no-ff
|
|
4
4
|
合并回主分支。使用场景:提交代码、commit、push、合并分支、merge to main、完成开发
|
|
5
5
|
---
|
|
6
|
-
<!-- generated by harness_deploy.py; core=
|
|
6
|
+
<!-- generated by harness_deploy.py; core=6232f66fbf691292; overlay=none; agent=codebuddy; do not edit -->
|
|
7
7
|
# harness-submit — 最终提交(含 worktree 合并)
|
|
8
8
|
|
|
9
9
|
## Purpose
|
|
@@ -106,7 +106,7 @@ commit+push / 仅本地 commit / 取消;**不调用 Superpowers 呈现 PR/丢
|
|
|
106
106
|
|
|
107
107
|
见 `checklist.md` 与 `../protocols/ledger-protocol.md`、`../protocols/submit-protocol.md`。
|
|
108
108
|
|
|
109
|
-
test-tracking manifest 是 ignored test 的唯一强制暂存授权:只允许 `harness_test_guard.py stage` 暂存 manifest
|
|
109
|
+
test-tracking manifest 是 ignored test 的唯一强制暂存授权:只允许 `harness_test_guard.py stage` 暂存 manifest 中已校验且相对 `HEAD` 仍有差异的路径,禁止 `git add -f .`、目录级 `git add -f` 或全局修改 `.gitignore`。worktree commit 前须确认 guard 返回的 `files` 全部进入 cached diff;manifest 中已由 `HEAD` 跟踪且未变化的历史条目允许保留而不进入本次 cached diff。合并回主分支后、删除 worktree 前仍须确认 manifest 路径已由目标 commit 跟踪,否则停止清理。
|
|
110
110
|
|
|
111
111
|
### 四、worktree 合并硬规则
|
|
112
112
|
|
|
@@ -119,7 +119,7 @@ python <skills-root>/scripts/harness_ledger.py can-reuse `
|
|
|
119
119
|
|
|
120
120
|
- [ ] 检查 `.harness/changes/<change-name>/evidence/test-tracking.json` 是否存在
|
|
121
121
|
- [ ] 存在时先执行 `python <skills-root>/scripts/harness_test_guard.py stage --project . --change-dir ".harness/changes/<change-name>" --json`;任一 manifest/path/hash/index 校验失败立即停止
|
|
122
|
-
- [ ] 用 `git diff --cached --name-only` 验证
|
|
122
|
+
- [ ] 用 `git diff --cached --name-only` 验证 guard 响应 `files` 中的每个精确路径均已暂存,且没有 guard 引入的额外路径;manifest 中已由 `HEAD` 跟踪且未变化的历史条目无需进入本次 cached diff
|
|
123
123
|
- [ ] 无 manifest 时禁止使用 `git add -f`;有 manifest 时也只允许 guard 内部的 exact force-add,**禁止全局 force-add**、目录级 force-add 和全局修改 `.gitignore`
|
|
124
124
|
|
|
125
125
|
提交前**强制检查 `.gitignore`** 是否包含 `.harness/`:
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: harness-sync
|
|
3
3
|
description: 检查并更新项目AI元数据(CodeGraph索引、harness-codebase-map分析、CLAUDE.md、AGENTS.md、.harness/完整性),确保Claude对代码库的理解与最新代码一致。当用户说'同步/更新索引/刷新元数据/检查一致性'时使用
|
|
4
4
|
---
|
|
5
|
-
<!-- generated by harness_deploy.py; core=
|
|
5
|
+
<!-- generated by harness_deploy.py; core=6232f66fbf691292; overlay=none; agent=codebuddy; do not edit -->
|
|
6
6
|
# harness-sync — 元数据同步
|
|
7
7
|
|
|
8
8
|
## Purpose
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: harness-test
|
|
3
3
|
description: 测试执行:读取场景表,执行单元测试+API接口测试+数据兼容验证,输出测试报告。当用户说'跑测试/验证/跑用例/接口测试/单元测试'时使用
|
|
4
4
|
---
|
|
5
|
-
<!-- generated by harness_deploy.py; core=
|
|
5
|
+
<!-- generated by harness_deploy.py; core=6232f66fbf691292; overlay=none; agent=codebuddy; do not edit -->
|
|
6
6
|
# harness-test — 测试执行
|
|
7
7
|
|
|
8
8
|
## Purpose
|