@hunter-harness/workflow-harness 0.2.14 → 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 +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 +80 -0
- package/harness/bundles/general/claude-code/scripts/harness_change.py +256 -16
- package/harness/bundles/general/claude-code/scripts/harness_events.py +14 -0
- package/harness/bundles/general/claude-code/scripts/harness_integration.py +64 -7
- package/harness/bundles/general/claude-code/scripts/harness_plan_finalize.py +85 -0
- package/harness/bundles/general/claude-code/scripts/harness_preflight.py +146 -77
- package/harness/bundles/general/claude-code/scripts/harness_state.py +12 -4
- 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 +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 +80 -0
- package/harness/bundles/general/codebuddy/scripts/harness_change.py +256 -16
- package/harness/bundles/general/codebuddy/scripts/harness_events.py +14 -0
- package/harness/bundles/general/codebuddy/scripts/harness_integration.py +64 -7
- package/harness/bundles/general/codebuddy/scripts/harness_plan_finalize.py +85 -0
- package/harness/bundles/general/codebuddy/scripts/harness_preflight.py +146 -77
- package/harness/bundles/general/codebuddy/scripts/harness_state.py +12 -4
- 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 +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 +80 -0
- package/harness/bundles/general/codex/scripts/harness_change.py +256 -16
- package/harness/bundles/general/codex/scripts/harness_events.py +14 -0
- package/harness/bundles/general/codex/scripts/harness_integration.py +64 -7
- package/harness/bundles/general/codex/scripts/harness_plan_finalize.py +85 -0
- package/harness/bundles/general/codex/scripts/harness_preflight.py +146 -77
- package/harness/bundles/general/codex/scripts/harness_state.py +12 -4
- 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 +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 +80 -0
- package/harness/bundles/general/cursor/scripts/harness_change.py +256 -16
- package/harness/bundles/general/cursor/scripts/harness_events.py +14 -0
- package/harness/bundles/general/cursor/scripts/harness_integration.py +64 -7
- package/harness/bundles/general/cursor/scripts/harness_plan_finalize.py +85 -0
- package/harness/bundles/general/cursor/scripts/harness_preflight.py +146 -77
- package/harness/bundles/general/cursor/scripts/harness_state.py +12 -4
- 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 +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 +80 -0
- package/harness/bundles/java/claude-code/scripts/harness_change.py +256 -16
- package/harness/bundles/java/claude-code/scripts/harness_events.py +14 -0
- package/harness/bundles/java/claude-code/scripts/harness_integration.py +64 -7
- package/harness/bundles/java/claude-code/scripts/harness_plan_finalize.py +85 -0
- package/harness/bundles/java/claude-code/scripts/harness_preflight.py +146 -77
- package/harness/bundles/java/claude-code/scripts/harness_state.py +12 -4
- 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 +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 +80 -0
- package/harness/bundles/java/codebuddy/scripts/harness_change.py +256 -16
- package/harness/bundles/java/codebuddy/scripts/harness_events.py +14 -0
- package/harness/bundles/java/codebuddy/scripts/harness_integration.py +64 -7
- package/harness/bundles/java/codebuddy/scripts/harness_plan_finalize.py +85 -0
- package/harness/bundles/java/codebuddy/scripts/harness_preflight.py +146 -77
- package/harness/bundles/java/codebuddy/scripts/harness_state.py +12 -4
- 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 +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 +80 -0
- package/harness/bundles/java/codex/scripts/harness_change.py +256 -16
- package/harness/bundles/java/codex/scripts/harness_events.py +14 -0
- package/harness/bundles/java/codex/scripts/harness_integration.py +64 -7
- package/harness/bundles/java/codex/scripts/harness_plan_finalize.py +85 -0
- package/harness/bundles/java/codex/scripts/harness_preflight.py +146 -77
- package/harness/bundles/java/codex/scripts/harness_state.py +12 -4
- 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 +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 +80 -0
- package/harness/bundles/java/cursor/scripts/harness_change.py +256 -16
- package/harness/bundles/java/cursor/scripts/harness_events.py +14 -0
- package/harness/bundles/java/cursor/scripts/harness_integration.py +64 -7
- package/harness/bundles/java/cursor/scripts/harness_plan_finalize.py +85 -0
- package/harness/bundles/java/cursor/scripts/harness_preflight.py +146 -77
- package/harness/bundles/java/cursor/scripts/harness_state.py +12 -4
- package/harness/manifests/general/claude-code.json +19 -19
- package/harness/manifests/general/codebuddy.json +19 -19
- package/harness/manifests/general/codex.json +19 -19
- package/harness/manifests/general/cursor.json +19 -19
- package/harness/manifests/java/claude-code.json +20 -20
- package/harness/manifests/java/codebuddy.json +20 -20
- package/harness/manifests/java/codex.json +20 -20
- package/harness/manifests/java/cursor.json +20 -20
- package/hunter-workflow-family.json +1 -1
- package/package.json +1 -1
|
@@ -367,10 +367,41 @@ def _resolve_agents_root(skills_root: Path, agents_root: Path | None) -> tuple[P
|
|
|
367
367
|
if skills_root.name == "skills" and skills_root.parent.name in (".claude", ".codebuddy"):
|
|
368
368
|
return (skills_root.parent / "agents").resolve(), None
|
|
369
369
|
if skills_root.name == "skills" and skills_root.parent.name in (".agents", ".cursor"):
|
|
370
|
-
|
|
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
|
|
371
374
|
return (skills_root / "agents").resolve(), None
|
|
372
375
|
|
|
373
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
|
+
|
|
374
405
|
def cmd_check_agents(
|
|
375
406
|
skills_root: Path,
|
|
376
407
|
agent: str,
|
|
@@ -388,98 +419,136 @@ def cmd_check_agents(
|
|
|
388
419
|
"reason": "agent name is empty",
|
|
389
420
|
}
|
|
390
421
|
|
|
391
|
-
resolved_agents_root,
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
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
|
+
}
|
|
410
466
|
return {
|
|
411
467
|
"ok": False,
|
|
412
468
|
"action": "check-agents",
|
|
413
469
|
"agent": agent_name,
|
|
414
|
-
"path": str(agent_path),
|
|
415
|
-
"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,
|
|
416
472
|
"usable": False,
|
|
417
|
-
"
|
|
418
|
-
"
|
|
473
|
+
"definitionPresent": False,
|
|
474
|
+
"hostCallable": False,
|
|
475
|
+
"toolContractValid": False,
|
|
419
476
|
"reasonCode": "AGENT_DEFINITION_NOT_FOUND",
|
|
420
|
-
"reason": f"agent file not found: {
|
|
477
|
+
"reason": f"agent file not found and host does not declare role: {agent_name}",
|
|
421
478
|
}
|
|
422
479
|
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
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
|
|
434
518
|
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
"agent": agent_name,
|
|
441
|
-
"path": str(agent_path),
|
|
442
|
-
"usable": False,
|
|
443
|
-
"reason": f"frontmatter parse failed: {err or 'unknown'}",
|
|
444
|
-
}
|
|
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
|
+
)
|
|
445
524
|
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
"path": str(agent_path),
|
|
453
|
-
"usable": False,
|
|
454
|
-
"reason": "tools declaration missing",
|
|
455
|
-
"frontmatter": meta,
|
|
456
|
-
}
|
|
457
|
-
if not isinstance(tools, list) or len(tools) == 0:
|
|
458
|
-
return {
|
|
459
|
-
"ok": False,
|
|
460
|
-
"action": "check-agents",
|
|
461
|
-
"agent": agent_name,
|
|
462
|
-
"path": str(agent_path),
|
|
463
|
-
"usable": False,
|
|
464
|
-
"reason": "tools declaration empty or invalid",
|
|
465
|
-
"frontmatter": meta,
|
|
466
|
-
}
|
|
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"
|
|
467
531
|
|
|
468
|
-
name_field = meta.get("name")
|
|
469
532
|
return {
|
|
470
533
|
"ok": True,
|
|
471
534
|
"action": "check-agents",
|
|
472
535
|
"agent": agent_name,
|
|
473
|
-
"path": str(agent_path),
|
|
474
|
-
"agentsRoot": str(resolved_agents_root),
|
|
475
|
-
"usable":
|
|
476
|
-
"
|
|
477
|
-
"
|
|
478
|
-
"
|
|
479
|
-
"
|
|
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
|
+
),
|
|
480
549
|
"name": name_field,
|
|
481
|
-
"tools":
|
|
482
|
-
"frontmatterKeys": sorted(meta.keys()),
|
|
550
|
+
"tools": tools_field,
|
|
551
|
+
"frontmatterKeys": sorted(meta.keys()) if meta else [],
|
|
483
552
|
}
|
|
484
553
|
|
|
485
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:
|
|
@@ -20,7 +20,7 @@ disallowed-tools:
|
|
|
20
20
|
- Bash(awk *)
|
|
21
21
|
- Bash(curl *)
|
|
22
22
|
---
|
|
23
|
-
<!-- generated by harness_deploy.py; core=
|
|
23
|
+
<!-- generated by harness_deploy.py; core=0e12e18a8a2b6489; overlay=java; agent=claude-code; do not edit -->
|
|
24
24
|
# harness-apidoc — 前端接口文档(Java overlay)
|
|
25
25
|
|
|
26
26
|
## Purpose
|
|
@@ -20,7 +20,7 @@ disallowed-tools:
|
|
|
20
20
|
- Bash(awk *)
|
|
21
21
|
- Bash(curl *)
|
|
22
22
|
---
|
|
23
|
-
<!-- generated by harness_deploy.py; core=
|
|
23
|
+
<!-- generated by harness_deploy.py; core=0e12e18a8a2b6489; overlay=java; agent=claude-code; do not edit -->
|
|
24
24
|
# harness-archive — 变更归档
|
|
25
25
|
|
|
26
26
|
## Purpose
|
|
@@ -20,7 +20,7 @@ disallowed-tools:
|
|
|
20
20
|
- Bash(awk *)
|
|
21
21
|
- Bash(curl *)
|
|
22
22
|
---
|
|
23
|
-
<!-- generated by harness_deploy.py; core=
|
|
23
|
+
<!-- generated by harness_deploy.py; core=0e12e18a8a2b6489; overlay=java; agent=claude-code; do not edit -->
|
|
24
24
|
# harness-codebase-map — 代码库地图
|
|
25
25
|
|
|
26
26
|
## Purpose
|
|
@@ -20,7 +20,7 @@ disallowed-tools:
|
|
|
20
20
|
- Bash(awk *)
|
|
21
21
|
- Bash(curl *)
|
|
22
22
|
---
|
|
23
|
-
<!-- generated by harness_deploy.py; core=
|
|
23
|
+
<!-- generated by harness_deploy.py; core=0e12e18a8a2b6489; overlay=java; agent=claude-code; do not edit -->
|
|
24
24
|
# harness-knowledge-ingest
|
|
25
25
|
|
|
26
26
|
从 `.harness/archive/**/reports/final/summary-data.json` 抽取项目知识,生成并维护本地 `.harness/knowledge/` 索引。
|
|
@@ -20,7 +20,7 @@ disallowed-tools:
|
|
|
20
20
|
- Bash(awk *)
|
|
21
21
|
- Bash(curl *)
|
|
22
22
|
---
|
|
23
|
-
<!-- generated by harness_deploy.py; core=
|
|
23
|
+
<!-- generated by harness_deploy.py; core=0e12e18a8a2b6489; overlay=java; agent=claude-code; do not edit -->
|
|
24
24
|
# harness-knowledge-query
|
|
25
25
|
|
|
26
26
|
并行 change 中查询必须传 `--change <change-id>`;成功后以该 change 的 `meta/knowledge-context.json` 为稳定指针。全局 `context-packs/latest.json` 仅向后兼容,不得用于判断多个 active change 的上下文归属。
|
|
@@ -20,7 +20,7 @@ disallowed-tools:
|
|
|
20
20
|
- Bash(awk *)
|
|
21
21
|
- Bash(curl *)
|
|
22
22
|
---
|
|
23
|
-
<!-- generated by harness_deploy.py; core=
|
|
23
|
+
<!-- generated by harness_deploy.py; core=0e12e18a8a2b6489; overlay=java; agent=claude-code; do not edit -->
|
|
24
24
|
# harness-package — 增量模块打包(Java overlay)
|
|
25
25
|
|
|
26
26
|
## Purpose
|
|
@@ -20,7 +20,7 @@ disallowed-tools:
|
|
|
20
20
|
- Bash(awk *)
|
|
21
21
|
- Bash(curl *)
|
|
22
22
|
---
|
|
23
|
-
<!-- generated by harness_deploy.py; core=
|
|
23
|
+
<!-- generated by harness_deploy.py; core=0e12e18a8a2b6489; overlay=java; agent=claude-code; do not edit -->
|
|
24
24
|
# harness-plan — 需求规划
|
|
25
25
|
|
|
26
26
|
## Purpose
|
|
@@ -21,7 +21,7 @@ disallowed-tools:
|
|
|
21
21
|
- Bash(curl *)
|
|
22
22
|
- Bash(codegraph *)
|
|
23
23
|
---
|
|
24
|
-
<!-- generated by harness_deploy.py; core=
|
|
24
|
+
<!-- generated by harness_deploy.py; core=0e12e18a8a2b6489; overlay=java; agent=claude-code; do not edit -->
|
|
25
25
|
# harness-review — 代码审查
|
|
26
26
|
|
|
27
27
|
## Purpose
|
|
@@ -21,7 +21,7 @@ disallowed-tools:
|
|
|
21
21
|
- Bash(curl *)
|
|
22
22
|
- Bash(codegraph *)
|
|
23
23
|
---
|
|
24
|
-
<!-- generated by harness_deploy.py; core=
|
|
24
|
+
<!-- generated by harness_deploy.py; core=0e12e18a8a2b6489; overlay=java; agent=claude-code; do not edit -->
|
|
25
25
|
# harness-run — 需求编码
|
|
26
26
|
|
|
27
27
|
## Purpose
|
|
@@ -20,7 +20,7 @@ disallowed-tools:
|
|
|
20
20
|
- Bash(awk *)
|
|
21
21
|
- Bash(curl *)
|
|
22
22
|
---
|
|
23
|
-
<!-- generated by harness_deploy.py; core=
|
|
23
|
+
<!-- generated by harness_deploy.py; core=0e12e18a8a2b6489; overlay=java; agent=claude-code; do not edit -->
|
|
24
24
|
# harness-submit — 最终提交(含 worktree 合并)
|
|
25
25
|
|
|
26
26
|
## Purpose
|
|
@@ -19,7 +19,7 @@ disallowed-tools:
|
|
|
19
19
|
- Bash(awk *)
|
|
20
20
|
- Bash(curl *)
|
|
21
21
|
---
|
|
22
|
-
<!-- generated by harness_deploy.py; core=
|
|
22
|
+
<!-- generated by harness_deploy.py; core=0e12e18a8a2b6489; overlay=java; agent=claude-code; do not edit -->
|
|
23
23
|
# harness-sync — 元数据同步
|
|
24
24
|
|
|
25
25
|
## Purpose
|
|
@@ -22,7 +22,7 @@ disallowed-tools:
|
|
|
22
22
|
- Bash(node *)
|
|
23
23
|
- Bash(codegraph *)
|
|
24
24
|
---
|
|
25
|
-
<!-- generated by harness_deploy.py; core=
|
|
25
|
+
<!-- generated by harness_deploy.py; core=0e12e18a8a2b6489; overlay=java; agent=claude-code; do not edit -->
|
|
26
26
|
# harness-test — 测试执行
|
|
27
27
|
|
|
28
28
|
## Purpose
|
|
@@ -683,6 +683,34 @@ def check_status(
|
|
|
683
683
|
else:
|
|
684
684
|
blockers.append(tier_issue)
|
|
685
685
|
|
|
686
|
+
# --- artifact preflight (retro §5.31) ---
|
|
687
|
+
# Classify artifact events before destructive finalize: informational (OK),
|
|
688
|
+
# canonicalizable (same-change repo-relative path, warning), or blocking
|
|
689
|
+
# (cross-change/absolute/escaping path, fail closed).
|
|
690
|
+
try:
|
|
691
|
+
preflight = artifact_preflight(change_dir)
|
|
692
|
+
except Exception as exc: # noqa: BLE001 — preflight must not crash status
|
|
693
|
+
preflight = {"ok": False, "items": [], "blocking": [], "error": str(exc)}
|
|
694
|
+
checks["artifact_preflight"] = preflight
|
|
695
|
+
for item in preflight.get("blocking") or []:
|
|
696
|
+
blockers.append({
|
|
697
|
+
"code": "artifact-path-blocking",
|
|
698
|
+
"message": (
|
|
699
|
+
f"artifact event {item.get('eventId', '')} path "
|
|
700
|
+
f"{item.get('path', '')}: {item.get('reason', 'blocking')}"
|
|
701
|
+
),
|
|
702
|
+
})
|
|
703
|
+
for item in preflight.get("items") or []:
|
|
704
|
+
if item.get("category") == "canonicalizable":
|
|
705
|
+
warnings.append({
|
|
706
|
+
"code": "artifact-path-canonicalizable",
|
|
707
|
+
"message": (
|
|
708
|
+
f"artifact event {item.get('eventId', '')} path "
|
|
709
|
+
f"{item.get('path', '')} is repo-relative; "
|
|
710
|
+
f"canonical={item.get('canonicalPath', '')}"
|
|
711
|
+
),
|
|
712
|
+
})
|
|
713
|
+
|
|
686
714
|
archivable = len(blockers) == 0
|
|
687
715
|
return {
|
|
688
716
|
"ok": True,
|
|
@@ -3231,6 +3259,36 @@ def cmd_finalize(
|
|
|
3231
3259
|
note="review missing on full tier (allowed by user)",
|
|
3232
3260
|
)
|
|
3233
3261
|
|
|
3262
|
+
# --- 2c. artifact preflight (retro §5.31) ---
|
|
3263
|
+
# Classify artifact events before freeze: blocking paths must fail closed
|
|
3264
|
+
# before the staged operation commits a phase.end.
|
|
3265
|
+
try:
|
|
3266
|
+
preflight = artifact_preflight(work_dir)
|
|
3267
|
+
except Exception as exc: # noqa: BLE001 — preflight must not crash finalize
|
|
3268
|
+
preflight = {"ok": False, "items": [], "blocking": [], "error": str(exc)}
|
|
3269
|
+
payload["steps"]["artifact_preflight"] = {
|
|
3270
|
+
"ok": bool(preflight.get("ok")),
|
|
3271
|
+
"blockingCount": len(preflight.get("blocking") or []),
|
|
3272
|
+
"itemsCount": len(preflight.get("items") or []),
|
|
3273
|
+
}
|
|
3274
|
+
if preflight.get("blocking"):
|
|
3275
|
+
payload["error"] = (
|
|
3276
|
+
f"artifact preflight blocking: "
|
|
3277
|
+
f"{len(preflight['blocking'])} path(s) cannot be archived"
|
|
3278
|
+
)
|
|
3279
|
+
payload["issues"] = [
|
|
3280
|
+
{
|
|
3281
|
+
"code": "ARTIFACT_PATH_BLOCKING",
|
|
3282
|
+
"severity": "error",
|
|
3283
|
+
"message": f"{item.get('path', '')}: {item.get('reason', 'blocking')}",
|
|
3284
|
+
}
|
|
3285
|
+
for item in preflight["blocking"]
|
|
3286
|
+
]
|
|
3287
|
+
_restore_finalize_failure()
|
|
3288
|
+
payload["warnings"] = warnings
|
|
3289
|
+
payload["ok"] = False
|
|
3290
|
+
return 1, payload
|
|
3291
|
+
|
|
3234
3292
|
# --- 3. candidate phase.end + freeze cutoff (RET-19 freeze-first) ---
|
|
3235
3293
|
# This terminal exists only inside the isolated operation staging tree. It
|
|
3236
3294
|
# becomes authoritative atomically at publish; validation failure discards
|
|
@@ -3293,6 +3351,28 @@ def cmd_finalize(
|
|
|
3293
3351
|
payload["ok"] = False
|
|
3294
3352
|
return 1, payload
|
|
3295
3353
|
|
|
3354
|
+
# --- 5b. report adequacy (retro §5.32) ---
|
|
3355
|
+
# Validate that the summary is factually complete: no diff=0 with non-empty
|
|
3356
|
+
# commit, no missing typed metrics despite test reports, no stageStatus
|
|
3357
|
+
# contradictions. Fail closed rather than archiving an incomplete summary.
|
|
3358
|
+
adequacy_result = validate_report_adequacy(summary)
|
|
3359
|
+
payload["steps"]["report_adequacy"] = adequacy_result
|
|
3360
|
+
summary.setdefault("reportPipeline", {})["reportAdequacy"] = {
|
|
3361
|
+
"ok": bool(adequacy_result.get("ok")),
|
|
3362
|
+
"issues": adequacy_result.get("issues") or [],
|
|
3363
|
+
}
|
|
3364
|
+
try:
|
|
3365
|
+
write_json(summary_path, summary)
|
|
3366
|
+
except OSError as exc:
|
|
3367
|
+
warnings.append(f"could not write reportAdequacy: {exc}")
|
|
3368
|
+
if not adequacy_result.get("ok"):
|
|
3369
|
+
payload["issues"] = adequacy_result.get("issues") or []
|
|
3370
|
+
payload["error"] = "report adequacy failed; staged operation discarded"
|
|
3371
|
+
_restore_finalize_failure()
|
|
3372
|
+
payload["warnings"] = warnings
|
|
3373
|
+
payload["ok"] = False
|
|
3374
|
+
return 1, payload
|
|
3375
|
+
|
|
3296
3376
|
# --- 6. render (Node, else Python fallback) ---
|
|
3297
3377
|
render_result = render_final_summary(work_dir, summary_path)
|
|
3298
3378
|
payload["steps"]["render"] = render_result
|