@deftai/directive-core 0.96.0 → 0.97.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/cache/archive.js +10 -4
- package/dist/check/gate-lists.js +8 -0
- package/dist/consumer-check-contract/evaluate.d.ts +124 -0
- package/dist/consumer-check-contract/evaluate.js +699 -0
- package/dist/consumer-check-contract/index.d.ts +5 -0
- package/dist/consumer-check-contract/index.js +5 -0
- package/dist/delivery-attempt/disk-begin.d.ts +51 -0
- package/dist/delivery-attempt/disk-begin.js +68 -0
- package/dist/delivery-attempt/evaluate.d.ts +26 -0
- package/dist/delivery-attempt/evaluate.js +443 -0
- package/dist/delivery-attempt/fingerprint.d.ts +32 -0
- package/dist/delivery-attempt/fingerprint.js +100 -0
- package/dist/delivery-attempt/handoff.d.ts +25 -0
- package/dist/delivery-attempt/handoff.js +102 -0
- package/dist/delivery-attempt/index.d.ts +17 -0
- package/dist/delivery-attempt/index.js +17 -0
- package/dist/delivery-attempt/ledger.d.ts +169 -0
- package/dist/delivery-attempt/ledger.js +758 -0
- package/dist/delivery-attempt/material-delta.d.ts +38 -0
- package/dist/delivery-attempt/material-delta.js +126 -0
- package/dist/delivery-attempt/types.d.ts +210 -0
- package/dist/delivery-attempt/types.js +77 -0
- package/dist/doctor/index.d.ts +1 -0
- package/dist/doctor/index.js +1 -0
- package/dist/doctor/main.js +12 -0
- package/dist/doctor/openclaw-soft-rebind.d.ts +26 -0
- package/dist/doctor/openclaw-soft-rebind.js +164 -0
- package/dist/hooks/dispatcher.d.ts +2 -1
- package/dist/hooks/dispatcher.js +63 -9
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/init-deposit/gitignore.js +7 -0
- package/dist/init-deposit/init-deposit.js +5 -0
- package/dist/init-deposit/refresh.js +3 -0
- package/dist/pr-merge-readiness/ci-gate.d.ts +29 -1
- package/dist/pr-merge-readiness/ci-gate.js +191 -24
- package/dist/pr-merge-readiness/compute.js +10 -1
- package/dist/pr-merge-readiness/index.d.ts +2 -1
- package/dist/pr-merge-readiness/index.js +2 -1
- package/dist/pr-merge-readiness/output.js +14 -0
- package/dist/pr-merge-readiness/platform-status.d.ts +29 -0
- package/dist/pr-merge-readiness/platform-status.js +49 -0
- package/dist/pr-watch/constants.d.ts +10 -0
- package/dist/pr-watch/constants.js +12 -1
- package/dist/pr-watch/main.js +16 -1
- package/dist/pr-watch/probe.js +13 -1
- package/dist/pr-watch/types.d.ts +3 -2
- package/dist/pr-watch/watch.js +14 -7
- package/dist/scope-provenance/digest.d.ts +67 -0
- package/dist/scope-provenance/digest.js +188 -0
- package/dist/scope-provenance/evaluate.d.ts +82 -0
- package/dist/scope-provenance/evaluate.js +528 -0
- package/dist/scope-provenance/index.d.ts +6 -0
- package/dist/scope-provenance/index.js +6 -0
- package/dist/session/compact-ritual.d.ts +96 -0
- package/dist/session/compact-ritual.js +237 -0
- package/dist/session/compact-ritual.spec.d.ts +2 -0
- package/dist/session/compact-ritual.spec.js +21 -0
- package/dist/session/index.d.ts +2 -0
- package/dist/session/index.js +2 -0
- package/dist/session/openclaw-soft-rebind-deposit.d.ts +46 -0
- package/dist/session/openclaw-soft-rebind-deposit.js +165 -0
- package/dist/test-boundary/evaluate.d.ts +54 -0
- package/dist/test-boundary/evaluate.js +368 -0
- package/dist/test-boundary/index.d.ts +6 -0
- package/dist/test-boundary/index.js +6 -0
- package/dist/test-boundary/policy.d.ts +52 -0
- package/dist/test-boundary/policy.js +182 -0
- package/dist/triage/bootstrap/gitignore.d.ts +1 -1
- package/dist/triage/bootstrap/gitignore.js +15 -1
- package/dist/vbrief-activate/activate.js +22 -6
- package/dist/xbrief/styles.js +33 -17
- package/package.json +7 -3
package/dist/cache/archive.js
CHANGED
|
@@ -58,18 +58,24 @@ function loadPlan(path) {
|
|
|
58
58
|
/** Parse github issue URI → `{repo: owner/name, number}` when possible. */
|
|
59
59
|
function issueRefFromUri(uri) {
|
|
60
60
|
const cleaned = uri.replace(/\/+$/, "");
|
|
61
|
-
|
|
61
|
+
// Accept github.com and www.github.com (case-insensitive host).
|
|
62
|
+
// Digits may include leading zeros (rare URL forms); Number() normalizes.
|
|
63
|
+
const m = /(?:https?:\/\/)?(?:www\.)?github\.com\/([^/]+)\/([^/]+)\/issues\/(\d+)$/i.exec(cleaned);
|
|
62
64
|
if (m) {
|
|
63
65
|
// Lowercase owner/repo so protection matches case-folded cache keys (#1137 review).
|
|
66
|
+
// Leading zeros normalize via Number(); reject 0 / non-positive.
|
|
67
|
+
const num = Number(m[3]);
|
|
68
|
+
if (!(num >= 1))
|
|
69
|
+
return null;
|
|
64
70
|
return {
|
|
65
71
|
repo: `${(m[1] ?? "").toLowerCase()}/${(m[2] ?? "").toLowerCase()}`,
|
|
66
|
-
number:
|
|
72
|
+
number: num,
|
|
67
73
|
};
|
|
68
74
|
}
|
|
69
75
|
const slash = cleaned.lastIndexOf("/");
|
|
70
76
|
const tail = slash >= 0 ? cleaned.slice(slash + 1) : cleaned;
|
|
71
|
-
if (
|
|
72
|
-
return { repo: "", number: Number
|
|
77
|
+
if (/^[1-9]\d*$/.test(tail)) {
|
|
78
|
+
return { repo: "", number: Number(tail) };
|
|
73
79
|
}
|
|
74
80
|
return null;
|
|
75
81
|
}
|
package/dist/check/gate-lists.js
CHANGED
|
@@ -29,6 +29,10 @@ export const FRAMEWORK_CHECK_GATES = [
|
|
|
29
29
|
"verify:branch",
|
|
30
30
|
"verify:encoding",
|
|
31
31
|
"verify:forward-coverage",
|
|
32
|
+
// #3145: test/source boundary + approved-scope provenance + consumer gate composition
|
|
33
|
+
"verify:test-boundary",
|
|
34
|
+
"verify:scope-provenance",
|
|
35
|
+
"verify:consumer-check-contract",
|
|
32
36
|
"verify:vbrief-conformance",
|
|
33
37
|
"verify:destructive-gh-verbs",
|
|
34
38
|
"verify:scm-boundary",
|
|
@@ -55,6 +59,10 @@ export const CONSUMER_CHECK_GATES = [
|
|
|
55
59
|
"verify:cache-fresh",
|
|
56
60
|
"verify:wip-cap",
|
|
57
61
|
"verify:orphan-active",
|
|
62
|
+
// #3145 enforcement trio (test placement, scope provenance, gate composition)
|
|
63
|
+
"verify:test-boundary",
|
|
64
|
+
"verify:scope-provenance",
|
|
65
|
+
"verify:consumer-check-contract",
|
|
58
66
|
"vbrief:validate",
|
|
59
67
|
"verify-strategy-output",
|
|
60
68
|
];
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* verify:consumer-check-contract evaluation (#3145).
|
|
3
|
+
*
|
|
4
|
+
* Fail closed when the consumer check task or required CI workflows omit
|
|
5
|
+
* configured Directive enforcement gates (test-boundary, scope-provenance,
|
|
6
|
+
* and other required surfaces). Emits a concrete repair path.
|
|
7
|
+
*
|
|
8
|
+
* Three-state exit: 0 clean / 1 missing gates / 2 config.
|
|
9
|
+
*/
|
|
10
|
+
import { type CheckGateSpec } from "../check/gate-lists.js";
|
|
11
|
+
/** Gates that #3145 requires on consumer check composition (beyond baseline). */
|
|
12
|
+
export declare const REQUIRED_CONSUMER_ENFORCEMENT_GATES: readonly string[];
|
|
13
|
+
export interface ConsumerCheckContractFinding {
|
|
14
|
+
readonly gateId: string;
|
|
15
|
+
readonly surface: "check-task" | "ci-workflow" | "verify-taskfile";
|
|
16
|
+
readonly detail: string;
|
|
17
|
+
readonly remediation: string;
|
|
18
|
+
}
|
|
19
|
+
export interface ConsumerCheckContractResult {
|
|
20
|
+
readonly exitCode: 0 | 1 | 2;
|
|
21
|
+
readonly findings: readonly ConsumerCheckContractFinding[];
|
|
22
|
+
readonly message: string;
|
|
23
|
+
}
|
|
24
|
+
export interface ConsumerCheckContractOptions {
|
|
25
|
+
/** Override required gates under test. */
|
|
26
|
+
readonly requiredGates?: readonly string[];
|
|
27
|
+
/** Inject Taskfile text (root). */
|
|
28
|
+
readonly rootTaskfileText?: string | null;
|
|
29
|
+
/** Inject tasks/verify.yml text. */
|
|
30
|
+
readonly verifyTaskfileText?: string | null;
|
|
31
|
+
/** Inject CI workflow file contents: relPath -> text. */
|
|
32
|
+
readonly ciWorkflows?: ReadonlyMap<string, string>;
|
|
33
|
+
/**
|
|
34
|
+
* Framework-source self-check: gates live in FRAMEWORK_CHECK_GATES / check:framework-source.
|
|
35
|
+
* When true, also accept framework aggregate composition.
|
|
36
|
+
*/
|
|
37
|
+
readonly frameworkSource?: boolean;
|
|
38
|
+
/** When true, missing CI references warn only (default true for migration). */
|
|
39
|
+
readonly ciWarnOnly?: boolean;
|
|
40
|
+
readonly enforce?: boolean;
|
|
41
|
+
}
|
|
42
|
+
/** True if `text` mentions the gate as a task dep, script, or CLI invocation. */
|
|
43
|
+
export declare function textReferencesGate(text: string, gateId: string): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* True when a shell line is only assignment(s) (no executed command).
|
|
46
|
+
* `CHECK_CMD="task check"` is pure assignment; `FOO=1 task check` is not.
|
|
47
|
+
* Linear scan (no nested regex quantifiers — CodeQL js/redos).
|
|
48
|
+
*/
|
|
49
|
+
export declare function isPureAssignmentLine(cmd: string): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* True when a shell/task line does not execute gates (echo, comment, pure assign).
|
|
52
|
+
* Greptile conf gate: non-executing text must not satisfy composition (#3145).
|
|
53
|
+
*/
|
|
54
|
+
export declare function isNonExecutingCommandLine(line: string): boolean;
|
|
55
|
+
/** Executable run/script command lines from a workflow (skips comments). */
|
|
56
|
+
export declare function extractWorkflowRunCommands(text: string): string[];
|
|
57
|
+
/**
|
|
58
|
+
* Strip simple single/double-quoted segments so runner phrases inside printf/args
|
|
59
|
+
* do not impersonate command-position invocations (Greptile conf=1).
|
|
60
|
+
*/
|
|
61
|
+
export declare function stripQuotedSegments(line: string): string;
|
|
62
|
+
/**
|
|
63
|
+
* True when a shell line discards or defers the primary command's exit status
|
|
64
|
+
* via `||`, pipelines, `;` chains, or job-control backgrounding. Used for
|
|
65
|
+
* dispatcher tokens that do not match the check-specific mask predicate.
|
|
66
|
+
*/
|
|
67
|
+
export declare function lineMasksShellStatus(line: string): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* True when a shell line uses job-control backgrounding (`cmd &`, `cmd & next`)
|
|
70
|
+
* as opposed to fd redirection (`2>&1`, `&>file`). Backgrounded jobs return
|
|
71
|
+
* before completion and do not propagate exit status — must not satisfy
|
|
72
|
+
* composition (Greptile conf=3/4 residual, #3145).
|
|
73
|
+
*/
|
|
74
|
+
export declare function lineHasBackgroundJob(line: string): boolean;
|
|
75
|
+
/**
|
|
76
|
+
* True when a shell line masks check failures (`|| true`, `| true`, `|| :`).
|
|
77
|
+
* Such lines must not satisfy composition (Greptile conf=3).
|
|
78
|
+
*/
|
|
79
|
+
export declare function lineMasksCheckFailure(line: string): boolean;
|
|
80
|
+
/**
|
|
81
|
+
* True when `line` invokes a runner at command position (start / after chain),
|
|
82
|
+
* not merely mentions it inside an argument, and does not mask failures.
|
|
83
|
+
*/
|
|
84
|
+
export declare function lineHasCommandPositionRunner(line: string, runnerPattern: RegExp): boolean;
|
|
85
|
+
/** True when a run command is a full check aggregate (not a single verify gate). */
|
|
86
|
+
export declare function runCommandIsFullCheck(cmd: string): boolean;
|
|
87
|
+
/**
|
|
88
|
+
* True when a run command invokes a specific verify gate id as an executable
|
|
89
|
+
* task/CLI form — not a bare substring in echo/docs/printf args.
|
|
90
|
+
*/
|
|
91
|
+
export declare function runCommandInvokesGate(cmd: string, gateId: string): boolean;
|
|
92
|
+
/**
|
|
93
|
+
* True when CI/workflow text has an executable `run:` line that invokes the full
|
|
94
|
+
* check aggregate (not a single gate, not prose) — Greptile P1.
|
|
95
|
+
*/
|
|
96
|
+
export declare function workflowExecutesCheck(text: string): boolean;
|
|
97
|
+
/** Extract the body of a top-level go-task task (indent=2 key). */
|
|
98
|
+
export declare function extractTaskBody(taskfileText: string, taskName: string): string;
|
|
99
|
+
/**
|
|
100
|
+
* Drop YAML/shell comment lines (and trailing `# ...` on otherwise empty marker
|
|
101
|
+
* lines) before orchestrator matching so commented markers cannot grant trust.
|
|
102
|
+
*/
|
|
103
|
+
export declare function stripTaskBodyComments(body: string): string;
|
|
104
|
+
/**
|
|
105
|
+
* True when a Taskfile task body actually dispatches the check orchestrator.
|
|
106
|
+
* ENGINE_CMD alone is inert metadata — require engine:invoke / dispatchTaskCheck
|
|
107
|
+
* (or a command-position runner) so inert YAML cannot grant trust (Greptile).
|
|
108
|
+
* Comments are stripped first so commented markers cannot bypass (Greptile conf=3).
|
|
109
|
+
*/
|
|
110
|
+
export declare function taskBodyInvokesCheckOrchestrator(body: string): boolean;
|
|
111
|
+
/** True when the check / check:consumer / check:framework-source task invokes orchestrator. */
|
|
112
|
+
export declare function taskfileInvokesCheckOrchestrator(text: string): boolean;
|
|
113
|
+
/**
|
|
114
|
+
* Extract dependency task names from a go-task task definition body snippet.
|
|
115
|
+
* Best-effort line parser for `deps:` list entries.
|
|
116
|
+
*/
|
|
117
|
+
export declare function extractCheckDeps(taskfileText: string, taskName: string): string[];
|
|
118
|
+
/**
|
|
119
|
+
* Evaluate whether required enforcement gates are composed into consumer check/CI.
|
|
120
|
+
*/
|
|
121
|
+
export declare function evaluateConsumerCheckContract(projectRoot: string, options?: ConsumerCheckContractOptions): ConsumerCheckContractResult;
|
|
122
|
+
/** Exported for tests — gate list helper. */
|
|
123
|
+
export declare function requiredGatesFromConsumerList(gates?: readonly CheckGateSpec[]): string[];
|
|
124
|
+
//# sourceMappingURL=evaluate.d.ts.map
|