phasegate 0.315.0 → 0.340.0
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 +4 -0
- package/README.ja.md +22 -9
- package/README.md +28 -17
- package/docs/ADR/038-config-state-operation-permission-policy.md +5 -2
- package/docs/ADR/039-hook-observable-state-as-authorization-unit.md +74 -0
- package/docs/ADR/040-quick-mode-config-via-preset-resolution.md +66 -0
- package/docs/ADR/041-non-excludable-agent-trust-roots.md +68 -0
- package/docs/guide/antigravity-integration.md +26 -0
- package/docs/guide/cli-reference.md +93 -11
- package/docs/guide/codex-integration.md +44 -107
- package/docs/guide/configuration.md +43 -2
- package/docs/guide/grok-integration.md +26 -0
- package/docs/guide/hooks-integration.md +27 -4
- package/docs/guide/installation.md +4 -2
- package/docs/guide/quick-vs-full-mode.md +36 -1
- package/docs/guide/setup-artifacts.md +4 -4
- package/docs/guide/skills-overview.md +1 -1
- package/package.json +2 -2
- package/scripts/harness/agent-integration/application/dto/handle-pre-tool-use-dto.ts +6 -2
- package/scripts/harness/agent-integration/application/dto/normalized-pre-tool-use-request.ts +32 -0
- package/scripts/harness/agent-integration/application/usecases/handle-pre-tool-use-usecase.ts +17 -9
- package/scripts/harness/agent-integration/domain/ports/full-mode-requirement-query-port.ts +3 -1
- package/scripts/harness/agent-integration/domain/services/apply-patch-write-target-extractor.ts +98 -0
- package/scripts/harness/agent-integration/domain/services/bash-write-target-extractor.ts +196 -54
- package/scripts/harness/agent-integration/domain/value-objects/hook-translation-result.ts +1 -1
- package/scripts/harness/agent-integration/domain/value-objects/protected-file-list.ts +39 -17
- package/scripts/harness/agent-integration/infrastructure/adapters/quick-mode-full-mode-requirement-adapter.ts +15 -1
- package/scripts/harness/agent-integration/presentation/phasegate-status-context.ts +1 -1
- package/scripts/harness/agent-integration/presentation/post-tool-use-hook.ts +1 -0
- package/scripts/harness/agent-integration/presentation/pre-tool-use-hook.ts +129 -73
- package/scripts/harness/agent-integration/presentation/pre-tool-use-payload-normalizer.ts +228 -0
- package/scripts/harness/agent-integration/presentation/pre-tool-use-response-renderer.ts +38 -0
- package/scripts/harness/ci-governance/application/dto/scaffold-inception-input.ts +9 -0
- package/scripts/harness/ci-governance/application/dto/scaffold-inception-output.ts +13 -0
- package/scripts/harness/ci-governance/application/usecases/list-templates-usecase.ts +30 -0
- package/scripts/harness/ci-governance/application/usecases/scaffold-inception-usecase.ts +63 -0
- package/scripts/harness/ci-governance/application/usecases/show-template-usecase.ts +39 -0
- package/scripts/harness/ci-governance/composition-root.ts +55 -3
- package/scripts/harness/ci-governance/domain/ports/inception-doc-writer-port.ts +19 -0
- package/scripts/harness/ci-governance/domain/ports/inception-template-repository-port.ts +16 -0
- package/scripts/harness/ci-governance/domain/ports/template-catalog-port.ts +23 -0
- package/scripts/harness/ci-governance/domain/value-objects/inception-doc-kind.ts +109 -0
- package/scripts/harness/ci-governance/domain/value-objects/integrity-target.ts +2 -0
- package/scripts/harness/ci-governance/domain/value-objects/template-catalog-entry.ts +53 -0
- package/scripts/harness/ci-governance/domain/value-objects/template-name.ts +50 -0
- package/scripts/harness/ci-governance/infrastructure/adapters/file-system-inception-doc-writer-adapter.ts +42 -0
- package/scripts/harness/ci-governance/infrastructure/adapters/file-system-inception-template-repository-adapter.ts +32 -0
- package/scripts/harness/ci-governance/infrastructure/adapters/file-system-template-catalog-adapter.ts +60 -0
- package/scripts/harness/ci-governance/presentation/handlers/scaffold-inception-handler.ts +101 -0
- package/scripts/harness/ci-governance/presentation/handlers/templates-handler.ts +103 -0
- package/scripts/harness/config-foundation/domain/harness-config.ts +12 -0
- package/scripts/harness/config-foundation/infrastructure/presets/minimal.json +2 -2
- package/scripts/harness/config-foundation/infrastructure/presets/standard.json +2 -2
- package/scripts/harness/config-foundation/infrastructure/presets/strict.json +2 -2
- package/scripts/harness/config-foundation/infrastructure/schemas/harness-config-v2.schema.json +44 -1
- package/scripts/harness/config-foundation/infrastructure/schemas/harness-config-v3.schema.json +42 -1
- package/scripts/harness/harness-api/domain/value-objects/known-harness-commands.ts +3 -1
- package/scripts/harness/installation/application/checks/antigravity-hook-missing-check.ts +79 -0
- package/scripts/harness/installation/application/checks/codex-hook-missing-check.ts +70 -6
- package/scripts/harness/installation/application/checks/grok-hook-missing-check.ts +79 -0
- package/scripts/harness/installation/application/checks/husky-runtime-inactive-check.ts +33 -0
- package/scripts/harness/installation/application/named-hook-json.ts +17 -0
- package/scripts/harness/installation/application/operator-notice.ts +42 -0
- package/scripts/harness/installation/application/usecases/run-doctor-diagnostics.ts +18 -7
- package/scripts/harness/installation/application/usecases/run-install.ts +152 -52
- package/scripts/harness/installation/application/usecases/run-reconcile.ts +86 -10
- package/scripts/harness/installation/application/usecases/run-uninstall.ts +149 -25
- package/scripts/harness/installation/composition-root.ts +10 -0
- package/scripts/harness/installation/domain/agent-target.ts +39 -0
- package/scripts/harness/installation/domain/check-id.ts +5 -0
- package/scripts/harness/installation/domain/husky-runtime-state.ts +34 -0
- package/scripts/harness/installation/domain/ports/git-hooks-runtime-probe.ts +9 -0
- package/scripts/harness/installation/domain/repair-table.ts +5 -0
- package/scripts/harness/installation/infrastructure/adapters/git-hooks-runtime-probe-adapter.ts +62 -0
- package/scripts/harness/installation/presentation/cli/install-handler.ts +23 -4
- package/scripts/harness/installation/presentation/cli/reconcile-handler.ts +7 -1
- package/scripts/harness/installation/presentation/formatters/diagnostic-report-formatter.ts +27 -0
- package/scripts/harness/main.ts +202 -51
- package/scripts/harness/phase-dependency-model/application/services/evidence-bundle-assembler.ts +2 -1
- package/scripts/harness/phase-dependency-model/domain/ports/plan-document-reader-port.ts +12 -0
- package/scripts/harness/phase-dependency-model/infrastructure/filesystem/markdown-plan-document-reader.ts +4 -1
- package/scripts/harness/quick-mode/application/dto/change-category-classification-contract.ts +1 -1
- package/scripts/harness/quick-mode/application/dto/quick-mode-eligibility-contract.ts +1 -1
- package/scripts/harness/quick-mode/application/usecases/classify-change-category-usecase.ts +3 -1
- package/scripts/harness/quick-mode/domain/errors/quick-mode-config-error.ts +19 -0
- package/scripts/harness/quick-mode/domain/services/quick-mode-judgment-engine.ts +59 -19
- package/scripts/harness/quick-mode/domain/types/rejection-rule.ts +1 -1
- package/scripts/harness/quick-mode/domain/value-objects/category-override-rules.ts +147 -0
- package/scripts/harness/quick-mode/domain/value-objects/change-category.ts +33 -0
- package/scripts/harness/quick-mode/domain/value-objects/quick-mode-config.ts +31 -10
- package/scripts/harness/quick-mode/index.ts +7 -1
- package/scripts/harness/quick-mode/infrastructure/adapters/harness-config-quick-mode-config-adapter.ts +83 -32
- package/scripts/harness/regression-suite/infrastructure/adapters/vitest-test-runner-adapter.ts +13 -3
- package/skills/product-architect/SKILL.md +19 -0
- package/skills/story-mapper/SKILL.md +11 -0
- package/skills/story-writer/SKILL.md +11 -0
- package/skills/unit-designer/SKILL.md +11 -0
- package/templates/.agents/hooks.json +16 -0
- package/templates/.claude/scripts/analyze-errors-hook.sh +2 -2
- package/templates/.claude/settings.json +5 -3
- package/templates/.codex/hooks.json +2 -2
- package/templates/product_overview.template.md +85 -0
- package/templates/product_overview_plan.template.md +55 -0
- package/templates/story_mapping_plan.template.md +61 -0
- package/templates/story_writer_plan.template.md +61 -0
- package/templates/unit_design_plan.template.md +63 -0
|
@@ -6,7 +6,15 @@
|
|
|
6
6
|
// @work-item-id WI-180
|
|
7
7
|
// @work-item-id WI-208
|
|
8
8
|
// @work-item-id WI-330
|
|
9
|
+
// @work-item-id WI-384
|
|
10
|
+
// @work-item-id WI-385
|
|
9
11
|
|
|
12
|
+
import {
|
|
13
|
+
ANTIGRAVITY_CLI_ONLY_NOTICE,
|
|
14
|
+
CODEX_HOOK_TRUST_UNVERIFIABLE_NOTICE,
|
|
15
|
+
GROK_HOOK_TRUST_UNVERIFIABLE_NOTICE,
|
|
16
|
+
type OperatorNotice,
|
|
17
|
+
} from "../../application/operator-notice.js";
|
|
10
18
|
import type {
|
|
11
19
|
DoctorAgentScope,
|
|
12
20
|
ScopedOutDiagnosticFinding,
|
|
@@ -27,6 +35,7 @@ export interface DiagnosticReportFormatterInput {
|
|
|
27
35
|
|
|
28
36
|
export class DiagnosticReportFormatter {
|
|
29
37
|
formatJson(input: DiagnosticReportFormatterInput): string {
|
|
38
|
+
const operatorNotices = noticesFor(input.agent);
|
|
30
39
|
return JSON.stringify(
|
|
31
40
|
{
|
|
32
41
|
schemaVersion: "1.0",
|
|
@@ -59,6 +68,7 @@ export class DiagnosticReportFormatter {
|
|
|
59
68
|
scopeReason,
|
|
60
69
|
};
|
|
61
70
|
}),
|
|
71
|
+
operatorNotices,
|
|
62
72
|
exitCode: input.exitCode,
|
|
63
73
|
},
|
|
64
74
|
null,
|
|
@@ -74,6 +84,9 @@ export class DiagnosticReportFormatter {
|
|
|
74
84
|
`Config: ${input.configStatus}`,
|
|
75
85
|
"",
|
|
76
86
|
];
|
|
87
|
+
for (const notice of noticesFor(input.agent)) {
|
|
88
|
+
lines.push(`Notice [${notice.code}]: ${notice.message}`, "");
|
|
89
|
+
}
|
|
77
90
|
for (const finding of input.report.findings) {
|
|
78
91
|
lines.push(`[${finding.severity}] ${finding.checkId}: ${finding.message}`);
|
|
79
92
|
lines.push(` target: ${finding.target}`);
|
|
@@ -107,9 +120,23 @@ function scopeDescription(agent: DoctorAgentScope, installationMode: "project" |
|
|
|
107
120
|
return "Personal Claude Code sandbox; team/project Husky, CI, package, and Codex-only findings are not repair targets.";
|
|
108
121
|
if (agent === "codex")
|
|
109
122
|
return "Personal Codex sandbox; team/project Husky, CI, package, and Claude-only findings are not repair targets.";
|
|
123
|
+
if (agent === "grok") return "Personal Grok-compatible hook diagnostics; external trust remains operator-verified.";
|
|
124
|
+
if (agent === "antigravity") return "Personal Antigravity CLI hook diagnostics; IDE/desktop uses the L2 backstop.";
|
|
125
|
+
if (agent === "all") return "Personal diagnostics for all supported runtime targets.";
|
|
110
126
|
return "Personal sandbox diagnostics; team/project Husky, CI, and package findings are not repair targets.";
|
|
111
127
|
}
|
|
112
128
|
if (agent === "claude") return "Claude Code and shared setup targets; Codex-only findings are not applicable.";
|
|
113
129
|
if (agent === "codex") return "Codex and shared setup targets; Claude-only findings are not applicable.";
|
|
130
|
+
if (agent === "grok") return "Grok-compatible Claude hook diagnostics; other runtime findings are not applicable.";
|
|
131
|
+
if (agent === "antigravity") return "Antigravity CLI hook diagnostics; other runtime findings are not applicable.";
|
|
132
|
+
if (agent === "all") return "Full setup diagnostics for Claude, Codex, Grok, Antigravity, and shared targets.";
|
|
114
133
|
return "Full setup diagnostics for Claude, Codex, and shared targets.";
|
|
115
134
|
}
|
|
135
|
+
|
|
136
|
+
function noticesFor(agent: DoctorAgentScope): readonly OperatorNotice[] {
|
|
137
|
+
return [
|
|
138
|
+
...(agent === "codex" || agent === "both" || agent === "all" ? [CODEX_HOOK_TRUST_UNVERIFIABLE_NOTICE] : []),
|
|
139
|
+
...(agent === "grok" || agent === "all" ? [GROK_HOOK_TRUST_UNVERIFIABLE_NOTICE] : []),
|
|
140
|
+
...(agent === "antigravity" || agent === "all" ? [ANTIGRAVITY_CLI_ONLY_NOTICE] : []),
|
|
141
|
+
];
|
|
142
|
+
}
|
package/scripts/harness/main.ts
CHANGED
|
@@ -25,6 +25,8 @@
|
|
|
25
25
|
* @work-item-id WI-300
|
|
26
26
|
* @work-item-id WI-306
|
|
27
27
|
* @work-item-id WI-308
|
|
28
|
+
* @work-item-id WI-384
|
|
29
|
+
* @work-item-id WI-385
|
|
28
30
|
*
|
|
29
31
|
* Phasegate CLI エントリポイント。
|
|
30
32
|
* 各Unitの Composition Root からハンドラーを取得し、コマンドに応じてディスパッチする。
|
|
@@ -45,7 +47,7 @@ import { basename, dirname, join, resolve } from "node:path";
|
|
|
45
47
|
import { fileURLToPath } from "node:url";
|
|
46
48
|
import { createAdrFoundationModule } from "./adr-foundation/composition-root.js";
|
|
47
49
|
import { createBiomeAstEngineModule } from "./biome-ast-engine/composition-root.js";
|
|
48
|
-
import { buildCiGovernance } from "./ci-governance/composition-root.js";
|
|
50
|
+
import { buildCiGovernance, type CiGovernanceDocPaths } from "./ci-governance/composition-root.js";
|
|
49
51
|
import { toPhaseConfigSection } from "./config-foundation/application/mappers/phase-config-section-mapper.js";
|
|
50
52
|
import { toValidatorSystemConfig } from "./config-foundation/application/mappers/validator-system-config-mapper.js";
|
|
51
53
|
import { toWorldModelConfig } from "./config-foundation/application/mappers/world-model-config-mapper.js";
|
|
@@ -63,6 +65,7 @@ import {
|
|
|
63
65
|
SkillDeployerManifestBuilder,
|
|
64
66
|
} from "./installation/application/wrappers/skill-deployer-manifest-builder.js";
|
|
65
67
|
import { createInstallationModule } from "./installation/composition-root.js";
|
|
68
|
+
import { type AgentTarget, isAgentTarget } from "./installation/domain/agent-target.js";
|
|
66
69
|
import { NodeCryptoHashAdapter } from "./installation/infrastructure/adapters/node-crypto-hash-adapter.js";
|
|
67
70
|
import { CheckStoryReflectionUseCase } from "./phase-dependency-model/application/usecases/check-story-reflection-usecase.js";
|
|
68
71
|
import { createPhaseDependencyModelModule } from "./phase-dependency-model/composition-root.js";
|
|
@@ -120,6 +123,19 @@ function toTraceabilityModelOptions(resolvedConfig: HarnessConfigV2 | undefined)
|
|
|
120
123
|
return resolvedConfig ? { pathRoots: { designDocsRoot: resolvedConfig.paths.designDocs } } : undefined;
|
|
121
124
|
}
|
|
122
125
|
|
|
126
|
+
/**
|
|
127
|
+
* WI-369: ci-governance の scaffold 系アダプタに解決済み paths を渡す。
|
|
128
|
+
* これが無いと `scaffold-design` の書き込み先が `docs/product/construction` に
|
|
129
|
+
* 固定され、`paths.designDocs` を移設した PJ で scaffold 先とゲート検査先がズレる。
|
|
130
|
+
*/
|
|
131
|
+
function toCiGovernanceDocPaths(resolvedConfig: HarnessConfigV2 | undefined): CiGovernanceDocPaths {
|
|
132
|
+
if (!resolvedConfig) return {};
|
|
133
|
+
return {
|
|
134
|
+
designDocs: resolvedConfig.paths.designDocs,
|
|
135
|
+
inceptionDocs: resolvedConfig.paths.inceptionDocs,
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
|
|
123
139
|
interface PackageJsonDocument {
|
|
124
140
|
readonly [key: string]: unknown;
|
|
125
141
|
readonly dependencies?: unknown;
|
|
@@ -194,14 +210,14 @@ Usage: phasegate <command> [options]
|
|
|
194
210
|
Setup:
|
|
195
211
|
init Initialize project: deploy skills + design docs + phasegate.config.json
|
|
196
212
|
(--name <project-name>, --preset <full|standard|minimal|custom>,
|
|
197
|
-
--skills <core|all>, --agent <claude|codex|both>, --workflow <standard|strict>,
|
|
213
|
+
--skills <core|all>, --agent <claude|codex|both|grok|antigravity|all>, --workflow <standard|strict>,
|
|
198
214
|
--language <language>, --with-husky, --with-ci, --yes)
|
|
199
215
|
update-skills Alias for reconcile (kept for compatibility)
|
|
200
|
-
doctor Diagnose silent installation failures (--json, --strict, --personal, --agent <claude|codex|both>, --report-out <path>)
|
|
216
|
+
doctor Diagnose silent installation failures (--json, --strict, --personal, --agent <claude|codex|both|grok|antigravity|all>, --report-out <path>)
|
|
201
217
|
scaffold-wi <unit|_cross> <story|issue|fix|refactor|chore>
|
|
202
218
|
Create docs/inception/{unit}/WI-XXX/description.md
|
|
203
219
|
emit-agent-rules Print AGENTS.md / CLAUDE.md WI workflow rules block
|
|
204
|
-
install Install phasegate managed files (--dry-run|--apply, --force, --personal, --agent <claude|codex|both>)
|
|
220
|
+
install Install phasegate managed files (--dry-run|--apply, --force, --personal, --agent <claude|codex|both|grok|antigravity|all>)
|
|
205
221
|
uninstall Uninstall phasegate managed files (--dry-run|--apply, --force)
|
|
206
222
|
reconcile Reconcile phasegate managed files (--dry-run|--apply, --force)
|
|
207
223
|
setup:agent Diagnose repo setup and produce/apply an agent-readable setup plan
|
|
@@ -258,11 +274,12 @@ Gate semantics:
|
|
|
258
274
|
ci:auto-refresh-agent-context Refresh AGENTS.md / CLAUDE.md (--dry-run, --apply, --json)
|
|
259
275
|
refresh-claude-md Refresh CLAUDE.md standard sections (--dry-run, --apply, --json)
|
|
260
276
|
p2:check-agent-context Check AGENTS.md / CLAUDE.md freshness (--threshold-days <n>, --json)
|
|
261
|
-
setup:agent Plan agent-driven setup (--intent <minimal|recommended|strict|ci-only|agent-hooks|retrofit>, --agent <claude|codex|both>, --dry-run|--apply, --json)
|
|
277
|
+
setup:agent Plan agent-driven setup (--intent <minimal|recommended|strict|ci-only|agent-hooks|retrofit>, --agent <claude|codex|both|grok|antigravity|all>, --dry-run|--apply, --json)
|
|
262
278
|
config:plan Plan safe config changes (--intent <l4-strict|codex-hooks|ci-fail-on-warning|baseline-reset|quick-mode-strict|quick-mode-relax|retrofit-bootstrap|planning-mode-relax>, --dry-run|--apply, --json)
|
|
263
279
|
ci:check-repetition Check error repetition (--code <errorCode>, --reset, --json)
|
|
264
280
|
baseline Create retrofit baseline snapshot (--dry-run, --force, --paths <glob,glob,...>, --json)
|
|
265
281
|
scaffold-design Scaffold a design doc (--unit <id>, --phase <logical|domain|uiux|unit-test|it-test>, --dry-run|--apply, --force, --json)
|
|
282
|
+
scaffold-inception Scaffold an inception/product doc (--kind <product-overview-plan|product-overview|story-writer-plan|story-mapping-plan|unit-design-plan>, --dry-run|--apply, --force, --json)
|
|
266
283
|
session begin Start a Full Mode session (--mode full, --unit, --work-item, --reason, --duration)
|
|
267
284
|
session end End a Full Mode session (--work-item)
|
|
268
285
|
|
|
@@ -294,6 +311,10 @@ Skills:
|
|
|
294
311
|
skills list List all available skills
|
|
295
312
|
skills info <name> Show skill details (SKILL.md)
|
|
296
313
|
|
|
314
|
+
Templates:
|
|
315
|
+
templates list List bundled document templates
|
|
316
|
+
templates show <name> Print a bundled template to stdout
|
|
317
|
+
|
|
297
318
|
Options:
|
|
298
319
|
--help Show this help message
|
|
299
320
|
--version Show version number
|
|
@@ -687,7 +708,7 @@ Options:
|
|
|
687
708
|
--name <project-name> Project name (default: "my-project")
|
|
688
709
|
--preset <full|standard|minimal|custom> Phase dependency preset (default: "standard")
|
|
689
710
|
--skills <core|all> Skill set to deploy (default: "all")
|
|
690
|
-
--agent <claude|codex|both> Agent integration target (default: "claude")
|
|
711
|
+
--agent <claude|codex|both|grok|antigravity|all> Agent integration target (default: "claude")
|
|
691
712
|
--workflow <standard|strict> Workflow enforcement defaults (default: "standard")
|
|
692
713
|
--language <language> Project language declaration (default: "typescript")
|
|
693
714
|
--with-husky Install Husky pre-commit hooks
|
|
@@ -713,7 +734,7 @@ Options:
|
|
|
713
734
|
--dry-run Preview target actions without writing (default)
|
|
714
735
|
--apply Write merge results and manifest
|
|
715
736
|
--force Force ai-assisted/manual targets after backing up existing files
|
|
716
|
-
--agent <claude|codex|both> Agent context and hook targets (default: both)
|
|
737
|
+
--agent <claude|codex|both|grok|antigravity|all> Agent context and hook targets (default: both)
|
|
717
738
|
--skills <core|all> Rendered agent context skill mode (default: all)
|
|
718
739
|
--workflow <standard|strict> Rendered agent context workflow mode (default: standard)
|
|
719
740
|
--with-husky Include Husky hook targets (opt-in; omitted by default)
|
|
@@ -722,13 +743,24 @@ Options:
|
|
|
722
743
|
With --agent claude, initializes .phasegate-local config/settings/skills and ignored .claude shims.
|
|
723
744
|
--json Output machine-readable JSON
|
|
724
745
|
--help, -h Show this help`,
|
|
746
|
+
doctor: `Usage: phasegate doctor [options]
|
|
747
|
+
|
|
748
|
+
Diagnose silent installation failures for the selected runtime scope.
|
|
749
|
+
|
|
750
|
+
Options:
|
|
751
|
+
--json Output machine-readable JSON
|
|
752
|
+
--strict Treat warnings as failures
|
|
753
|
+
--personal Diagnose a personal installation
|
|
754
|
+
--agent <claude|codex|both|grok|antigravity|all> Diagnostic scope (default: both)
|
|
755
|
+
--report-out <path> Write the JSON report to a file
|
|
756
|
+
--help, -h Show this help`,
|
|
725
757
|
"setup:agent": `Usage: phasegate setup:agent [options]
|
|
726
758
|
|
|
727
759
|
Diagnose repository setup and produce an agent-readable setup plan.
|
|
728
760
|
|
|
729
761
|
Options:
|
|
730
762
|
--intent <minimal|recommended|strict|ci-only|agent-hooks|retrofit>
|
|
731
|
-
--agent <claude|codex|both>
|
|
763
|
+
--agent <claude|codex|both|grok|antigravity|all>
|
|
732
764
|
--workflow <standard|strict>
|
|
733
765
|
--with-husky
|
|
734
766
|
--with-ci
|
|
@@ -900,6 +932,33 @@ Options:
|
|
|
900
932
|
--force Overwrite an existing target when applying.
|
|
901
933
|
--json Output machine-readable JSON.
|
|
902
934
|
--help, -h Show this help`,
|
|
935
|
+
"scaffold-inception": `Usage: phasegate scaffold-inception --kind <doc-kind> [options]
|
|
936
|
+
|
|
937
|
+
Scaffold an inception plan document or the product overview.
|
|
938
|
+
Targets follow paths.inceptionDocs / paths.designDocs from phasegate.config.json.
|
|
939
|
+
|
|
940
|
+
Options:
|
|
941
|
+
--kind <doc-kind> product-overview-plan, product-overview, story-writer-plan,
|
|
942
|
+
story-mapping-plan, or unit-design-plan.
|
|
943
|
+
--dry-run Preview target and template without writing (default).
|
|
944
|
+
--apply Write the scaffold.
|
|
945
|
+
--force Overwrite an existing target when applying.
|
|
946
|
+
--json Output machine-readable JSON.
|
|
947
|
+
--help, -h Show this help`,
|
|
948
|
+
templates: `Usage: phasegate templates <list|show <name>>
|
|
949
|
+
|
|
950
|
+
Print bundled document templates to stdout, without reading node_modules.
|
|
951
|
+
|
|
952
|
+
Subcommands:
|
|
953
|
+
list List available template names.
|
|
954
|
+
show <name> Print the template body to stdout.
|
|
955
|
+
|
|
956
|
+
Options:
|
|
957
|
+
--json Output machine-readable JSON (list only).
|
|
958
|
+
--help, -h Show this help
|
|
959
|
+
|
|
960
|
+
Notes:
|
|
961
|
+
<name> is matched against the bundled template catalog. Paths are rejected.`,
|
|
903
962
|
session: `Usage: phasegate session <begin|end> [options]
|
|
904
963
|
|
|
905
964
|
Manage hook-visible Full Mode sessions.
|
|
@@ -1030,7 +1089,7 @@ function parseCoverageThreshold(raw: string | undefined): number {
|
|
|
1030
1089
|
}
|
|
1031
1090
|
|
|
1032
1091
|
type InitPhasePreset = "full" | "standard" | "minimal" | "custom";
|
|
1033
|
-
|
|
1092
|
+
const AGENT_TARGET_USAGE = "claude|codex|both|grok|antigravity|all";
|
|
1034
1093
|
type SetupIntent = "minimal" | "recommended" | "strict" | "ci-only" | "agent-hooks" | "retrofit";
|
|
1035
1094
|
type ConfigChangeIntent =
|
|
1036
1095
|
| "l4-strict"
|
|
@@ -1052,7 +1111,7 @@ interface SetupCompletenessEntry {
|
|
|
1052
1111
|
}
|
|
1053
1112
|
|
|
1054
1113
|
interface AgentReadinessEntry {
|
|
1055
|
-
readonly agent: "claude" | "codex" | "shared";
|
|
1114
|
+
readonly agent: "claude" | "codex" | "grok" | "antigravity" | "shared";
|
|
1056
1115
|
readonly status: SetupCompletenessStatus;
|
|
1057
1116
|
readonly evidence: readonly string[];
|
|
1058
1117
|
readonly nextAction: string | null;
|
|
@@ -1089,14 +1148,9 @@ function parseInitPhasePreset(value: string | undefined): InitPhasePreset | unde
|
|
|
1089
1148
|
return undefined;
|
|
1090
1149
|
}
|
|
1091
1150
|
|
|
1092
|
-
function parseAgentTarget(value: string | undefined, fallback: AgentTarget = "both"): AgentTarget {
|
|
1093
|
-
if (value === "claude" || value === "codex" || value === "both") return value;
|
|
1094
|
-
return fallback;
|
|
1095
|
-
}
|
|
1096
|
-
|
|
1097
1151
|
function parseRequiredAgentTarget(value: string | undefined, fallback: AgentTarget = "both"): AgentTarget | null {
|
|
1098
1152
|
if (value === undefined) return fallback;
|
|
1099
|
-
if (value
|
|
1153
|
+
if (isAgentTarget(value)) return value;
|
|
1100
1154
|
return null;
|
|
1101
1155
|
}
|
|
1102
1156
|
|
|
@@ -1189,6 +1243,7 @@ function buildSetupCompleteness(input: {
|
|
|
1189
1243
|
readonly phasegateConfig: boolean;
|
|
1190
1244
|
readonly claudeSettings: boolean;
|
|
1191
1245
|
readonly codexHooks: boolean;
|
|
1246
|
+
readonly antigravityHooks: boolean;
|
|
1192
1247
|
readonly agentsMd: boolean;
|
|
1193
1248
|
readonly claudeMd: boolean;
|
|
1194
1249
|
readonly huskyPreCommit: boolean;
|
|
@@ -1196,12 +1251,19 @@ function buildSetupCompleteness(input: {
|
|
|
1196
1251
|
readonly skillsVersion: boolean;
|
|
1197
1252
|
};
|
|
1198
1253
|
}): readonly SetupCompletenessEntry[] {
|
|
1199
|
-
const includeClaude = input.agent === "claude" || input.agent === "both";
|
|
1200
|
-
const includeCodex = input.agent === "codex" || input.agent === "both";
|
|
1254
|
+
const includeClaude = input.agent === "claude" || input.agent === "both" || input.agent === "all";
|
|
1255
|
+
const includeCodex = input.agent === "codex" || input.agent === "both" || input.agent === "all";
|
|
1256
|
+
const includeGrok = input.agent === "grok" || input.agent === "all";
|
|
1257
|
+
const includeAntigravity = input.agent === "antigravity" || input.agent === "all";
|
|
1258
|
+
const includeClaudeHook = includeClaude || includeGrok;
|
|
1259
|
+
const includeAgentsContext = includeCodex || includeGrok || includeAntigravity;
|
|
1201
1260
|
const doctorCommand = doctorValidationCommand(input.agent);
|
|
1202
1261
|
const agentHooksConfigured =
|
|
1203
|
-
(!
|
|
1204
|
-
|
|
1262
|
+
(!includeClaudeHook || input.checks.claudeSettings) &&
|
|
1263
|
+
(!includeCodex || input.checks.codexHooks) &&
|
|
1264
|
+
(!includeAntigravity || input.checks.antigravityHooks);
|
|
1265
|
+
const agentContextConfigured =
|
|
1266
|
+
(!includeClaude || input.checks.claudeMd) && (!includeAgentsContext || input.checks.agentsMd);
|
|
1205
1267
|
const entries: SetupCompletenessEntry[] = [
|
|
1206
1268
|
setupCompletenessEntry({
|
|
1207
1269
|
area: "local-config",
|
|
@@ -1213,16 +1275,22 @@ function buildSetupCompleteness(input: {
|
|
|
1213
1275
|
}),
|
|
1214
1276
|
setupCompletenessEntry({
|
|
1215
1277
|
area: "agent-hooks",
|
|
1216
|
-
included:
|
|
1278
|
+
included: includeClaudeHook || includeCodex || includeAntigravity,
|
|
1217
1279
|
configured: agentHooksConfigured,
|
|
1218
1280
|
configuredEvidence: "Selected agent hook settings are present.",
|
|
1219
1281
|
plannedEvidence: "setup:agent will create or refresh selected agent hook settings.",
|
|
1220
1282
|
nextAction: "Run setup:agent --apply for selected agents.",
|
|
1221
|
-
risk: includeCodex
|
|
1283
|
+
risk: includeCodex
|
|
1284
|
+
? "Codex user-level hook feature enablement remains a manual external check."
|
|
1285
|
+
: includeGrok
|
|
1286
|
+
? "Grok project-hook trust remains a manual external check."
|
|
1287
|
+
: includeAntigravity
|
|
1288
|
+
? "Antigravity hard blocking is CLI-only; IDE/desktop relies on L2 pre-commit."
|
|
1289
|
+
: undefined,
|
|
1222
1290
|
}),
|
|
1223
1291
|
setupCompletenessEntry({
|
|
1224
1292
|
area: "agent-context",
|
|
1225
|
-
included: includeClaude ||
|
|
1293
|
+
included: includeClaude || includeAgentsContext,
|
|
1226
1294
|
configured: agentContextConfigured,
|
|
1227
1295
|
configuredEvidence: "Selected AGENTS.md / CLAUDE.md managed context files are present.",
|
|
1228
1296
|
plannedEvidence: "setup:agent will create or refresh selected managed agent context sections.",
|
|
@@ -1326,6 +1394,7 @@ function buildAgentReadiness(input: {
|
|
|
1326
1394
|
readonly phasegateConfig: boolean;
|
|
1327
1395
|
readonly claudeSettings: boolean;
|
|
1328
1396
|
readonly codexHooks: boolean;
|
|
1397
|
+
readonly antigravityHooks: boolean;
|
|
1329
1398
|
readonly agentsMd: boolean;
|
|
1330
1399
|
readonly claudeMd: boolean;
|
|
1331
1400
|
readonly huskyPreCommit: boolean;
|
|
@@ -1333,8 +1402,10 @@ function buildAgentReadiness(input: {
|
|
|
1333
1402
|
readonly skillsVersion: boolean;
|
|
1334
1403
|
};
|
|
1335
1404
|
}): readonly AgentReadinessEntry[] {
|
|
1336
|
-
const includeClaude = input.agent === "claude" || input.agent === "both";
|
|
1337
|
-
const includeCodex = input.agent === "codex" || input.agent === "both";
|
|
1405
|
+
const includeClaude = input.agent === "claude" || input.agent === "both" || input.agent === "all";
|
|
1406
|
+
const includeCodex = input.agent === "codex" || input.agent === "both" || input.agent === "all";
|
|
1407
|
+
const includeGrok = input.agent === "grok" || input.agent === "all";
|
|
1408
|
+
const includeAntigravity = input.agent === "antigravity" || input.agent === "all";
|
|
1338
1409
|
const doctorCommand = doctorValidationCommand(input.agent);
|
|
1339
1410
|
const sharedConfigured =
|
|
1340
1411
|
input.checks.packageJson &&
|
|
@@ -1378,6 +1449,24 @@ function buildAgentReadiness(input: {
|
|
|
1378
1449
|
nextAction: "Run setup:agent --agent codex --apply, then enable hooks at user level if needed.",
|
|
1379
1450
|
risk: "Codex user-level hook feature enablement remains a manual external check.",
|
|
1380
1451
|
}),
|
|
1452
|
+
setupReadinessEntry({
|
|
1453
|
+
agent: "grok",
|
|
1454
|
+
included: includeGrok,
|
|
1455
|
+
configured: input.checks.claudeSettings && input.checks.agentsMd,
|
|
1456
|
+
configuredEvidence: [".claude/settings.json and AGENTS.md are present for Grok compatibility."],
|
|
1457
|
+
plannedEvidence: ["setup:agent will deploy the Claude-compatible hook and AGENTS.md without .grok duplication."],
|
|
1458
|
+
nextAction: "Run setup:agent --agent grok --apply, then verify grok inspect and /hooks trust.",
|
|
1459
|
+
risk: "Grok project-hook trust cannot be verified by Phasegate.",
|
|
1460
|
+
}),
|
|
1461
|
+
setupReadinessEntry({
|
|
1462
|
+
agent: "antigravity",
|
|
1463
|
+
included: includeAntigravity,
|
|
1464
|
+
configured: input.checks.antigravityHooks && input.checks.agentsMd,
|
|
1465
|
+
configuredEvidence: [".agents/hooks.json and AGENTS.md are present for Antigravity CLI."],
|
|
1466
|
+
plannedEvidence: ["setup:agent will deploy the Antigravity named hook map and AGENTS.md."],
|
|
1467
|
+
nextAction: "Run setup:agent --agent antigravity --apply, then inspect /hooks in agy.",
|
|
1468
|
+
risk: "IDE/desktop hook execution is not guaranteed; keep the L2 pre-commit backstop.",
|
|
1469
|
+
}),
|
|
1381
1470
|
setupReadinessEntry({
|
|
1382
1471
|
agent: "shared",
|
|
1383
1472
|
included: true,
|
|
@@ -1407,14 +1496,17 @@ async function buildAgentSetupPlan(
|
|
|
1407
1496
|
phasegateConfig: await projectFileExists(rootDir, "phasegate.config.json"),
|
|
1408
1497
|
claudeSettings: await projectFileExists(rootDir, ".claude/settings.json"),
|
|
1409
1498
|
codexHooks: await projectFileExists(rootDir, ".codex/hooks.json"),
|
|
1499
|
+
antigravityHooks: await projectFileExists(rootDir, ".agents/hooks.json"),
|
|
1410
1500
|
agentsMd: await projectFileExists(rootDir, "AGENTS.md"),
|
|
1411
1501
|
claudeMd: await projectFileExists(rootDir, "CLAUDE.md"),
|
|
1412
1502
|
huskyPreCommit: await projectFileExists(rootDir, ".husky/pre-commit"),
|
|
1413
1503
|
ciWorkflow: await projectFileExists(rootDir, ".github/workflows/phasegate-aidlc-gate.yml"),
|
|
1414
1504
|
skillsVersion: await projectFileExists(rootDir, "skills/.harness-version"),
|
|
1415
1505
|
};
|
|
1416
|
-
const includeClaude = input.agent === "claude" || input.agent === "both";
|
|
1417
|
-
const includeCodex = input.agent === "codex" || input.agent === "both";
|
|
1506
|
+
const includeClaude = input.agent === "claude" || input.agent === "both" || input.agent === "all";
|
|
1507
|
+
const includeCodex = input.agent === "codex" || input.agent === "both" || input.agent === "all";
|
|
1508
|
+
const includeGrok = input.agent === "grok" || input.agent === "all";
|
|
1509
|
+
const includeAntigravity = input.agent === "antigravity" || input.agent === "all";
|
|
1418
1510
|
const changes = [
|
|
1419
1511
|
!checks.packageJson
|
|
1420
1512
|
? "Add phasegate devDependency and phasegate scripts to package.json."
|
|
@@ -1424,6 +1516,8 @@ async function buildAgentSetupPlan(
|
|
|
1424
1516
|
: "Keep existing phasegate.config.json; review config:plan before changing policy.",
|
|
1425
1517
|
includeClaude ? "Create or refresh .claude/settings.json and CLAUDE.md managed section." : null,
|
|
1426
1518
|
includeCodex ? "Create or refresh .codex/hooks.json and AGENTS.md managed section." : null,
|
|
1519
|
+
includeGrok ? "Create or refresh the Claude-compatible hook and AGENTS.md without a .grok hook duplicate." : null,
|
|
1520
|
+
includeAntigravity ? "Create or refresh .agents/hooks.json named hook and AGENTS.md managed section." : null,
|
|
1427
1521
|
input.withHusky
|
|
1428
1522
|
? "Create or refresh Husky pre-commit, commit-msg, and pre-push backstops."
|
|
1429
1523
|
: "Leave Husky hooks unmanaged in this setup run.",
|
|
@@ -2055,8 +2149,8 @@ async function main(): Promise<void> {
|
|
|
2055
2149
|
}
|
|
2056
2150
|
const skillSet: SkillSet = skillSetRaw;
|
|
2057
2151
|
const agentRaw = parseFlag(args, "--agent") ?? "claude";
|
|
2058
|
-
if (agentRaw
|
|
2059
|
-
console.error(`Invalid --agent value: "${agentRaw}". Use
|
|
2152
|
+
if (!isAgentTarget(agentRaw)) {
|
|
2153
|
+
console.error(`Invalid --agent value: "${agentRaw}". Use <${AGENT_TARGET_USAGE}>.`);
|
|
2060
2154
|
process.exit(2);
|
|
2061
2155
|
}
|
|
2062
2156
|
const agent = agentRaw;
|
|
@@ -2071,8 +2165,8 @@ async function main(): Promise<void> {
|
|
|
2071
2165
|
console.error("Invalid --language value: value must not be empty.");
|
|
2072
2166
|
process.exit(2);
|
|
2073
2167
|
}
|
|
2074
|
-
const deployClaude = agent === "claude" || agent === "both";
|
|
2075
|
-
const deployCodex = agent === "codex" || agent === "both";
|
|
2168
|
+
const deployClaude = agent === "claude" || agent === "both" || agent === "grok" || agent === "all";
|
|
2169
|
+
const deployCodex = agent === "codex" || agent === "both" || agent === "all";
|
|
2076
2170
|
const result = await deploySkills(harnessRoot, rootDir, skillSet);
|
|
2077
2171
|
const packageResult = await ensurePhasegatePackageDependency(rootDir, result.version);
|
|
2078
2172
|
const skillLinkResult = await deployAgentSkillLinks(rootDir, {
|
|
@@ -2267,11 +2361,15 @@ async function main(): Promise<void> {
|
|
|
2267
2361
|
console.log(" 3. Edit .claude/scripts/hook-config.json to set target directories");
|
|
2268
2362
|
}
|
|
2269
2363
|
if (deployCodex) {
|
|
2270
|
-
console.log(
|
|
2364
|
+
console.log(
|
|
2365
|
+
` ${deployClaude ? "4" : "3"}. Use Codex CLI >= 0.124.0, then open /hooks and trust the current hook definition hash`,
|
|
2366
|
+
);
|
|
2271
2367
|
console.log(
|
|
2272
2368
|
` ${deployClaude ? "5" : "4"}. (Recommended) Install pre-commit backstop: rerun with --with-husky or set up husky manually`,
|
|
2273
2369
|
);
|
|
2274
|
-
console.log(
|
|
2370
|
+
console.log(
|
|
2371
|
+
` See docs/guide/codex-integration.md for native apply_patch coverage and trust troubleshooting.`,
|
|
2372
|
+
);
|
|
2275
2373
|
}
|
|
2276
2374
|
if (skillSet !== "core") {
|
|
2277
2375
|
console.log("");
|
|
@@ -2318,7 +2416,7 @@ async function main(): Promise<void> {
|
|
|
2318
2416
|
}
|
|
2319
2417
|
const agent = parseRequiredAgentTarget(parseFlag(args, "--agent"), "both");
|
|
2320
2418
|
if (agent === null) {
|
|
2321
|
-
console.error(`Invalid --agent value: "${parseFlag(args, "--agent")}". Use
|
|
2419
|
+
console.error(`Invalid --agent value: "${parseFlag(args, "--agent")}". Use <${AGENT_TARGET_USAGE}>.`);
|
|
2322
2420
|
process.exit(2);
|
|
2323
2421
|
}
|
|
2324
2422
|
const mod = createInstallationModule();
|
|
@@ -2389,7 +2487,11 @@ async function main(): Promise<void> {
|
|
|
2389
2487
|
}
|
|
2390
2488
|
const apply = hasFlag(args, "--apply");
|
|
2391
2489
|
const dryRun = hasFlag(args, "--dry-run") || !apply;
|
|
2392
|
-
const agent =
|
|
2490
|
+
const agent = parseRequiredAgentTarget(parseFlag(args, "--agent"), "both");
|
|
2491
|
+
if (agent === null) {
|
|
2492
|
+
console.error(`Invalid --agent value: "${parseFlag(args, "--agent")}". Use <${AGENT_TARGET_USAGE}>.`);
|
|
2493
|
+
process.exit(2);
|
|
2494
|
+
}
|
|
2393
2495
|
const skillSetRaw = parseFlag(args, "--skills") ?? "all";
|
|
2394
2496
|
if (skillSetRaw !== "core" && skillSetRaw !== "all") {
|
|
2395
2497
|
console.error(`Invalid --skills value: "${skillSetRaw}". Use "core" or "all".`);
|
|
@@ -2400,8 +2502,8 @@ async function main(): Promise<void> {
|
|
|
2400
2502
|
console.error(`Invalid --workflow value: "${workflowRaw}". Use "standard" or "strict".`);
|
|
2401
2503
|
process.exit(2);
|
|
2402
2504
|
}
|
|
2403
|
-
const includeClaude = agent === "claude" || agent === "both";
|
|
2404
|
-
const includeCodex = agent === "codex" || agent === "both";
|
|
2505
|
+
const includeClaude = agent === "claude" || agent === "both" || agent === "grok" || agent === "all";
|
|
2506
|
+
const includeCodex = agent === "codex" || agent === "both" || agent === "all";
|
|
2405
2507
|
const personal = hasFlag(args, "--personal");
|
|
2406
2508
|
const mod = createInstallationModule();
|
|
2407
2509
|
const phasegateVersion = await getHarnessVersion(harnessRoot);
|
|
@@ -2445,7 +2547,11 @@ async function main(): Promise<void> {
|
|
|
2445
2547
|
process.exit(2);
|
|
2446
2548
|
}
|
|
2447
2549
|
const intent = parseSetupIntent(parseFlag(args, "--intent"));
|
|
2448
|
-
const agent =
|
|
2550
|
+
const agent = parseRequiredAgentTarget(parseFlag(args, "--agent"), "both");
|
|
2551
|
+
if (agent === null) {
|
|
2552
|
+
console.error(`Invalid --agent value: "${parseFlag(args, "--agent")}". Use <${AGENT_TARGET_USAGE}>.`);
|
|
2553
|
+
process.exit(2);
|
|
2554
|
+
}
|
|
2449
2555
|
const workflow = parseWorkflowMode(
|
|
2450
2556
|
parseFlag(args, "--workflow") ?? (intent === "strict" ? "strict" : "standard"),
|
|
2451
2557
|
);
|
|
@@ -2481,8 +2587,8 @@ async function main(): Promise<void> {
|
|
|
2481
2587
|
dryRun: false,
|
|
2482
2588
|
apply: true,
|
|
2483
2589
|
force: hasFlag(args, "--force"),
|
|
2484
|
-
includeClaude: agent === "claude" || agent === "both",
|
|
2485
|
-
includeCodex: agent === "codex" || agent === "both",
|
|
2590
|
+
includeClaude: agent === "claude" || agent === "both" || agent === "grok" || agent === "all",
|
|
2591
|
+
includeCodex: agent === "codex" || agent === "both" || agent === "all",
|
|
2486
2592
|
includeHusky: withHusky,
|
|
2487
2593
|
includeCi: withCi,
|
|
2488
2594
|
skillSet: "all",
|
|
@@ -2965,7 +3071,10 @@ async function main(): Promise<void> {
|
|
|
2965
3071
|
case "ci-check": {
|
|
2966
3072
|
const quick = hasFlag(args, "--quick");
|
|
2967
3073
|
if (quick) {
|
|
2968
|
-
|
|
3074
|
+
// WI-364: check-change-category (WI-351) と同様に解決済み configPath / rootDir を注入する。
|
|
3075
|
+
// 無指定だと quickMode 設定を cwd 基準でしか探せず、サブディレクトリ実行で
|
|
3076
|
+
// HarnessConfigNotFoundError → exit 2 になっていた。
|
|
3077
|
+
const mod = createQuickModeCompositionRoot(await resolveQuickModeCompositionOptions());
|
|
2969
3078
|
const failOnReject = hasFlag(args, "--fail-on-reject");
|
|
2970
3079
|
const dryRun = hasFlag(args, "--dry-run");
|
|
2971
3080
|
const files = parseFlag(args, "--files");
|
|
@@ -3241,7 +3350,7 @@ Examples:
|
|
|
3241
3350
|
console.error(flagError);
|
|
3242
3351
|
process.exit(2);
|
|
3243
3352
|
}
|
|
3244
|
-
const mod = buildCiGovernance(rootDir, harnessRoot);
|
|
3353
|
+
const mod = buildCiGovernance(rootDir, harnessRoot, toCiGovernanceDocPaths(resolvedConfig));
|
|
3245
3354
|
const presetId = parseFlag(args, "--preset") ?? "standard";
|
|
3246
3355
|
const templateType = parseFlag(args, "--type") ?? "aidlc-gate";
|
|
3247
3356
|
const render = hasFlag(args, "--render");
|
|
@@ -3253,7 +3362,7 @@ Examples:
|
|
|
3253
3362
|
}
|
|
3254
3363
|
|
|
3255
3364
|
case "ci:migrate-agents-md": {
|
|
3256
|
-
const mod = buildCiGovernance(rootDir, harnessRoot);
|
|
3365
|
+
const mod = buildCiGovernance(rootDir, harnessRoot, toCiGovernanceDocPaths(resolvedConfig));
|
|
3257
3366
|
const dryRun = hasFlag(args, "--dry-run");
|
|
3258
3367
|
const validateOnly = hasFlag(args, "--validate-only");
|
|
3259
3368
|
const format = json ? "json" : "human";
|
|
@@ -3264,7 +3373,7 @@ Examples:
|
|
|
3264
3373
|
}
|
|
3265
3374
|
|
|
3266
3375
|
case "ci:auto-refresh-agent-context": {
|
|
3267
|
-
const mod = buildCiGovernance(rootDir, harnessRoot);
|
|
3376
|
+
const mod = buildCiGovernance(rootDir, harnessRoot, toCiGovernanceDocPaths(resolvedConfig));
|
|
3268
3377
|
const dryRun = hasFlag(args, "--dry-run");
|
|
3269
3378
|
const apply = hasFlag(args, "--apply");
|
|
3270
3379
|
const format = json ? "json" : "human";
|
|
@@ -3275,7 +3384,7 @@ Examples:
|
|
|
3275
3384
|
}
|
|
3276
3385
|
|
|
3277
3386
|
case "refresh-claude-md": {
|
|
3278
|
-
const mod = buildCiGovernance(rootDir, harnessRoot);
|
|
3387
|
+
const mod = buildCiGovernance(rootDir, harnessRoot, toCiGovernanceDocPaths(resolvedConfig));
|
|
3279
3388
|
const dryRun = hasFlag(args, "--dry-run");
|
|
3280
3389
|
const apply = hasFlag(args, "--apply");
|
|
3281
3390
|
const format = json ? "json" : "human";
|
|
@@ -3286,7 +3395,7 @@ Examples:
|
|
|
3286
3395
|
}
|
|
3287
3396
|
|
|
3288
3397
|
case "p2:check-agent-context": {
|
|
3289
|
-
const mod = buildCiGovernance(rootDir, harnessRoot);
|
|
3398
|
+
const mod = buildCiGovernance(rootDir, harnessRoot, toCiGovernanceDocPaths(resolvedConfig));
|
|
3290
3399
|
const thresholdRaw = parseFlag(args, "--threshold-days");
|
|
3291
3400
|
const thresholdDays = thresholdRaw === undefined ? undefined : Number(thresholdRaw);
|
|
3292
3401
|
const format = json ? "json" : "human";
|
|
@@ -3297,7 +3406,7 @@ Examples:
|
|
|
3297
3406
|
}
|
|
3298
3407
|
|
|
3299
3408
|
case "ci:check-repetition": {
|
|
3300
|
-
const mod = buildCiGovernance(rootDir, harnessRoot);
|
|
3409
|
+
const mod = buildCiGovernance(rootDir, harnessRoot, toCiGovernanceDocPaths(resolvedConfig));
|
|
3301
3410
|
const errorCode = parseFlag(args, "--code") ?? "";
|
|
3302
3411
|
const reset = hasFlag(args, "--reset");
|
|
3303
3412
|
const format = json ? "json" : "human";
|
|
@@ -3308,7 +3417,7 @@ Examples:
|
|
|
3308
3417
|
}
|
|
3309
3418
|
|
|
3310
3419
|
case "baseline": {
|
|
3311
|
-
const mod = buildCiGovernance(rootDir, harnessRoot);
|
|
3420
|
+
const mod = buildCiGovernance(rootDir, harnessRoot, toCiGovernanceDocPaths(resolvedConfig));
|
|
3312
3421
|
const dryRun = hasFlag(args, "--dry-run");
|
|
3313
3422
|
const force = hasFlag(args, "--force");
|
|
3314
3423
|
const pathsFlag = parseFlag(args, "--paths");
|
|
@@ -3331,7 +3440,7 @@ Examples:
|
|
|
3331
3440
|
}
|
|
3332
3441
|
|
|
3333
3442
|
case "scaffold-design": {
|
|
3334
|
-
const mod = buildCiGovernance(rootDir, harnessRoot);
|
|
3443
|
+
const mod = buildCiGovernance(rootDir, harnessRoot, toCiGovernanceDocPaths(resolvedConfig));
|
|
3335
3444
|
const unit = parseFlag(args, "--unit") ?? "";
|
|
3336
3445
|
const phase = parseFlag(args, "--phase") ?? "";
|
|
3337
3446
|
const dryRun = hasFlag(args, "--dry-run");
|
|
@@ -3351,8 +3460,50 @@ Examples:
|
|
|
3351
3460
|
return;
|
|
3352
3461
|
}
|
|
3353
3462
|
|
|
3463
|
+
case "scaffold-inception": {
|
|
3464
|
+
const mod = buildCiGovernance(rootDir, harnessRoot, toCiGovernanceDocPaths(resolvedConfig));
|
|
3465
|
+
const kind = parseFlag(args, "--kind") ?? "";
|
|
3466
|
+
const dryRun = hasFlag(args, "--dry-run");
|
|
3467
|
+
const apply = hasFlag(args, "--apply");
|
|
3468
|
+
const force = hasFlag(args, "--force");
|
|
3469
|
+
const format = json ? "json" : "human";
|
|
3470
|
+
const result = await mod.scaffoldInceptionHandler.handle({
|
|
3471
|
+
kind,
|
|
3472
|
+
dryRun,
|
|
3473
|
+
apply,
|
|
3474
|
+
force,
|
|
3475
|
+
format,
|
|
3476
|
+
});
|
|
3477
|
+
console.log(result.output);
|
|
3478
|
+
await finishCliExit(result.exitCode);
|
|
3479
|
+
return;
|
|
3480
|
+
}
|
|
3481
|
+
|
|
3482
|
+
case "templates": {
|
|
3483
|
+
const mod = buildCiGovernance(rootDir, harnessRoot, toCiGovernanceDocPaths(resolvedConfig));
|
|
3484
|
+
const subCommand = args[1];
|
|
3485
|
+
const emit = async (result: { exitCode: number; output: string; errorOutput: string }): Promise<void> => {
|
|
3486
|
+
if (result.output.length > 0) console.log(result.output);
|
|
3487
|
+
if (result.errorOutput.length > 0) console.error(result.errorOutput);
|
|
3488
|
+
await finishCliExit(result.exitCode);
|
|
3489
|
+
};
|
|
3490
|
+
|
|
3491
|
+
if (subCommand === "list") {
|
|
3492
|
+
await emit(await mod.templatesHandler.list({ format: json ? "json" : "human" }));
|
|
3493
|
+
return;
|
|
3494
|
+
}
|
|
3495
|
+
|
|
3496
|
+
if (subCommand === "show") {
|
|
3497
|
+
await emit(await mod.templatesHandler.show({ name: args[2] }));
|
|
3498
|
+
return;
|
|
3499
|
+
}
|
|
3500
|
+
|
|
3501
|
+
await emit(mod.templatesHandler.usage());
|
|
3502
|
+
return;
|
|
3503
|
+
}
|
|
3504
|
+
|
|
3354
3505
|
case "integrity:pin": {
|
|
3355
|
-
const mod = buildCiGovernance(rootDir, harnessRoot);
|
|
3506
|
+
const mod = buildCiGovernance(rootDir, harnessRoot, toCiGovernanceDocPaths(resolvedConfig));
|
|
3356
3507
|
const dryRun = hasFlag(args, "--dry-run");
|
|
3357
3508
|
const format = json ? "json" : "human";
|
|
3358
3509
|
const result = await mod.integrityHandler.pin({ dryRun, format });
|
|
@@ -3362,7 +3513,7 @@ Examples:
|
|
|
3362
3513
|
}
|
|
3363
3514
|
|
|
3364
3515
|
case "integrity:verify": {
|
|
3365
|
-
const mod = buildCiGovernance(rootDir, harnessRoot);
|
|
3516
|
+
const mod = buildCiGovernance(rootDir, harnessRoot, toCiGovernanceDocPaths(resolvedConfig));
|
|
3366
3517
|
const format = json ? "json" : "human";
|
|
3367
3518
|
const result = await mod.integrityHandler.verify({ format });
|
|
3368
3519
|
console.log(result.output);
|
package/scripts/harness/phase-dependency-model/application/services/evidence-bundle-assembler.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @layer application
|
|
3
3
|
* @unit phase-dependency-model
|
|
4
|
+
* @work-item-id WI-369
|
|
4
5
|
*/
|
|
5
6
|
|
|
6
7
|
import type { ArtifactExistenceCheckerPort } from '../../domain/ports/artifact-existence-checker-port.js';
|
|
@@ -68,7 +69,7 @@ export class EvidenceBundleAssembler {
|
|
|
68
69
|
continue;
|
|
69
70
|
}
|
|
70
71
|
|
|
71
|
-
const actual = await this.planDocumentReader.readEvidence(node, scope, planningMode);
|
|
72
|
+
const actual = await this.planDocumentReader.readEvidence(node, scope, planningMode, pathRoots);
|
|
72
73
|
planEvidences.set(node.nodeKey(), actual);
|
|
73
74
|
}
|
|
74
75
|
|