@subseam/mcp 0.4.44 → 0.4.46
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/README.md +1 -1
- package/dist/main.js +43 -133
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
subseam reads your repository's history and checks every pull request against the rules your
|
|
4
4
|
team writes down: "this package never imports that one", "only this module talks to the
|
|
5
|
-
database". You write a rule as a one-line note, subseam turns it into a definition
|
|
5
|
+
database". You write a rule as a one-line note, subseam turns it into a definition,
|
|
6
6
|
and from then on each PR shows where it breaks the rule, with the file, the line and the cause.
|
|
7
7
|
|
|
8
8
|
This package is the MCP server that gives your coding agent (Claude Code, or any MCP host) the
|
package/dist/main.js
CHANGED
|
@@ -20287,6 +20287,9 @@ init_esm_shims();
|
|
|
20287
20287
|
// ../execution-contract/src/unit/test-shard.ts
|
|
20288
20288
|
init_esm_shims();
|
|
20289
20289
|
|
|
20290
|
+
// ../execution-contract/src/unit/default-test-file.ts
|
|
20291
|
+
init_esm_shims();
|
|
20292
|
+
|
|
20290
20293
|
// ../execution-contract/src/unit/footprint-segment.ts
|
|
20291
20294
|
init_esm_shims();
|
|
20292
20295
|
|
|
@@ -30647,7 +30650,7 @@ function renderDraft(d, atTip = true) {
|
|
|
30647
30650
|
const tip = d.atTip.failures.length > 0 ? `${tipAt}: ${d.atTip.failures.length} failing: ` + shown.join("; ") + (more > 0 ? `; \u2026 and ${more} more` : "") : notEvaluated !== null ? `${tipAt}: not evaluated (${notEvaluated})` : `${tipAt}: holds`;
|
|
30648
30651
|
const tipRest = d.atTip.failures.length > 0 && notEvaluated !== null ? [`${tipAt}, the rest was not evaluated (${notEvaluated})`] : [];
|
|
30649
30652
|
const open7 = notComputedLines(d.atTip.uncomputed, atTip);
|
|
30650
|
-
const rung = d.rung === void 0 ? [] : [`
|
|
30653
|
+
const rung = d.rung === void 0 ? [] : [` in force at ${d.rung.means}`];
|
|
30651
30654
|
if (typeof d.gated === "string") return [` ${d.statement}`, ` gated: ${d.gated} This definition is not evaluated.`, ...rung, ` conflicts: ${d.conflicts}`].join("\n");
|
|
30652
30655
|
return [` ${d.statement}`, ...exampleLines(d.examples), ` history: ${history}`, ...floor, tip, ...tipRest, ...open7, ...rung, ` conflicts: ${d.conflicts}`].join("\n");
|
|
30653
30656
|
}
|
|
@@ -30773,7 +30776,7 @@ var seedBody = external_exports.discriminatedUnion("status", [
|
|
|
30773
30776
|
})),
|
|
30774
30777
|
rejectedCandidates: external_exports.number(),
|
|
30775
30778
|
gateErrorDistribution: external_exports.record(external_exports.number()),
|
|
30776
|
-
|
|
30779
|
+
admitted: external_exports.array(external_exports.object({ name: external_exports.string(), definitionId: external_exports.string(), conceptId: external_exports.string() })),
|
|
30777
30780
|
routedContested: external_exports.array(external_exports.object({
|
|
30778
30781
|
name: external_exports.string(),
|
|
30779
30782
|
definitionId: external_exports.string(),
|
|
@@ -30794,11 +30797,8 @@ var input2 = external_exports.object({
|
|
|
30794
30797
|
source: external_exports.record(external_exports.unknown()).optional(),
|
|
30795
30798
|
nlIntent: external_exports.string().min(1).optional(),
|
|
30796
30799
|
createdBy: external_exports.string().min(1).optional(),
|
|
30797
|
-
//
|
|
30798
|
-
//
|
|
30799
|
-
// MISSING_BASIS carrying its repair hint. Declaring it required here would trade that named
|
|
30800
|
-
// refusal for a Zod 400 with nothing to act on, and the `dry_run`/`mine` arms need none. The
|
|
30801
|
-
// `nlIntent` arm forwards it when given and otherwise cites its own sentence.
|
|
30800
|
+
// Optional on every arm: a citation is recorded as the version's history and nothing routes on it.
|
|
30801
|
+
// The `nlIntent` arm forwards it when given and otherwise cites its own sentence.
|
|
30802
30802
|
basis: external_exports.string().min(1).optional(),
|
|
30803
30803
|
dry_run: external_exports.boolean().optional(),
|
|
30804
30804
|
mine: external_exports.object({
|
|
@@ -30816,7 +30816,7 @@ var input2 = external_exports.object({
|
|
|
30816
30816
|
});
|
|
30817
30817
|
var defineTool = {
|
|
30818
30818
|
name: "define",
|
|
30819
|
-
description: "Write a definition into this tenant's governing corpus. Pass exactly one of `source` (the SDL definition object \u2014 deterministic, no LLM) or `nlIntent` (a natural-language note: your own agent decomposes it into slices by pull \u2014 the first call answers with the task to pull, then re-issue the same call unchanged \u2014 and each slice is authored through the CEGIS loop), plus `repo` (org-qualified) and optional `commit` (defaults to resolved tip). Pass `basis` on either arm: free text citing what the definition stood on \u2014 the source doc plus its section (there is no fixed vocabulary), or `capture-note:<id>` for a captured note, which also marks that note formalized. It is
|
|
30819
|
+
description: "Write a definition into this tenant's governing corpus. Pass exactly one of `source` (the SDL definition object \u2014 deterministic, no LLM) or `nlIntent` (a natural-language note: your own agent decomposes it into slices by pull \u2014 the first call answers with the task to pull, then re-issue the same call unchanged \u2014 and each slice is authored through the CEGIS loop), plus `repo` (org-qualified) and optional `commit` (defaults to resolved tip). Pass `basis` on either arm: free text citing what the definition stood on \u2014 the source doc plus its section (there is no fixed vocabulary), or `capture-note:<id>` for a captured note, which also marks that note formalized. It is kept as the version's history. With `nlIntent` it defaults to the note, with the slice number appended. Authoring answers within about 45 s; if it is still queued or iterating it returns a job id: call `define` again with `authorJobId` to read it. An admission of `source` answers the same way: a job id still running is read with `admitJobId`, and a `dry_run` still running with `compileJobId`. `dry_run: true` with `source` validates against the live graph and admits NOTHING, returning per-gate errors with repair hints. `dry_run: true` with `source` and no `repo` answers only whether the language can say it (bind, capability and strength are deferred until a repo is named). `mine: {repo}` submits a whole-repo candidate mining pass instead (async \u2014 poll with `mine: {jobId}`). `gap: { construct, witness, issue }` records a construct the language cannot say yet (witness is the file:line that needed it) and admits nothing.",
|
|
30820
30820
|
capability: "define",
|
|
30821
30821
|
inputSchema: input2.shape,
|
|
30822
30822
|
async handler(raw, ctx) {
|
|
@@ -30961,7 +30961,7 @@ function renderSlice(r) {
|
|
|
30961
30961
|
const rungs = r.rungs === void 0 || r.rungs.length === 0 ? "" : `
|
|
30962
30962
|
Model calls: ${rungLine(r.rungs)}`;
|
|
30963
30963
|
if (r.ok) {
|
|
30964
|
-
const head = `admitted definition ${r.definitionId} v${r.version} in ${r.iterations} iteration(s). Clover: ${r.clover.agreeCount} agreeing${r.clover.agreed ? "" : " \u2014 no consensus"}
|
|
30964
|
+
const head = `admitted definition ${r.definitionId} v${r.version} in ${r.iterations} iteration(s). Clover: ${r.clover.agreeCount} agreeing${r.clover.agreed ? "" : " \u2014 no consensus"}.`;
|
|
30965
30965
|
return (r.draft === void 0 ? head : `${head}
|
|
30966
30966
|
${renderDraft(r.draft)}`) + rungs;
|
|
30967
30967
|
}
|
|
@@ -31007,8 +31007,7 @@ function renderAdmit(r) {
|
|
|
31007
31007
|
return r.status === "running" ? `define: admission job ${r.jobId} is still running (the gates and the first verdict). Call define with admitJobId: "${r.jobId}" to read it.` : `define: admission job ${r.jobId} failed: ${r.error}`;
|
|
31008
31008
|
}
|
|
31009
31009
|
if (r.ok) {
|
|
31010
|
-
const
|
|
31011
|
-
const head = `define: admitted ${r.definitionId} v${r.version} [${r.changeClass}] \u2014 ${standing}.`;
|
|
31010
|
+
const head = `define: admitted ${r.definitionId} v${r.version} [${r.changeClass}].`;
|
|
31012
31011
|
return r.draft === void 0 ? head : `${head}
|
|
31013
31012
|
${renderDraft(r.draft)}`;
|
|
31014
31013
|
}
|
|
@@ -31030,7 +31029,7 @@ ${renderSummary(r.summary)}`;
|
|
|
31030
31029
|
}
|
|
31031
31030
|
function renderSummary(s) {
|
|
31032
31031
|
const lines = [
|
|
31033
|
-
`Mined ${s.candidatesMined} candidate(s): ${s.
|
|
31032
|
+
`Mined ${s.candidatesMined} candidate(s): ${s.admitted.length} admitted, ${s.routedContested.length} contested, ${s.rejectedCandidates} rejected, ${s.droppedRedundant.count} redundant, ${s.discardedUnsupported.length} unsupported.`
|
|
31034
31033
|
];
|
|
31035
31034
|
if (s.discardedUnsupported.length > 0) {
|
|
31036
31035
|
lines.push("Discarded by measurement (support vs exceptions against the live graph):");
|
|
@@ -31038,9 +31037,9 @@ function renderSummary(s) {
|
|
|
31038
31037
|
lines.push(` \u2022 ${d.name} \u2014 ${d.reason}: support ${d.support}, exceptions ${d.exceptions} (${d.grain} grain)`);
|
|
31039
31038
|
}
|
|
31040
31039
|
}
|
|
31041
|
-
if (s.
|
|
31042
|
-
lines.push("Admitted
|
|
31043
|
-
for (const a of s.
|
|
31040
|
+
if (s.admitted.length > 0) {
|
|
31041
|
+
lines.push("Admitted:");
|
|
31042
|
+
for (const a of s.admitted) lines.push(` \u2022 ${a.name} (${a.definitionId})`);
|
|
31044
31043
|
}
|
|
31045
31044
|
if (s.routedContested.length > 0) {
|
|
31046
31045
|
lines.push("Contested (in the decision queue):");
|
|
@@ -31296,12 +31295,7 @@ var input3 = external_exports.object({
|
|
|
31296
31295
|
definitionId: external_exports.string().uuid().optional(),
|
|
31297
31296
|
repo: external_exports.string().min(1).optional(),
|
|
31298
31297
|
status: external_exports.enum(["active", "contested", "abandoned", "superseded"]).optional(),
|
|
31299
|
-
//
|
|
31300
|
-
// into the drift backlog, so they have to be FINDABLE: by standing (`versionStatus: 'defaulted'`
|
|
31301
|
-
// is the un-affirmed corpus), by how they got here (`provenance`), and by area
|
|
31302
|
-
// (`locationPrefix`). Dashboard-mode filters; meaningless beside `definitionId`.
|
|
31303
|
-
versionStatus: external_exports.enum(["defaulted", "ratified", "corrected"]).optional(),
|
|
31304
|
-
provenance: external_exports.enum(["authored", "mined", "witness-derived"]).optional(),
|
|
31298
|
+
// Findable by area (`locationPrefix`). Dashboard-mode filter; meaningless beside `definitionId`.
|
|
31305
31299
|
locationPrefix: external_exports.string().min(1).optional(),
|
|
31306
31300
|
// The practice library (direction/define/language.md §9.6): a search over product content, never
|
|
31307
31301
|
// over this tenant's definitions, so it is an arm of its own and takes no other field beside it.
|
|
@@ -31312,13 +31306,8 @@ var statusBody = external_exports.object({
|
|
|
31312
31306
|
definitionId: external_exports.string(),
|
|
31313
31307
|
name: external_exports.string(),
|
|
31314
31308
|
class: external_exports.string(),
|
|
31315
|
-
versionStatus: external_exports.string(),
|
|
31316
31309
|
epistemicStatus: external_exports.string(),
|
|
31317
|
-
currentVersion: external_exports.number()
|
|
31318
|
-
ratifiedBy: external_exports.string().nullable(),
|
|
31319
|
-
ratifiedAt: external_exports.string().nullable(),
|
|
31320
|
-
ratifiedBasis: external_exports.string().nullable(),
|
|
31321
|
-
ratifiedActorKind: external_exports.string().nullable()
|
|
31310
|
+
currentVersion: external_exports.number()
|
|
31322
31311
|
})),
|
|
31323
31312
|
driftBacklog: external_exports.array(external_exports.object({
|
|
31324
31313
|
driftEventId: external_exports.string(),
|
|
@@ -31335,8 +31324,6 @@ var statusBody = external_exports.object({
|
|
|
31335
31324
|
});
|
|
31336
31325
|
var showVersion = external_exports.object({
|
|
31337
31326
|
version: external_exports.number(),
|
|
31338
|
-
status: external_exports.string(),
|
|
31339
|
-
provenance: external_exports.string(),
|
|
31340
31327
|
changeClass: external_exports.string(),
|
|
31341
31328
|
class: external_exports.string(),
|
|
31342
31329
|
modality: external_exports.string(),
|
|
@@ -31347,10 +31334,6 @@ var showVersion = external_exports.object({
|
|
|
31347
31334
|
// such, while an absent field is a wire skew — without this it would render as "absent
|
|
31348
31335
|
// (pre-#911)" for a version that has an envelope.
|
|
31349
31336
|
authoredEnvelope: external_exports.unknown().refine((v) => v !== void 0, { message: "Required" }),
|
|
31350
|
-
ratifiedBy: external_exports.string().nullable(),
|
|
31351
|
-
ratifiedAt: external_exports.string().nullable(),
|
|
31352
|
-
ratifiedBasis: external_exports.string().nullable(),
|
|
31353
|
-
ratifiedActorKind: external_exports.string().nullable(),
|
|
31354
31337
|
witnesses: external_exports.object({ corroboration: external_exports.number(), pinned: external_exports.number(), counterexample: external_exports.number() })
|
|
31355
31338
|
});
|
|
31356
31339
|
var showViolation = external_exports.object({
|
|
@@ -31396,7 +31379,7 @@ var showBody = external_exports.discriminatedUnion("ok", [
|
|
|
31396
31379
|
]);
|
|
31397
31380
|
var showTool = {
|
|
31398
31381
|
name: "show",
|
|
31399
|
-
description: 'Show this tenant\'s definitions. With `definitionId`: ONE definition as a coherent object \u2014 every version with its
|
|
31382
|
+
description: 'Show this tenant\'s definitions. With `definitionId`: ONE definition as a coherent object \u2014 every version with its change class, subject bindings, standing violations, live suppressions, and banked witnesses. Without: the corpus dashboard (admitted definitions, the open drift backlog, corpus size + evaluation staleness), optionally filtered by `repo`, epistemic `status`, or `locationPrefix` (e.g. `app/src/billing/`). With `practice` (words, e.g. "one integration point for an external API" or "least privilege"): the practice library \u2014 how to state a coding best practice as definitions on your code\'s concepts, with the plain sentences to enter through `define`.',
|
|
31400
31383
|
capability: "define",
|
|
31401
31384
|
inputSchema: input3.shape,
|
|
31402
31385
|
async handler(raw, ctx) {
|
|
@@ -31474,13 +31457,7 @@ function json(value) {
|
|
|
31474
31457
|
}
|
|
31475
31458
|
function versionLines(v, currentVersion) {
|
|
31476
31459
|
const current = v.version === currentVersion ? " \u2190 current" : "";
|
|
31477
|
-
const lines = [` \u2022 v${v.version}#${v.canonicalHash.slice(0, 12)} [${v.class}/${v.modality}
|
|
31478
|
-
if (v.ratifiedBy !== null) {
|
|
31479
|
-
const kind = v.ratifiedActorKind === null ? "" : ` (${v.ratifiedActorKind})`;
|
|
31480
|
-
const when = v.ratifiedAt === null ? "" : ` on ${v.ratifiedAt}`;
|
|
31481
|
-
const basis = v.ratifiedBasis === null ? "" : ` \u2014 basis: ${v.ratifiedBasis}`;
|
|
31482
|
-
lines.push(` approved by ${v.ratifiedBy}${kind}${when}${basis}`);
|
|
31483
|
-
}
|
|
31460
|
+
const lines = [` \u2022 v${v.version}#${v.canonicalHash.slice(0, 12)} [${v.class}/${v.modality}] ${v.changeClass}${current}`];
|
|
31484
31461
|
const w = v.witnesses;
|
|
31485
31462
|
const banked = w.corroboration + w.pinned + w.counterexample;
|
|
31486
31463
|
if (banked > 0) {
|
|
@@ -31517,13 +31494,7 @@ Definitions:
|
|
|
31517
31494
|
${defs}${queue}`;
|
|
31518
31495
|
}
|
|
31519
31496
|
function renderDefinition(d) {
|
|
31520
|
-
|
|
31521
|
-
if (d.ratifiedBy === null) return line;
|
|
31522
|
-
const kind = d.ratifiedActorKind === null ? "" : ` (${d.ratifiedActorKind})`;
|
|
31523
|
-
const when = d.ratifiedAt === null ? "" : ` on ${d.ratifiedAt}`;
|
|
31524
|
-
const basis = d.ratifiedBasis === null ? "" : ` \u2014 basis: ${d.ratifiedBasis}`;
|
|
31525
|
-
return `${line}
|
|
31526
|
-
approved by ${d.ratifiedBy}${kind}${when}${basis}`;
|
|
31497
|
+
return ` \u2022 ${d.name} [${d.class}] v${d.currentVersion} (${d.definitionId})`;
|
|
31527
31498
|
}
|
|
31528
31499
|
function renderBacklogItem(q) {
|
|
31529
31500
|
const line = ` \u2022 ${q.kind}: ${q.definitionName} (drift ${q.driftEventId})`;
|
|
@@ -31548,7 +31519,6 @@ var conformanceBody = external_exports.object({
|
|
|
31548
31519
|
canonicalHash: external_exports.string(),
|
|
31549
31520
|
class: external_exports.string(),
|
|
31550
31521
|
modality: external_exports.string(),
|
|
31551
|
-
versionStatus: external_exports.string(),
|
|
31552
31522
|
verdict: external_exports.string(),
|
|
31553
31523
|
reason: external_exports.string().optional(),
|
|
31554
31524
|
witness: external_exports.object({
|
|
@@ -31591,7 +31561,7 @@ var generationBody = external_exports.object({
|
|
|
31591
31561
|
planned: external_exports.number(),
|
|
31592
31562
|
cached: external_exports.number(),
|
|
31593
31563
|
witnessesStored: external_exports.number(),
|
|
31594
|
-
kinds: external_exports.object({ corroboration: external_exports.number(),
|
|
31564
|
+
kinds: external_exports.object({ corroboration: external_exports.number(), counterexample: external_exports.number() }),
|
|
31595
31565
|
partitions: external_exports.object({
|
|
31596
31566
|
hit: external_exports.array(external_exports.string()),
|
|
31597
31567
|
skipped: external_exports.array(external_exports.object({ key: external_exports.string(), reason: external_exports.string() }))
|
|
@@ -31607,7 +31577,7 @@ var input4 = external_exports.object({
|
|
|
31607
31577
|
});
|
|
31608
31578
|
var evalTool = {
|
|
31609
31579
|
name: "eval",
|
|
31610
|
-
description: "Evaluate definitions against a repo's code as-built. With `definitionIds`: verdicts for those definitions, plus generated-and-executed behavioral checks (banked witnesses) where applicable. Without: the whole admitted corpus. Provide `repo` and optional `commit` (defaults to resolved tip). Returns conformant/violated/unevaluable per definition; violations carry a witness.
|
|
31580
|
+
description: "Evaluate definitions against a repo's code as-built. With `definitionIds`: verdicts for those definitions, plus generated-and-executed behavioral checks (banked witnesses) where applicable. Without: the whole admitted corpus. Provide `repo` and optional `commit` (defaults to resolved tip). Returns conformant/violated/unevaluable per definition; violations carry a witness. MUST/MUST-NEVER violations are blocking. A pass that is still evaluating answers a job id: call again with `conformanceJobId` to read it.",
|
|
31611
31581
|
capability: "define",
|
|
31612
31582
|
inputSchema: input4.shape,
|
|
31613
31583
|
async handler(raw, ctx) {
|
|
@@ -31652,9 +31622,6 @@ var evalTool = {
|
|
|
31652
31622
|
function isHard(e) {
|
|
31653
31623
|
return e.modality === "MUST" || e.modality === "MUST-NEVER";
|
|
31654
31624
|
}
|
|
31655
|
-
function isCertified(e) {
|
|
31656
|
-
return e.versionStatus === "ratified" || e.versionStatus === "corrected";
|
|
31657
|
-
}
|
|
31658
31625
|
function witnessOf(e) {
|
|
31659
31626
|
const f = e.witness?.structuralFacts;
|
|
31660
31627
|
if (f !== void 0) return ` \u2014 concept is kind=${f.kind}, name=${f.name} at ${f.location}`;
|
|
@@ -31695,7 +31662,7 @@ function successorStamp(e) {
|
|
|
31695
31662
|
return e.evaluatedOnSuccessor !== void 0 ? ` {evaluated on ${e.evaluatedOnSuccessor.name} at ${e.evaluatedOnSuccessor.location}}` : "";
|
|
31696
31663
|
}
|
|
31697
31664
|
function violationLine(e) {
|
|
31698
|
-
return [` \u2022 ${e.name}${versionStamp(e)} [${e.modality}
|
|
31665
|
+
return [` \u2022 ${e.name}${versionStamp(e)} [${e.modality}]${grainStamp(e)}${successorStamp(e)}${witnessOf(e)}`, ...witnessDetailLines(e)];
|
|
31699
31666
|
}
|
|
31700
31667
|
function violationLines2(entries) {
|
|
31701
31668
|
return entries.flatMap(violationLine);
|
|
@@ -31707,7 +31674,7 @@ function suppressedLine(e) {
|
|
|
31707
31674
|
const sup = e.suppression;
|
|
31708
31675
|
if (sup === void 0) return violationLine(e);
|
|
31709
31676
|
return [
|
|
31710
|
-
` \u2022 ${e.name}${versionStamp(e)} [${e.modality}
|
|
31677
|
+
` \u2022 ${e.name}${versionStamp(e)} [${e.modality}]${grainStamp(e)}${successorStamp(e)} \u2014 violated, suppressed until ${sup.expiresAt} by ${sup.attributedTo}: ${sup.reason}${witnessOf(e)}`,
|
|
31711
31678
|
...witnessDetailLines(e)
|
|
31712
31679
|
];
|
|
31713
31680
|
}
|
|
@@ -31721,14 +31688,12 @@ function guaranteeLine() {
|
|
|
31721
31688
|
function laneLines(entries, behavioralHeader) {
|
|
31722
31689
|
const violated = entries.filter((e) => e.verdict === "violated");
|
|
31723
31690
|
const suppressed = violated.filter(isSuppressed);
|
|
31724
|
-
const blocking = violated.filter((e) => isHard(e) &&
|
|
31725
|
-
const approvalQuestions = violated.filter((e) => isHard(e) && e.versionStatus === "defaulted" && !isSuppressed(e));
|
|
31691
|
+
const blocking = violated.filter((e) => isHard(e) && !isSuppressed(e));
|
|
31726
31692
|
const shoulds = violated.filter((e) => e.modality === "SHOULD" && !isSuppressed(e));
|
|
31727
31693
|
const unevaluable = entries.filter((e) => e.verdict === "unevaluable");
|
|
31728
31694
|
const behavioral = entries.filter((e) => e.verdict === "static-unevaluable");
|
|
31729
31695
|
const out2 = [];
|
|
31730
|
-
if (blocking.length > 0) out2.push("\nBLOCKING \u2014
|
|
31731
|
-
if (approvalQuestions.length > 0) out2.push("\nApprove or correct? \u2014 defaulted violations:", ...violationLines2(approvalQuestions));
|
|
31696
|
+
if (blocking.length > 0) out2.push("\nBLOCKING \u2014 MUST/MUST-NEVER violations:", ...violationLines2(blocking));
|
|
31732
31697
|
if (shoulds.length > 0) out2.push("\nSHOULD reports:", ...violationLines2(shoulds));
|
|
31733
31698
|
if (suppressed.length > 0) out2.push("\nSuppressed \u2014 still violated, not blocking (expiring):", ...suppressed.flatMap(suppressedLine));
|
|
31734
31699
|
if (unevaluable.length > 0) out2.push("\nUnevaluable (no fact backing):", ...unevaluable.map((e) => ` \u2022 ${e.name}${versionStamp(e)}: ${e.reason ?? "no reason given"}`));
|
|
@@ -31775,18 +31740,13 @@ function renderGeneration(r) {
|
|
|
31775
31740
|
lines.push("No witnesses banked this run.");
|
|
31776
31741
|
} else {
|
|
31777
31742
|
lines.push(
|
|
31778
|
-
`Witnesses banked (${r.witnessesStored}): ${r.kinds.corroboration} corroboration, ${r.kinds.
|
|
31743
|
+
`Witnesses banked (${r.witnessesStored}): ${r.kinds.corroboration} corroboration, ${r.kinds.counterexample} counterexample.`
|
|
31779
31744
|
);
|
|
31780
31745
|
if (r.kinds.counterexample > 0) {
|
|
31781
31746
|
lines.push(
|
|
31782
31747
|
` ! ${r.kinds.counterexample} COUNTEREXAMPLE(S): the code as-built contradicts the definition's own claim. Either the code is wrong or the definition is \u2014 this is not a passing run.`
|
|
31783
31748
|
);
|
|
31784
31749
|
}
|
|
31785
|
-
if (r.kinds.pinned > 0) {
|
|
31786
|
-
lines.push(
|
|
31787
|
-
` \xB7 ${r.kinds.pinned} pinned: these came from DEFAULTED definitions, so they pin current behavior rather than certify an approved intent. Approve the definitions to promote them to corroboration.`
|
|
31788
|
-
);
|
|
31789
|
-
}
|
|
31790
31750
|
}
|
|
31791
31751
|
if (r.partitions.hit.length > 0) {
|
|
31792
31752
|
lines.push(`Checked partitions (${r.partitions.hit.length}):`);
|
|
@@ -31809,13 +31769,6 @@ var repinObserved = external_exports.object({
|
|
|
31809
31769
|
observations: external_exports.array(external_exports.object({ kind: external_exports.enum(["return", "raise"]), value: external_exports.unknown() }))
|
|
31810
31770
|
});
|
|
31811
31771
|
var ratifyBody = external_exports.discriminatedUnion("kind", [
|
|
31812
|
-
external_exports.object({
|
|
31813
|
-
kind: external_exports.literal("ratify-version"),
|
|
31814
|
-
result: external_exports.discriminatedUnion("ok", [
|
|
31815
|
-
external_exports.object({ ok: external_exports.literal(true), definitionId: external_exports.string(), version: external_exports.number(), status: external_exports.enum(["ratified", "corrected"]) }),
|
|
31816
|
-
refusal(["not-found", "not-defaulted", "missing-ratifier", "missing-basis", "ratifier-mismatch"])
|
|
31817
|
-
])
|
|
31818
|
-
}),
|
|
31819
31772
|
external_exports.object({
|
|
31820
31773
|
kind: external_exports.literal("resolve-drift-item"),
|
|
31821
31774
|
result: external_exports.discriminatedUnion("ok", [external_exports.object({ ok: external_exports.literal(true) }), refusal(["not-found", "already-resolved"])])
|
|
@@ -31856,21 +31809,8 @@ var ratifyBody = external_exports.discriminatedUnion("kind", [
|
|
|
31856
31809
|
})
|
|
31857
31810
|
]);
|
|
31858
31811
|
var input5 = external_exports.object({
|
|
31859
|
-
kind: external_exports.enum(["
|
|
31812
|
+
kind: external_exports.enum(["resolve-drift-item", "supersede", "suppress", "unsuppress", "repin-witness"]),
|
|
31860
31813
|
definitionId: external_exports.string().min(1).optional(),
|
|
31861
|
-
version: external_exports.number().int().optional(),
|
|
31862
|
-
status: external_exports.enum(["ratified", "corrected"]).optional(),
|
|
31863
|
-
// A4 + CL-E/F2. Optional because the gateway ALWAYS stamps the authenticated caller; passing it
|
|
31864
|
-
// is only allowed as a restatement of who you already are, and passing anybody else's name is
|
|
31865
|
-
// refused (`ratifier-mismatch`) rather than honoured. What it never does is go unrecorded.
|
|
31866
|
-
ratifiedBy: external_exports.string().min(1).optional(),
|
|
31867
|
-
// What the approval was judged against. Unnamed, it is the version's provenance basis (for a
|
|
31868
|
-
// drafted note, the note), so approving a draft asks for nothing beyond the approval.
|
|
31869
|
-
ratifiedBasis: external_exports.string().min(1).optional(),
|
|
31870
|
-
// NO `ratifiedActorKind` (CL-F, operator direction 2026-08-05 on PR #96). The store records what
|
|
31871
|
-
// was OBSERVED about a ratifier, never what a caller declares itself to be, so there is nothing
|
|
31872
|
-
// for a caller to pass. `z.object` strips unknown keys, so a caller that sends one anyway is
|
|
31873
|
-
// silently ignored here and it never reaches the gateway or the column.
|
|
31874
31814
|
driftEventId: external_exports.string().min(1).optional(),
|
|
31875
31815
|
resolvedBy: external_exports.string().min(1).optional(),
|
|
31876
31816
|
anchorConceptId: external_exports.string().min(1).optional(),
|
|
@@ -31883,7 +31823,7 @@ var input5 = external_exports.object({
|
|
|
31883
31823
|
});
|
|
31884
31824
|
var defineRatifyTool = {
|
|
31885
31825
|
name: "define_ratify",
|
|
31886
|
-
description: "
|
|
31826
|
+
description: "Close out the overlay. kind `resolve-drift-item` needs {driftEventId} (+ optional resolvedBy) and acknowledges a drift-backlog item. kind `supersede` needs {definitionId} and retires a definition from the active corpus. kind `suppress` needs {definitionId, anchorConceptId, attributedTo, reason, expiresAt} and marks a violation non-blocking until that date \u2014 it does NOT make it conformant, and there is no permanent suppression: past the date the violation blocks again and lands in the drift backlog. kind `unsuppress` needs {suppressionId, reason} (+ optional revokedBy, defaults to you) and REVOKES a suppression before its date \u2014 the violation blocks again on the next conformance run, and the revocation is recorded in the drift backlog with who/why. Extending a suppression is unsuppress then suppress, two explicit acts; there is no second live suppression per target. kind `repin-witness` needs {ledgerRowId} and reports the outcome of repinning a ledger-row witness; it returns whether the witness stands on the current determinant, or refuses with a reason when it cannot \u2014 row-not-found, not-witness-determinant, witness-absent, or not-pinnable.",
|
|
31887
31827
|
capability: "define",
|
|
31888
31828
|
inputSchema: input5.shape,
|
|
31889
31829
|
async handler(raw, ctx) {
|
|
@@ -31895,20 +31835,6 @@ var defineRatifyTool = {
|
|
|
31895
31835
|
}
|
|
31896
31836
|
};
|
|
31897
31837
|
function renderRatify(r) {
|
|
31898
|
-
if (r.kind === "ratify-version") {
|
|
31899
|
-
if (r.result.ok) return `define_ratify: ${r.result.definitionId} v${r.result.version} is now ${r.result.status}, in force at rung *new code only* (the default): a PR that adds a violation fails its check; violations already on the trunk do not. \`define_config\` sets it to warn or off.`;
|
|
31900
|
-
if (r.result.reason === "not-defaulted") return "define_ratify: refused \u2014 that version is not defaulted (already ratified/corrected).";
|
|
31901
|
-
if (r.result.reason === "missing-ratifier") {
|
|
31902
|
-
return "define_ratify: refused \u2014 the ratification names nobody. Ratifying is an act someone performs, and the record of it is permanent; pass ratifiedBy, or call as an authenticated principal.";
|
|
31903
|
-
}
|
|
31904
|
-
if (r.result.reason === "missing-basis") {
|
|
31905
|
-
return "define_ratify: refused \u2014 this version cites nothing it was drafted from, so there is nothing to say it was judged against. Pass ratifiedBasis (a contract, a docstring, an issue).";
|
|
31906
|
-
}
|
|
31907
|
-
if (r.result.reason === "ratifier-mismatch") {
|
|
31908
|
-
return "define_ratify: refused \u2014 ratifiedBy named somebody other than you. A ratification is a signature, and the signature is the signer; you cannot affirm on another principal's behalf. Drop ratifiedBy (your identity is recorded automatically), or have them ratify.";
|
|
31909
|
-
}
|
|
31910
|
-
return "define_ratify: refused \u2014 no such definition/version.";
|
|
31911
|
-
}
|
|
31912
31838
|
if (r.kind === "suppress") {
|
|
31913
31839
|
if (r.result.ok) {
|
|
31914
31840
|
return `define_ratify: suppressed until ${r.result.expiresAt}. The violation still reads violated \u2014 it is non-blocking until then, and blocks again afterwards.`;
|
|
@@ -32012,7 +31938,7 @@ var input6 = external_exports.object({
|
|
|
32012
31938
|
});
|
|
32013
31939
|
var defineInboxTool = {
|
|
32014
31940
|
name: "define_inbox",
|
|
32015
|
-
description: "The decision inbox: everything Define is currently waiting on a human for, open questions first and oldest first. Gathers the drift backlog (every drift kind, including expired and revoked suppressions),
|
|
31941
|
+
description: "The decision inbox: everything Define is currently waiting on a human for, open questions first and oldest first. Gathers the drift backlog (every drift kind, including expired and revoked suppressions), and failure-ledger snoozes that have run out or are about to. Every line carries the id you act on. Optional `limit` caps the rendered list; the counts always describe the whole answer.",
|
|
32016
31942
|
capability: "decision",
|
|
32017
31943
|
inputSchema: input6.shape,
|
|
32018
31944
|
async handler(raw, ctx) {
|
|
@@ -32025,8 +31951,6 @@ var defineInboxTool = {
|
|
|
32025
31951
|
};
|
|
32026
31952
|
var LABELS = {
|
|
32027
31953
|
drift: "drift",
|
|
32028
|
-
draft: "draft",
|
|
32029
|
-
"refinement-pending": "refinement",
|
|
32030
31954
|
"snooze-expired": "snooze expired",
|
|
32031
31955
|
"snooze-expiring": "snooze due",
|
|
32032
31956
|
proposal: "proposal"
|
|
@@ -32035,15 +31959,6 @@ var HOW = {
|
|
|
32035
31959
|
// Both facts held: `item.id` IS the driftEventId this call takes (the wire's own contract for
|
|
32036
31960
|
// the field). A complete, runnable call.
|
|
32037
31961
|
drift: (item) => `define_ratify {kind:'resolve-drift-item', driftEventId:'${item.id}'}`,
|
|
32038
|
-
// PARTIAL BY NECESSITY, and it says so rather than filling the hole. `item.id` is the
|
|
32039
|
-
// definitionId, but `ratify-version` also needs `version` and `status`, and the version is NOT on
|
|
32040
|
-
// the wire — it survives only as prose inside `detail` ("… v2 is a weaken refinement …"), and
|
|
32041
|
-
// parsing a number back out of a sentence to put it in a tool call is precisely the guessed
|
|
32042
|
-
// content the ruling forbids. So the call is named with the id it does hold and the remaining
|
|
32043
|
-
// arguments are stated as arguments the caller supplies.
|
|
32044
|
-
// A first draft is version 1, so the call is complete.
|
|
32045
|
-
draft: (item) => `define_ratify {kind:'ratify-version', definitionId:'${item.id}', version:1, status:'ratified'|'corrected'}`,
|
|
32046
|
-
"refinement-pending": (item) => `define_ratify {kind:'ratify-version', definitionId:'${item.id}', version:\u2026, status:'ratified'|'corrected'} \u2014 supply the version shown in this line`,
|
|
32047
31962
|
// The read shows the alteration, verdict and definition; the adjudication follows it.
|
|
32048
31963
|
proposal: (item) => `define_proposal_read {taskId:'${item.id}'}, then define_adjudicate {taskId:'${item.id}', decision:'accept'|'reject', reason:\u2026}`
|
|
32049
31964
|
};
|
|
@@ -47431,10 +47346,8 @@ var VerificationQuestionSchema = contractObject({
|
|
|
47431
47346
|
presentation: PresentationSchema
|
|
47432
47347
|
}).readonly();
|
|
47433
47348
|
var DivergenceKindSchema = external_exports2.enum(["missing", "spurious", "divergent"]);
|
|
47434
|
-
var DivergenceInterpretationSchema = external_exports2.enum(["ratify-or-correct", "conformance-violation"]);
|
|
47435
47349
|
var ConformanceDivergenceSchema = contractObject({
|
|
47436
47350
|
kind: DivergenceKindSchema,
|
|
47437
|
-
interpretation: DivergenceInterpretationSchema,
|
|
47438
47351
|
presentation: PresentationSchema
|
|
47439
47352
|
}).readonly();
|
|
47440
47353
|
var VerificationContextSchema = contractObject({
|
|
@@ -47559,7 +47472,6 @@ init_esm_shims();
|
|
|
47559
47472
|
init_esm_shims();
|
|
47560
47473
|
var DEFINITION_CLASSES = ["structural", "relational", "behavioral", "judgment"];
|
|
47561
47474
|
var MODALITIES = ["MUST", "MUST-NEVER", "SHOULD", "MAY"];
|
|
47562
|
-
var VERSION_STATUSES = ["defaulted", "ratified", "corrected"];
|
|
47563
47475
|
var CONFORMANCE_VERDICTS = ["conformant", "violated", "unevaluable", "static-unevaluable"];
|
|
47564
47476
|
var CARDINALITY_GRAINS = ["concept", "element"];
|
|
47565
47477
|
var CONFORMANCE_SCOPES = ["corpus", "cone", "scratch"];
|
|
@@ -47590,7 +47502,6 @@ var ConformanceEntrySchema = contractObject({
|
|
|
47590
47502
|
canonicalHash: external_exports2.string(),
|
|
47591
47503
|
class: external_exports2.enum(DEFINITION_CLASSES),
|
|
47592
47504
|
modality: external_exports2.enum(MODALITIES),
|
|
47593
|
-
versionStatus: external_exports2.enum(VERSION_STATUSES),
|
|
47594
47505
|
verdict: external_exports2.enum(CONFORMANCE_VERDICTS),
|
|
47595
47506
|
reason: external_exports2.string().optional(),
|
|
47596
47507
|
witness: ConformanceWitnessSchema.optional(),
|
|
@@ -47831,6 +47742,7 @@ var BUILD_REFUSAL_CODES = [
|
|
|
47831
47742
|
"origin-moved",
|
|
47832
47743
|
"overlay-blob-missing",
|
|
47833
47744
|
"overlay-path-ignored",
|
|
47745
|
+
"path-file-and-directory",
|
|
47834
47746
|
"path-invalid",
|
|
47835
47747
|
"repo-name-invalid",
|
|
47836
47748
|
"repo-not-found",
|
|
@@ -47973,28 +47885,26 @@ var BuildRunOutcomeShape = {
|
|
|
47973
47885
|
shardPlan: ShardPlanSchema.nullable()
|
|
47974
47886
|
};
|
|
47975
47887
|
var LandDefineViolationSchema = contractObject({
|
|
47976
|
-
|
|
47977
|
-
|
|
47978
|
-
|
|
47979
|
-
|
|
47980
|
-
|
|
47981
|
-
/** The evaluator's own words, or null when the verdict carried none. */
|
|
47982
|
-
reason: external_exports2.string().nullable(),
|
|
47983
|
-
/** THE PAIRS THAT CARRY IT. The definition name says a boundary was crossed; these say where.
|
|
47984
|
-
* Empty when the verdict named none. */
|
|
47985
|
-
offendingEdges: external_exports2.array(contractObject({ edge: external_exports2.string(), from: external_exports2.string(), to: external_exports2.string() }))
|
|
47888
|
+
definitionName: external_exports2.string(),
|
|
47889
|
+
path: external_exports2.string(),
|
|
47890
|
+
line: external_exports2.number().int(),
|
|
47891
|
+
/** Why, in the check's words: what the change adds that the definition forbids. */
|
|
47892
|
+
cause: external_exports2.string()
|
|
47986
47893
|
});
|
|
47987
47894
|
var LandDefineVerdictSchema = external_exports2.discriminatedUnion("kind", [
|
|
47988
47895
|
contractObject({
|
|
47989
47896
|
kind: external_exports2.literal("judged"),
|
|
47990
47897
|
commit: external_exports2.string(),
|
|
47991
|
-
/** What the pass covered, in its own words
|
|
47898
|
+
/** What the pass covered, in its own words: the definitions the change reaches. */
|
|
47992
47899
|
coverage: external_exports2.string(),
|
|
47993
|
-
|
|
47994
|
-
|
|
47900
|
+
/** `undecided`: nothing blocks, but part of the change was not computed. Never read as clean. */
|
|
47901
|
+
verdict: external_exports2.enum(["clean", "violated", "undecided"]),
|
|
47902
|
+
/** The divergences that block, by the check's own rule. */
|
|
47995
47903
|
violations: external_exports2.array(LandDefineViolationSchema),
|
|
47996
|
-
/**
|
|
47904
|
+
/** Diverged but not blocking (rung `warn` or suppressed). */
|
|
47997
47905
|
reported: external_exports2.array(LandDefineViolationSchema),
|
|
47906
|
+
/** Where the check could not compute a definition's answer, and why. */
|
|
47907
|
+
uncomputed: external_exports2.array(contractObject({ definitionName: external_exports2.string(), path: external_exports2.string(), reason: external_exports2.string() })),
|
|
47998
47908
|
/** When Define judged: the served report row's recordedAt, an ISO instant. */
|
|
47999
47909
|
judgedAt: external_exports2.iso.datetime()
|
|
48000
47910
|
}),
|
|
@@ -48767,7 +48677,7 @@ var workReadTools = createWorkReadToolProviders({ capability: "work" });
|
|
|
48767
48677
|
var bundledProviders = [src_default2, src_default, tension_default, ...defineTools, ...decisionTools, ...captureTools, ...buildTools, secureTool, ...workTools, ...workReadTools];
|
|
48768
48678
|
|
|
48769
48679
|
// package.json
|
|
48770
|
-
var version2 = "0.4.
|
|
48680
|
+
var version2 = "0.4.46";
|
|
48771
48681
|
|
|
48772
48682
|
// src/server.ts
|
|
48773
48683
|
var SERVER_VERSION = version2;
|