@deftai/directive-core 0.99.0 → 0.101.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/dist/authz/actions.d.ts +6 -0
- package/dist/authz/actions.js +3 -0
- package/dist/authz/classify.js +241 -30
- package/dist/authz/decompose-apply.d.ts +81 -0
- package/dist/authz/decompose-apply.js +377 -0
- package/dist/authz/index.d.ts +3 -1
- package/dist/authz/index.js +3 -1
- package/dist/authz/store.d.ts +53 -0
- package/dist/authz/store.js +219 -1
- package/dist/authz/types.d.ts +19 -2
- package/dist/authz/types.js +5 -1
- package/dist/check/cached-orchestrator.d.ts +26 -5
- package/dist/check/cached-orchestrator.js +228 -6
- package/dist/check/gate-lists.d.ts +10 -4
- package/dist/check/gate-lists.js +19 -5
- package/dist/check/index.d.ts +3 -2
- package/dist/check/index.js +2 -1
- package/dist/check/named-cause.d.ts +45 -0
- package/dist/check/named-cause.js +121 -0
- package/dist/check/orchestrator.js +6 -1
- package/dist/doctor/checks.d.ts +44 -0
- package/dist/doctor/checks.js +428 -2
- package/dist/doctor/help.d.ts +5 -0
- package/dist/doctor/help.js +31 -0
- package/dist/doctor/index.d.ts +2 -0
- package/dist/doctor/index.js +2 -0
- package/dist/doctor/main.d.ts +6 -7
- package/dist/doctor/main.js +130 -79
- package/dist/doctor/session-coda.d.ts +82 -0
- package/dist/doctor/session-coda.js +151 -0
- package/dist/doctor/types.d.ts +16 -0
- package/dist/doctor/which.d.ts +20 -1
- package/dist/doctor/which.js +67 -1
- package/dist/finish-loop/pr-finish-loop.d.ts +13 -2
- package/dist/finish-loop/pr-finish-loop.js +116 -5
- package/dist/finish-loop/types.d.ts +1 -1
- package/dist/hooks/dispatcher.d.ts +9 -5
- package/dist/hooks/dispatcher.js +23 -15
- package/dist/hooks/readonly.d.ts +6 -3
- package/dist/hooks/readonly.js +44 -25
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/init-deposit/agent-hooks.d.ts +20 -0
- package/dist/init-deposit/agent-hooks.js +51 -31
- package/dist/init-deposit/gitignore.js +2 -0
- package/dist/intake/issue-ingest.js +36 -0
- package/dist/lifecycle/completed-consistency.d.ts +60 -0
- package/dist/lifecycle/completed-consistency.js +443 -0
- package/dist/lifecycle/completed-tracked-on-delivery.d.ts +47 -0
- package/dist/lifecycle/completed-tracked-on-delivery.js +415 -0
- package/dist/lifecycle/index.d.ts +2 -0
- package/dist/lifecycle/index.js +2 -0
- package/dist/literal-acceptance/capture.d.ts +52 -0
- package/dist/literal-acceptance/capture.js +658 -0
- package/dist/literal-acceptance/evaluate.d.ts +47 -0
- package/dist/literal-acceptance/evaluate.js +193 -0
- package/dist/literal-acceptance/index.d.ts +12 -0
- package/dist/literal-acceptance/index.js +12 -0
- package/dist/literal-acceptance/run.d.ts +38 -0
- package/dist/literal-acceptance/run.js +216 -0
- package/dist/literal-acceptance/safety.d.ts +24 -0
- package/dist/literal-acceptance/safety.js +251 -0
- package/dist/literal-acceptance/types.d.ts +82 -0
- package/dist/literal-acceptance/types.js +26 -0
- package/dist/policy/ac-pass-banking.d.ts +58 -0
- package/dist/policy/ac-pass-banking.js +150 -0
- package/dist/policy/ceremony-dial.d.ts +96 -11
- package/dist/policy/ceremony-dial.js +250 -23
- package/dist/policy/index.d.ts +2 -0
- package/dist/policy/index.js +16 -1
- package/dist/policy/merge-approval-head.d.ts +129 -0
- package/dist/policy/merge-approval-head.js +461 -0
- package/dist/policy/require-human-merge.d.ts +5 -0
- package/dist/policy/require-human-merge.js +5 -0
- package/dist/pr-merge-readiness/ci-gate.d.ts +20 -3
- package/dist/pr-merge-readiness/ci-gate.js +65 -5
- package/dist/pr-merge-readiness/compute.d.ts +13 -0
- package/dist/pr-merge-readiness/compute.js +99 -14
- package/dist/pr-merge-readiness/gh.d.ts +49 -0
- package/dist/pr-merge-readiness/gh.js +268 -0
- package/dist/pr-merge-readiness/index.d.ts +2 -2
- package/dist/pr-merge-readiness/index.js +2 -2
- package/dist/pr-merge-readiness/test-gh-fixtures.helpers.js +4 -0
- package/dist/pr-wait-mergeable/cascade.d.ts +11 -0
- package/dist/pr-wait-mergeable/cascade.js +115 -1
- package/dist/pr-wait-mergeable/main.d.ts +4 -0
- package/dist/pr-wait-mergeable/main.js +4 -0
- package/dist/pr-wait-mergeable/types.d.ts +3 -1
- package/dist/pr-wait-mergeable/wrappers.d.ts +6 -1
- package/dist/pr-wait-mergeable/wrappers.js +7 -1
- package/dist/preflight/evaluate.d.ts +15 -1
- package/dist/preflight/evaluate.js +33 -2
- package/dist/preflight-cache/evaluate.d.ts +3 -0
- package/dist/preflight-cache/evaluate.js +3 -0
- package/dist/product-first-done-gate/acceptance.d.ts +25 -0
- package/dist/product-first-done-gate/acceptance.js +247 -0
- package/dist/product-first-done-gate/check-mode.d.ts +45 -0
- package/dist/product-first-done-gate/check-mode.js +148 -0
- package/dist/product-first-done-gate/evaluate.d.ts +50 -0
- package/dist/product-first-done-gate/evaluate.js +255 -0
- package/dist/product-first-done-gate/index.d.ts +11 -0
- package/dist/product-first-done-gate/index.js +11 -0
- package/dist/product-first-done-gate/types.d.ts +64 -0
- package/dist/product-first-done-gate/types.js +61 -0
- package/dist/render/framework-commands.js +4 -0
- package/dist/run-summary/emit.d.ts +56 -0
- package/dist/run-summary/emit.js +171 -0
- package/dist/run-summary/index.d.ts +4 -0
- package/dist/run-summary/index.js +4 -0
- package/dist/run-summary/path.d.ts +25 -0
- package/dist/run-summary/path.js +78 -0
- package/dist/run-summary/types.d.ts +76 -0
- package/dist/run-summary/types.js +21 -0
- package/dist/scope/acceptance-evidence.d.ts +110 -0
- package/dist/scope/acceptance-evidence.js +422 -0
- package/dist/scope/coverage-map.d.ts +98 -0
- package/dist/scope/coverage-map.js +558 -0
- package/dist/scope/decompose.d.ts +5 -0
- package/dist/scope/decompose.js +134 -11
- package/dist/scope/index.d.ts +3 -0
- package/dist/scope/index.js +3 -0
- package/dist/scope/parent-lineage.d.ts +125 -0
- package/dist/scope/parent-lineage.js +626 -0
- package/dist/scope/transition.d.ts +8 -0
- package/dist/scope/transition.js +61 -2
- package/dist/session/ac-pass-banking.d.ts +221 -0
- package/dist/session/ac-pass-banking.js +761 -0
- package/dist/session/active-cli.d.ts +79 -0
- package/dist/session/active-cli.js +382 -0
- package/dist/session/deposit-sha.d.ts +49 -0
- package/dist/session/deposit-sha.js +121 -0
- package/dist/session/effort-budget.d.ts +136 -0
- package/dist/session/effort-budget.js +352 -0
- package/dist/session/index.d.ts +7 -0
- package/dist/session/index.js +7 -0
- package/dist/session/orientation-compression.d.ts +127 -0
- package/dist/session/orientation-compression.js +425 -0
- package/dist/session/orientation-state.d.ts +29 -0
- package/dist/session/orientation-state.js +85 -0
- package/dist/session/session-start.d.ts +31 -0
- package/dist/session/session-start.js +228 -2
- package/dist/session/toolchain-preflight.d.ts +64 -0
- package/dist/session/toolchain-preflight.js +151 -0
- package/dist/session/verify-session-ritual.d.ts +14 -0
- package/dist/session/verify-session-ritual.js +33 -0
- package/dist/story-ready/evaluate.d.ts +11 -0
- package/dist/story-ready/evaluate.js +41 -3
- package/dist/triage/actions/candidates-log.d.ts +1 -2
- package/dist/triage/actions/candidates-log.js +37 -6
- package/dist/triage/bootstrap/gitignore.d.ts +1 -1
- package/dist/triage/bootstrap/gitignore.js +8 -2
- package/dist/triage/bootstrap/index.js +15 -3
- package/dist/triage/classify/index.d.ts +1 -0
- package/dist/triage/classify/index.js +2 -0
- package/dist/triage/classify/label-mirror.js +16 -0
- package/dist/triage/classify/mirror-discovery-tip.d.ts +95 -0
- package/dist/triage/classify/mirror-discovery-tip.js +234 -0
- package/dist/triage/reconcile/reconcile.js +28 -6
- package/dist/triage/summary/index.js +12 -4
- package/dist/triage/welcome/default-mode.js +16 -0
- package/dist/ts-check-lane/run-lane.js +21 -4
- package/dist/vbrief-validate/conformance.js +7 -0
- package/dist/vitest-runner/coverage-debt-teardown.js +16 -4
- package/dist/xbrief-migrate/migrate-project.d.ts +4 -0
- package/dist/xbrief-migrate/migrate-project.js +92 -3
- package/package.json +15 -3
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve where run-summary JSONL should go (#3282 emission matrix).
|
|
3
|
+
*
|
|
4
|
+
* - `DEFT_RUN_SUMMARY_PATH=<path>` → append JSONL there (explicit; warn once on write fail)
|
|
5
|
+
* - `DEFT_RUN_SUMMARY_PATH=-` → stdout lines prefixed `DEFT-TLM:`
|
|
6
|
+
* - unset → repo-root `.deft-run-summary.json` only when .gitignore covers it; else silent
|
|
7
|
+
*/
|
|
8
|
+
import { type RunSummaryDestination } from "./types.js";
|
|
9
|
+
export { DEFAULT_RUN_SUMMARY_BASENAME, ENV_RUN_SUMMARY_PATH, RUN_SUMMARY_STDOUT_PREFIX, RUN_SUMMARY_WRITE_WARNING, } from "./types.js";
|
|
10
|
+
/**
|
|
11
|
+
* True when a .gitignore line covers the default run-summary basename.
|
|
12
|
+
* Matches exact line or trailing slash variants; ignores comments.
|
|
13
|
+
*/
|
|
14
|
+
export declare function gitignoreCoversRunSummary(projectRoot: string, basename?: string): boolean;
|
|
15
|
+
export interface ResolveRunSummaryDestinationOptions {
|
|
16
|
+
readonly env?: NodeJS.ProcessEnv;
|
|
17
|
+
/** Test seam for gitignore coverage. */
|
|
18
|
+
readonly gitignoreCovers?: (projectRoot: string) => boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Resolve emission destination for the run-summary matrix (#3282).
|
|
22
|
+
* Never throws — fail-open consumers treat resolution errors as silent.
|
|
23
|
+
*/
|
|
24
|
+
export declare function resolveRunSummaryDestination(projectRoot: string, options?: ResolveRunSummaryDestinationOptions): RunSummaryDestination;
|
|
25
|
+
//# sourceMappingURL=path.d.ts.map
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve where run-summary JSONL should go (#3282 emission matrix).
|
|
3
|
+
*
|
|
4
|
+
* - `DEFT_RUN_SUMMARY_PATH=<path>` → append JSONL there (explicit; warn once on write fail)
|
|
5
|
+
* - `DEFT_RUN_SUMMARY_PATH=-` → stdout lines prefixed `DEFT-TLM:`
|
|
6
|
+
* - unset → repo-root `.deft-run-summary.json` only when .gitignore covers it; else silent
|
|
7
|
+
*/
|
|
8
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
9
|
+
import { isAbsolute, join, resolve } from "node:path";
|
|
10
|
+
import { DEFAULT_RUN_SUMMARY_BASENAME, ENV_RUN_SUMMARY_PATH, } from "./types.js";
|
|
11
|
+
export { DEFAULT_RUN_SUMMARY_BASENAME, ENV_RUN_SUMMARY_PATH, RUN_SUMMARY_STDOUT_PREFIX, RUN_SUMMARY_WRITE_WARNING, } from "./types.js";
|
|
12
|
+
/**
|
|
13
|
+
* True when a .gitignore line covers the default run-summary basename.
|
|
14
|
+
* Matches exact line or trailing slash variants; ignores comments.
|
|
15
|
+
*/
|
|
16
|
+
export function gitignoreCoversRunSummary(projectRoot, basename = DEFAULT_RUN_SUMMARY_BASENAME) {
|
|
17
|
+
const giPath = join(projectRoot, ".gitignore");
|
|
18
|
+
if (!existsSync(giPath)) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
let text;
|
|
22
|
+
try {
|
|
23
|
+
text = readFileSync(giPath, "utf8");
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
const targets = new Set([basename, basename.replace(/^\.\//, "")]);
|
|
29
|
+
for (const raw of text.split(/\r?\n/)) {
|
|
30
|
+
const line = raw.trim();
|
|
31
|
+
if (line.length === 0 || line.startsWith("#"))
|
|
32
|
+
continue;
|
|
33
|
+
// Strip trailing inline comments carefully (space + #).
|
|
34
|
+
const bare = line.replace(/\s+#.*$/, "").trim();
|
|
35
|
+
if (targets.has(bare) || targets.has(bare.replace(/^\//, ""))) {
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Resolve emission destination for the run-summary matrix (#3282).
|
|
43
|
+
* Never throws — fail-open consumers treat resolution errors as silent.
|
|
44
|
+
*/
|
|
45
|
+
export function resolveRunSummaryDestination(projectRoot, options = {}) {
|
|
46
|
+
try {
|
|
47
|
+
const env = options.env ?? process.env;
|
|
48
|
+
const raw = env[ENV_RUN_SUMMARY_PATH];
|
|
49
|
+
if (raw !== undefined && raw.trim() === "-") {
|
|
50
|
+
return { kind: "stdout" };
|
|
51
|
+
}
|
|
52
|
+
if (raw !== undefined && raw.trim().length > 0) {
|
|
53
|
+
const trimmed = raw.trim();
|
|
54
|
+
const path = isAbsolute(trimmed) ? resolve(trimmed) : resolve(projectRoot, trimmed);
|
|
55
|
+
return {
|
|
56
|
+
kind: "file",
|
|
57
|
+
path,
|
|
58
|
+
truncateOnSessionStart: false,
|
|
59
|
+
explicit: true,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
// Unset: default path only with gitignore coverage.
|
|
63
|
+
const covers = options.gitignoreCovers?.(projectRoot) ?? gitignoreCoversRunSummary(projectRoot);
|
|
64
|
+
if (!covers) {
|
|
65
|
+
return { kind: "silent" };
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
kind: "file",
|
|
69
|
+
path: resolve(projectRoot, DEFAULT_RUN_SUMMARY_BASENAME),
|
|
70
|
+
truncateOnSessionStart: true,
|
|
71
|
+
explicit: false,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
catch {
|
|
75
|
+
return { kind: "silent" };
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=path.js.map
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Run-summary telemetry types (#3282).
|
|
3
|
+
*
|
|
4
|
+
* Event-driven JSONL lines for harness collection. Silent by default unless
|
|
5
|
+
* `DEFT_RUN_SUMMARY_PATH` is set (or the gitignored default path is writable).
|
|
6
|
+
*/
|
|
7
|
+
export declare const RUN_SUMMARY_SCHEMA_VERSION: 1;
|
|
8
|
+
/** Env var that opts into / redirects run-summary JSONL (#3282). */
|
|
9
|
+
export declare const ENV_RUN_SUMMARY_PATH = "DEFT_RUN_SUMMARY_PATH";
|
|
10
|
+
/** Repo-root default collectible path when gitignore coverage is present. */
|
|
11
|
+
export declare const DEFAULT_RUN_SUMMARY_BASENAME = ".deft-run-summary.json";
|
|
12
|
+
/** Prefix for stdout lines when `DEFT_RUN_SUMMARY_PATH=-`. */
|
|
13
|
+
export declare const RUN_SUMMARY_STDOUT_PREFIX = "DEFT-TLM:";
|
|
14
|
+
/** One warning when an explicitly requested write fails. */
|
|
15
|
+
export declare const RUN_SUMMARY_WRITE_WARNING = "[deft run-summary] failed to write DEFT_RUN_SUMMARY_PATH telemetry (fail-open; exit codes unchanged)";
|
|
16
|
+
export declare const RUN_SUMMARY_EVENT_KINDS: readonly ["session_start", "dial_transition", "check_invocation"];
|
|
17
|
+
export type RunSummaryEventKind = (typeof RUN_SUMMARY_EVENT_KINDS)[number];
|
|
18
|
+
export interface RunSummaryBaseFields {
|
|
19
|
+
readonly schema_version: typeof RUN_SUMMARY_SCHEMA_VERSION;
|
|
20
|
+
readonly session_id: string;
|
|
21
|
+
readonly framework_version: string;
|
|
22
|
+
/** Monotonic per-emitter sequence (1-based). */
|
|
23
|
+
readonly seq: number;
|
|
24
|
+
readonly ts: string;
|
|
25
|
+
readonly event: RunSummaryEventKind;
|
|
26
|
+
}
|
|
27
|
+
export interface SessionStartRunSummaryPayload {
|
|
28
|
+
readonly ceremony_dial?: Record<string, unknown>;
|
|
29
|
+
readonly preflight?: Record<string, unknown>;
|
|
30
|
+
readonly ceremony_tier?: string;
|
|
31
|
+
readonly ready?: boolean;
|
|
32
|
+
readonly exit_code?: number;
|
|
33
|
+
/** #3286: orientation surfaces composed into session:start (graduation trigger). */
|
|
34
|
+
readonly orientation_call_count?: number;
|
|
35
|
+
readonly orientation_compact?: boolean;
|
|
36
|
+
readonly deposit_sha?: string;
|
|
37
|
+
readonly orientation_later_status?: string;
|
|
38
|
+
readonly orientation_sections?: readonly Record<string, unknown>[];
|
|
39
|
+
}
|
|
40
|
+
export interface DialTransitionRunSummaryPayload {
|
|
41
|
+
readonly from: string | null;
|
|
42
|
+
readonly to: string;
|
|
43
|
+
readonly reason: string;
|
|
44
|
+
readonly evidence?: string;
|
|
45
|
+
}
|
|
46
|
+
export interface CheckGateOutcome {
|
|
47
|
+
readonly id: string;
|
|
48
|
+
readonly status: "run" | "skipped" | "failed";
|
|
49
|
+
readonly exit_code?: number;
|
|
50
|
+
readonly cause?: string;
|
|
51
|
+
readonly remedy?: string;
|
|
52
|
+
readonly from_cache?: boolean;
|
|
53
|
+
}
|
|
54
|
+
export interface CheckInvocationRunSummaryPayload {
|
|
55
|
+
readonly target: string;
|
|
56
|
+
readonly exit_code: number;
|
|
57
|
+
readonly degraded?: boolean;
|
|
58
|
+
readonly gates: readonly CheckGateOutcome[];
|
|
59
|
+
}
|
|
60
|
+
export type RunSummaryPayload = SessionStartRunSummaryPayload | DialTransitionRunSummaryPayload | CheckInvocationRunSummaryPayload;
|
|
61
|
+
export type RunSummaryLine = RunSummaryBaseFields & {
|
|
62
|
+
readonly payload: RunSummaryPayload;
|
|
63
|
+
};
|
|
64
|
+
export type RunSummaryDestination = {
|
|
65
|
+
readonly kind: "silent";
|
|
66
|
+
} | {
|
|
67
|
+
readonly kind: "stdout";
|
|
68
|
+
} | {
|
|
69
|
+
readonly kind: "file";
|
|
70
|
+
readonly path: string;
|
|
71
|
+
/** Truncate default-path file on session_start only. */
|
|
72
|
+
readonly truncateOnSessionStart: boolean;
|
|
73
|
+
/** Explicit path (env set) vs default gitignored path. */
|
|
74
|
+
readonly explicit: boolean;
|
|
75
|
+
};
|
|
76
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Run-summary telemetry types (#3282).
|
|
3
|
+
*
|
|
4
|
+
* Event-driven JSONL lines for harness collection. Silent by default unless
|
|
5
|
+
* `DEFT_RUN_SUMMARY_PATH` is set (or the gitignored default path is writable).
|
|
6
|
+
*/
|
|
7
|
+
export const RUN_SUMMARY_SCHEMA_VERSION = 1;
|
|
8
|
+
/** Env var that opts into / redirects run-summary JSONL (#3282). */
|
|
9
|
+
export const ENV_RUN_SUMMARY_PATH = "DEFT_RUN_SUMMARY_PATH";
|
|
10
|
+
/** Repo-root default collectible path when gitignore coverage is present. */
|
|
11
|
+
export const DEFAULT_RUN_SUMMARY_BASENAME = ".deft-run-summary.json";
|
|
12
|
+
/** Prefix for stdout lines when `DEFT_RUN_SUMMARY_PATH=-`. */
|
|
13
|
+
export const RUN_SUMMARY_STDOUT_PREFIX = "DEFT-TLM:";
|
|
14
|
+
/** One warning when an explicitly requested write fails. */
|
|
15
|
+
export const RUN_SUMMARY_WRITE_WARNING = "[deft run-summary] failed to write DEFT_RUN_SUMMARY_PATH telemetry (fail-open; exit codes unchanged)";
|
|
16
|
+
export const RUN_SUMMARY_EVENT_KINDS = [
|
|
17
|
+
"session_start",
|
|
18
|
+
"dial_transition",
|
|
19
|
+
"check_invocation",
|
|
20
|
+
];
|
|
21
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-acceptance-criterion evidence / disposition for scope:complete (#3240 / epic #3237 Q3).
|
|
3
|
+
*
|
|
4
|
+
* Merge ancestry alone must not auto-complete acceptance items. Each non-terminal
|
|
5
|
+
* plan item needs either typed evidence or a human-origin disposition before complete
|
|
6
|
+
* may advance it. Kind suitability: merge/review alone cannot satisfy smoke, UAT,
|
|
7
|
+
* deploy, or observed_behavior requirements.
|
|
8
|
+
*
|
|
9
|
+
* Canonical item keys are namespaced under #1620 / #3305 (Option B):
|
|
10
|
+
* - plan.items[].x-directive/evidence
|
|
11
|
+
* - plan.items[].x-directive/disposition
|
|
12
|
+
* Bare `evidence` / `disposition` are not valid typed evidence (no dual-read).
|
|
13
|
+
* ITEM_CORE is not expanded with bare keys; verify:vbrief-conformance rejects them.
|
|
14
|
+
*/
|
|
15
|
+
import type { GrantOrigin } from "../authz/types.js";
|
|
16
|
+
/** Canonical namespaced key for typed acceptance evidence (#3305 / #1620). */
|
|
17
|
+
export declare const ACCEPTANCE_EVIDENCE_KEY: "x-directive/evidence";
|
|
18
|
+
/** Canonical namespaced key for human-origin disposition (#3305 / #1620). */
|
|
19
|
+
export declare const ACCEPTANCE_DISPOSITION_KEY: "x-directive/disposition";
|
|
20
|
+
/** Closed evidence kinds (locked Q3). */
|
|
21
|
+
export declare const ACCEPTANCE_EVIDENCE_KINDS: readonly ["test", "review", "merge", "deploy", "smoke", "uat", "observed_behavior"];
|
|
22
|
+
export type AcceptanceEvidenceKind = (typeof ACCEPTANCE_EVIDENCE_KINDS)[number];
|
|
23
|
+
/** Closed dispositions (locked Q3). */
|
|
24
|
+
export declare const ACCEPTANCE_DISPOSITIONS: readonly ["waived", "deferred", "not_applicable"];
|
|
25
|
+
export type AcceptanceDispositionKind = (typeof ACCEPTANCE_DISPOSITIONS)[number];
|
|
26
|
+
/**
|
|
27
|
+
* Axes that merge/review evidence alone cannot satisfy.
|
|
28
|
+
* Matches epic #3237 Q3 suitability rule.
|
|
29
|
+
*/
|
|
30
|
+
export declare const STRICT_ACCEPTANCE_AXES: readonly ["deploy", "smoke", "uat", "observed_behavior"];
|
|
31
|
+
export type StrictAcceptanceAxis = (typeof STRICT_ACCEPTANCE_AXES)[number];
|
|
32
|
+
export interface AcceptanceEvidenceRecord {
|
|
33
|
+
readonly kind: AcceptanceEvidenceKind;
|
|
34
|
+
readonly pointer: string;
|
|
35
|
+
readonly recorded_at: string;
|
|
36
|
+
readonly recorded_by: string;
|
|
37
|
+
}
|
|
38
|
+
export interface AcceptanceDispositionRecord {
|
|
39
|
+
readonly disposition: AcceptanceDispositionKind;
|
|
40
|
+
readonly reason: string;
|
|
41
|
+
/** Human-origin provenance (kind + actor required; other GrantOrigin fields optional). */
|
|
42
|
+
readonly provenance: Pick<GrantOrigin, "kind" | "actor"> & Partial<GrantOrigin>;
|
|
43
|
+
readonly recorded_at: string;
|
|
44
|
+
readonly resume_when?: string;
|
|
45
|
+
}
|
|
46
|
+
export interface CriterionAcceptanceReport {
|
|
47
|
+
readonly path: string;
|
|
48
|
+
readonly title: string;
|
|
49
|
+
readonly outcome: "evidence" | "disposition" | "already_terminal" | "missing" | "invalid";
|
|
50
|
+
readonly detail: string;
|
|
51
|
+
readonly evidence?: AcceptanceEvidenceRecord;
|
|
52
|
+
readonly disposition?: AcceptanceDispositionRecord;
|
|
53
|
+
}
|
|
54
|
+
export interface AcceptanceEvidenceGateResult {
|
|
55
|
+
readonly ok: boolean;
|
|
56
|
+
readonly message: string;
|
|
57
|
+
readonly reports: readonly CriterionAcceptanceReport[];
|
|
58
|
+
}
|
|
59
|
+
export declare function isAcceptanceEvidenceKind(value: unknown): value is AcceptanceEvidenceKind;
|
|
60
|
+
export declare function isAcceptanceDispositionKind(value: unknown): value is AcceptanceDispositionKind;
|
|
61
|
+
/**
|
|
62
|
+
* Infer strict axes a criterion requires from explicit fields and title/Acceptance text.
|
|
63
|
+
* Explicit `requires` / `requiredEvidenceKind` / `acceptanceAxis` wins when valid.
|
|
64
|
+
*/
|
|
65
|
+
export declare function inferRequiredStrictAxes(item: Record<string, unknown>): StrictAcceptanceAxis[];
|
|
66
|
+
/**
|
|
67
|
+
* Whether evidence.kind is suitable for the criterion's required strict axes.
|
|
68
|
+
* merge and review never satisfy smoke/UAT/deploy/observed_behavior.
|
|
69
|
+
*
|
|
70
|
+
* A single evidence.kind covers only that axis. When free-text inference yields
|
|
71
|
+
* multiple axes (e.g. "smoke after deploy"), every required axis must match the
|
|
72
|
+
* same kind — which is only possible when the axes are identical. Otherwise use
|
|
73
|
+
* explicit `requires` / `acceptanceAxis` for a single axis, split the criterion,
|
|
74
|
+
* or record a human-origin disposition (#3240 Greptile P1).
|
|
75
|
+
*/
|
|
76
|
+
export declare function isEvidenceKindSuitable(kind: AcceptanceEvidenceKind, requiredAxes: readonly StrictAcceptanceAxis[]): boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Read only namespaced acceptance fields (#3305). Bare `evidence` / `disposition`
|
|
79
|
+
* are never treated as success (no permanent dual-read).
|
|
80
|
+
*/
|
|
81
|
+
export declare function readNamespacedAcceptanceFields(item: Record<string, unknown>): {
|
|
82
|
+
readonly evidence: unknown;
|
|
83
|
+
readonly disposition: unknown;
|
|
84
|
+
readonly hasEvidence: boolean;
|
|
85
|
+
readonly hasDisposition: boolean;
|
|
86
|
+
readonly hasBareEvidence: boolean;
|
|
87
|
+
readonly hasBareDisposition: boolean;
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Stamp typed evidence under the canonical namespaced key only.
|
|
91
|
+
* Clears bare evidence/disposition and any prior namespaced disposition so the item
|
|
92
|
+
* cannot carry both acceptance fields after a replace (#3305 Greptile P2).
|
|
93
|
+
*/
|
|
94
|
+
export declare function stampNamespacedEvidence(item: Record<string, unknown>, record: AcceptanceEvidenceRecord): void;
|
|
95
|
+
/**
|
|
96
|
+
* Stamp human-origin disposition under the canonical namespaced key only.
|
|
97
|
+
* Clears bare evidence/disposition and any prior namespaced evidence so the item
|
|
98
|
+
* cannot carry both acceptance fields after a replace (#3305 Greptile P2).
|
|
99
|
+
*/
|
|
100
|
+
export declare function stampNamespacedDisposition(item: Record<string, unknown>, record: AcceptanceDispositionRecord): void;
|
|
101
|
+
/**
|
|
102
|
+
* Fail closed when any non-terminal plan item lacks suitable evidence or a human-origin disposition.
|
|
103
|
+
*/
|
|
104
|
+
export declare function evaluateAcceptanceEvidenceGate(plan: Record<string, unknown>): AcceptanceEvidenceGateResult;
|
|
105
|
+
/**
|
|
106
|
+
* Format a short multi-line listing of evidence/disposition for every criterion
|
|
107
|
+
* (including already-terminal) for complete success output.
|
|
108
|
+
*/
|
|
109
|
+
export declare function formatAcceptanceCompletionListing(reports: readonly CriterionAcceptanceReport[]): string;
|
|
110
|
+
//# sourceMappingURL=acceptance-evidence.d.ts.map
|