phasegate 0.74.0 → 0.91.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 (99) hide show
  1. package/CHANGELOG.md +267 -0
  2. package/docs/ADR/ADR-014-presentation-domain-dependency.md +82 -0
  3. package/package.json +1 -1
  4. package/scripts/harness/adr-foundation/application/dto/application-errors.ts +0 -13
  5. package/scripts/harness/agent-integration/{infrastructure → application}/ports/cli-executor-port.ts +2 -2
  6. package/scripts/harness/agent-integration/application/usecases/handle-post-tool-use-usecase.ts +2 -2
  7. package/scripts/harness/agent-integration/application/usecases/handle-pre-tool-use-usecase.ts +28 -8
  8. package/scripts/harness/agent-integration/application/usecases/handle-stop-usecase.ts +1 -1
  9. package/scripts/harness/agent-integration/domain/ports/error-guidance-query-port.ts +0 -8
  10. package/scripts/harness/agent-integration/domain/ports/phase-gate-query-port.ts +6 -0
  11. package/scripts/harness/agent-integration/domain/services/fallback-verification-service.ts +2 -17
  12. package/scripts/harness/agent-integration/index.ts +3 -4
  13. package/scripts/harness/agent-integration/infrastructure/adapters/child-process-cli-executor-adapter.ts +2 -2
  14. package/scripts/harness/agent-integration/infrastructure/adapters/env-file-reentry-guard-state-adapter.ts +2 -10
  15. package/scripts/harness/agent-integration/infrastructure/adapters/phase-gate-query-adapter.ts +30 -0
  16. package/scripts/harness/agent-integration/presentation/session-start-hook.ts +2 -17
  17. package/scripts/harness/agent-integration/presentation/user-prompt-submit-hook.ts +2 -21
  18. package/scripts/harness/biome-ast-engine/composition-root.ts +2 -18
  19. package/scripts/harness/biome-ast-engine/domain/services/lint-runner.ts +19 -3
  20. package/scripts/harness/biome-ast-engine/domain/services/rule-definition-registry.ts +29 -3
  21. package/scripts/harness/biome-ast-engine/domain/value-objects/import-graph.ts +22 -6
  22. package/scripts/harness/biome-ast-engine/domain/value-objects/layer-name.ts +1 -1
  23. package/scripts/harness/biome-ast-engine/infrastructure/adapters/typescript-source-module-analyzer-adapter.ts +38 -48
  24. package/scripts/harness/biome-ast-engine/infrastructure/parsers/layer-comment-parser.ts +2 -8
  25. package/scripts/harness/biome-ast-engine/infrastructure/parsers/unit-comment-parser.ts +3 -10
  26. package/scripts/harness/ci-governance/application/usecases/generate-ci-template-usecase.ts +2 -2
  27. package/scripts/harness/ci-governance/domain/types/lesson-artifact.ts +5 -13
  28. package/scripts/harness/ci-governance/domain/types/template-type.ts +2 -6
  29. package/scripts/harness/ci-governance/domain/types/trigger-condition.ts +2 -6
  30. package/scripts/harness/ci-governance/infrastructure/adapters/harness-api-command-existence-adapter.ts +2 -6
  31. package/scripts/harness/ci-governance/infrastructure/adapters/validator-id-registry-adapter.ts +2 -6
  32. package/scripts/harness/ci-governance/infrastructure/schema/error-history-schema.ts +2 -6
  33. package/scripts/harness/ci-governance/presentation/handlers/migrate-agents-md-handler.ts +1 -1
  34. package/scripts/harness/config-foundation/domain/errors/config-foundation-domain-error.ts +3 -6
  35. package/scripts/harness/config-foundation/domain/errors/invalid-preset-error.ts +3 -6
  36. package/scripts/harness/config-foundation/domain/harness-config.ts +2 -1
  37. package/scripts/harness/config-foundation/domain/value-objects/phase-dependencies-config.ts +2 -1
  38. package/scripts/harness/config-foundation/index.ts +2 -11
  39. package/scripts/harness/harness-error/application/dto/error-definition-summary.ts +3 -6
  40. package/scripts/harness/harness-error/application/dto/harness-error-contract.ts +3 -6
  41. package/scripts/harness/harness-error/application/dto/validator-issue-draft.ts +3 -6
  42. package/scripts/harness/harness-error/domain/errors/adr-reference-not-found-error.ts +3 -6
  43. package/scripts/harness/harness-error/domain/errors/duplicate-error-code-error.ts +3 -6
  44. package/scripts/harness/harness-error/domain/errors/invalid-adr-ref-error.ts +3 -6
  45. package/scripts/harness/harness-error/domain/errors/invalid-error-code-error.ts +3 -6
  46. package/scripts/harness/harness-error/domain/errors/invalid-severity-error.ts +3 -6
  47. package/scripts/harness/harness-error/domain/errors/missing-adr-ref-error.ts +3 -6
  48. package/scripts/harness/harness-error/domain/errors/missing-fix-example-error.ts +3 -6
  49. package/scripts/harness/harness-error/domain/errors/severity-downgrade-violation-error.ts +3 -6
  50. package/scripts/harness/harness-error/domain/errors/unknown-error-definition-error.ts +3 -6
  51. package/scripts/harness/harness-error/domain/ports/fix-example-validator-port.ts +3 -7
  52. package/scripts/harness/nyquist-validation/application/dto/analyze-impact-output.ts +2 -6
  53. package/scripts/harness/nyquist-validation/infrastructure/adapters/ajv-json-schema-validator-adapter.ts +7 -19
  54. package/scripts/harness/nyquist-validation/infrastructure/adapters/traceability-model-story-registry-adapter.ts +4 -8
  55. package/scripts/harness/phase-dependency-model/application/usecases/check-story-reflection-usecase.ts +2 -13
  56. package/scripts/harness/phase-dependency-model/domain/ports/story-reflection-file-system-port.ts +2 -6
  57. package/scripts/harness/quick-mode/application/dto/change-category-classification-contract.ts +3 -7
  58. package/scripts/harness/quick-mode/index.ts +2 -13
  59. package/scripts/harness/setup/skill-deployer.ts +3 -58
  60. package/scripts/harness/skill-quality/infrastructure/adapters/ajv-lesson-artifact-schema-adapter.ts +3 -3
  61. package/scripts/harness/traceability-model/domain/services/metadata-validator.ts +1 -1
  62. package/scripts/harness/traceability-model/domain/value-objects/story-id.ts +3 -3
  63. package/scripts/harness/traceability-model/infrastructure/parsers/story-catalog-parser.ts +2 -2
  64. package/scripts/harness/validator-system/application/dto/run-full-validation-input.ts +4 -10
  65. package/scripts/harness/validator-system/domain/ports/adr-reference-port.ts +2 -6
  66. package/scripts/harness/validator-system/domain/ports/it-test-file-analyzer-port.ts +2 -10
  67. package/scripts/harness/validator-system/domain/ports/metadata-policy-port.ts +3 -6
  68. package/scripts/harness/validator-system/domain/ports/source-analysis-port.ts +2 -7
  69. package/scripts/harness/validator-system/domain/ports/source-code-analyzer-port.ts +2 -7
  70. package/scripts/harness/validator-system/domain/ports/source-file-text-scanner-port.ts +2 -9
  71. package/scripts/harness/validator-system/domain/ports/test-quality-analyzer-port.ts +3 -6
  72. package/scripts/harness/validator-system/domain/services/cli-e2e-test-existence-service.ts +3 -11
  73. package/scripts/harness/validator-system/domain/services/stub-comment-detection-service.ts +3 -8
  74. package/scripts/harness/validator-system/infrastructure/adapters/cli-command-registry-adapter.ts +3 -7
  75. package/scripts/harness/adr-foundation/application/dto/seed-adr-definition.ts +0 -21
  76. package/scripts/harness/adr-foundation/application/usecases/seed-initial-adrs-use-case.ts +0 -84
  77. package/scripts/harness/adr-foundation/infrastructure/seeds/initial-adr-definitions.ts +0 -161
  78. package/scripts/harness/agent-integration/domain/ports/import-analyzer-port.ts +0 -13
  79. package/scripts/harness/agent-integration/infrastructure/adapters/regex-import-analyzer-adapter.ts +0 -69
  80. package/scripts/harness/ci-governance/application/dto/validate-pointers-input.ts +0 -8
  81. package/scripts/harness/ci-governance/presentation/dto/ci-governance-render-options.ts +0 -9
  82. package/scripts/harness/ci-governance/presentation/formatters/error-repetition-formatter.ts +0 -26
  83. package/scripts/harness/config-foundation/infrastructure/registries/composite-feature-registry-adapter.ts +0 -22
  84. package/scripts/harness/nyquist-validation/domain/errors/story-not-found-error.ts +0 -14
  85. package/scripts/harness/nyquist-validation/presentation/dto/cli-render-options.ts +0 -12
  86. package/scripts/harness/quick-mode/application/dto/build-relaxation-profile-input.ts +0 -12
  87. package/scripts/harness/quick-mode/application/dto/execute-quick-ci-check-input.ts +0 -11
  88. package/scripts/harness/quick-mode/application/dto/judge-quick-mode-eligibility-input.ts +0 -10
  89. package/scripts/harness/quick-mode/domain/ports/quick-mode-config-port.ts +0 -12
  90. package/scripts/harness/quick-mode/domain/ports/validator-id-registry-port.ts +0 -10
  91. package/scripts/harness/shared-kernel/harness-api.ts +0 -6
  92. package/scripts/harness/shared-kernel/quick-mode.ts +0 -15
  93. package/scripts/harness/shared-kernel/validator-system.ts +0 -14
  94. package/scripts/harness/skill-quality/application/mappers/cascade-update-result-mapper.ts +0 -16
  95. package/scripts/harness/skill-quality/application/mappers/coverage-report-mapper.ts +0 -37
  96. package/scripts/harness/skill-quality/application/mappers/lesson-artifact-mapper.ts +0 -11
  97. package/scripts/harness/skill-quality/domain/types/unit-name.ts +0 -5
  98. package/scripts/harness/traceability-model/application/dto/metadata-validation-input.ts +0 -12
  99. package/scripts/harness/traceability-model/domain/constants/traceability-link-types.ts +0 -14
@@ -1,12 +0,0 @@
1
- /**
2
- * @layer presentation
3
- * @unit nyquist-validation
4
- */
5
-
6
- export interface CliRenderOptions {
7
- readonly format: 'human' | 'agent' | 'json';
8
- readonly verbose: boolean;
9
- readonly color: boolean;
10
- }
11
-
12
- // @story-id H08-07
@@ -1,12 +0,0 @@
1
- /**
2
- * @layer application
3
- * @unit quick-mode
4
- *
5
- * BuildRelaxationProfileUseCase の入力 DTO
6
- */
7
-
8
- import type { QuickModeEligibilityContract } from './quick-mode-eligibility-contract.js';
9
-
10
- export interface BuildRelaxationProfileInput {
11
- readonly eligibilityContract: QuickModeEligibilityContract;
12
- }
@@ -1,11 +0,0 @@
1
- /**
2
- * @layer application
3
- * @unit quick-mode
4
- *
5
- * ExecuteQuickCiCheckUseCase の入力 DTO
6
- */
7
-
8
- export interface ExecuteQuickCiCheckInput {
9
- readonly changedFiles?: readonly { filePath: string; changeKind: string }[];
10
- readonly dryRun?: boolean;
11
- }
@@ -1,10 +0,0 @@
1
- /**
2
- * @layer application
3
- * @unit quick-mode
4
- *
5
- * JudgeQuickModeEligibilityUseCase の入力 DTO
6
- */
7
-
8
- export interface JudgeQuickModeEligibilityInput {
9
- readonly changedFiles?: readonly { filePath: string; changeKind: string }[];
10
- }
@@ -1,12 +0,0 @@
1
- /**
2
- * @layer domain
3
- * @unit quick-mode
4
- *
5
- * QuickModeConfig取得のドメインポート
6
- */
7
-
8
- import type { QuickModeConfig } from '../value-objects/quick-mode-config.js';
9
-
10
- export interface QuickModeConfigPort {
11
- getQuickModeConfig(): Promise<QuickModeConfig>;
12
- }
@@ -1,10 +0,0 @@
1
- /**
2
- * @layer domain
3
- * @unit quick-mode
4
- *
5
- * ValidatorId一覧取得のドメインポート
6
- */
7
-
8
- export interface ValidatorIdRegistryPort {
9
- getAllValidatorIds(): Promise<readonly string[]>;
10
- }
@@ -1,6 +0,0 @@
1
- // @layer domain
2
- // harness-api.ts — Shared Kernel public entry for harness-api types
3
-
4
- export type { HarnessApiResponseContract } from '../harness-api/application/dto/harness-api-response-contract.js';
5
- export { HarnessApiResponse } from '../harness-api/domain/value-objects/harness-api-response.js';
6
- export type { ResponseStatus, ExitCode, HarnessError, ResponseSummary } from '../harness-api/domain/value-objects/harness-api-response.js';
@@ -1,15 +0,0 @@
1
- /**
2
- * @layer application
3
- * @unit quick-mode
4
- *
5
- * quick-mode ユニットの Shared Kernel 公開面(Cross-Unit Contract 再エクスポート)
6
- */
7
-
8
- // Public DTOs (Shared Kernel contracts)
9
- export type { QuickModeDecisionContract } from '../quick-mode/application/dto/quick-mode-decision-contract.js';
10
- export type { QuickModeEligibilityContract } from '../quick-mode/application/dto/quick-mode-eligibility-contract.js';
11
- export type { ValidatorRelaxationProfileContract } from '../quick-mode/application/dto/validator-relaxation-profile-contract.js';
12
-
13
- // Composition Root
14
- export { createQuickModeCompositionRoot } from '../quick-mode/composition-root.js';
15
- export type { QuickModeCompositionRoot } from '../quick-mode/composition-root.js';
@@ -1,14 +0,0 @@
1
- /**
2
- * @layer shared-kernel
3
- * @unit validator-system
4
- *
5
- * Cross-Unit Contract 再エクスポート
6
- * ValidatorRegistry インターフェース + ValidationResult Contract
7
- */
8
- export type { ValidationResultContract } from '../validator-system/application/dto/validation-result-contract.js';
9
- export type { ValidatorRelaxationProfile } from '../validator-system/application/dto/validator-relaxation-profile.js';
10
- export type { AggregatedValidationReport } from '../validator-system/application/dto/aggregated-validation-report.js';
11
- export { ValidatorId, InvalidValidatorIdError } from '../validator-system/domain/value-objects/validator-id.js';
12
- export { ValidatorRegistry, UnknownValidatorError } from '../validator-system/domain/services/validator-registry.js';
13
- export { createValidatorSystemModule } from '../validator-system/composition-root.js';
14
- export type { ValidatorSystemModule } from '../validator-system/composition-root.js';
@@ -1,16 +0,0 @@
1
- /**
2
- * @layer application
3
- * @unit skill-quality
4
- */
5
- import type { CascadeUpdateResult } from '../../domain/value-objects/cascade-update-result.js';
6
- import type { ApplyCascadeUpdateOutput } from '../dto/apply-cascade-update-output.js';
7
-
8
- export class CascadeUpdateResultMapper {
9
- static toOutput(result: CascadeUpdateResult): ApplyCascadeUpdateOutput {
10
- return {
11
- updatedCount: result.updatedCount,
12
- appliedStoryIds: result.appliedStoryIds,
13
- errors: result.errors,
14
- };
15
- }
16
- }
@@ -1,37 +0,0 @@
1
- /**
2
- * @layer application
3
- * @unit skill-quality
4
- */
5
- import type { CoverageReport } from '../../domain/value-objects/coverage-report.js';
6
-
7
- export interface CoverageReportDto {
8
- readonly requirementCoverage: {
9
- readonly total: number;
10
- readonly covered: number;
11
- readonly coverageRate: number;
12
- readonly uncoveredIds: readonly string[];
13
- };
14
- readonly codeCoverage: {
15
- readonly lineCoverage: number;
16
- readonly branchCoverage: number;
17
- readonly functionCoverage: number;
18
- };
19
- }
20
-
21
- export class CoverageReportMapper {
22
- static toDto(report: CoverageReport): CoverageReportDto {
23
- return {
24
- requirementCoverage: {
25
- total: report.requirementCoverage.total,
26
- covered: report.requirementCoverage.covered,
27
- coverageRate: report.requirementCoverage.coverageRate,
28
- uncoveredIds: report.requirementCoverage.uncoveredIds,
29
- },
30
- codeCoverage: {
31
- lineCoverage: report.codeCoverage.lineCoverage,
32
- branchCoverage: report.codeCoverage.branchCoverage,
33
- functionCoverage: report.codeCoverage.functionCoverage,
34
- },
35
- };
36
- }
37
- }
@@ -1,11 +0,0 @@
1
- /**
2
- * @layer application
3
- * @unit skill-quality
4
- */
5
- import type { LessonArtifact, LessonArtifactJson } from '../../domain/aggregates/lesson-artifact.js';
6
-
7
- export class LessonArtifactMapper {
8
- static toJson(artifact: LessonArtifact): LessonArtifactJson {
9
- return artifact.toJson();
10
- }
11
- }
@@ -1,5 +0,0 @@
1
- /**
2
- * @layer domain
3
- * @unit skill-quality
4
- */
5
- export type UnitName = string;
@@ -1,12 +0,0 @@
1
- /**
2
- * @layer application
3
- * @unit traceability-model
4
- */
5
-
6
- import type { ProjectRelativePath } from '../../domain/value-objects/project-relative-path.js';
7
-
8
- export interface MetadataValidationInput {
9
- readonly filePaths: readonly ProjectRelativePath[];
10
- readonly failOnWarning?: boolean;
11
- readonly format?: string;
12
- }
@@ -1,14 +0,0 @@
1
- /**
2
- * @layer domain
3
- * @unit traceability-model
4
- *
5
- * 逆引きチェーンで使用するリンク種別
6
- */
7
- export const TRACEABILITY_LINK_TYPES = Object.freeze([
8
- 'implementation-to-unit',
9
- 'unit-to-design',
10
- 'design-to-story',
11
- 'story-to-plan',
12
- ] as const);
13
-
14
- export type TraceabilityLinkType = (typeof TRACEABILITY_LINK_TYPES)[number];