coding-agent-harness 1.0.4 → 1.0.6
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/CHANGELOG.md +7 -0
- package/CONTRIBUTING.md +2 -2
- package/LICENSE +661 -21
- package/LICENSE-EXCEPTION.md +37 -0
- package/README.md +96 -4
- package/README.zh-CN.md +75 -4
- package/SKILL.md +52 -51
- package/dist/build-dist.mjs +189 -0
- package/dist/check-dist-observation.mjs +428 -0
- package/dist/check-harness.mjs +489 -0
- package/dist/check-import-graph.mjs +511 -0
- package/dist/check-runtime-emit.mjs +304 -0
- package/dist/check-type-boundaries.mjs +139 -0
- package/dist/commands/dashboard-command.mjs +80 -0
- package/dist/commands/migration-command.mjs +152 -0
- package/dist/commands/preset-command.mjs +91 -0
- package/dist/commands/task-command.mjs +324 -0
- package/dist/harness.mjs +304 -0
- package/dist/lib/capability-registry.mjs +643 -0
- package/dist/lib/check-module-parallel.mjs +227 -0
- package/dist/lib/check-profiles.mjs +414 -0
- package/dist/lib/check-task-contracts.mjs +54 -0
- package/dist/lib/core-shared.mjs +254 -0
- package/dist/lib/dashboard-data.mjs +608 -0
- package/dist/lib/dashboard-workbench.mjs +334 -0
- package/dist/lib/dashboard-writer.mjs +200 -0
- package/dist/lib/git-status-summary.mjs +45 -0
- package/dist/lib/governance-index-generator.mjs +236 -0
- package/dist/lib/governance-sync.mjs +617 -0
- package/dist/lib/governance-table-boundary.mjs +161 -0
- package/{scripts → dist}/lib/harness-core.mjs +3 -0
- package/dist/lib/harness-paths.mjs +338 -0
- package/dist/lib/lesson-maintenance.mjs +139 -0
- package/dist/lib/markdown-utils.mjs +193 -0
- package/dist/lib/migration-planner.mjs +439 -0
- package/dist/lib/migration-support.mjs +317 -0
- package/dist/lib/phase-kind.mjs +46 -0
- package/dist/lib/preset-audit-contracts.mjs +40 -0
- package/dist/lib/preset-engine.mjs +516 -0
- package/dist/lib/preset-registry.mjs +831 -0
- package/dist/lib/preset-resource-contracts.mjs +83 -0
- package/dist/lib/review-confirm-git-gate.mjs +244 -0
- package/dist/lib/status-builder.mjs +87 -0
- package/{scripts → dist}/lib/status-dashboard-renderer.mjs +48 -47
- package/dist/lib/structure-migration.mjs +404 -0
- package/dist/lib/subagent-authorization-audit.mjs +198 -0
- package/dist/lib/task-audit-metadata.mjs +376 -0
- package/dist/lib/task-audit-migration.mjs +355 -0
- package/dist/lib/task-completion-consistency.mjs +29 -0
- package/dist/lib/task-index.mjs +133 -0
- package/dist/lib/task-lesson-candidates.mjs +239 -0
- package/dist/lib/task-lesson-sedimentation.mjs +300 -0
- package/dist/lib/task-lifecycle/create-task-helpers.mjs +84 -0
- package/dist/lib/task-lifecycle/phase-sync.mjs +82 -0
- package/dist/lib/task-lifecycle/review-confirm.mjs +93 -0
- package/dist/lib/task-lifecycle/review-gates.mjs +62 -0
- package/dist/lib/task-lifecycle/review-submission.mjs +52 -0
- package/dist/lib/task-lifecycle/scaffold-provenance.mjs +54 -0
- package/dist/lib/task-lifecycle/template-files.mjs +52 -0
- package/dist/lib/task-lifecycle/text-utils.mjs +26 -0
- package/dist/lib/task-lifecycle.mjs +611 -0
- package/dist/lib/task-metadata.mjs +116 -0
- package/dist/lib/task-review-model.mjs +474 -0
- package/dist/lib/task-scanner.mjs +439 -0
- package/dist/lib/task-tombstone-commands.mjs +125 -0
- package/dist/postinstall.mjs +14 -0
- package/dist/run-built-tests.mjs +84 -0
- package/docs-release/README.md +1 -0
- package/docs-release/architecture/overview.md +13 -13
- package/docs-release/architecture/overview.zh-CN.md +13 -13
- package/docs-release/architecture/system-explainer/01-system-overview.md +218 -0
- package/docs-release/architecture/system-explainer/02-module-dependency.md +257 -0
- package/docs-release/architecture/system-explainer/03-task-lifecycle.md +304 -0
- package/docs-release/architecture/system-explainer/04-check-and-governance.md +241 -0
- package/docs-release/architecture/system-explainer/05-data-flow.md +276 -0
- package/docs-release/architecture/system-explainer/06-preset-and-migration.md +300 -0
- package/docs-release/architecture/system-explainer/README.md +67 -0
- package/docs-release/architecture/system-explainer/en-US/01-system-overview.md +227 -0
- package/docs-release/architecture/system-explainer/en-US/02-module-dependency.md +263 -0
- package/docs-release/architecture/system-explainer/en-US/03-task-lifecycle.md +319 -0
- package/docs-release/architecture/system-explainer/en-US/04-check-and-governance.md +252 -0
- package/docs-release/architecture/system-explainer/en-US/05-data-flow.md +290 -0
- package/docs-release/architecture/system-explainer/en-US/06-preset-and-migration.md +320 -0
- package/docs-release/architecture/system-explainer/en-US/README.md +70 -0
- package/docs-release/guides/agent-installation.en-US.md +22 -15
- package/docs-release/guides/agent-installation.md +23 -15
- package/docs-release/guides/contributing.md +3 -3
- package/docs-release/guides/contributing.zh-CN.md +3 -3
- package/docs-release/guides/document-audience-and-surfaces.en-US.md +10 -10
- package/docs-release/guides/document-audience-and-surfaces.md +10 -10
- package/docs-release/guides/legacy-migration-agent-prompt.md +25 -2
- package/docs-release/guides/legacy-migration-agent-prompt.zh-CN.md +25 -2
- package/docs-release/guides/migration-playbook.en-US.md +63 -1
- package/docs-release/guides/migration-playbook.md +59 -1
- package/docs-release/guides/parent-control-repository-pattern.en-US.md +25 -25
- package/docs-release/guides/parent-control-repository-pattern.md +25 -25
- package/docs-release/guides/preset-development.md +28 -4
- package/docs-release/guides/repository-operating-models.en-US.md +21 -21
- package/docs-release/guides/repository-operating-models.md +21 -21
- package/docs-release/guides/task-state-machine.en-US.md +35 -18
- package/docs-release/guides/task-state-machine.md +35 -18
- package/docs-release/guides/typescript-runtime-migration-closeout.md +96 -0
- package/examples/minimal-project/AGENTS.md +2 -2
- package/examples/minimal-project/coding-agent-harness/harness.yaml +14 -0
- package/examples/minimal-project/coding-agent-harness/planning/tasks/demo-task/INDEX.md +60 -0
- package/examples/minimal-project/coding-agent-harness/planning/tasks/demo-task/progress.md +11 -0
- package/examples/minimal-project/{docs/09-PLANNING/TASKS → coding-agent-harness/planning/tasks}/demo-task/review.md +1 -1
- package/package.json +22 -13
- package/presets/legacy-migration/preset.yaml +5 -5
- package/presets/legacy-migration/templates/execution_strategy.append.md +1 -1
- package/presets/lesson-sedimentation/preset.yaml +3 -3
- package/presets/module/preset.yaml +2 -2
- package/presets/module/templates/execution_strategy.append.md +1 -1
- package/presets/module/templates/task_plan.append.md +3 -3
- package/presets/standard-task/preset.yaml +2 -2
- package/references/adversarial-review-standard.md +2 -2
- package/references/agents-md-pattern.md +14 -14
- package/references/cadence-ledger.md +1 -1
- package/references/ci-cd-standard.md +1 -1
- package/references/delivery-operating-model-standard.md +4 -4
- package/references/docs-directory-standard.md +65 -159
- package/references/external-source-intake-standard.md +10 -10
- package/references/harness-ledger.md +6 -6
- package/references/legacy-12-phase-bootstrap.md +2 -2
- package/references/lessons-governance.md +15 -15
- package/references/long-running-task-standard.md +6 -6
- package/references/module-parallel-standard.md +34 -34
- package/references/planning-loop.md +6 -6
- package/references/project-onboarding-audit.md +4 -4
- package/references/regression-system.md +2 -2
- package/references/repo-governance-standard.md +4 -4
- package/references/review-routing-standard.md +1 -1
- package/references/ssot-governance.md +19 -19
- package/references/taskr-gap-analysis.md +5 -5
- package/references/walkthrough-closeout.md +14 -14
- package/references/worktree-parallel.md +3 -3
- package/skills/preset-creator/references/complex-task-skeleton/brief.md +11 -0
- package/skills/preset-creator/references/complex-task-skeleton/task_plan.md +1 -1
- package/skills/preset-creator/references/preset-package-skeleton.md +5 -5
- package/templates/AGENTS.md.template +31 -29
- package/templates/architecture/README.md +4 -4
- package/templates/architecture/service-catalog.md +2 -2
- package/templates/architecture/services/service-template.md +1 -1
- package/templates/dashboard/assets/app-src/00-state.js +12 -0
- package/templates/dashboard/assets/app-src/10-router.js +3 -0
- package/templates/dashboard/assets/app-src/20-overview.js +13 -3
- package/templates/dashboard/assets/app-src/35-task-detail.js +46 -6
- package/templates/dashboard/assets/app-src/40-modules.js +1 -1
- package/templates/dashboard/assets/app-src/55-presets.js +375 -0
- package/templates/dashboard/assets/app-src/60-shared.js +3 -1
- package/templates/dashboard/assets/app-src/90-bindings.js +131 -0
- package/templates/dashboard/assets/app.css +583 -0
- package/templates/dashboard/assets/app.css.manifest.json +1 -0
- package/templates/dashboard/assets/app.js +585 -11
- package/templates/dashboard/assets/app.manifest.json +1 -0
- package/templates/dashboard/assets/css-src/00-foundation.css +4 -0
- package/templates/dashboard/assets/css-src/40-detail-modules-migration.css +62 -0
- package/templates/dashboard/assets/css-src/45-presets.css +516 -0
- package/templates/dashboard/assets/i18n.js +144 -4
- package/templates/development/README.md +10 -10
- package/templates/development/cross-repo-debugging.md +3 -3
- package/templates/development/external-context/service-template.md +2 -2
- package/templates/development/external-source-packs/README.md +4 -4
- package/templates/integrations/README.md +4 -4
- package/templates/integrations/api-contract.md +2 -2
- package/templates/integrations/event-contract.md +2 -2
- package/templates/integrations/third-party/vendor-template.md +2 -2
- package/templates/integrations/webhook-contract.md +2 -2
- package/templates/ledger/Harness-Ledger.md +1 -1
- package/templates/planning/INDEX.md +88 -0
- package/templates/planning/brief.md +1 -1
- package/templates/planning/module_session_prompt.md +2 -1
- package/templates/planning/review.md +0 -18
- package/templates/planning/task_plan.md +5 -44
- package/templates/planning/visual_map.md +13 -9
- package/templates/planning/visual_map.simple.md +52 -0
- package/templates/planning/walkthrough.md +47 -0
- package/templates/reference/docs-library-standard.md +8 -8
- package/templates/reference/execution-workflow-standard.md +29 -2
- package/templates/reference/external-source-intake-standard.md +15 -15
- package/templates/reference/repo-governance-standard.md +1 -1
- package/templates/ssot/Module-Registry.md +1 -1
- package/templates/walkthrough/walkthrough-template.md +2 -2
- package/templates-zh-CN/AGENTS.md.template +31 -29
- package/templates-zh-CN/CLAUDE.md.template +1 -1
- package/templates-zh-CN/architecture/README.md +4 -4
- package/templates-zh-CN/architecture/service-catalog.md +2 -2
- package/templates-zh-CN/architecture/services/service-template.md +1 -1
- package/templates-zh-CN/development/README.md +10 -10
- package/templates-zh-CN/development/cross-repo-debugging.md +3 -3
- package/templates-zh-CN/development/external-context/service-template.md +2 -2
- package/templates-zh-CN/development/external-source-packs/README.md +4 -4
- package/templates-zh-CN/integrations/README.md +4 -4
- package/templates-zh-CN/integrations/api-contract.md +2 -2
- package/templates-zh-CN/integrations/event-contract.md +2 -2
- package/templates-zh-CN/integrations/third-party/vendor-template.md +2 -2
- package/templates-zh-CN/integrations/webhook-contract.md +2 -2
- package/templates-zh-CN/ledger/Harness-Ledger.md +1 -1
- package/templates-zh-CN/lessons/lesson-arch-process-change.md +1 -1
- package/templates-zh-CN/lessons/lesson-new-doc.md +3 -3
- package/templates-zh-CN/lessons/lesson-ref-change.md +4 -4
- package/templates-zh-CN/planning/INDEX.md +87 -0
- package/templates-zh-CN/planning/brief.md +1 -1
- package/templates-zh-CN/planning/module_session_prompt.md +12 -11
- package/templates-zh-CN/planning/review.md +0 -18
- package/templates-zh-CN/planning/task_plan.md +3 -63
- package/templates-zh-CN/planning/visual_map.md +14 -7
- package/templates-zh-CN/planning/visual_map.simple.md +48 -0
- package/templates-zh-CN/planning/walkthrough.md +47 -0
- package/templates-zh-CN/reference/adversarial-review-standard.md +2 -2
- package/templates-zh-CN/reference/delivery-operating-model-standard.md +3 -3
- package/templates-zh-CN/reference/docs-library-standard.md +28 -28
- package/templates-zh-CN/reference/execution-workflow-standard.md +32 -7
- package/templates-zh-CN/reference/external-source-intake-standard.md +16 -16
- package/templates-zh-CN/reference/harness-ledger-standard.md +6 -6
- package/templates-zh-CN/reference/regression-ssot-governance.md +2 -2
- package/templates-zh-CN/reference/repo-governance-standard.md +1 -1
- package/templates-zh-CN/reference/review-routing-standard.md +1 -1
- package/templates-zh-CN/reference/walkthrough-standard.md +7 -7
- package/templates-zh-CN/reference/worktree-standard.md +1 -1
- package/templates-zh-CN/regression/Cadence-Ledger.md +2 -2
- package/templates-zh-CN/ssot/Delivery-SSoT.md +3 -3
- package/templates-zh-CN/ssot/Module-Registry.md +3 -3
- package/templates-zh-CN/ssot/Regression-SSoT.md +2 -2
- package/templates-zh-CN/walkthrough/walkthrough-template.md +5 -5
- package/tsconfig.dist.json +16 -0
- package/tsconfig.json +25 -0
- package/tsconfig.runtime.json +24 -0
- package/examples/minimal-project/.harness-capabilities.json +0 -8
- package/examples/minimal-project/docs/09-PLANNING/TASKS/demo-task/progress.md +0 -11
- package/scripts/check-harness.mjs +0 -508
- package/scripts/commands/dashboard-command.mjs +0 -67
- package/scripts/commands/migration-command.mjs +0 -96
- package/scripts/commands/preset-command.mjs +0 -73
- package/scripts/commands/task-command.mjs +0 -327
- package/scripts/harness.mjs +0 -287
- package/scripts/lib/capability-registry.mjs +0 -591
- package/scripts/lib/check-module-parallel.mjs +0 -237
- package/scripts/lib/check-profiles.mjs +0 -418
- package/scripts/lib/check-task-contracts.mjs +0 -47
- package/scripts/lib/core-shared.mjs +0 -196
- package/scripts/lib/dashboard-data.mjs +0 -412
- package/scripts/lib/dashboard-workbench.mjs +0 -257
- package/scripts/lib/dashboard-writer.mjs +0 -198
- package/scripts/lib/git-status-summary.mjs +0 -46
- package/scripts/lib/governance-index-generator.mjs +0 -174
- package/scripts/lib/governance-sync.mjs +0 -514
- package/scripts/lib/governance-table-boundary.mjs +0 -175
- package/scripts/lib/lesson-maintenance.mjs +0 -152
- package/scripts/lib/markdown-utils.mjs +0 -158
- package/scripts/lib/migration-planner.mjs +0 -478
- package/scripts/lib/migration-support.mjs +0 -312
- package/scripts/lib/preset-audit-contracts.mjs +0 -37
- package/scripts/lib/preset-engine.mjs +0 -497
- package/scripts/lib/preset-registry.mjs +0 -627
- package/scripts/lib/preset-resource-contracts.mjs +0 -83
- package/scripts/lib/review-confirm-git-gate.mjs +0 -248
- package/scripts/lib/subagent-authorization-audit.mjs +0 -196
- package/scripts/lib/task-completion-consistency.mjs +0 -16
- package/scripts/lib/task-index.mjs +0 -93
- package/scripts/lib/task-lesson-candidates.mjs +0 -242
- package/scripts/lib/task-lesson-sedimentation.mjs +0 -326
- package/scripts/lib/task-lifecycle/review-confirm.mjs +0 -101
- package/scripts/lib/task-lifecycle/review-gates.mjs +0 -70
- package/scripts/lib/task-lifecycle/text-utils.mjs +0 -24
- package/scripts/lib/task-lifecycle.mjs +0 -649
- package/scripts/lib/task-review-model.mjs +0 -469
- package/scripts/lib/task-scanner.mjs +0 -576
- package/scripts/lib/task-tombstone-commands.mjs +0 -140
- package/scripts/postinstall.mjs +0 -14
- package/templates/walkthrough/Closeout-SSoT.md +0 -43
- package/templates-zh-CN/walkthrough/Closeout-SSoT.md +0 -42
- /package/examples/minimal-project/{docs → coding-agent-harness/governance/generated}/Harness-Ledger.md +0 -0
- /package/examples/minimal-project/{docs/09-PLANNING/TASKS → coding-agent-harness/planning/tasks}/demo-task/brief.md +0 -0
- /package/examples/minimal-project/{docs/09-PLANNING/TASKS → coding-agent-harness/planning/tasks}/demo-task/execution_strategy.md +0 -0
- /package/examples/minimal-project/{docs/09-PLANNING/TASKS → coding-agent-harness/planning/tasks}/demo-task/findings.md +0 -0
- /package/examples/minimal-project/{docs/09-PLANNING/TASKS → coding-agent-harness/planning/tasks}/demo-task/lesson_candidates.md +0 -0
- /package/examples/minimal-project/{docs/09-PLANNING/TASKS → coding-agent-harness/planning/tasks}/demo-task/task_plan.md +0 -0
- /package/examples/minimal-project/{docs/09-PLANNING/TASKS → coding-agent-harness/planning/tasks}/demo-task/visual_map.md +0 -0
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import fs from "node:fs";
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
import {
|
|
4
|
-
normalizeTarget,
|
|
5
|
-
nowTimestamp,
|
|
6
|
-
readFileSafe,
|
|
7
|
-
toPosix,
|
|
8
|
-
datePrefix,
|
|
9
|
-
} from "./core-shared.mjs";
|
|
10
|
-
import { collectTasks } from "./task-scanner.mjs";
|
|
11
|
-
import {
|
|
12
|
-
beginGovernanceSync,
|
|
13
|
-
commitGovernanceSync,
|
|
14
|
-
releaseGovernanceSync,
|
|
15
|
-
} from "./governance-sync.mjs";
|
|
16
|
-
|
|
17
|
-
export function supersedeTask(targetInput, oldRef, { by = "", reason = "" } = {}) {
|
|
18
|
-
if (!by) throw new Error("task-supersede requires --by <new-task-id>");
|
|
19
|
-
const target = normalizeTarget(targetInput);
|
|
20
|
-
const oldTask = resolveTask(target, oldRef);
|
|
21
|
-
const newTask = resolveTask(target, by);
|
|
22
|
-
const governanceContext = beginGovernanceSync(target, { operation: `task-supersede ${oldTask.id}` });
|
|
23
|
-
try {
|
|
24
|
-
writeTombstone(target, oldTask, {
|
|
25
|
-
State: "superseded",
|
|
26
|
-
"Superseded By": newTask.id,
|
|
27
|
-
Reason: reason || "superseded",
|
|
28
|
-
Operator: "coordinator",
|
|
29
|
-
Timestamp: nowTimestamp(),
|
|
30
|
-
"Reopen Eligible": "yes",
|
|
31
|
-
"Archive Eligible": "no",
|
|
32
|
-
});
|
|
33
|
-
appendProgress(target, oldTask, `task-supersede: superseded by ${newTask.id}`, reason || "superseded");
|
|
34
|
-
appendSupersedes(target, newTask, oldTask.id);
|
|
35
|
-
const commit = commitGovernanceSync(contextFor(target, governanceContext), taskPaths(target, oldTask, newTask), {
|
|
36
|
-
message: `chore(harness): supersede task ${oldTask.id}`,
|
|
37
|
-
});
|
|
38
|
-
return { taskId: oldTask.id, supersededBy: newTask.id, reason: reason || "superseded", governance: { commit } };
|
|
39
|
-
} finally {
|
|
40
|
-
releaseGovernanceSync(governanceContext);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export function softDeleteTask(targetInput, taskRef, { reason = "" } = {}) {
|
|
45
|
-
const target = normalizeTarget(targetInput);
|
|
46
|
-
const task = resolveTask(target, taskRef);
|
|
47
|
-
return writeDeletionState(target, task, "soft-deleted", reason || "soft-delete", "task-delete --soft");
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export function archiveTask(targetInput, taskRef, { reason = "" } = {}) {
|
|
51
|
-
const target = normalizeTarget(targetInput);
|
|
52
|
-
const task = resolveTask(target, taskRef);
|
|
53
|
-
return writeDeletionState(target, task, "archived", reason || "archive", "task-archive");
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export function reopenTask(targetInput, taskRef, { reason = "" } = {}) {
|
|
57
|
-
const target = normalizeTarget(targetInput);
|
|
58
|
-
const task = resolveTask(target, taskRef);
|
|
59
|
-
const governanceContext = beginGovernanceSync(target, { operation: `task-reopen ${task.id}` });
|
|
60
|
-
try {
|
|
61
|
-
const taskPlanPath = path.join(target.projectRoot, task.taskPlanPath.replace(/^TARGET:/, ""));
|
|
62
|
-
const content = readFileSafe(taskPlanPath);
|
|
63
|
-
const next = content.replace(/\n##\s*(?:Task Tombstone|任务墓碑)\s*$[\s\S]*?(?=^##\s+|(?![\s\S]))/im, "");
|
|
64
|
-
fs.writeFileSync(taskPlanPath, next.endsWith("\n") ? next : `${next}\n`);
|
|
65
|
-
appendProgress(target, task, "task-reopen", reason || "reopened");
|
|
66
|
-
const commit = commitGovernanceSync(governanceContext, taskPaths(target, task), {
|
|
67
|
-
message: `chore(harness): reopen task ${task.id}`,
|
|
68
|
-
});
|
|
69
|
-
return { taskId: task.id, deletionState: "active", reason: reason || "reopened", governance: { commit } };
|
|
70
|
-
} finally {
|
|
71
|
-
releaseGovernanceSync(governanceContext);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
function writeDeletionState(target, task, deletionState, reason, action) {
|
|
76
|
-
const governanceContext = beginGovernanceSync(target, { operation: `${action} ${task.id}` });
|
|
77
|
-
try {
|
|
78
|
-
writeTombstone(target, task, {
|
|
79
|
-
State: deletionState,
|
|
80
|
-
Reason: reason,
|
|
81
|
-
Operator: "coordinator",
|
|
82
|
-
Timestamp: nowTimestamp(),
|
|
83
|
-
"Reopen Eligible": "yes",
|
|
84
|
-
"Archive Eligible": deletionState === "archived" ? "yes" : "no",
|
|
85
|
-
});
|
|
86
|
-
appendProgress(target, task, action, reason);
|
|
87
|
-
const commit = commitGovernanceSync(governanceContext, taskPaths(target, task), {
|
|
88
|
-
message: `chore(harness): ${action.replace(/\s+/g, " ")} ${task.id}`,
|
|
89
|
-
});
|
|
90
|
-
return { taskId: task.id, deletionState, reason, governance: { commit } };
|
|
91
|
-
} finally {
|
|
92
|
-
releaseGovernanceSync(governanceContext);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
function taskPaths(target, ...tasks) {
|
|
97
|
-
return [...new Set(tasks.flatMap((task) => [task.taskPlanPath, task.progressPath]).filter(Boolean).map((item) => toPosix(item.replace(/^TARGET:/, ""))))];
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
function contextFor(_target, context) {
|
|
101
|
-
return context;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
function resolveTask(target, ref) {
|
|
105
|
-
const normalized = String(ref || "").trim();
|
|
106
|
-
const matches = collectTasks(target).filter((task) => {
|
|
107
|
-
const bare = datePrefix.test(task.shortId) ? task.shortId.replace(datePrefix, "") : task.shortId;
|
|
108
|
-
return task.id === normalized || task.shortId === normalized || task.id.endsWith(`/${normalized}`) || bare === normalized;
|
|
109
|
-
});
|
|
110
|
-
if (matches.length === 1) return matches[0];
|
|
111
|
-
if (matches.length > 1) throw new Error(`Ambiguous task reference: ${ref}`);
|
|
112
|
-
throw new Error(`Task not found: ${ref}`);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
function writeTombstone(target, task, fields) {
|
|
116
|
-
const taskPlanPath = path.join(target.projectRoot, task.taskPlanPath.replace(/^TARGET:/, ""));
|
|
117
|
-
const content = readFileSafe(taskPlanPath).replace(/\n##\s*(?:Task Tombstone|任务墓碑)\s*$[\s\S]*?(?=^##\s+|(?![\s\S]))/im, "");
|
|
118
|
-
const block = ["", "## Task Tombstone", "", "| Field | Value |", "| --- | --- |", ...Object.entries(fields).map(([key, value]) => `| ${key} | ${escapeCell(value)} |`), ""].join("\n");
|
|
119
|
-
fs.writeFileSync(taskPlanPath, `${content.trimEnd()}\n${block}`);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
function appendSupersedes(target, task, oldId) {
|
|
123
|
-
const taskPlanPath = path.join(target.projectRoot, task.taskPlanPath.replace(/^TARGET:/, ""));
|
|
124
|
-
const content = readFileSafe(taskPlanPath);
|
|
125
|
-
if (/^Supersedes\s*[::]/im.test(content)) {
|
|
126
|
-
fs.writeFileSync(taskPlanPath, content.replace(/^Supersedes\s*[::]\s*(.*)$/im, (_m, current) => `Supersedes: ${[current, oldId].filter(Boolean).join(", ")}`));
|
|
127
|
-
return;
|
|
128
|
-
}
|
|
129
|
-
fs.writeFileSync(taskPlanPath, `${content.trimEnd()}\nSupersedes: ${oldId}\n`);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
function appendProgress(target, task, action, reason) {
|
|
133
|
-
const progressPath = path.join(target.projectRoot, task.progressPath.replace(/^TARGET:/, ""));
|
|
134
|
-
const relative = toPosix(path.relative(target.projectRoot, progressPath));
|
|
135
|
-
fs.appendFileSync(progressPath, `\n\n## Tombstone Log\n\n- ${nowTimestamp()} ${action}: ${escapeCell(reason)} (${relative})\n`);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
function escapeCell(value) {
|
|
139
|
-
return String(value || "").replace(/\r?\n/g, " ").replaceAll("|", "\\|").trim();
|
|
140
|
-
}
|
package/scripts/postinstall.mjs
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { seedBundledPresets } from "./lib/harness-core.mjs";
|
|
4
|
-
|
|
5
|
-
if (process.env.CODING_AGENT_HARNESS_SKIP_POSTINSTALL === "1") process.exit(0);
|
|
6
|
-
|
|
7
|
-
try {
|
|
8
|
-
const result = seedBundledPresets({ scope: "user" });
|
|
9
|
-
const changed = result.created + result.overwritten;
|
|
10
|
-
const summary = changed > 0 ? `${changed} bundled presets installed` : `${result.skipped} bundled presets already present`;
|
|
11
|
-
console.log(`coding-agent-harness postinstall: ${summary} at ${result.target}`);
|
|
12
|
-
} catch (error) {
|
|
13
|
-
console.warn(`coding-agent-harness postinstall: preset seed skipped (${error.message})`);
|
|
14
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
# Closeout SSoT
|
|
2
|
-
|
|
3
|
-
## Purpose
|
|
4
|
-
|
|
5
|
-
Track whether planned work has completed the required closeout contract: implementation evidence, regression evidence, review disposition, walkthrough, residual routing, lessons check, and ledger update.
|
|
6
|
-
|
|
7
|
-
## Status Legend
|
|
8
|
-
|
|
9
|
-
| Status | Meaning | Required Next Step |
|
|
10
|
-
| --- | --- | --- |
|
|
11
|
-
| open | Work is not ready for closeout. | Continue implementation or evidence collection. |
|
|
12
|
-
| evidence | Implementation is done but verification is incomplete. | Run required checks and attach evidence. |
|
|
13
|
-
| review | Evidence exists and review is pending. | Resolve findings or record `accepted-risk`. |
|
|
14
|
-
| closing | Final walkthrough and ledger updates are in progress. | Finish lessons check and routing. |
|
|
15
|
-
| closed | Closeout contract is complete. | Archive after the retention window. |
|
|
16
|
-
| blocked | Closeout cannot finish. | Record blocker owner and unblock condition. |
|
|
17
|
-
| archived | Closeout is historical. | Keep archive pointer. |
|
|
18
|
-
|
|
19
|
-
## Active Closeouts
|
|
20
|
-
|
|
21
|
-
| ID | Work Item | Owner | Status | Implementation Evidence | Regression Evidence | Review Disposition | Walkthrough | Lessons Check | Harness Ledger | Residual | Updated |
|
|
22
|
-
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
|
23
|
-
| CO-YYYY-MM-DD-001 | F-000 or D-000 title | owner | [open / closed / blocked] | path or pending | RG-000 or pending | pending | pending | pending | HL-000 | none | YYYY-MM-DD |
|
|
24
|
-
|
|
25
|
-
## Release-Blocking Residuals
|
|
26
|
-
|
|
27
|
-
| Residual | Source | Owner | Blocks Release? | Decision | Due |
|
|
28
|
-
| --- | --- | --- | --- | --- | --- |
|
|
29
|
-
| risk or unresolved finding | review, regression, or walkthrough | owner | yes / no | fix, accept, defer, or waive | YYYY-MM-DD |
|
|
30
|
-
|
|
31
|
-
## Routing Rules
|
|
32
|
-
|
|
33
|
-
1. Every shipped feature, delivery, release, and harness update needs a closeout row.
|
|
34
|
-
2. Move to `closed` only after walkthrough, regression evidence, review disposition, lessons check, and Harness Ledger link are complete.
|
|
35
|
-
3. `not run` verification is a residual, not a pass.
|
|
36
|
-
4. Release-blocking residuals must stay visible until fixed, accepted by an owner, or moved to a follow-up with a due date.
|
|
37
|
-
5. Closeout rows should link durable files rather than summarize chat decisions.
|
|
38
|
-
|
|
39
|
-
## Archive Rules
|
|
40
|
-
|
|
41
|
-
- Keep open, evidence, review, closing, and blocked rows in this file.
|
|
42
|
-
- Archive closed rows after the next release or maintenance cycle.
|
|
43
|
-
- Preserve final evidence, walkthrough, lessons check, residual decision, and archive date.
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
# 收口 SSoT - [项目名称]
|
|
2
|
-
|
|
3
|
-
> 任务收口证据的单一事实源。每个已关闭的 Harness Ledger 行都必须在这里有对应记录。
|
|
4
|
-
|
|
5
|
-
## 活跃收口
|
|
6
|
-
|
|
7
|
-
| Harness ID | 日期 | 任务 | 任务计划 | 审查报告 | 收口记录 | 证据 | 残余路由 | Lessons 检查 | 收口状态 |
|
|
8
|
-
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
|
9
|
-
| HL-YYYY-MM-DD-001 | YYYY-MM-DD | [任务名称] | `docs/09-PLANNING/TASKS/[task]/task_plan.md` | `review.md` / `n/a: [原因]` | `docs/10-WALKTHROUGH/[file].md` / 允许的跳过原因 | [测试、命令、review、运行时证据] | `none` / [负责人 + 路由] | `checked-created: L-YYYY-MM-DD-001` / `checked-none: [原因]` | [open / closed / blocked] |
|
|
10
|
-
|
|
11
|
-
## 允许的 walkthrough 跳过原因
|
|
12
|
-
|
|
13
|
-
- `walkthrough skipped-with-reason: docs-only`
|
|
14
|
-
- `walkthrough skipped-with-reason: no-runtime`
|
|
15
|
-
- `walkthrough skipped-with-reason: superseded`
|
|
16
|
-
- `walkthrough skipped-with-reason: historical-backfill`
|
|
17
|
-
- `walkthrough skipped-with-reason: owner-deferred`
|
|
18
|
-
|
|
19
|
-
## 状态说明
|
|
20
|
-
|
|
21
|
-
- `open`:收口材料仍在整理。
|
|
22
|
-
- `closed`:证据、残余和 Lessons 检查已完成。
|
|
23
|
-
- `closed-with-residual`:收口完成,但仍有已路由残余。
|
|
24
|
-
- `blocked`:缺少必要证据或负责人决策,暂不能收口。
|
|
25
|
-
- `superseded`:被后续 closeout 行取代。
|
|
26
|
-
|
|
27
|
-
## 归档索引
|
|
28
|
-
|
|
29
|
-
> 活跃收口表超过 50 行,或 release / wave 完成后,将已关闭条目移入 `docs/10-WALKTHROUGH/_archive/Closeout-SSoT-archive-YYYY-QN.md`。
|
|
30
|
-
|
|
31
|
-
| 归档文件 | 覆盖 Harness ID | 移入日期 | 说明 |
|
|
32
|
-
| --- | --- | --- | --- |
|
|
33
|
-
| `docs/10-WALKTHROUGH/_archive/Closeout-SSoT-archive-YYYY-QN.md` | HL-... 至 HL-... | YYYY-MM-DD | [说明] |
|
|
34
|
-
|
|
35
|
-
## 路由规则
|
|
36
|
-
|
|
37
|
-
1. 每个 `closed`、`closed-with-residual` 或 `closed-local-only` 的 Harness Ledger 行都必须在本文件有一行。
|
|
38
|
-
2. 实现类任务应写 walkthrough;跳过原因只用于受限场景,不用于省略收口。
|
|
39
|
-
3. `证据` 必须列出实际检查、冒烟、review、运行时验证或发布证据。
|
|
40
|
-
4. `残余路由` 必须写 `none`,或指向负责人、任务、Regression SSoT、Harness Ledger、issue 或接受风险记录。
|
|
41
|
-
5. `Lessons 检查` 只能写 `checked-candidate: LC-...`、`queued-promotion: LC-...`、`checked-created: L-YYYY-MM-DD-NNN`,或旧任务兼容的 `checked-none: [原因]`。
|
|
42
|
-
6. `checked-created` 必须存在 promoted lesson 详情文档;`queued-promotion` 必须能追溯到任务目录 `lesson_candidates.md`。
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|