phasegate 0.74.0 → 0.83.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.
Files changed (89) hide show
  1. package/CHANGELOG.md +123 -0
  2. package/package.json +1 -1
  3. package/scripts/harness/agent-integration/{infrastructure → application}/ports/cli-executor-port.ts +2 -2
  4. package/scripts/harness/agent-integration/application/usecases/handle-post-tool-use-usecase.ts +2 -2
  5. package/scripts/harness/agent-integration/application/usecases/handle-pre-tool-use-usecase.ts +28 -8
  6. package/scripts/harness/agent-integration/application/usecases/handle-stop-usecase.ts +1 -1
  7. package/scripts/harness/agent-integration/domain/ports/phase-gate-query-port.ts +6 -0
  8. package/scripts/harness/agent-integration/domain/services/fallback-verification-service.ts +2 -17
  9. package/scripts/harness/agent-integration/index.ts +3 -4
  10. package/scripts/harness/agent-integration/infrastructure/adapters/child-process-cli-executor-adapter.ts +2 -2
  11. package/scripts/harness/agent-integration/infrastructure/adapters/env-file-reentry-guard-state-adapter.ts +2 -10
  12. package/scripts/harness/agent-integration/infrastructure/adapters/phase-gate-query-adapter.ts +30 -0
  13. package/scripts/harness/agent-integration/presentation/session-start-hook.ts +2 -17
  14. package/scripts/harness/agent-integration/presentation/user-prompt-submit-hook.ts +2 -21
  15. package/scripts/harness/biome-ast-engine/composition-root.ts +2 -18
  16. package/scripts/harness/biome-ast-engine/domain/services/lint-runner.ts +19 -3
  17. package/scripts/harness/biome-ast-engine/domain/services/rule-definition-registry.ts +28 -3
  18. package/scripts/harness/biome-ast-engine/domain/value-objects/import-graph.ts +22 -6
  19. package/scripts/harness/biome-ast-engine/infrastructure/adapters/typescript-source-module-analyzer-adapter.ts +38 -48
  20. package/scripts/harness/biome-ast-engine/infrastructure/parsers/layer-comment-parser.ts +2 -8
  21. package/scripts/harness/biome-ast-engine/infrastructure/parsers/unit-comment-parser.ts +3 -10
  22. package/scripts/harness/ci-governance/application/usecases/generate-ci-template-usecase.ts +2 -2
  23. package/scripts/harness/ci-governance/domain/types/lesson-artifact.ts +5 -13
  24. package/scripts/harness/ci-governance/domain/types/template-type.ts +2 -6
  25. package/scripts/harness/ci-governance/domain/types/trigger-condition.ts +2 -6
  26. package/scripts/harness/ci-governance/infrastructure/adapters/harness-api-command-existence-adapter.ts +2 -6
  27. package/scripts/harness/ci-governance/infrastructure/adapters/validator-id-registry-adapter.ts +2 -6
  28. package/scripts/harness/ci-governance/infrastructure/schema/error-history-schema.ts +2 -6
  29. package/scripts/harness/ci-governance/presentation/handlers/migrate-agents-md-handler.ts +1 -1
  30. package/scripts/harness/config-foundation/domain/errors/config-foundation-domain-error.ts +3 -6
  31. package/scripts/harness/config-foundation/domain/errors/invalid-preset-error.ts +3 -6
  32. package/scripts/harness/config-foundation/domain/harness-config.ts +2 -1
  33. package/scripts/harness/config-foundation/domain/value-objects/phase-dependencies-config.ts +2 -1
  34. package/scripts/harness/config-foundation/index.ts +2 -11
  35. package/scripts/harness/harness-error/application/dto/error-definition-summary.ts +3 -6
  36. package/scripts/harness/harness-error/application/dto/harness-error-contract.ts +3 -6
  37. package/scripts/harness/harness-error/application/dto/validator-issue-draft.ts +3 -6
  38. package/scripts/harness/harness-error/domain/errors/adr-reference-not-found-error.ts +3 -6
  39. package/scripts/harness/harness-error/domain/errors/duplicate-error-code-error.ts +3 -6
  40. package/scripts/harness/harness-error/domain/errors/invalid-adr-ref-error.ts +3 -6
  41. package/scripts/harness/harness-error/domain/errors/invalid-error-code-error.ts +3 -6
  42. package/scripts/harness/harness-error/domain/errors/invalid-severity-error.ts +3 -6
  43. package/scripts/harness/harness-error/domain/errors/missing-adr-ref-error.ts +3 -6
  44. package/scripts/harness/harness-error/domain/errors/missing-fix-example-error.ts +3 -6
  45. package/scripts/harness/harness-error/domain/errors/severity-downgrade-violation-error.ts +3 -6
  46. package/scripts/harness/harness-error/domain/errors/unknown-error-definition-error.ts +3 -6
  47. package/scripts/harness/harness-error/domain/ports/fix-example-validator-port.ts +3 -7
  48. package/scripts/harness/nyquist-validation/application/dto/analyze-impact-output.ts +2 -6
  49. package/scripts/harness/nyquist-validation/infrastructure/adapters/ajv-json-schema-validator-adapter.ts +7 -19
  50. package/scripts/harness/nyquist-validation/infrastructure/adapters/traceability-model-story-registry-adapter.ts +4 -8
  51. package/scripts/harness/phase-dependency-model/application/usecases/check-story-reflection-usecase.ts +2 -13
  52. package/scripts/harness/phase-dependency-model/domain/ports/story-reflection-file-system-port.ts +2 -6
  53. package/scripts/harness/quick-mode/application/dto/change-category-classification-contract.ts +3 -7
  54. package/scripts/harness/quick-mode/index.ts +2 -13
  55. package/scripts/harness/setup/skill-deployer.ts +3 -58
  56. package/scripts/harness/skill-quality/infrastructure/adapters/ajv-lesson-artifact-schema-adapter.ts +3 -3
  57. package/scripts/harness/validator-system/application/dto/run-full-validation-input.ts +4 -10
  58. package/scripts/harness/validator-system/domain/ports/adr-reference-port.ts +2 -6
  59. package/scripts/harness/validator-system/domain/ports/it-test-file-analyzer-port.ts +2 -10
  60. package/scripts/harness/validator-system/domain/ports/metadata-policy-port.ts +3 -6
  61. package/scripts/harness/validator-system/domain/ports/source-analysis-port.ts +2 -7
  62. package/scripts/harness/validator-system/domain/ports/source-code-analyzer-port.ts +2 -7
  63. package/scripts/harness/validator-system/domain/ports/source-file-text-scanner-port.ts +2 -9
  64. package/scripts/harness/validator-system/domain/ports/test-quality-analyzer-port.ts +3 -6
  65. package/scripts/harness/validator-system/domain/services/cli-e2e-test-existence-service.ts +3 -11
  66. package/scripts/harness/validator-system/domain/services/stub-comment-detection-service.ts +3 -8
  67. package/scripts/harness/validator-system/infrastructure/adapters/cli-command-registry-adapter.ts +3 -7
  68. package/scripts/harness/agent-integration/domain/ports/import-analyzer-port.ts +0 -13
  69. package/scripts/harness/agent-integration/infrastructure/adapters/regex-import-analyzer-adapter.ts +0 -69
  70. package/scripts/harness/ci-governance/application/dto/validate-pointers-input.ts +0 -8
  71. package/scripts/harness/ci-governance/presentation/dto/ci-governance-render-options.ts +0 -9
  72. package/scripts/harness/ci-governance/presentation/formatters/error-repetition-formatter.ts +0 -26
  73. package/scripts/harness/config-foundation/infrastructure/registries/composite-feature-registry-adapter.ts +0 -22
  74. package/scripts/harness/nyquist-validation/domain/errors/story-not-found-error.ts +0 -14
  75. package/scripts/harness/nyquist-validation/presentation/dto/cli-render-options.ts +0 -12
  76. package/scripts/harness/quick-mode/application/dto/build-relaxation-profile-input.ts +0 -12
  77. package/scripts/harness/quick-mode/application/dto/execute-quick-ci-check-input.ts +0 -11
  78. package/scripts/harness/quick-mode/application/dto/judge-quick-mode-eligibility-input.ts +0 -10
  79. package/scripts/harness/quick-mode/domain/ports/quick-mode-config-port.ts +0 -12
  80. package/scripts/harness/quick-mode/domain/ports/validator-id-registry-port.ts +0 -10
  81. package/scripts/harness/shared-kernel/harness-api.ts +0 -6
  82. package/scripts/harness/shared-kernel/quick-mode.ts +0 -15
  83. package/scripts/harness/shared-kernel/validator-system.ts +0 -14
  84. package/scripts/harness/skill-quality/application/mappers/cascade-update-result-mapper.ts +0 -16
  85. package/scripts/harness/skill-quality/application/mappers/coverage-report-mapper.ts +0 -37
  86. package/scripts/harness/skill-quality/application/mappers/lesson-artifact-mapper.ts +0 -11
  87. package/scripts/harness/skill-quality/domain/types/unit-name.ts +0 -5
  88. package/scripts/harness/traceability-model/application/dto/metadata-validation-input.ts +0 -12
  89. package/scripts/harness/traceability-model/domain/constants/traceability-link-types.ts +0 -14
@@ -68,7 +68,18 @@ export class RuleDefinitionRegistry {
68
68
  'enforce-folder-structure',
69
69
  'L1-004',
70
70
  Object.freeze([REQUIRED_INPUT.sourceModuleSnapshots]),
71
- Object.freeze({ rootDir: 'scripts/harness', allowTestFixtures: true }),
71
+ Object.freeze({
72
+ rootDir: 'scripts/harness',
73
+ allowTestFixtures: true,
74
+ ignorePatterns: Object.freeze([
75
+ '**/composition-root.ts',
76
+ '**/index.ts',
77
+ '**/main.ts',
78
+ '**/shared-kernel/**',
79
+ '**/integrations/**',
80
+ '**/setup/**',
81
+ ]),
82
+ }),
72
83
  'フォルダ構造がレイヤーと一致していることを検証する',
73
84
  '宣言レイヤーと配置ディレクトリを一致させる'
74
85
  ),
@@ -101,7 +112,14 @@ export class RuleDefinitionRegistry {
101
112
  'L1-007',
102
113
  Object.freeze([REQUIRED_INPUT.importGraph]),
103
114
  Object.freeze({
104
- entryPointPatterns: Object.freeze(['**/index.ts', '**/cli/**/*.ts']),
115
+ entryPointPatterns: Object.freeze([
116
+ '**/index.ts',
117
+ '**/cli/**/*.ts',
118
+ '**/*.config*.ts',
119
+ '**/main.ts',
120
+ '**/composition-root.ts',
121
+ '**/presentation/*-hook.ts',
122
+ ]),
105
123
  ignorePatterns: Object.freeze(['**/*.test.ts', '**/*.spec.ts']),
106
124
  }),
107
125
  '未参照ファイルを検出する',
@@ -111,7 +129,14 @@ export class RuleDefinitionRegistry {
111
129
  'no-layer-violation',
112
130
  'L1-003',
113
131
  Object.freeze([REQUIRED_INPUT.sourceModuleSnapshots, REQUIRED_INPUT.importGraph]),
114
- Object.freeze({ ignorePatterns: Object.freeze(['**/shared-kernel/**']) }),
132
+ Object.freeze({
133
+ ignorePatterns: Object.freeze([
134
+ '**/shared-kernel/**',
135
+ '**/composition-root.ts',
136
+ '**/main.ts',
137
+ '**/presentation/*-hook.ts',
138
+ ]),
139
+ }),
115
140
  'レイヤー違反を検出する',
116
141
  '依存方向をアーキテクチャ方針に合わせる'
117
142
  ),
@@ -62,7 +62,7 @@ const globToRegex = (pattern: string): RegExp => {
62
62
  return new RegExp(`^${output}$`);
63
63
  };
64
64
 
65
- const matchesPattern = (value: string, pattern: string): boolean => {
65
+ export const matchesPattern = (value: string, pattern: string): boolean => {
66
66
  return globToRegex(pattern).test(value) || value.includes(pattern.replace(/\*/g, '').replace(/\//g, ''));
67
67
  };
68
68
 
@@ -169,11 +169,18 @@ export class ImportGraph {
169
169
 
170
170
  findLayerViolations(
171
171
  boundaries: readonly LayerBoundary[],
172
- layerByFile: ReadonlyMap<string, LayerName>
172
+ layerByFile: ReadonlyMap<string, LayerName>,
173
+ ignorePatterns: readonly string[] = []
173
174
  ): readonly ImportEdge[] {
174
175
  return Object.freeze(
175
176
  this.edges.filter((edge) => {
176
- const sourceLayer = layerByFile.get(edge.from.toString());
177
+ const fromStr = edge.from.toString();
178
+
179
+ if (ignorePatterns.some((pattern) => matchesPattern(fromStr, pattern))) {
180
+ return false;
181
+ }
182
+
183
+ const sourceLayer = layerByFile.get(fromStr);
177
184
  const targetLayer = layerByFile.get(edge.to.toString());
178
185
 
179
186
  if (sourceLayer === undefined || targetLayer === undefined) {
@@ -189,12 +196,21 @@ export class ImportGraph {
189
196
  );
190
197
  }
191
198
 
192
- findGhostFiles(ignorePatterns: readonly string[]): readonly FilePath[] {
199
+ findGhostFiles(
200
+ ignorePatterns: readonly string[],
201
+ entryPointPatterns: readonly string[] = []
202
+ ): readonly FilePath[] {
193
203
  const rootNodeSet = new Set(this.rootNodes.map((node) => node.toString()));
194
204
 
195
205
  return Object.freeze(
196
206
  this.nodes.filter((node) => {
197
- if (rootNodeSet.has(node.toString())) {
207
+ const nodeStr = node.toString();
208
+
209
+ if (rootNodeSet.has(nodeStr)) {
210
+ return false;
211
+ }
212
+
213
+ if (entryPointPatterns.some((pattern) => matchesPattern(nodeStr, pattern))) {
198
214
  return false;
199
215
  }
200
216
 
@@ -202,7 +218,7 @@ export class ImportGraph {
202
218
  return false;
203
219
  }
204
220
 
205
- return !ignorePatterns.some((pattern) => matchesPattern(node.toString(), pattern));
221
+ return !ignorePatterns.some((pattern) => matchesPattern(nodeStr, pattern));
206
222
  })
207
223
  );
208
224
  }
@@ -84,37 +84,47 @@ export class TypeScriptSourceModuleAnalyzerAdapter implements SourceModuleAnalyz
84
84
 
85
85
  private extractImports(sourceFile: ts.SourceFile, fromFile: FilePath): ImportEdge[] {
86
86
  const edges: ImportEdge[] = [];
87
+ const fromDir = path.dirname(path.resolve(this.rootDir, fromFile.toString()));
87
88
 
88
- ts.forEachChild(sourceFile, (node) => {
89
- if (ts.isImportDeclaration(node) && ts.isStringLiteral(node.moduleSpecifier)) {
90
- const specifier = node.moduleSpecifier.text;
89
+ const pushEdge = (specifier: string, importKind: 'value' | 'type' | 'dynamic'): void => {
90
+ if (!specifier.startsWith('.')) {
91
+ return;
92
+ }
91
93
 
92
- if (!specifier.startsWith('.')) {
93
- return;
94
- }
94
+ const resolved = path.resolve(fromDir, specifier.replace(/\.js$/, '.ts'));
95
+ const relative = path.relative(this.rootDir, resolved);
95
96
 
96
- const fromDir = path.dirname(path.resolve(this.rootDir, fromFile.toString()));
97
- const resolved = path.resolve(fromDir, specifier.replace(/\.js$/, '.ts'));
98
- const relative = path.relative(this.rootDir, resolved);
97
+ if (relative.startsWith('..')) {
98
+ return;
99
+ }
99
100
 
100
- if (relative.startsWith('..')) {
101
- return;
102
- }
101
+ try {
102
+ edges.push(
103
+ ImportEdge.create({
104
+ from: fromFile,
105
+ to: FilePathVO.fromWorkspaceRelative(relative),
106
+ importKind,
107
+ })
108
+ );
109
+ } catch {
110
+ // invalid path — skip
111
+ }
112
+ };
103
113
 
114
+ const visit = (node: ts.Node): void => {
115
+ if (ts.isImportDeclaration(node) && ts.isStringLiteral(node.moduleSpecifier)) {
104
116
  const importKind =
105
117
  node.importClause?.isTypeOnly === true ? 'type' as const : 'value' as const;
118
+ pushEdge(node.moduleSpecifier.text, importKind);
119
+ }
106
120
 
107
- try {
108
- edges.push(
109
- ImportEdge.create({
110
- from: fromFile,
111
- to: FilePathVO.fromWorkspaceRelative(relative),
112
- importKind,
113
- })
114
- );
115
- } catch {
116
- // invalid path — skip
117
- }
121
+ if (
122
+ ts.isExportDeclaration(node) &&
123
+ node.moduleSpecifier !== undefined &&
124
+ ts.isStringLiteral(node.moduleSpecifier)
125
+ ) {
126
+ const importKind = node.isTypeOnly === true ? 'type' as const : 'value' as const;
127
+ pushEdge(node.moduleSpecifier.text, importKind);
118
128
  }
119
129
 
120
130
  if (
@@ -123,33 +133,13 @@ export class TypeScriptSourceModuleAnalyzerAdapter implements SourceModuleAnalyz
123
133
  node.arguments.length > 0 &&
124
134
  ts.isStringLiteral(node.arguments[0])
125
135
  ) {
126
- const specifier = node.arguments[0].text;
127
-
128
- if (!specifier.startsWith('.')) {
129
- return;
130
- }
131
-
132
- const fromDir = path.dirname(path.resolve(this.rootDir, fromFile.toString()));
133
- const resolved = path.resolve(fromDir, specifier.replace(/\.js$/, '.ts'));
134
- const relative = path.relative(this.rootDir, resolved);
136
+ pushEdge(node.arguments[0].text, 'dynamic');
137
+ }
135
138
 
136
- if (relative.startsWith('..')) {
137
- return;
138
- }
139
+ ts.forEachChild(node, visit);
140
+ };
139
141
 
140
- try {
141
- edges.push(
142
- ImportEdge.create({
143
- from: fromFile,
144
- to: FilePathVO.fromWorkspaceRelative(relative),
145
- importKind: 'dynamic',
146
- })
147
- );
148
- } catch {
149
- // invalid path — skip
150
- }
151
- }
152
- });
142
+ ts.forEachChild(sourceFile, visit);
153
143
 
154
144
  return edges;
155
145
  }
@@ -1,7 +1,5 @@
1
- /**
2
- * @layer infrastructure
3
- * @unit biome-ast-engine
4
- */
1
+ // @unit biome-ast-engine
2
+ // @layer infrastructure
5
3
 
6
4
  const LAYER_COMMENT_PATTERN = /^\s*(?:\/\/|\/\*\*?\s*|\*)\s*@layer\s+(\S+)/m;
7
5
 
@@ -9,10 +7,6 @@ export type LayerCommentResult = {
9
7
  readonly layerName: string | null;
10
8
  };
11
9
 
12
- /**
13
- * ソースコードから `// @layer {layer}` コメントを抽出する。
14
- * JSDoc (`/** @layer ... * /`) 形式にも対応する。
15
- */
16
10
  export const parseLayerComment = (sourceCode: string): LayerCommentResult => {
17
11
  const match = sourceCode.match(LAYER_COMMENT_PATTERN);
18
12
 
@@ -1,20 +1,13 @@
1
- /**
2
- * @layer infrastructure
3
- * @unit biome-ast-engine
4
- */
1
+ // @unit biome-ast-engine
2
+ // @layer infrastructure
5
3
 
4
+ // カンマ区切り複数ユニット対応 + 複数行の @unit を収集、重複除去。
6
5
  const UNIT_COMMENT_PATTERN = /^\s*(?:\/\/|\/\*\*?\s*|\*)\s*@unit\s+(.+)/gm;
7
6
 
8
7
  export type UnitCommentResult = {
9
8
  readonly unitNames: readonly string[];
10
9
  };
11
10
 
12
- /**
13
- * ソースコードから `// @unit {unit}` コメントを抽出する。
14
- * JSDoc (`/** @unit ... * /`) 形式にも対応する。
15
- * カンマ区切りで複数ユニットを指定でき、複数行の @unit も収集する。
16
- * 結果は重複除去済み。
17
- */
18
11
  export const parseUnitComment = (sourceCode: string): UnitCommentResult => {
19
12
  const matches = sourceCode.matchAll(UNIT_COMMENT_PATTERN);
20
13
  const names: string[] = [];
@@ -9,7 +9,7 @@ import type { TemplateGenerator } from '../../domain/services/template-generator
9
9
  import type { GenerateCiTemplateInput } from '../dto/generate-ci-template-input.js';
10
10
  import type { GenerateCiTemplateOutput } from '../dto/generate-ci-template-output.js';
11
11
  import { CiTemplate } from '../../domain/aggregates/ci-template.js';
12
- import { isTemplateType, TEMPLATE_TYPES } from '../../domain/types/template-type.js';
12
+ import { isTemplateType, TEMPLATE_TYPES, type TemplateType } from '../../domain/types/template-type.js';
13
13
 
14
14
  export class GenerateCiTemplateUseCase {
15
15
  constructor(private readonly templateGenerator: TemplateGenerator) {}
@@ -23,7 +23,7 @@ export class GenerateCiTemplateUseCase {
23
23
  ? ` (Hint: --type specifies the template purpose, not the CI platform. Use one of: ${validValues})`
24
24
  : ` (valid: ${validValues})`;
25
25
  return {
26
- templateType: templateType as any,
26
+ templateType: templateType as TemplateType,
27
27
  presetRef: presetId,
28
28
  triggerCondition: 'pull_request',
29
29
  targetValidatorIds: [],
@@ -1,11 +1,6 @@
1
- /**
2
- * @layer domain
3
- * @unit ci-governance
4
- *
5
- * LessonArtifact型定義(Cross-Unit Contract所有)
6
- * Schema Owner: ci-governance Unit
7
- * Cross-Unit Contract: docs/contracts/lesson-artifact.schema.json
8
- */
1
+ // @unit ci-governance
2
+ // @layer domain
3
+ // Cross-Unit Contract: docs/contracts/lesson-artifact.schema.json
9
4
 
10
5
  import type { LessonCategory } from './lesson-category.js';
11
6
 
@@ -14,12 +9,9 @@ export type { LessonCategory };
14
9
  export interface LessonArtifact {
15
10
  /** UUID形式の一意識別子(INV-12: UUID形式必須) */
16
11
  readonly lessonId: string;
17
- /** lesson artifactの出力元スキル名(例: 'story-implementor', 'domain-designer') */
18
12
  readonly source: string;
19
- /** AGENTS.mdに集約するlesson内容テキスト */
20
13
  readonly content: string;
21
- /** lessonのカテゴリタグ(重複集約時はマージされる) */
22
14
  readonly tags: LessonCategory[];
23
- /** artifact作成日時(ISO 8601形式) */
24
- readonly timestamp: string; // ISO8601DateString
15
+ /** ISO 8601形式 */
16
+ readonly timestamp: string;
25
17
  }
@@ -1,9 +1,5 @@
1
- /**
2
- * @layer domain
3
- * @unit ci-governance
4
- *
5
- * TemplateType補助型
6
- */
1
+ // @unit ci-governance
2
+ // @layer domain
7
3
 
8
4
  export type TemplateType = 'aidlc-gate' | 'consistency-check' | 'pre-commit';
9
5
 
@@ -1,9 +1,5 @@
1
- /**
2
- * @layer domain
3
- * @unit ci-governance
4
- *
5
- * TriggerCondition補助型
6
- */
1
+ // @unit ci-governance
2
+ // @layer domain
7
3
 
8
4
  export type TriggerCondition = 'pull_request' | 'schedule' | 'pre-commit';
9
5
 
@@ -1,9 +1,5 @@
1
- /**
2
- * @layer infrastructure
3
- * @unit ci-governance
4
- *
5
- * CommandExistencePort実装
6
- */
1
+ // @unit ci-governance
2
+ // @layer infrastructure
7
3
 
8
4
  import type { CommandExistencePort } from '../../domain/ports/command-existence-port.js';
9
5
 
@@ -1,9 +1,5 @@
1
- /**
2
- * @layer infrastructure
3
- * @unit ci-governance
4
- *
5
- * ValidatorIdRegistryPort実装
6
- */
1
+ // @unit ci-governance
2
+ // @layer infrastructure
7
3
 
8
4
  import type { ValidatorIdRegistryPort } from '../../domain/ports/validator-id-registry-port.js';
9
5
 
@@ -1,9 +1,5 @@
1
- /**
2
- * @layer infrastructure
3
- * @unit ci-governance
4
- *
5
- * .harness/error-history.json スキーマ定義
6
- */
1
+ // @unit ci-governance
2
+ // @layer infrastructure
7
3
 
8
4
  export interface ErrorHistoryEntry {
9
5
  readonly code: string;
@@ -36,7 +36,7 @@ export class MigrateAgentsMdHandler {
36
36
  }
37
37
  const lines = vResult.passed
38
38
  ? ['✓ All pointers are valid']
39
- : ['❌ Dead pointers detected', ...vResult.errors.map((e: any) => ` [${e.code}] ${e.message}`)];
39
+ : ['❌ Dead pointers detected', ...vResult.errors.map((e) => ` [${e.code}] ${e.message}`)];
40
40
  return { exitCode: vResult.passed ? 0 : 1, output: lines.join('\n'), errors: vResult.errors };
41
41
  }
42
42
 
@@ -1,9 +1,6 @@
1
- /**
2
- * @layer domain
3
- * @unit config-foundation
4
- *
5
- * config-foundation ドメイン層の基底エラークラス
6
- */
1
+ // @unit config-foundation
2
+ // @layer domain
3
+
7
4
  export class ConfigFoundationDomainError extends Error {
8
5
  readonly errorCode: string;
9
6
 
@@ -1,9 +1,6 @@
1
- /**
2
- * @layer domain
3
- * @unit config-foundation
4
- *
5
- * project.preset が許可列挙値に一致しない場合のエラー
6
- */
1
+ // @unit config-foundation
2
+ // @layer domain
3
+
7
4
  import { ConfigFoundationDomainError } from './config-foundation-domain-error.js';
8
5
 
9
6
  export class InvalidPresetError extends ConfigFoundationDomainError {
@@ -8,6 +8,7 @@ import { UnsupportedFeatureError } from './errors/unsupported-feature-error.js';
8
8
  import { LayersConfig } from './value-objects/layers-config.js';
9
9
  import { PathsConfig } from './value-objects/paths-config.js';
10
10
  import { PhaseDependenciesConfig } from './value-objects/phase-dependencies-config.js';
11
+ import type { PhaseDependenciesPresetId } from './value-objects/phase-dependencies-config.js';
11
12
  import { PlanningModeConfig } from './value-objects/planning-mode-config.js';
12
13
  import { ProjectConfig } from './value-objects/project-config.js';
13
14
  import { QuickModeConfig } from './value-objects/quick-mode-config.js';
@@ -23,7 +24,7 @@ import type { L4Config } from './value-objects/l4-config.js';
23
24
  export type LayerId = 'L1' | 'L2' | 'L3' | 'L4';
24
25
  export type PresetId = 'minimal' | 'standard' | 'strict';
25
26
  export type PlanningModeValue = 'interactive' | 'embedded-qa';
26
- export type PhaseDependenciesPresetId = 'default' | 'full' | 'standard' | 'minimal' | 'custom';
27
+ export type { PhaseDependenciesPresetId };
27
28
  type DeepPartial<T> = {
28
29
  [K in keyof T]?: T[K] extends Array<infer TItem>
29
30
  ? Array<DeepPartial<TItem>>
@@ -7,7 +7,8 @@
7
7
  */
8
8
  import { CustomPhaseRule } from './custom-phase-rule.js';
9
9
  import type { CustomPhaseRuleProps } from './custom-phase-rule.js';
10
- import type { PhaseDependenciesPresetId } from '../harness-config.js';
10
+
11
+ export type PhaseDependenciesPresetId = 'default' | 'full' | 'standard' | 'minimal' | 'custom';
11
12
 
12
13
  export interface PhaseDependenciesConfigProps {
13
14
  readonly preset: PhaseDependenciesPresetId;
@@ -1,26 +1,17 @@
1
- /**
2
- * @layer public-api
3
- * @unit config-foundation
4
- *
5
- * config-foundation ユニットのバレルエクスポート。
6
- */
1
+ // @unit config-foundation
2
+ // @layer public-api
7
3
 
8
- // Composition Root
9
4
  export { createConfigFoundationModule } from './composition-root.js';
10
5
 
11
- // Application — usecases
12
6
  export { LoadResolvedConfigUseCase } from './application/usecases/load-resolved-config-use-case.js';
13
7
 
14
- // Application — DTOs
15
8
  export type { ResolvedConfigOutput } from './application/dto/resolved-config-output.js';
16
9
  export type { FeatureToggleResult } from './application/dto/feature-toggle-result.js';
17
10
  export type { AvailableFeatureItem } from './application/dto/available-feature-item.js';
18
11
 
19
- // Presentation — CLI handlers
20
12
  export { EnableFeatureCommandHandler } from './presentation/cli/enable-feature-command-handler.js';
21
13
  export { DisableFeatureCommandHandler } from './presentation/cli/disable-feature-command-handler.js';
22
14
 
23
- // Domain — ports
24
15
  export type { ConfigRepositoryPort } from './domain/ports/config-repository-port.js';
25
16
  export type { ConfigSchemaValidatorPort } from './domain/ports/config-schema-validator-port.js';
26
17
  export type { FeatureRegistryPort } from './domain/ports/feature-registry-port.js';
@@ -1,9 +1,6 @@
1
- /**
2
- * @layer application
3
- * @unit harness-error
4
- *
5
- * ErrorDefinition の一覧投影DTO
6
- */
1
+ // @unit harness-error
2
+ // @layer application
3
+
7
4
  export interface ErrorDefinitionSummary {
8
5
  readonly code: string;
9
6
  readonly title: string;
@@ -1,9 +1,6 @@
1
- /**
2
- * @layer application
3
- * @unit harness-error
4
- *
5
- * HarnessError の公開契約DTO
6
- */
1
+ // @unit harness-error
2
+ // @layer application
3
+
7
4
  export interface HarnessErrorContract {
8
5
  readonly code: string;
9
6
  readonly severity: 'error' | 'warning';
@@ -1,9 +1,6 @@
1
- /**
2
- * @layer application
3
- * @unit harness-error
4
- *
5
- * validator出力の正規化前DTO
6
- */
1
+ // @unit harness-error
2
+ // @layer application
3
+
7
4
  export interface ValidatorIssueDraft {
8
5
  readonly code: string;
9
6
  readonly message: string;
@@ -1,9 +1,6 @@
1
- /**
2
- * @layer domain
3
- * @unit harness-error
4
- *
5
- * ADR参照先が実在しない場合に送出されるドメインエラー
6
- */
1
+ // @unit harness-error
2
+ // @layer domain
3
+
7
4
  import { HarnessErrorDomainError } from './harness-error-domain-error.js';
8
5
 
9
6
  export class AdrReferenceNotFoundError extends HarnessErrorDomainError {
@@ -1,9 +1,6 @@
1
- /**
2
- * @layer domain
3
- * @unit harness-error
4
- *
5
- * ErrorDefinitionRegistry に重複コードが登録された場合に送出されるドメインエラー
6
- */
1
+ // @unit harness-error
2
+ // @layer domain
3
+
7
4
  import { HarnessErrorDomainError } from './harness-error-domain-error.js';
8
5
 
9
6
  export class DuplicateErrorCodeError extends HarnessErrorDomainError {
@@ -1,9 +1,6 @@
1
- /**
2
- * @layer domain
3
- * @unit harness-error
4
- *
5
- * AdrRef の形式不正時に送出されるドメインエラー
6
- */
1
+ // @unit harness-error
2
+ // @layer domain
3
+
7
4
  import { HarnessErrorDomainError } from './harness-error-domain-error.js';
8
5
 
9
6
  export class InvalidAdrRefError extends HarnessErrorDomainError {
@@ -1,9 +1,6 @@
1
- /**
2
- * @layer domain
3
- * @unit harness-error
4
- *
5
- * ErrorCode の形式不正時に送出されるドメインエラー
6
- */
1
+ // @unit harness-error
2
+ // @layer domain
3
+
7
4
  import { HarnessErrorDomainError } from './harness-error-domain-error.js';
8
5
 
9
6
  export class InvalidErrorCodeError extends HarnessErrorDomainError {
@@ -1,9 +1,6 @@
1
- /**
2
- * @layer domain
3
- * @unit harness-error
4
- *
5
- * Severity の入力不正時に送出されるドメインエラー
6
- */
1
+ // @unit harness-error
2
+ // @layer domain
3
+
7
4
  import { HarnessErrorDomainError } from './harness-error-domain-error.js';
8
5
 
9
6
  export class InvalidSeverityError extends HarnessErrorDomainError {
@@ -1,9 +1,6 @@
1
- /**
2
- * @layer domain
3
- * @unit harness-error
4
- *
5
- * ADR参照が必須なのに未指定の場合に送出されるドメインエラー
6
- */
1
+ // @unit harness-error
2
+ // @layer domain
3
+
7
4
  import { HarnessErrorDomainError } from './harness-error-domain-error.js';
8
5
 
9
6
  export class MissingAdrRefError extends HarnessErrorDomainError {
@@ -1,9 +1,6 @@
1
- /**
2
- * @layer domain
3
- * @unit harness-error
4
- *
5
- * fix_example が必須なのに未指定の場合に送出されるドメインエラー
6
- */
1
+ // @unit harness-error
2
+ // @layer domain
3
+
7
4
  import { HarnessErrorDomainError } from './harness-error-domain-error.js';
8
5
 
9
6
  export class MissingFixExampleError extends HarnessErrorDomainError {
@@ -1,9 +1,6 @@
1
- /**
2
- * @layer domain
3
- * @unit harness-error
4
- *
5
- * severity の格下げ(error -> warning)が試みられた場合に送出されるドメインエラー
6
- */
1
+ // @unit harness-error
2
+ // @layer domain
3
+
7
4
  import { HarnessErrorDomainError } from './harness-error-domain-error.js';
8
5
 
9
6
  export class SeverityDowngradeViolationError extends HarnessErrorDomainError {
@@ -1,9 +1,6 @@
1
- /**
2
- * @layer domain
3
- * @unit harness-error
4
- *
5
- * ErrorDefinitionRegistry に未登録のコードが指定された場合に送出されるドメインエラー
6
- */
1
+ // @unit harness-error
2
+ // @layer domain
3
+
7
4
  import { HarnessErrorDomainError } from './harness-error-domain-error.js';
8
5
 
9
6
  export class UnknownErrorDefinitionError extends HarnessErrorDomainError {