@jeger-ai/opengantry 3.0.0 → 3.1.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/LICENSE +10 -27
- package/NOTICE +1 -0
- package/README.md +72 -15
- package/dist/cli/commands/arch.d.ts +1 -1
- package/dist/cli/commands/arch.d.ts.map +1 -1
- package/dist/cli/commands/arch.js +4 -4
- package/dist/cli/commands/arch.js.map +1 -1
- package/dist/cli/commands/attest.d.ts +8 -0
- package/dist/cli/commands/attest.d.ts.map +1 -0
- package/dist/cli/commands/attest.js +19 -0
- package/dist/cli/commands/attest.js.map +1 -0
- package/dist/cli/commands/doctor.d.ts +4 -2
- package/dist/cli/commands/doctor.d.ts.map +1 -1
- package/dist/cli/commands/doctor.js +1 -1
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/lib/{architecture-drift-doctor.d.ts → arch/cage/architecture-drift-doctor.d.ts} +1 -1
- package/dist/cli/lib/arch/cage/architecture-drift-doctor.d.ts.map +1 -0
- package/dist/cli/lib/{architecture-drift-doctor.js → arch/cage/architecture-drift-doctor.js} +2 -2
- package/dist/cli/lib/arch/cage/architecture-drift-doctor.js.map +1 -0
- package/dist/cli/lib/{target-architecture-doctor.d.ts → arch/cage/target-architecture-doctor.d.ts} +1 -1
- package/dist/cli/lib/arch/cage/target-architecture-doctor.d.ts.map +1 -0
- package/dist/cli/lib/arch/cage/target-architecture-doctor.js.map +1 -0
- package/dist/cli/lib/arch/cage/target-architecture.d.ts.map +1 -0
- package/dist/cli/lib/{target-architecture.js → arch/cage/target-architecture.js} +19 -21
- package/dist/cli/lib/arch/cage/target-architecture.js.map +1 -0
- package/dist/cli/lib/arch/external/architecture-credential.d.ts.map +1 -0
- package/dist/cli/lib/{architecture-credential.js → arch/external/architecture-credential.js} +2 -2
- package/dist/cli/lib/arch/external/architecture-credential.js.map +1 -0
- package/dist/cli/lib/arch/external/architecture-fetch.d.ts.map +1 -0
- package/dist/cli/lib/{architecture-fetch.js → arch/external/architecture-fetch.js} +1 -1
- package/dist/cli/lib/arch/external/architecture-fetch.js.map +1 -0
- package/dist/cli/lib/{architecture-pointer.d.ts → arch/external/architecture-pointer.d.ts} +1 -1
- package/dist/cli/lib/arch/external/architecture-pointer.d.ts.map +1 -0
- package/dist/cli/lib/{architecture-pointer.js → arch/external/architecture-pointer.js} +2 -2
- package/dist/cli/lib/arch/external/architecture-pointer.js.map +1 -0
- package/dist/cli/lib/attest-mission.d.ts +13 -0
- package/dist/cli/lib/attest-mission.d.ts.map +1 -0
- package/dist/cli/lib/attest-mission.js +22 -0
- package/dist/cli/lib/attest-mission.js.map +1 -0
- package/dist/cli/lib/attestation-receipt.d.ts +40 -0
- package/dist/cli/lib/attestation-receipt.d.ts.map +1 -0
- package/dist/cli/lib/attestation-receipt.js +110 -0
- package/dist/cli/lib/attestation-receipt.js.map +1 -0
- package/dist/cli/lib/blueprint-engine.js +1 -1
- package/dist/cli/lib/blueprint-engine.js.map +1 -1
- package/dist/cli/lib/break-glass.d.ts +1 -1
- package/dist/cli/lib/break-glass.d.ts.map +1 -1
- package/dist/cli/lib/canonical-json.d.ts +3 -0
- package/dist/cli/lib/canonical-json.d.ts.map +1 -0
- package/dist/cli/lib/canonical-json.js +13 -0
- package/dist/cli/lib/canonical-json.js.map +1 -0
- package/dist/cli/lib/constants.d.ts +3 -0
- package/dist/cli/lib/constants.d.ts.map +1 -1
- package/dist/cli/lib/constants.js +3 -0
- package/dist/cli/lib/constants.js.map +1 -1
- package/dist/cli/lib/context-feed-remediation.d.ts +2 -2
- package/dist/cli/lib/context-feed-remediation.d.ts.map +1 -1
- package/dist/cli/lib/discovery-proposal.js +1 -1
- package/dist/cli/lib/discovery-proposal.js.map +1 -1
- package/dist/cli/lib/discovery-scanner.d.ts +3 -39
- package/dist/cli/lib/discovery-scanner.d.ts.map +1 -1
- package/dist/cli/lib/discovery-scanner.js +2 -1
- package/dist/cli/lib/discovery-scanner.js.map +1 -1
- package/dist/cli/lib/discovery-types.d.ts +40 -0
- package/dist/cli/lib/discovery-types.d.ts.map +1 -0
- package/dist/cli/lib/discovery-types.js +3 -0
- package/dist/cli/lib/discovery-types.js.map +1 -0
- package/dist/cli/lib/doctor-core.d.ts +1 -1
- package/dist/cli/lib/doctor-core.d.ts.map +1 -1
- package/dist/cli/lib/doctor-core.js +28 -6
- package/dist/cli/lib/doctor-core.js.map +1 -1
- package/dist/cli/lib/domains/domain-adapter.d.ts +4 -2
- package/dist/cli/lib/domains/domain-adapter.d.ts.map +1 -1
- package/dist/cli/lib/domains/domain-adapter.js.map +1 -1
- package/dist/cli/lib/domains/domain-code.d.ts.map +1 -1
- package/dist/cli/lib/domains/domain-code.js +1 -2
- package/dist/cli/lib/domains/domain-code.js.map +1 -1
- package/dist/cli/lib/domains/domain-content.d.ts.map +1 -1
- package/dist/cli/lib/domains/domain-content.js +1 -2
- package/dist/cli/lib/domains/domain-content.js.map +1 -1
- package/dist/cli/lib/domains/index.d.ts +4 -4
- package/dist/cli/lib/domains/index.d.ts.map +1 -1
- package/dist/cli/lib/domains/index.js +15 -4
- package/dist/cli/lib/domains/index.js.map +1 -1
- package/dist/cli/lib/draft-token.d.ts +1 -2
- package/dist/cli/lib/draft-token.d.ts.map +1 -1
- package/dist/cli/lib/draft-token.js +2 -12
- package/dist/cli/lib/draft-token.js.map +1 -1
- package/dist/cli/lib/flight-telemetry-doctor.d.ts +3 -0
- package/dist/cli/lib/flight-telemetry-doctor.d.ts.map +1 -0
- package/dist/cli/lib/flight-telemetry-doctor.js +25 -0
- package/dist/cli/lib/flight-telemetry-doctor.js.map +1 -0
- package/dist/cli/lib/gxt-config.d.ts +11 -0
- package/dist/cli/lib/gxt-config.d.ts.map +1 -1
- package/dist/cli/lib/gxt-config.js +10 -0
- package/dist/cli/lib/gxt-config.js.map +1 -1
- package/dist/cli/lib/init-compose.d.ts +1 -1
- package/dist/cli/lib/init-compose.d.ts.map +1 -1
- package/dist/cli/lib/kpi-advisory-findings.d.ts +5 -0
- package/dist/cli/lib/kpi-advisory-findings.d.ts.map +1 -0
- package/dist/cli/lib/kpi-advisory-findings.js +16 -0
- package/dist/cli/lib/kpi-advisory-findings.js.map +1 -0
- package/dist/cli/lib/kpi-engine.d.ts +4 -3
- package/dist/cli/lib/kpi-engine.d.ts.map +1 -1
- package/dist/cli/lib/kpi-engine.js +36 -20
- package/dist/cli/lib/kpi-engine.js.map +1 -1
- package/dist/cli/lib/manifest.d.ts +1 -1
- package/dist/cli/lib/manifest.d.ts.map +1 -1
- package/dist/cli/lib/manifest.js +1 -1
- package/dist/cli/lib/manifest.js.map +1 -1
- package/dist/cli/lib/mcp-attest.d.ts +6 -0
- package/dist/cli/lib/mcp-attest.d.ts.map +1 -0
- package/dist/cli/lib/mcp-attest.js +15 -0
- package/dist/cli/lib/mcp-attest.js.map +1 -0
- package/dist/cli/lib/mcp-check-signature.d.ts +6 -0
- package/dist/cli/lib/mcp-check-signature.d.ts.map +1 -0
- package/dist/cli/lib/mcp-check-signature.js +40 -0
- package/dist/cli/lib/mcp-check-signature.js.map +1 -0
- package/dist/cli/lib/mcp-draft-legislation.d.ts +6 -0
- package/dist/cli/lib/mcp-draft-legislation.d.ts.map +1 -0
- package/dist/cli/lib/mcp-draft-legislation.js +63 -0
- package/dist/cli/lib/mcp-draft-legislation.js.map +1 -0
- package/dist/cli/lib/mcp-execute-legislation.d.ts +6 -0
- package/dist/cli/lib/mcp-execute-legislation.d.ts.map +1 -0
- package/dist/cli/lib/mcp-execute-legislation.js +53 -0
- package/dist/cli/lib/mcp-execute-legislation.js.map +1 -0
- package/dist/cli/lib/mcp-governance-shared.d.ts +119 -0
- package/dist/cli/lib/mcp-governance-shared.d.ts.map +1 -0
- package/dist/cli/lib/mcp-governance-shared.js +21 -0
- package/dist/cli/lib/mcp-governance-shared.js.map +1 -0
- package/dist/cli/lib/mcp-governance.d.ts +9 -121
- package/dist/cli/lib/mcp-governance.d.ts.map +1 -1
- package/dist/cli/lib/mcp-governance.js +8 -259
- package/dist/cli/lib/mcp-governance.js.map +1 -1
- package/dist/cli/lib/mcp-last-error.d.ts +3 -0
- package/dist/cli/lib/mcp-last-error.d.ts.map +1 -0
- package/dist/cli/lib/mcp-last-error.js +18 -0
- package/dist/cli/lib/mcp-last-error.js.map +1 -0
- package/dist/cli/lib/mcp-pin-mission.d.ts +6 -0
- package/dist/cli/lib/mcp-pin-mission.d.ts.map +1 -0
- package/dist/cli/lib/mcp-pin-mission.js +21 -0
- package/dist/cli/lib/mcp-pin-mission.js.map +1 -0
- package/dist/cli/lib/mcp-resolve-mission.d.ts +3 -0
- package/dist/cli/lib/mcp-resolve-mission.d.ts.map +1 -0
- package/dist/cli/lib/mcp-resolve-mission.js +18 -0
- package/dist/cli/lib/mcp-resolve-mission.js.map +1 -0
- package/dist/cli/lib/mcp-start-orchestration.d.ts +3 -0
- package/dist/cli/lib/mcp-start-orchestration.d.ts.map +1 -0
- package/dist/cli/lib/mcp-start-orchestration.js +53 -0
- package/dist/cli/lib/mcp-start-orchestration.js.map +1 -0
- package/dist/cli/lib/mcp-tools-register.d.ts.map +1 -1
- package/dist/cli/lib/mcp-tools-register.js +20 -1
- package/dist/cli/lib/mcp-tools-register.js.map +1 -1
- package/dist/cli/lib/path-glob.d.ts +8 -0
- package/dist/cli/lib/path-glob.d.ts.map +1 -0
- package/dist/cli/lib/path-glob.js +40 -0
- package/dist/cli/lib/path-glob.js.map +1 -0
- package/dist/cli/lib/perimeter.d.ts +1 -2
- package/dist/cli/lib/perimeter.d.ts.map +1 -1
- package/dist/cli/lib/perimeter.js +2 -10
- package/dist/cli/lib/perimeter.js.map +1 -1
- package/dist/cli/lib/policy-digest-doctor.d.ts +11 -0
- package/dist/cli/lib/policy-digest-doctor.d.ts.map +1 -0
- package/dist/cli/lib/policy-digest-doctor.js +37 -0
- package/dist/cli/lib/policy-digest-doctor.js.map +1 -0
- package/dist/cli/lib/receipt-signing.d.ts +12 -0
- package/dist/cli/lib/receipt-signing.d.ts.map +1 -0
- package/dist/cli/lib/receipt-signing.js +150 -0
- package/dist/cli/lib/receipt-signing.js.map +1 -0
- package/dist/cli/lib/runtime-exec.d.ts +1 -0
- package/dist/cli/lib/runtime-exec.d.ts.map +1 -1
- package/dist/cli/lib/runtime-exec.js +21 -17
- package/dist/cli/lib/runtime-exec.js.map +1 -1
- package/dist/cli/lib/surgeons/registry.d.ts +1 -1
- package/dist/cli/lib/surgeons/registry.d.ts.map +1 -1
- package/dist/cli/lib/trace-evidence.d.ts +21 -0
- package/dist/cli/lib/trace-evidence.d.ts.map +1 -0
- package/dist/cli/lib/trace-evidence.js +113 -0
- package/dist/cli/lib/trace-evidence.js.map +1 -0
- package/dist/cli/lib/trace-quote.d.ts +37 -0
- package/dist/cli/lib/trace-quote.d.ts.map +1 -0
- package/dist/cli/lib/trace-quote.js +177 -0
- package/dist/cli/lib/trace-quote.js.map +1 -0
- package/dist/cli/lib/trace-status.d.ts +7 -0
- package/dist/cli/lib/trace-status.d.ts.map +1 -0
- package/dist/cli/lib/trace-status.js +20 -0
- package/dist/cli/lib/trace-status.js.map +1 -0
- package/dist/cli/lib/trace.d.ts +3 -60
- package/dist/cli/lib/trace.d.ts.map +1 -1
- package/dist/cli/lib/trace.js +3 -304
- package/dist/cli/lib/trace.js.map +1 -1
- package/dist/cli/lib/types.d.ts +1 -0
- package/dist/cli/lib/types.d.ts.map +1 -1
- package/dist/cli/lib/upgrade-plan-catalog.d.ts +13 -0
- package/dist/cli/lib/upgrade-plan-catalog.d.ts.map +1 -0
- package/dist/cli/lib/upgrade-plan-catalog.js +85 -0
- package/dist/cli/lib/upgrade-plan-catalog.js.map +1 -0
- package/dist/cli/lib/upgrade-plan-payload.d.ts +1 -1
- package/dist/cli/lib/upgrade-plan-payload.d.ts.map +1 -1
- package/dist/cli/lib/upgrade-plan-scaffold.d.ts +15 -0
- package/dist/cli/lib/upgrade-plan-scaffold.d.ts.map +1 -0
- package/dist/cli/lib/upgrade-plan-scaffold.js +109 -0
- package/dist/cli/lib/upgrade-plan-scaffold.js.map +1 -0
- package/dist/cli/lib/upgrade-plan-types.d.ts +43 -0
- package/dist/cli/lib/upgrade-plan-types.d.ts.map +1 -0
- package/dist/cli/lib/upgrade-plan-types.js +3 -0
- package/dist/cli/lib/upgrade-plan-types.js.map +1 -0
- package/dist/cli/lib/upgrade-plan.d.ts +4 -62
- package/dist/cli/lib/upgrade-plan.d.ts.map +1 -1
- package/dist/cli/lib/upgrade-plan.js +7 -181
- package/dist/cli/lib/upgrade-plan.js.map +1 -1
- package/dist/cli/lib/verify-defensive-phase.d.ts +1 -1
- package/dist/cli/lib/verify-defensive-phase.d.ts.map +1 -1
- package/dist/cli/lib/verify-engine.d.ts +4 -37
- package/dist/cli/lib/verify-engine.d.ts.map +1 -1
- package/dist/cli/lib/verify-engine.js +13 -2
- package/dist/cli/lib/verify-engine.js.map +1 -1
- package/dist/cli/lib/verify-export.d.ts.map +1 -1
- package/dist/cli/lib/verify-export.js +3 -2
- package/dist/cli/lib/verify-export.js.map +1 -1
- package/dist/cli/lib/verify-failure-normalize.d.ts +2 -4
- package/dist/cli/lib/verify-failure-normalize.d.ts.map +1 -1
- package/dist/cli/lib/verify-failure-normalize.js +0 -50
- package/dist/cli/lib/verify-failure-normalize.js.map +1 -1
- package/dist/cli/lib/verify-hints.d.ts +1 -1
- package/dist/cli/lib/verify-hints.d.ts.map +1 -1
- package/dist/cli/lib/verify-options.d.ts +44 -0
- package/dist/cli/lib/verify-options.d.ts.map +1 -0
- package/dist/cli/lib/verify-options.js +13 -0
- package/dist/cli/lib/verify-options.js.map +1 -0
- package/dist/cli/lib/verify-payload.d.ts +7 -1
- package/dist/cli/lib/verify-payload.d.ts.map +1 -1
- package/dist/cli/lib/verify-payload.js +55 -1
- package/dist/cli/lib/verify-payload.js.map +1 -1
- package/dist/cli/lib/verify-presenters.d.ts +11 -5
- package/dist/cli/lib/verify-presenters.d.ts.map +1 -1
- package/dist/cli/lib/verify-presenters.js +22 -26
- package/dist/cli/lib/verify-presenters.js.map +1 -1
- package/dist/cli/lib/verify-receipt.d.ts +11 -0
- package/dist/cli/lib/verify-receipt.d.ts.map +1 -0
- package/dist/cli/lib/verify-receipt.js +40 -0
- package/dist/cli/lib/verify-receipt.js.map +1 -0
- package/dist/cli/lib/verify-run.d.ts +2 -2
- package/dist/cli/lib/verify-run.d.ts.map +1 -1
- package/dist/cli/lib/verify-run.js +72 -20
- package/dist/cli/lib/verify-run.js.map +1 -1
- package/dist/cli/lib/version.gen.d.ts +1 -1
- package/dist/cli/lib/version.gen.js +1 -1
- package/dist/cli/lib/working-digests.d.ts +8 -0
- package/dist/cli/lib/working-digests.d.ts.map +1 -0
- package/dist/cli/lib/working-digests.js +21 -0
- package/dist/cli/lib/working-digests.js.map +1 -0
- package/dist/cli/program-arch.js +1 -1
- package/dist/cli/program-arch.js.map +1 -1
- package/dist/cli/program-core.d.ts.map +1 -1
- package/dist/cli/program-core.js +10 -24
- package/dist/cli/program-core.js.map +1 -1
- package/dist/cli/program-init-options.d.ts +4 -0
- package/dist/cli/program-init-options.d.ts.map +1 -0
- package/dist/cli/program-init-options.js +23 -0
- package/dist/cli/program-init-options.js.map +1 -0
- package/dist/cli/program-workflow.d.ts.map +1 -1
- package/dist/cli/program-workflow.js +21 -1
- package/dist/cli/program-workflow.js.map +1 -1
- package/dist/cli/program.d.ts.map +1 -1
- package/dist/cli/program.js +2 -0
- package/dist/cli/program.js.map +1 -1
- package/package.json +3 -3
- package/templates/.gitagent/config.json +3 -0
- package/templates/.gitagent/foreman/SUBSTRATE.version.json +1 -1
- package/templates/.gitagent/planner/KPI-REPORT.schema.yaml +4 -0
- package/templates/.gitagent/planner/PERFORMANCE.md +18 -0
- package/templates/.gitagent/planner/PERFORMANCE_RUBRIC.template.md +32 -0
- package/templates/.githooks/pre-push +5 -5
- package/templates/.github/workflows/gxt-validate.yml +7 -4
- package/templates/integrations/asset-catalog.json +3 -0
- package/templates/integrations/compatibility.json +1 -1
- package/templates/scripts/gxt-manifest-lib.mjs +12 -493
- package/templates/scripts/lib/glob-match.mjs +24 -0
- package/templates/scripts/lib/manifest-validate.mjs +126 -0
- package/templates/scripts/lib/trusted-automation.mjs +407 -0
- package/templates/scripts/verify-pr-missions.sh +3 -3
- package/dist/cli/lib/architecture-credential.d.ts.map +0 -1
- package/dist/cli/lib/architecture-credential.js.map +0 -1
- package/dist/cli/lib/architecture-drift-doctor.d.ts.map +0 -1
- package/dist/cli/lib/architecture-drift-doctor.js.map +0 -1
- package/dist/cli/lib/architecture-fetch.d.ts.map +0 -1
- package/dist/cli/lib/architecture-fetch.js.map +0 -1
- package/dist/cli/lib/architecture-pointer.d.ts.map +0 -1
- package/dist/cli/lib/architecture-pointer.js.map +0 -1
- package/dist/cli/lib/target-architecture-doctor.d.ts.map +0 -1
- package/dist/cli/lib/target-architecture-doctor.js.map +0 -1
- package/dist/cli/lib/target-architecture.d.ts.map +0 -1
- package/dist/cli/lib/target-architecture.js.map +0 -1
- /package/dist/cli/lib/{target-architecture-doctor.js → arch/cage/target-architecture-doctor.js} +0 -0
- /package/dist/cli/lib/{target-architecture.d.ts → arch/cage/target-architecture.d.ts} +0 -0
- /package/dist/cli/lib/{architecture-credential.d.ts → arch/external/architecture-credential.d.ts} +0 -0
- /package/dist/cli/lib/{architecture-fetch.d.ts → arch/external/architecture-fetch.d.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../../src/cli/lib/surgeons/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAI1D,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../../src/cli/lib/surgeons/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAI1D,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAI5C,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,8EAA8E;AAC9E,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,WAAW,CAAC;IACrB,QAAQ,EAAE,QAAQ,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,YAAY,CAAC;CACzB;AAED,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,YAAY,CAAC;IACxB,aAAa,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;CACxE;AAID,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,YAAY,GAAG,WAAW,GAAG,SAAS,CAElF;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,kBAAkB,GAAG,YAAY,GAAG,IAAI,CAaxF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Manifest, TraceRow } from "./types.js";
|
|
2
|
+
import type { ResolvedQuoteLine } from "./trace-quote.js";
|
|
3
|
+
export declare const UNCOMMITTED_BLAME_COMMIT = "0000000000000000000000000000000000000000";
|
|
4
|
+
export interface TraceEvidenceFailure {
|
|
5
|
+
row: TraceRow;
|
|
6
|
+
attestationCommit: string;
|
|
7
|
+
quoteLine: number;
|
|
8
|
+
stalePaths: string[];
|
|
9
|
+
reason: string;
|
|
10
|
+
}
|
|
11
|
+
export interface TraceEvidenceOptions {
|
|
12
|
+
skipStaleEvidence?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/** Parse `git blame --porcelain` into 1-based line number → commit hash. */
|
|
15
|
+
export declare function parseBlamePorcelainByLine(blameOutput: string): Map<number, string>;
|
|
16
|
+
export declare function readBlamePorcelainByLine(repoRoot: string, executorLogRelPath: string): Map<number, string>;
|
|
17
|
+
export declare function verifyTraceEvidenceFreshness(repoRoot: string, manifest: Manifest, skillKey: string | null, executorLogPath: string, resolvedLines: ResolvedQuoteLine[], options?: TraceEvidenceOptions): {
|
|
18
|
+
failures: TraceEvidenceFailure[];
|
|
19
|
+
skippedUncommitted: number;
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=trace-evidence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trace-evidence.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/trace-evidence.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,eAAO,MAAM,wBAAwB,6CAA6C,CAAC;AAEnF,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,QAAQ,CAAC;IACd,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,oBAAoB;IACnC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAQD,4EAA4E;AAC5E,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAgClF;AAED,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAI1G;AAkBD,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,MAAM,GAAG,IAAI,EACvB,eAAe,EAAE,MAAM,EACvB,aAAa,EAAE,iBAAiB,EAAE,EAClC,OAAO,GAAE,oBAAyB,GACjC;IAAE,QAAQ,EAAE,oBAAoB,EAAE,CAAC;IAAC,kBAAkB,EAAE,MAAM,CAAA;CAAE,CA+DlE"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { EXECUTOR_LOG_FILENAME } from "./constants.js";
|
|
3
|
+
import { toPosixRel } from "./cli-io.js";
|
|
4
|
+
import { gitDiffNameOnlySinceCommit, gitRun } from "./git.js";
|
|
5
|
+
import { tmvcRootsForSkill } from "./tmvc-path.js";
|
|
6
|
+
export const UNCOMMITTED_BLAME_COMMIT = "0000000000000000000000000000000000000000";
|
|
7
|
+
function executorLogRelPath(executorLogPath, repoRoot) {
|
|
8
|
+
const abs = path.resolve(executorLogPath);
|
|
9
|
+
const rel = toPosixRel(repoRoot, abs);
|
|
10
|
+
return rel.length > 0 && !rel.startsWith("..") ? rel : EXECUTOR_LOG_FILENAME;
|
|
11
|
+
}
|
|
12
|
+
/** Parse `git blame --porcelain` into 1-based line number → commit hash. */
|
|
13
|
+
export function parseBlamePorcelainByLine(blameOutput) {
|
|
14
|
+
const byLine = new Map();
|
|
15
|
+
const lines = blameOutput.split(/\r?\n/);
|
|
16
|
+
let i = 0;
|
|
17
|
+
while (i < lines.length) {
|
|
18
|
+
const header = lines[i];
|
|
19
|
+
const full = /^([0-9a-f]{40})\s+\d+\s+(\d+)\s+(\d+)/.exec(header);
|
|
20
|
+
const short = /^([0-9a-f]{40})\s+\d+\s+(\d+)\s*$/.exec(header);
|
|
21
|
+
if (!full && !short) {
|
|
22
|
+
i += 1;
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
const commit = (full ?? short)[1];
|
|
26
|
+
const finalLine = parseInt((full ?? short)[2], 10);
|
|
27
|
+
i += 1;
|
|
28
|
+
if (full) {
|
|
29
|
+
while (i < lines.length && !lines[i].startsWith("\t")) {
|
|
30
|
+
i += 1;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
if (i < lines.length && lines[i].startsWith("\t")) {
|
|
34
|
+
byLine.set(finalLine, commit);
|
|
35
|
+
i += 1;
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
if (short) {
|
|
39
|
+
byLine.set(finalLine, commit);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return byLine;
|
|
43
|
+
}
|
|
44
|
+
export function readBlamePorcelainByLine(repoRoot, executorLogRelPath) {
|
|
45
|
+
const r = gitRun(repoRoot, ["blame", "--porcelain", "--", executorLogRelPath]);
|
|
46
|
+
if (!r.ok)
|
|
47
|
+
return new Map();
|
|
48
|
+
return parseBlamePorcelainByLine(r.stdout);
|
|
49
|
+
}
|
|
50
|
+
function formatStaleReason(row, quoteLine, attestationCommit, stalePaths) {
|
|
51
|
+
const shortCommit = attestationCommit.slice(0, 7);
|
|
52
|
+
const shown = stalePaths.slice(0, 5);
|
|
53
|
+
const suffix = stalePaths.length > shown.length ? ` (+${String(stalePaths.length - shown.length)} more)` : "";
|
|
54
|
+
return (`Trace STALE for DoD ${row.dodId} (EXECUTOR_LOG.md line ${String(quoteLine)}, attested at ${shortCommit}): ` +
|
|
55
|
+
`TMVC drift since attestation — ${shown.join(", ")}${suffix}. Re-run gate and append a fresh trace line.`);
|
|
56
|
+
}
|
|
57
|
+
export function verifyTraceEvidenceFreshness(repoRoot, manifest, skillKey, executorLogPath, resolvedLines, options = {}) {
|
|
58
|
+
if (options.skipStaleEvidence === true) {
|
|
59
|
+
return { failures: [], skippedUncommitted: 0 };
|
|
60
|
+
}
|
|
61
|
+
const tmvcRoots = tmvcRootsForSkill(manifest, skillKey);
|
|
62
|
+
if (tmvcRoots.length === 0) {
|
|
63
|
+
return { failures: [], skippedUncommitted: 0 };
|
|
64
|
+
}
|
|
65
|
+
const executorLogRel = executorLogRelPath(executorLogPath, repoRoot);
|
|
66
|
+
const blameByLine = readBlamePorcelainByLine(repoRoot, executorLogRel);
|
|
67
|
+
const diffCache = new Map();
|
|
68
|
+
const failures = [];
|
|
69
|
+
let skippedUncommitted = 0;
|
|
70
|
+
for (const { row, lineNumber } of resolvedLines) {
|
|
71
|
+
const attestationCommit = blameByLine.get(lineNumber);
|
|
72
|
+
if (!attestationCommit) {
|
|
73
|
+
failures.push({
|
|
74
|
+
row,
|
|
75
|
+
attestationCommit: "unknown",
|
|
76
|
+
quoteLine: lineNumber,
|
|
77
|
+
stalePaths: [],
|
|
78
|
+
reason: `Trace STALE for DoD ${row.dodId}: cannot resolve git blame for EXECUTOR_LOG.md line ${String(lineNumber)}`,
|
|
79
|
+
});
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
if (attestationCommit === UNCOMMITTED_BLAME_COMMIT) {
|
|
83
|
+
skippedUncommitted += 1;
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
let diffResult = diffCache.get(attestationCommit);
|
|
87
|
+
if (diffResult === undefined) {
|
|
88
|
+
diffResult = gitDiffNameOnlySinceCommit(repoRoot, attestationCommit, tmvcRoots);
|
|
89
|
+
diffCache.set(attestationCommit, diffResult);
|
|
90
|
+
}
|
|
91
|
+
if (!diffResult.ok) {
|
|
92
|
+
failures.push({
|
|
93
|
+
row,
|
|
94
|
+
attestationCommit,
|
|
95
|
+
quoteLine: lineNumber,
|
|
96
|
+
stalePaths: [],
|
|
97
|
+
reason: `Trace STALE for DoD ${row.dodId}: cannot evaluate TMVC drift since attestation (git diff failed)`,
|
|
98
|
+
});
|
|
99
|
+
continue;
|
|
100
|
+
}
|
|
101
|
+
if (diffResult.paths.length > 0) {
|
|
102
|
+
failures.push({
|
|
103
|
+
row,
|
|
104
|
+
attestationCommit,
|
|
105
|
+
quoteLine: lineNumber,
|
|
106
|
+
stalePaths: diffResult.paths,
|
|
107
|
+
reason: formatStaleReason(row, lineNumber, attestationCommit, diffResult.paths),
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return { failures, skippedUncommitted };
|
|
112
|
+
}
|
|
113
|
+
//# source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I,CAAC;gBACZ,GAAG;gBACH,iBAAiB;gBACjB,SAAS,EAAE,UAAU;gBACrB,UAAU,EAAE,UAAU,CAAC,KAAK;gBAC5B,MAAM,EAAE,iBAAiB,CAAC,GAAG,EAAE,UAAU,EAAE,iBAAiB,EAAE,UAAU,CAAC,KAAK,CAAC;aAChF,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type ExecutorLogLineMap } from "./executor-log-line-map.js";
|
|
2
|
+
import type { TraceRow } from "./types.js";
|
|
3
|
+
/** Typed trace verification failure — control flow must branch on this, not UI strings. */
|
|
4
|
+
export type TraceFailureKind = "ambiguous" | "quote_missing" | "executor_log_missing" | "placeholder_quote" | "strict_line_drift" | "empty_quote" | "anchor_mismatch" | "stale_evidence" | "other";
|
|
5
|
+
export interface TraceVerifyFailure {
|
|
6
|
+
row: TraceRow;
|
|
7
|
+
/** Set at construction — every failure site knows its own kind. */
|
|
8
|
+
kind: TraceFailureKind;
|
|
9
|
+
reason: string;
|
|
10
|
+
}
|
|
11
|
+
export interface TraceVerifyWarning {
|
|
12
|
+
row: TraceRow;
|
|
13
|
+
declaredLine: number;
|
|
14
|
+
foundLine: number;
|
|
15
|
+
autoResolved?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface TraceVerifyOptions {
|
|
18
|
+
/** Force fuzzy for all numeric anchors. */
|
|
19
|
+
fuzzyNumericAnchor?: boolean;
|
|
20
|
+
/** Disable auto-retry on line drift only. */
|
|
21
|
+
strictTrace?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface ResolvedQuoteLine {
|
|
24
|
+
row: TraceRow;
|
|
25
|
+
lineNumber: number;
|
|
26
|
+
}
|
|
27
|
+
export interface TraceVerifyResult {
|
|
28
|
+
failures: TraceVerifyFailure[];
|
|
29
|
+
warnings: TraceVerifyWarning[];
|
|
30
|
+
resolvedLines: ResolvedQuoteLine[];
|
|
31
|
+
map: ExecutorLogLineMap | null;
|
|
32
|
+
}
|
|
33
|
+
export declare function resolveQuoteLineNumber(map: ExecutorLogLineMap, row: TraceRow, resolvedLineByDodId: ReadonlyMap<string, number>): number | null;
|
|
34
|
+
/** Line numbers are 1-based in mission table; other anchors match a substring on a line */
|
|
35
|
+
export declare function verifyTraceRows(executorLogPath: string, rows: TraceRow[], options?: TraceVerifyOptions): TraceVerifyResult;
|
|
36
|
+
export declare function defaultExecutorLogPath(repoRoot: string): string;
|
|
37
|
+
//# sourceMappingURL=trace-quote.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trace-quote.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/trace-quote.ts"],"names":[],"mappings":"AAEA,OAAO,EAAoB,KAAK,kBAAkB,EAAoC,MAAM,4BAA4B,CAAC;AACzH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAG3C,2FAA2F;AAC3F,MAAM,MAAM,gBAAgB,GACxB,WAAW,GACX,eAAe,GACf,sBAAsB,GACtB,mBAAmB,GACnB,mBAAmB,GACnB,aAAa,GACb,iBAAiB,GACjB,gBAAgB,GAChB,OAAO,CAAC;AAMZ,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,QAAQ,CAAC;IACd,mEAAmE;IACnE,IAAI,EAAE,gBAAgB,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,QAAQ,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,kBAAkB;IACjC,2CAA2C;IAC3C,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,6CAA6C;IAC7C,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,QAAQ,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,kBAAkB,EAAE,CAAC;IAC/B,QAAQ,EAAE,kBAAkB,EAAE,CAAC;IAC/B,aAAa,EAAE,iBAAiB,EAAE,CAAC;IACnC,GAAG,EAAE,kBAAkB,GAAG,IAAI,CAAC;CAChC;AAED,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,kBAAkB,EACvB,GAAG,EAAE,QAAQ,EACb,mBAAmB,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/C,MAAM,GAAG,IAAI,CAmBf;AA6FD,2FAA2F;AAC3F,wBAAgB,eAAe,CAC7B,eAAe,EAAE,MAAM,EACvB,IAAI,EAAE,QAAQ,EAAE,EAChB,OAAO,GAAE,kBAAuB,GAC/B,iBAAiB,CAwEnB;AAED,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE/D"}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { LEGISLATE_TRACE_PLACEHOLDER, EXECUTOR_LOG_FILENAME } from "./constants.js";
|
|
3
|
+
import { quoteLineNumbers, buildExecutorLogLineMapForQuotes } from "./executor-log-line-map.js";
|
|
4
|
+
import { isPassTraceRow } from "./trace-status.js";
|
|
5
|
+
function missingQuoteKind(traceQuote) {
|
|
6
|
+
return traceQuote.trim() === LEGISLATE_TRACE_PLACEHOLDER ? "placeholder_quote" : "quote_missing";
|
|
7
|
+
}
|
|
8
|
+
export function resolveQuoteLineNumber(map, row, resolvedLineByDodId) {
|
|
9
|
+
const override = resolvedLineByDodId.get(row.dodId);
|
|
10
|
+
if (override !== undefined)
|
|
11
|
+
return override;
|
|
12
|
+
const anchor = row.anchor.trim();
|
|
13
|
+
if (/^\d+$/.test(anchor)) {
|
|
14
|
+
const declared = parseInt(anchor, 10);
|
|
15
|
+
const line = map.lines[declared - 1];
|
|
16
|
+
if (line !== undefined && line.includes(row.traceQuote))
|
|
17
|
+
return declared;
|
|
18
|
+
const matches = quoteLineNumbers(map, row.traceQuote);
|
|
19
|
+
if (matches.length === 1)
|
|
20
|
+
return matches[0];
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
for (let i = 0; i < map.lines.length; i++) {
|
|
24
|
+
const line = map.lines[i];
|
|
25
|
+
if (line.includes(anchor) && line.includes(row.traceQuote))
|
|
26
|
+
return i + 1;
|
|
27
|
+
}
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
function buildResolvedQuoteLines(passRows, map, warnings) {
|
|
31
|
+
const resolvedLineByDodId = new Map();
|
|
32
|
+
for (const warning of warnings) {
|
|
33
|
+
resolvedLineByDodId.set(warning.row.dodId, warning.foundLine);
|
|
34
|
+
}
|
|
35
|
+
const resolved = [];
|
|
36
|
+
for (const row of passRows) {
|
|
37
|
+
const lineNumber = resolveQuoteLineNumber(map, row, resolvedLineByDodId);
|
|
38
|
+
if (lineNumber !== null)
|
|
39
|
+
resolved.push({ row, lineNumber });
|
|
40
|
+
}
|
|
41
|
+
return resolved;
|
|
42
|
+
}
|
|
43
|
+
function verifyNumericAnchorExact(map, row, lineNumber) {
|
|
44
|
+
const line = map.lines[lineNumber - 1];
|
|
45
|
+
if (line === undefined) {
|
|
46
|
+
return {
|
|
47
|
+
row,
|
|
48
|
+
kind: "strict_line_drift",
|
|
49
|
+
reason: `Anchor line ${lineNumber} out of range (file has ${map.lines.length} lines)`,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
if (!line.includes(row.traceQuote)) {
|
|
53
|
+
return { row, kind: "strict_line_drift", reason: `Trace quote not on anchored line ${lineNumber}` };
|
|
54
|
+
}
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
function resolveDriftFromMap(map, row, lineNumber) {
|
|
58
|
+
const matches = quoteLineNumbers(map, row.traceQuote);
|
|
59
|
+
if (matches.length === 0) {
|
|
60
|
+
return {
|
|
61
|
+
failure: {
|
|
62
|
+
row,
|
|
63
|
+
kind: missingQuoteKind(row.traceQuote),
|
|
64
|
+
reason: "Trace quote not found verbatim in EXECUTOR_LOG.md",
|
|
65
|
+
},
|
|
66
|
+
warning: null,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
if (matches.length === 1) {
|
|
70
|
+
const foundLine = matches[0];
|
|
71
|
+
return {
|
|
72
|
+
failure: null,
|
|
73
|
+
warning: { row, declaredLine: lineNumber, foundLine, autoResolved: true },
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
return {
|
|
77
|
+
failure: {
|
|
78
|
+
row,
|
|
79
|
+
kind: "ambiguous",
|
|
80
|
+
reason: `Ambiguous trace quote: found on lines ${matches.join(", ")}; re-run a clean flight`,
|
|
81
|
+
},
|
|
82
|
+
warning: null,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
function verifyNumericAnchorFuzzy(map, row, lineNumber) {
|
|
86
|
+
const exact = verifyNumericAnchorExact(map, row, lineNumber);
|
|
87
|
+
if (exact === null)
|
|
88
|
+
return { failure: null, warning: null };
|
|
89
|
+
return resolveDriftFromMap(map, row, lineNumber);
|
|
90
|
+
}
|
|
91
|
+
function verifyFreeformAnchor(map, row, anchor) {
|
|
92
|
+
const found = map.lines.some((line) => line.includes(anchor) && line.includes(row.traceQuote));
|
|
93
|
+
if (!found) {
|
|
94
|
+
return {
|
|
95
|
+
row,
|
|
96
|
+
kind: "anchor_mismatch",
|
|
97
|
+
reason: `No line contains both anchor "${anchor}" and trace quote`,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
/** Line numbers are 1-based in mission table; other anchors match a substring on a line */
|
|
103
|
+
export function verifyTraceRows(executorLogPath, rows, options = {}) {
|
|
104
|
+
const forceFuzzy = options.fuzzyNumericAnchor === true;
|
|
105
|
+
const autoFuzzy = options.strictTrace !== true;
|
|
106
|
+
const passRows = rows.filter((r) => isPassTraceRow(r.status));
|
|
107
|
+
const quotes = passRows.map((r) => r.traceQuote);
|
|
108
|
+
const map = buildExecutorLogLineMapForQuotes(executorLogPath, quotes);
|
|
109
|
+
if (!map) {
|
|
110
|
+
return {
|
|
111
|
+
failures: passRows.map((row) => ({
|
|
112
|
+
row,
|
|
113
|
+
kind: "executor_log_missing",
|
|
114
|
+
reason: `EXECUTOR_LOG missing: ${executorLogPath}`,
|
|
115
|
+
})),
|
|
116
|
+
warnings: [],
|
|
117
|
+
resolvedLines: [],
|
|
118
|
+
map: null,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
const failures = [];
|
|
122
|
+
const warnings = [];
|
|
123
|
+
for (const row of passRows) {
|
|
124
|
+
if (!row.traceQuote.trim()) {
|
|
125
|
+
failures.push({ row, kind: "empty_quote", reason: "PASS row has empty trace quote" });
|
|
126
|
+
continue;
|
|
127
|
+
}
|
|
128
|
+
if (!map.content.includes(row.traceQuote)) {
|
|
129
|
+
failures.push({
|
|
130
|
+
row,
|
|
131
|
+
kind: missingQuoteKind(row.traceQuote),
|
|
132
|
+
reason: "Trace quote not found verbatim in EXECUTOR_LOG.md",
|
|
133
|
+
});
|
|
134
|
+
continue;
|
|
135
|
+
}
|
|
136
|
+
const anchor = row.anchor.trim();
|
|
137
|
+
if (/^\d+$/.test(anchor)) {
|
|
138
|
+
const lineNumber = parseInt(anchor, 10);
|
|
139
|
+
if (forceFuzzy) {
|
|
140
|
+
const { failure, warning } = verifyNumericAnchorFuzzy(map, row, lineNumber);
|
|
141
|
+
if (failure)
|
|
142
|
+
failures.push(failure);
|
|
143
|
+
else if (warning)
|
|
144
|
+
warnings.push(warning);
|
|
145
|
+
continue;
|
|
146
|
+
}
|
|
147
|
+
const exactFailure = verifyNumericAnchorExact(map, row, lineNumber);
|
|
148
|
+
if (exactFailure === null)
|
|
149
|
+
continue;
|
|
150
|
+
// Exact numeric-anchor failures are always line drift; auto-fuzzy retries them.
|
|
151
|
+
if (autoFuzzy) {
|
|
152
|
+
const { failure, warning } = resolveDriftFromMap(map, row, lineNumber);
|
|
153
|
+
if (failure)
|
|
154
|
+
failures.push(failure);
|
|
155
|
+
else if (warning)
|
|
156
|
+
warnings.push(warning);
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
failures.push(exactFailure);
|
|
160
|
+
}
|
|
161
|
+
continue;
|
|
162
|
+
}
|
|
163
|
+
const failure = verifyFreeformAnchor(map, row, anchor);
|
|
164
|
+
if (failure)
|
|
165
|
+
failures.push(failure);
|
|
166
|
+
}
|
|
167
|
+
return {
|
|
168
|
+
failures,
|
|
169
|
+
warnings,
|
|
170
|
+
resolvedLines: buildResolvedQuoteLines(passRows, map, warnings),
|
|
171
|
+
map,
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
export function defaultExecutorLogPath(repoRoot) {
|
|
175
|
+
return path.join(repoRoot, EXECUTOR_LOG_FILENAME);
|
|
176
|
+
}
|
|
177
|
+
//# sourceMappingURL=trace-quote.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trace-quote.js","sourceRoot":"","sources":["../../../src/cli/lib/trace-quote.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,2BAA2B,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAA2B,gCAAgC,EAAE,MAAM,4BAA4B,CAAC;AAEzH,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAcnD,SAAS,gBAAgB,CAAC,UAAkB;IAC1C,OAAO,UAAU,CAAC,IAAI,EAAE,KAAK,2BAA2B,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,eAAe,CAAC;AACnG,CAAC;AAmCD,MAAM,UAAU,sBAAsB,CACpC,GAAuB,EACvB,GAAa,EACb,mBAAgD;IAEhD,MAAM,QA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AM,CAAC;gBACN,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YAC9B,CAAC;YACD,SAAS;QACX,CAAC;QAED,MAAM,OAAO,GAAG,oBAAoB,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;QACvD,IAAI,OAAO;YAAE,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAED,OAAO;QACL,QAAQ;QACR,QAAQ;QACR,aAAa,EAAE,uBAAuB,CAAC,QAAQ,EAAE,GAAG,EAAE,QAAQ,CAAC;QAC/D,GAAG;KACJ,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,QAAgB;IACrD,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,qBAAqB,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Normalized trace row status at mission boundary. */
|
|
2
|
+
export type NormalizedTraceStatus = "PASS" | "FAIL" | "PENDING";
|
|
3
|
+
export declare function normalizeTraceStatus(status: string): NormalizedTraceStatus;
|
|
4
|
+
export declare function isPassStatus(status: NormalizedTraceStatus): boolean;
|
|
5
|
+
export declare function isPendingStatus(status: NormalizedTraceStatus): boolean;
|
|
6
|
+
export declare function isPassTraceRow(status: string): boolean;
|
|
7
|
+
//# sourceMappingURL=trace-status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trace-status.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/trace-status.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;AAEhE,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,qBAAqB,CAM1E;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAEnE;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAEtE;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEtD"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export function normalizeTraceStatus(status) {
|
|
2
|
+
const upper = status.trim().toUpperCase();
|
|
3
|
+
if (upper === "PASS")
|
|
4
|
+
return "PASS";
|
|
5
|
+
if (upper === "FAIL")
|
|
6
|
+
return "FAIL";
|
|
7
|
+
if (upper === "PENDING")
|
|
8
|
+
return "PENDING";
|
|
9
|
+
return "PENDING";
|
|
10
|
+
}
|
|
11
|
+
export function isPassStatus(status) {
|
|
12
|
+
return status === "PASS";
|
|
13
|
+
}
|
|
14
|
+
export function isPendingStatus(status) {
|
|
15
|
+
return status === "PENDING";
|
|
16
|
+
}
|
|
17
|
+
export function isPassTraceRow(status) {
|
|
18
|
+
return isPassStatus(normalizeTraceStatus(status));
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=trace-status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trace-status.js","sourceRoot":"","sources":["../../../src/cli/lib/trace-status.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,oBAAoB,CAAC,MAAc;IACjD,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC1C,IAAI,KAAK,KAAK,MAAM;QAAE,OAAO,MAAM,CAAC;IACpC,IAAI,KAAK,KAAK,MAAM;QAAE,OAAO,MAAM,CAAC;IACpC,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC1C,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,MAA6B;IACxD,OAAO,MAAM,KAAK,MAAM,CAAC;AAC3B,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,MAA6B;IAC3D,OAAO,MAAM,KAAK,SAAS,CAAC;AAC9B,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,MAAc;IAC3C,OAAO,YAAY,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC;AACpD,CAAC"}
|
package/dist/cli/lib/trace.d.ts
CHANGED
|
@@ -1,61 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export type NormalizedTraceStatus = "PASS" | "FAIL" | "PENDING";
|
|
5
|
-
export declare function normalizeTraceStatus(status: string): NormalizedTraceStatus;
|
|
6
|
-
export declare function isPassStatus(status: NormalizedTraceStatus): boolean;
|
|
7
|
-
export declare function isPendingStatus(status: NormalizedTraceStatus): boolean;
|
|
8
|
-
/** Typed trace verification failure — control flow must branch on this, not UI strings. */
|
|
9
|
-
export type TraceFailureKind = "ambiguous" | "quote_missing" | "executor_log_missing" | "placeholder_quote" | "strict_line_drift" | "empty_quote" | "anchor_mismatch" | "stale_evidence" | "other";
|
|
10
|
-
export declare const UNCOMMITTED_BLAME_COMMIT = "0000000000000000000000000000000000000000";
|
|
11
|
-
export interface TraceEvidenceFailure {
|
|
12
|
-
row: TraceRow;
|
|
13
|
-
attestationCommit: string;
|
|
14
|
-
quoteLine: number;
|
|
15
|
-
stalePaths: string[];
|
|
16
|
-
reason: string;
|
|
17
|
-
}
|
|
18
|
-
export interface TraceEvidenceOptions {
|
|
19
|
-
skipStaleEvidence?: boolean;
|
|
20
|
-
}
|
|
21
|
-
/** Parse `git blame --porcelain` into 1-based line number → commit hash. */
|
|
22
|
-
export declare function parseBlamePorcelainByLine(blameOutput: string): Map<number, string>;
|
|
23
|
-
export declare function readBlamePorcelainByLine(repoRoot: string, executorLogRelPath: string): Map<number, string>;
|
|
24
|
-
export declare function verifyTraceEvidenceFreshness(repoRoot: string, manifest: Manifest, skillKey: string | null, executorLogPath: string, resolvedLines: ResolvedQuoteLine[], options?: TraceEvidenceOptions): {
|
|
25
|
-
failures: TraceEvidenceFailure[];
|
|
26
|
-
skippedUncommitted: number;
|
|
27
|
-
};
|
|
28
|
-
export interface TraceVerifyFailure {
|
|
29
|
-
row: TraceRow;
|
|
30
|
-
/** Set at construction — every failure site knows its own kind. */
|
|
31
|
-
kind: TraceFailureKind;
|
|
32
|
-
reason: string;
|
|
33
|
-
}
|
|
34
|
-
export interface TraceVerifyWarning {
|
|
35
|
-
row: TraceRow;
|
|
36
|
-
declaredLine: number;
|
|
37
|
-
foundLine: number;
|
|
38
|
-
autoResolved?: boolean;
|
|
39
|
-
}
|
|
40
|
-
export interface TraceVerifyOptions {
|
|
41
|
-
/** Force fuzzy for all numeric anchors. */
|
|
42
|
-
fuzzyNumericAnchor?: boolean;
|
|
43
|
-
/** Disable auto-retry on line drift only. */
|
|
44
|
-
strictTrace?: boolean;
|
|
45
|
-
}
|
|
46
|
-
export interface ResolvedQuoteLine {
|
|
47
|
-
row: TraceRow;
|
|
48
|
-
lineNumber: number;
|
|
49
|
-
}
|
|
50
|
-
export interface TraceVerifyResult {
|
|
51
|
-
failures: TraceVerifyFailure[];
|
|
52
|
-
warnings: TraceVerifyWarning[];
|
|
53
|
-
resolvedLines: ResolvedQuoteLine[];
|
|
54
|
-
map: ExecutorLogLineMap | null;
|
|
55
|
-
}
|
|
56
|
-
export declare function isPassTraceRow(status: string): boolean;
|
|
57
|
-
export declare function resolveQuoteLineNumber(map: ExecutorLogLineMap, row: TraceRow, resolvedLineByDodId: ReadonlyMap<string, number>): number | null;
|
|
58
|
-
/** Line numbers are 1-based in mission table; other anchors match a substring on a line */
|
|
59
|
-
export declare function verifyTraceRows(executorLogPath: string, rows: TraceRow[], options?: TraceVerifyOptions): TraceVerifyResult;
|
|
60
|
-
export declare function defaultExecutorLogPath(repoRoot: string): string;
|
|
1
|
+
export { type NormalizedTraceStatus, normalizeTraceStatus, isPassStatus, isPendingStatus, isPassTraceRow, } from "./trace-status.js";
|
|
2
|
+
export { type TraceFailureKind, type TraceVerifyFailure, type TraceVerifyWarning, type TraceVerifyOptions, type ResolvedQuoteLine, type TraceVerifyResult, resolveQuoteLineNumber, verifyTraceRows, defaultExecutorLogPath, } from "./trace-quote.js";
|
|
3
|
+
export { UNCOMMITTED_BLAME_COMMIT, type TraceEvidenceFailure, type TraceEvidenceOptions, parseBlamePorcelainByLine, readBlamePorcelainByLine, verifyTraceEvidenceFreshness, } from "./trace-evidence.js";
|
|
61
4
|
//# sourceMappingURL=trace.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trace.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/trace.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"trace.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/trace.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,qBAAqB,EAC1B,oBAAoB,EACpB,YAAY,EACZ,eAAe,EACf,cAAc,GACf,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,sBAAsB,EACtB,eAAe,EACf,sBAAsB,GACvB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,wBAAwB,EACxB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,yBAAyB,EACzB,wBAAwB,EACxB,4BAA4B,GAC7B,MAAM,qBAAqB,CAAC"}
|