@deftai/directive-core 0.101.0 → 0.102.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/classify.js +97 -8
- package/dist/check/cached-orchestrator.d.ts +4 -0
- package/dist/check/cached-orchestrator.js +70 -5
- package/dist/check/cli-native-gates.d.ts +43 -0
- package/dist/check/cli-native-gates.js +84 -0
- package/dist/check/index.d.ts +1 -0
- package/dist/check/index.js +1 -0
- package/dist/check/named-cause.js +10 -0
- package/dist/doctor/checks.d.ts +5 -6
- package/dist/doctor/checks.js +13 -56
- package/dist/eval/later-graduation.d.ts +39 -0
- package/dist/eval/later-graduation.js +91 -0
- package/dist/eval/report.d.ts +6 -0
- package/dist/eval/report.js +27 -8
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/intake/issue-ingest.js +42 -0
- package/dist/policy/ceremony-dial-escalation.d.ts +52 -0
- package/dist/policy/ceremony-dial-escalation.js +92 -0
- package/dist/policy/ceremony-dial.d.ts +3 -1
- package/dist/policy/ceremony-dial.js +52 -1
- package/dist/policy/check-resume.d.ts +9 -38
- package/dist/policy/check-resume.js +18 -156
- package/dist/policy/coverage-debt.d.ts +18 -37
- package/dist/policy/coverage-debt.js +38 -147
- package/dist/policy/index.d.ts +1 -1
- package/dist/policy/index.js +1 -1
- package/dist/product-first-done-gate/acceptance.js +22 -0
- package/dist/product-first-done-gate/empty-resolution.d.ts +26 -0
- package/dist/product-first-done-gate/empty-resolution.js +38 -0
- package/dist/product-first-done-gate/evaluate.d.ts +28 -2
- package/dist/product-first-done-gate/evaluate.js +209 -53
- package/dist/product-first-done-gate/index.d.ts +1 -0
- package/dist/product-first-done-gate/index.js +1 -0
- package/dist/product-first-done-gate/types.d.ts +3 -0
- package/dist/product-first-done-gate/types.js +0 -7
- package/dist/run-summary/emit.d.ts +11 -1
- package/dist/run-summary/emit.js +48 -2
- package/dist/run-summary/index.d.ts +2 -1
- package/dist/run-summary/index.js +2 -1
- package/dist/run-summary/path.d.ts +1 -1
- package/dist/run-summary/path.js +1 -1
- package/dist/run-summary/share.d.ts +25 -0
- package/dist/run-summary/share.js +106 -0
- package/dist/run-summary/types.d.ts +60 -2
- package/dist/run-summary/types.js +7 -0
- package/dist/scope/acceptance-activate-gate.d.ts +23 -0
- package/dist/scope/acceptance-activate-gate.js +70 -0
- package/dist/scope/index.d.ts +1 -0
- package/dist/scope/index.js +1 -0
- package/dist/scope/transition.js +5 -0
- package/dist/session/index.d.ts +0 -1
- package/dist/session/index.js +0 -1
- package/dist/session/orientation-compression.js +19 -9
- package/dist/session/session-start.d.ts +6 -0
- package/dist/session/session-start.js +44 -22
- package/dist/session/toolchain-preflight.d.ts +15 -0
- package/dist/session/toolchain-preflight.js +65 -5
- package/dist/verify-ac/clauses.d.ts +51 -0
- package/dist/verify-ac/clauses.js +490 -0
- package/dist/verify-ac/evaluate.d.ts +55 -0
- package/dist/verify-ac/evaluate.js +145 -0
- package/dist/verify-ac/flag.d.ts +35 -0
- package/dist/verify-ac/flag.js +104 -0
- package/dist/verify-ac/index.d.ts +10 -0
- package/dist/verify-ac/index.js +10 -0
- package/package.json +7 -3
- package/dist/policy/coverage-check-resume-presets.d.ts +0 -46
- package/dist/policy/coverage-check-resume-presets.js +0 -228
- package/dist/session/coverage-check-resume-nudge.d.ts +0 -34
- package/dist/session/coverage-check-resume-nudge.js +0 -66
|
@@ -7,6 +7,8 @@ import { MIGRATE_COMPLETION_NUDGE, shouldEmitMigrateNudge } from "../init-deposi
|
|
|
7
7
|
import { hostContentSurfaceToDict, maybeFormatHostContentSurfaceLines, } from "../platform/host-content-surface.js";
|
|
8
8
|
import { detectEnvironmentContext, environmentContextToDict, formatEnvironmentContext, } from "../platform/shell-context.js";
|
|
9
9
|
import { ceremonyDialToDict, formatCeremonyDialStatusLine, mergeCeremonyDialDeferrals, resolveCeremonyDial, resolveSessionCeremonyDialInputs, } from "../policy/ceremony-dial.js";
|
|
10
|
+
import { emitCeremonyDialEscalationEvaluation, evaluateSessionStartCeremonyDialEscalation, formatCeremonyDialPinBypassLine, isCeremonyStartTierPinned, resolveCeremonyStartTierProvenance, } from "../policy/ceremony-dial-escalation.js";
|
|
11
|
+
import { maybeFormatCoverageCheckResumeDisclosure } from "../policy/coverage-debt.js";
|
|
10
12
|
import { DEFT_DIRECTIVE_DISABLE_FLAG_NAME, DEFT_DIRECTIVE_DISABLE_STATUS, detectDeftDirectiveDisable, formatDeftDirectiveDisableMessage, isDeftDirectiveDisableActive, } from "../policy/deft-directive-disable.js";
|
|
11
13
|
import { disclosureLine } from "../policy/disclosure.js";
|
|
12
14
|
import { detectNoDeftDirective, NO_DEFT_DIRECTIVE_DISABLED_MESSAGE, NO_DEFT_DIRECTIVE_FLAG_NAME, NO_DEFT_DIRECTIVE_INCONSISTENT_MESSAGE, NO_DEFT_DIRECTIVE_INCONSISTENT_POLICY, } from "../policy/no-deft-directive.js";
|
|
@@ -21,7 +23,6 @@ import { runDefaultMode } from "../triage/welcome/default-mode.js";
|
|
|
21
23
|
import { resolveUserMdPath } from "../user-config/resolve-user-md.js";
|
|
22
24
|
import { emitSessionValueReadback } from "../value/readback.js";
|
|
23
25
|
import { verifyRequiredTools } from "../verify-env/verify-tools.js";
|
|
24
|
-
import { maybeFormatCoverageCheckResumeNudge } from "./coverage-check-resume-nudge.js";
|
|
25
26
|
import { effortBudgetToDict, maybeFormatEffortBudgetLines, resolveProductionHostEffortDescriptor, } from "./effort-budget.js";
|
|
26
27
|
import { defaultGitRunner, gitHead, gitIsAncestor, worktreePath } from "./git.js";
|
|
27
28
|
import { runOrientationCompression, } from "./orientation-compression.js";
|
|
@@ -48,6 +49,18 @@ export const QUICK_STEPS = [
|
|
|
48
49
|
"verify_tools",
|
|
49
50
|
];
|
|
50
51
|
export const GATED_STEPS = ["agent_hooks", "doctor", "cache_fresh"];
|
|
52
|
+
/** Standing one-liner when coverageDebt/checkResume is non-default (#3314). */
|
|
53
|
+
function pushCoverageCheckResumeDisclosure(lines, projectRoot) {
|
|
54
|
+
try {
|
|
55
|
+
const line = maybeFormatCoverageCheckResumeDisclosure(projectRoot);
|
|
56
|
+
if (line !== null) {
|
|
57
|
+
lines.push(line);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
// best-effort — ritual must not abort
|
|
62
|
+
}
|
|
63
|
+
}
|
|
51
64
|
/** Env opt-in for optional session:start network (release probe + triage cache hydrate) (#2991). */
|
|
52
65
|
export const ENV_SESSION_START_NETWORK = "DEFT_SESSION_START_NETWORK";
|
|
53
66
|
/** Human-readable skip notice when optional network is off the hot path (#2991). */
|
|
@@ -527,16 +540,7 @@ function runSessionRearm(projectRoot, options, instant, environment) {
|
|
|
527
540
|
if (humanMergeLine !== null) {
|
|
528
541
|
lines.push(humanMergeLine);
|
|
529
542
|
}
|
|
530
|
-
|
|
531
|
-
try {
|
|
532
|
-
const coverageNudge = maybeFormatCoverageCheckResumeNudge({ projectRoot });
|
|
533
|
-
if (coverageNudge.length > 0) {
|
|
534
|
-
lines.push(coverageNudge.trimEnd());
|
|
535
|
-
}
|
|
536
|
-
}
|
|
537
|
-
catch {
|
|
538
|
-
// best-effort — re-arm must not abort
|
|
539
|
-
}
|
|
543
|
+
pushCoverageCheckResumeDisclosure(lines, projectRoot);
|
|
540
544
|
const priorQuick = eligibility.state.quickSteps;
|
|
541
545
|
const priorTriage = priorQuick.triage_welcome ?? ritualStep({ ok: true, ts: instant });
|
|
542
546
|
// Greptile P1: legacy ritual-state without verify_tools must re-run tools —
|
|
@@ -802,6 +806,11 @@ export function runSessionStart(projectRoot, options = {}) {
|
|
|
802
806
|
env: options.env,
|
|
803
807
|
});
|
|
804
808
|
const ceremonyDialSelection = options.ceremonyDial ?? resolveCeremonyDial(projectRoot, { inputs: resolvedDialInputs });
|
|
809
|
+
const startTierProvenance = resolveCeremonyStartTierProvenance({
|
|
810
|
+
selection: ceremonyDialSelection,
|
|
811
|
+
injectedSelection: options.ceremonyDial !== undefined,
|
|
812
|
+
hint: options.ceremonyDialStartTierProvenance,
|
|
813
|
+
});
|
|
805
814
|
const effectiveDeferrals = mergeCeremonyDialDeferrals(deferrals, ceremonyDialSelection);
|
|
806
815
|
const skipFatPath = ceremonyDialSelection.profile.skipFatPath;
|
|
807
816
|
const { head: gitHeadValue, error: gitError } = gitHead(projectRoot, runGit);
|
|
@@ -831,7 +840,13 @@ export function runSessionStart(projectRoot, options = {}) {
|
|
|
831
840
|
const quickSteps = recordDeferredSteps(QUICK_STEPS, effectiveDeferrals, instant);
|
|
832
841
|
const gatedSteps = recordDeferredSteps(GATED_STEPS, effectiveDeferrals, instant);
|
|
833
842
|
const lines = [];
|
|
834
|
-
lines.push(formatCeremonyDialStatusLine(ceremonyDialSelection
|
|
843
|
+
lines.push(formatCeremonyDialStatusLine(ceremonyDialSelection, {
|
|
844
|
+
startTierProvenance,
|
|
845
|
+
}));
|
|
846
|
+
const pinBypassLine = formatCeremonyDialPinBypassLine(startTierProvenance);
|
|
847
|
+
if (pinBypassLine !== null) {
|
|
848
|
+
lines.push(pinBypassLine);
|
|
849
|
+
}
|
|
835
850
|
if (provisionalDial.reasons.length > 0 && options.ceremonyDial === undefined) {
|
|
836
851
|
lines.push(`[deft ceremony-dial] provisional: ${provisionalDial.reasons.join("; ")}`);
|
|
837
852
|
}
|
|
@@ -919,6 +934,8 @@ export function runSessionStart(projectRoot, options = {}) {
|
|
|
919
934
|
else {
|
|
920
935
|
stepTimings.push({ name: "branch_policy", duration_ms: 0, skipped: true });
|
|
921
936
|
}
|
|
937
|
+
// Standing disclosure is independent of branch_policy deferral (#3314 / Greptile).
|
|
938
|
+
pushCoverageCheckResumeDisclosure(lines, projectRoot);
|
|
922
939
|
// #3214 / #3156: verify_tools is mutation readiness — always run, even under
|
|
923
940
|
// rapid/minimal. Dial skipFatPath only lightens *ceremony* (triage welcome,
|
|
924
941
|
// optional network, staleness tickler), never readiness gates.
|
|
@@ -1182,20 +1199,12 @@ export function runSessionStart(projectRoot, options = {}) {
|
|
|
1182
1199
|
if (consentPrompt.length > 0) {
|
|
1183
1200
|
lines.push(consentPrompt.trimEnd());
|
|
1184
1201
|
}
|
|
1185
|
-
// #3189: skippable coverageDebt/checkResume project-decision nudge (fail-open; never blocks).
|
|
1186
|
-
try {
|
|
1187
|
-
const coverageNudge = maybeFormatCoverageCheckResumeNudge({ projectRoot });
|
|
1188
|
-
if (coverageNudge.length > 0) {
|
|
1189
|
-
lines.push(coverageNudge.trimEnd());
|
|
1190
|
-
}
|
|
1191
|
-
}
|
|
1192
|
-
catch {
|
|
1193
|
-
// best-effort operator advisory — session start must not abort
|
|
1194
|
-
}
|
|
1195
1202
|
const writeStarted = performance.now();
|
|
1196
1203
|
const coldSessionId = (options.newSessionId ?? randomUUID)();
|
|
1197
1204
|
const dialDict = {
|
|
1198
1205
|
...ceremonyDialToDict(ceremonyDialSelection),
|
|
1206
|
+
start_tier: ceremonyDialSelection.depth,
|
|
1207
|
+
start_tier_provenance: startTierProvenance,
|
|
1199
1208
|
provisional: {
|
|
1200
1209
|
taskSize: provisionalDial.taskSize,
|
|
1201
1210
|
modelTier: provisionalDial.modelTier,
|
|
@@ -1274,6 +1283,19 @@ export function runSessionStart(projectRoot, options = {}) {
|
|
|
1274
1283
|
}
|
|
1275
1284
|
: {}),
|
|
1276
1285
|
});
|
|
1286
|
+
emitter.emitKnownToolTurnDenominator();
|
|
1287
|
+
// #3319: evaluate escalate-on-evidence only when #3274 is live. A pin
|
|
1288
|
+
// emits nothing so never-evaluated stays distinguishable from declined.
|
|
1289
|
+
if (!isCeremonyStartTierPinned(startTierProvenance)) {
|
|
1290
|
+
emitCeremonyDialEscalationEvaluation({
|
|
1291
|
+
projectRoot,
|
|
1292
|
+
sessionId: coldSessionId,
|
|
1293
|
+
env: options.env,
|
|
1294
|
+
evaluation: evaluateSessionStartCeremonyDialEscalation({
|
|
1295
|
+
selection: ceremonyDialSelection,
|
|
1296
|
+
}),
|
|
1297
|
+
});
|
|
1298
|
+
}
|
|
1277
1299
|
}
|
|
1278
1300
|
catch {
|
|
1279
1301
|
// fail-open
|
|
@@ -8,9 +8,12 @@
|
|
|
8
8
|
* Never bootstraps tooling the PRODUCT does not need. Failures name cause and
|
|
9
9
|
* remedy without embedding env values.
|
|
10
10
|
*/
|
|
11
|
+
import { type CheckGateSpec } from "../check/gate-lists.js";
|
|
11
12
|
export declare const TOOLCHAIN_PREFLIGHT_TOOLS: readonly ["task", "pnpm", "node", "git"];
|
|
12
13
|
export type ToolchainPreflightTool = (typeof TOOLCHAIN_PREFLIGHT_TOOLS)[number];
|
|
13
14
|
export type ToolchainPreflightStatus = "ok" | "missing" | "degraded";
|
|
15
|
+
/** How a missing tool affects check dispatch (#3335). */
|
|
16
|
+
export type ToolchainPreflightImpact = "none" | "degraded";
|
|
14
17
|
export interface ToolchainPreflightFinding {
|
|
15
18
|
readonly tool: ToolchainPreflightTool | "cli_dist";
|
|
16
19
|
readonly present: boolean;
|
|
@@ -18,6 +21,11 @@ export interface ToolchainPreflightFinding {
|
|
|
18
21
|
readonly cause: string | null;
|
|
19
22
|
/** Operator/agent remedy command or instruction. */
|
|
20
23
|
readonly remedy: string | null;
|
|
24
|
+
/**
|
|
25
|
+
* Missing-tool impact. `none` = present false but no install remedy and
|
|
26
|
+
* check does not skip CLI-native gates (#3335).
|
|
27
|
+
*/
|
|
28
|
+
readonly impact?: ToolchainPreflightImpact | null;
|
|
21
29
|
}
|
|
22
30
|
export interface ToolchainPreflightResult {
|
|
23
31
|
readonly status: ToolchainPreflightStatus;
|
|
@@ -46,6 +54,13 @@ export interface ToolchainPreflightOptions {
|
|
|
46
54
|
* a global `deft`/`directive` is on PATH.
|
|
47
55
|
*/
|
|
48
56
|
readonly probeCliDist?: boolean;
|
|
57
|
+
/** Active check composition. Defaults from consumer vs framework context. */
|
|
58
|
+
readonly composedGates?: readonly CheckGateSpec[];
|
|
59
|
+
/**
|
|
60
|
+
* Consumer deposit (not framework source). When omitted, inferred from
|
|
61
|
+
* frameworkRoot vs projectRoot (#3335 / #3324).
|
|
62
|
+
*/
|
|
63
|
+
readonly consumerDeposit?: boolean;
|
|
49
64
|
}
|
|
50
65
|
/**
|
|
51
66
|
* Gates that specifically need a package manager / built dist.
|
|
@@ -10,6 +10,9 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { existsSync } from "node:fs";
|
|
12
12
|
import { join } from "node:path";
|
|
13
|
+
import { allGatesCliDispatchable, GLOBAL_CLI_REMEDY, isCliNativeGate, } from "../check/cli-native-gates.js";
|
|
14
|
+
import { isFrameworkRepoRoot, isFrameworkSourceContext } from "../check/context.js";
|
|
15
|
+
import { CONSUMER_CHECK_GATES, checkGateId, FRAMEWORK_CHECK_GATES, } from "../check/gate-lists.js";
|
|
13
16
|
import { defaultWhich } from "../doctor/which.js";
|
|
14
17
|
export const TOOLCHAIN_PREFLIGHT_TOOLS = ["task", "pnpm", "node", "git"];
|
|
15
18
|
const REMEDY = {
|
|
@@ -73,16 +76,35 @@ function formatFindingLine(finding) {
|
|
|
73
76
|
if (finding.present) {
|
|
74
77
|
return `[deft preflight] ${finding.tool}: ok`;
|
|
75
78
|
}
|
|
79
|
+
if (finding.impact === "none") {
|
|
80
|
+
const cause = finding.cause ?? "absent";
|
|
81
|
+
return `[deft preflight] ${finding.tool}: absent (impact: none) — ${cause}`;
|
|
82
|
+
}
|
|
76
83
|
const cause = finding.cause ?? "missing";
|
|
77
84
|
const remedy = finding.remedy ?? "install the tool";
|
|
78
85
|
return `[deft preflight] ${finding.tool}: MISSING — cause: ${cause}; remedy: ${remedy}`;
|
|
79
86
|
}
|
|
87
|
+
function inferConsumerDeposit(options) {
|
|
88
|
+
if (options.consumerDeposit !== undefined)
|
|
89
|
+
return options.consumerDeposit;
|
|
90
|
+
const project = options.projectRoot;
|
|
91
|
+
if (project === undefined)
|
|
92
|
+
return false;
|
|
93
|
+
// Same-path roots are framework-source only when the tree is the source repo.
|
|
94
|
+
if (isFrameworkRepoRoot(project))
|
|
95
|
+
return false;
|
|
96
|
+
const framework = options.frameworkRoot ?? project;
|
|
97
|
+
return !isFrameworkSourceContext(framework, project);
|
|
98
|
+
}
|
|
80
99
|
/**
|
|
81
100
|
* Run done-gate toolchain preflight. Pure probe — never installs or builds.
|
|
82
101
|
*/
|
|
83
102
|
export function runToolchainPreflight(options = {}) {
|
|
84
103
|
const which = options.which ?? defaultWhich;
|
|
85
104
|
const exists = options.exists ?? existsSync;
|
|
105
|
+
const consumerDeposit = inferConsumerDeposit(options);
|
|
106
|
+
const composed = options.composedGates ?? (consumerDeposit ? CONSUMER_CHECK_GATES : FRAMEWORK_CHECK_GATES);
|
|
107
|
+
const allCli = allGatesCliDispatchable(composed);
|
|
86
108
|
const findings = [];
|
|
87
109
|
for (const tool of TOOLCHAIN_PREFLIGHT_TOOLS) {
|
|
88
110
|
findings.push(probeTool(tool, which));
|
|
@@ -90,13 +112,48 @@ export function runToolchainPreflight(options = {}) {
|
|
|
90
112
|
if (options.probeCliDist !== false) {
|
|
91
113
|
findings.push(probeCliDist(options.frameworkRoot ?? options.projectRoot, which, exists));
|
|
92
114
|
}
|
|
93
|
-
const
|
|
115
|
+
const cliPresent = findings.some((f) => f.tool === "cli_dist" && f.present);
|
|
94
116
|
const taskMissing = findings.some((f) => f.tool === "task" && !f.present);
|
|
95
117
|
const pnpmMissing = findings.some((f) => f.tool === "pnpm" && !f.present);
|
|
96
118
|
const nodeMissing = findings.some((f) => f.tool === "node" && !f.present);
|
|
119
|
+
// #3335: in a deposit whose composed gates are all CLI-dispatchable, a
|
|
120
|
+
// missing task binary is impact none — no install-go-task remedy.
|
|
121
|
+
if (taskMissing && allCli) {
|
|
122
|
+
const idx = findings.findIndex((f) => f.tool === "task");
|
|
123
|
+
const prior = findings[idx];
|
|
124
|
+
if (idx >= 0 && prior !== undefined) {
|
|
125
|
+
findings[idx] = {
|
|
126
|
+
...prior,
|
|
127
|
+
impact: "none",
|
|
128
|
+
remedy: cliPresent || nodeMissing ? null : GLOBAL_CLI_REMEDY,
|
|
129
|
+
cause: cliPresent
|
|
130
|
+
? "go-task absent; CLI-native gates dispatch via global deft/directive (#3335)"
|
|
131
|
+
: "go-task absent and no global deft/directive CLI",
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
const missingCritical = findings.filter((f) => {
|
|
136
|
+
if (f.present || f.impact === "none")
|
|
137
|
+
return false;
|
|
138
|
+
return f.tool === "task" || f.tool === "pnpm" || f.tool === "node";
|
|
139
|
+
});
|
|
97
140
|
const skip = new Set();
|
|
98
|
-
if (
|
|
99
|
-
|
|
141
|
+
if (nodeMissing) {
|
|
142
|
+
skip.add(SKIP_ALL_GATES);
|
|
143
|
+
}
|
|
144
|
+
else if (taskMissing && !allCli) {
|
|
145
|
+
if (!cliPresent) {
|
|
146
|
+
skip.add(SKIP_ALL_GATES);
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
for (const spec of composed) {
|
|
150
|
+
const id = checkGateId(spec);
|
|
151
|
+
if (!isCliNativeGate(id))
|
|
152
|
+
skip.add(id);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
else if (taskMissing && allCli && !cliPresent) {
|
|
100
157
|
skip.add(SKIP_ALL_GATES);
|
|
101
158
|
}
|
|
102
159
|
else if (pnpmMissing) {
|
|
@@ -104,7 +161,7 @@ export function runToolchainPreflight(options = {}) {
|
|
|
104
161
|
skip.add(id);
|
|
105
162
|
}
|
|
106
163
|
}
|
|
107
|
-
const degraded = missingCritical.length > 0;
|
|
164
|
+
const degraded = missingCritical.length > 0 || (taskMissing && allCli && !cliPresent);
|
|
108
165
|
const ok = !degraded;
|
|
109
166
|
const status = ok ? "ok" : "degraded";
|
|
110
167
|
const lines = [];
|
|
@@ -115,7 +172,9 @@ export function runToolchainPreflight(options = {}) {
|
|
|
115
172
|
}
|
|
116
173
|
}
|
|
117
174
|
if (ok) {
|
|
118
|
-
lines.push(
|
|
175
|
+
lines.push(taskMissing && allCli
|
|
176
|
+
? "[deft preflight] done-gate toolchain ready (CLI dispatch; go-task not required) (#3335)"
|
|
177
|
+
: "[deft preflight] done-gate toolchain ready (task, pnpm, node)");
|
|
119
178
|
}
|
|
120
179
|
else {
|
|
121
180
|
lines.push("[deft preflight] degraded mode: directive check will skip toolchain-dependent gates " +
|
|
@@ -144,6 +203,7 @@ export function toolchainPreflightToDict(result) {
|
|
|
144
203
|
present: f.present,
|
|
145
204
|
cause: f.cause,
|
|
146
205
|
remedy: f.remedy,
|
|
206
|
+
...(f.impact !== undefined ? { impact: f.impact } : {}),
|
|
147
207
|
})),
|
|
148
208
|
skip_gate_ids: [...result.skipGateIds],
|
|
149
209
|
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rung-2 derived AC: decompose the task statement into testable clauses
|
|
3
|
+
* at intake; walk every clause against the shipped artifact at done (#3323).
|
|
4
|
+
*/
|
|
5
|
+
export type ClauseOutcome = "verified" | "unverifiable" | "failed";
|
|
6
|
+
export interface AcceptanceClauseReading {
|
|
7
|
+
readonly text: string;
|
|
8
|
+
readonly artifact_path: string | null;
|
|
9
|
+
}
|
|
10
|
+
export interface AcceptanceClause {
|
|
11
|
+
readonly id: number;
|
|
12
|
+
readonly text: string;
|
|
13
|
+
readonly artifact_path: string | null;
|
|
14
|
+
readonly ambiguous: boolean;
|
|
15
|
+
readonly readings?: readonly AcceptanceClauseReading[];
|
|
16
|
+
readonly chosen_reading?: number;
|
|
17
|
+
}
|
|
18
|
+
export interface ClauseWalkResult {
|
|
19
|
+
readonly id: number;
|
|
20
|
+
readonly text: string;
|
|
21
|
+
readonly artifact_path: string | null;
|
|
22
|
+
readonly outcome: ClauseOutcome;
|
|
23
|
+
readonly detail: string;
|
|
24
|
+
}
|
|
25
|
+
export interface ClauseWalkReport {
|
|
26
|
+
readonly clauses: readonly ClauseWalkResult[];
|
|
27
|
+
readonly failed: readonly ClauseWalkResult[];
|
|
28
|
+
readonly unverifiable: readonly ClauseWalkResult[];
|
|
29
|
+
readonly verified: readonly ClauseWalkResult[];
|
|
30
|
+
readonly ok: boolean;
|
|
31
|
+
readonly message: string;
|
|
32
|
+
}
|
|
33
|
+
/** Numbered independently testable clauses from the task statement (#3323). */
|
|
34
|
+
export declare function deriveAcceptanceClauses(taskStatement: string): AcceptanceClause[];
|
|
35
|
+
export declare function readAcceptanceClauses(acceptance: unknown): AcceptanceClause[];
|
|
36
|
+
export declare function serializeAcceptanceClauses(clauses: readonly AcceptanceClause[]): Record<string, unknown>[];
|
|
37
|
+
/**
|
|
38
|
+
* When no commands are stated, stamp derived clauses onto plan.acceptance
|
|
39
|
+
* and promote source_rung to derived. Leaves stated-command acceptance alone.
|
|
40
|
+
*/
|
|
41
|
+
export declare function stampDerivedClausesOnAcceptance(plan: Record<string, unknown>, taskStatement: string): {
|
|
42
|
+
readonly plan: Record<string, unknown>;
|
|
43
|
+
readonly clauses: readonly AcceptanceClause[];
|
|
44
|
+
};
|
|
45
|
+
export declare function isScratchArtifactPath(artifactPath: string): boolean;
|
|
46
|
+
export declare function walkAcceptanceClauses(clauses: readonly AcceptanceClause[], projectRoot: string): ClauseWalkReport;
|
|
47
|
+
/** Done reports lead with failed/unverifiable; unverifiable is never dropped. */
|
|
48
|
+
export declare function formatClauseWalkMessage(report: Omit<ClauseWalkReport, "message"> & {
|
|
49
|
+
readonly message?: string;
|
|
50
|
+
}, prior?: string): string;
|
|
51
|
+
//# sourceMappingURL=clauses.d.ts.map
|