phasegate 0.163.0 → 0.165.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 +11 -0
- package/docs/ADR/019-ai-independence-boundary.md +63 -0
- package/docs/ADR/020-reverse-learning-forward-proposal.md +52 -0
- package/package.json +1 -1
- package/scripts/harness/attestation/application/dto/attestation-document.ts +54 -0
- package/scripts/harness/attestation/application/dto/produce-attestation-input.ts +18 -0
- package/scripts/harness/attestation/application/dto/verify-attestation-input.ts +12 -0
- package/scripts/harness/attestation/application/dto/verify-attestation-output.ts +30 -0
- package/scripts/harness/attestation/application/mappers/attestation-record-mapper.ts +240 -0
- package/scripts/harness/attestation/application/ports/attestation-repository-port.ts +14 -0
- package/scripts/harness/attestation/application/ports/gate-result-source-port.ts +23 -0
- package/scripts/harness/attestation/application/ports/source-digester-port.ts +15 -0
- package/scripts/harness/attestation/application/usecases/produce-attestation-usecase.ts +155 -0
- package/scripts/harness/attestation/application/usecases/verify-attestation-usecase.ts +137 -0
- package/scripts/harness/attestation/composition-root.ts +93 -0
- package/scripts/harness/attestation/domain/entities/attestation-record.ts +240 -0
- package/scripts/harness/attestation/domain/ports/content-hasher-port.ts +13 -0
- package/scripts/harness/attestation/domain/services/granularity-derivation-service.ts +51 -0
- package/scripts/harness/attestation/domain/value-objects/digest.ts +51 -0
- package/scripts/harness/attestation/domain/value-objects/granularity-claim.ts +89 -0
- package/scripts/harness/attestation/domain/value-objects/signature-block.ts +87 -0
- package/scripts/harness/attestation/domain/value-objects/validator-outcome.ts +44 -0
- package/scripts/harness/attestation/index.ts +18 -0
- package/scripts/harness/attestation/infrastructure/adapters/ci-check-gate-result-adapter.ts +164 -0
- package/scripts/harness/attestation/infrastructure/adapters/file-system-attestation-repository-adapter.ts +32 -0
- package/scripts/harness/attestation/infrastructure/adapters/file-system-source-digester-adapter.ts +27 -0
- package/scripts/harness/attestation/infrastructure/adapters/node-crypto-content-hasher-adapter.ts +18 -0
- package/scripts/harness/attestation/presentation/handlers/attest-handler.ts +71 -0
- package/scripts/harness/attestation/presentation/handlers/verify-attestation-handler.ts +74 -0
- package/scripts/harness/main.ts +51 -2
package/scripts/harness/main.ts
CHANGED
|
@@ -229,6 +229,8 @@ Commands:
|
|
|
229
229
|
phasegate:complete-check Complete L2-L4 check (--json)
|
|
230
230
|
phasegate:impact-analysis Impact analysis for story (<storyId>, --json)
|
|
231
231
|
phasegate:generate-matrix Generate requirement-test matrix (--requirements, --tests, --out, --json)
|
|
232
|
+
phasegate:attest Produce a signed-attestation record of ci-check (--out <path>, --require-pass, --mode <unsigned-poc|signed>, --json)
|
|
233
|
+
phasegate:verify-attestation Verify an attestation record's integrity (<file>, --json)
|
|
232
234
|
|
|
233
235
|
Gate semantics:
|
|
234
236
|
phasegate:complete-check Gate: lint + all validators; exits 1 on failure
|
|
@@ -2554,8 +2556,11 @@ async function main(): Promise<void> {
|
|
|
2554
2556
|
}
|
|
2555
2557
|
|
|
2556
2558
|
// ── adr-foundation ──
|
|
2559
|
+
// ADR は docs/ADR/ 配下に集約されているため、モジュールには project root ではなく
|
|
2560
|
+
// ADR ディレクトリを rootDir として渡す(project root を渡すと readdir が ADR を
|
|
2561
|
+
// 一切発見できず vacuous な valid を返す phantom gate になる)。
|
|
2557
2562
|
case "list-adrs": {
|
|
2558
|
-
const mod = createAdrFoundationModule(rootDir);
|
|
2563
|
+
const mod = createAdrFoundationModule(join(rootDir, "docs", "ADR"));
|
|
2559
2564
|
const statuses = toAdrStatuses(parseFlag(args, "--status"));
|
|
2560
2565
|
const result = await mod.listAdrsCommandHandler.execute({
|
|
2561
2566
|
statuses,
|
|
@@ -2567,7 +2572,7 @@ async function main(): Promise<void> {
|
|
|
2567
2572
|
}
|
|
2568
2573
|
|
|
2569
2574
|
case "validate-adr": {
|
|
2570
|
-
const mod = createAdrFoundationModule(rootDir);
|
|
2575
|
+
const mod = createAdrFoundationModule(join(rootDir, "docs", "ADR"));
|
|
2571
2576
|
const all = hasFlag(args, "--all");
|
|
2572
2577
|
const adrRef = args.find((a) => !a.startsWith("--") && a !== command);
|
|
2573
2578
|
const result = await mod.validateAdrCommandHandler.execute({
|
|
@@ -2821,6 +2826,50 @@ async function main(): Promise<void> {
|
|
|
2821
2826
|
break;
|
|
2822
2827
|
}
|
|
2823
2828
|
|
|
2829
|
+
case "phasegate:attest": {
|
|
2830
|
+
const flagError = validateKnownFlags(args.slice(1), [
|
|
2831
|
+
"--out",
|
|
2832
|
+
"--require-pass",
|
|
2833
|
+
"--mode",
|
|
2834
|
+
"--json",
|
|
2835
|
+
"--help",
|
|
2836
|
+
]);
|
|
2837
|
+
if (flagError !== null) {
|
|
2838
|
+
console.error(flagError);
|
|
2839
|
+
process.exit(2);
|
|
2840
|
+
}
|
|
2841
|
+
const { createAttestationModule } = await import("./attestation/index.js");
|
|
2842
|
+
const pkgVersion = await getHarnessVersion(harnessRoot);
|
|
2843
|
+
const mod = createAttestationModule(rootDir, { pkgVersion });
|
|
2844
|
+
const result = await mod.attestHandler.handle({
|
|
2845
|
+
out: parseFlag(args, "--out") ?? ".harness/attestation.json",
|
|
2846
|
+
requirePass: hasFlag(args, "--require-pass"),
|
|
2847
|
+
emitJson: json,
|
|
2848
|
+
mode: parseFlag(args, "--mode"),
|
|
2849
|
+
});
|
|
2850
|
+
console.log(result.output);
|
|
2851
|
+
process.exit(result.exitCode);
|
|
2852
|
+
break;
|
|
2853
|
+
}
|
|
2854
|
+
|
|
2855
|
+
case "phasegate:verify-attestation": {
|
|
2856
|
+
const flagError = validateKnownFlags(args.slice(1), ["--json", "--help"]);
|
|
2857
|
+
if (flagError !== null) {
|
|
2858
|
+
console.error(flagError);
|
|
2859
|
+
process.exit(2);
|
|
2860
|
+
}
|
|
2861
|
+
const { createAttestationModule } = await import("./attestation/index.js");
|
|
2862
|
+
const mod = createAttestationModule(rootDir);
|
|
2863
|
+
const file = args[1] && !args[1].startsWith("--") ? args[1] : undefined;
|
|
2864
|
+
const result = await mod.verifyAttestationHandler.handle({
|
|
2865
|
+
file,
|
|
2866
|
+
emitJson: json,
|
|
2867
|
+
});
|
|
2868
|
+
console.log(result.output);
|
|
2869
|
+
process.exit(result.exitCode);
|
|
2870
|
+
break;
|
|
2871
|
+
}
|
|
2872
|
+
|
|
2824
2873
|
// ── ci-governance ──
|
|
2825
2874
|
case "ci:generate-template": {
|
|
2826
2875
|
if (hasFlag(args, "--help")) {
|