@inerrata-corporation/errata 2.0.2-dev.629 → 2.0.2-dev.633
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/errata.mjs +150 -31
- package/package.json +1 -1
package/errata.mjs
CHANGED
|
@@ -18178,10 +18178,10 @@ function matchPackagesInText(text, index) {
|
|
|
18178
18178
|
for (const [key, node2] of index) {
|
|
18179
18179
|
if (key.length < MIN_NAME_LEN) continue;
|
|
18180
18180
|
if (!hay.includes(key)) continue;
|
|
18181
|
-
const
|
|
18182
|
-
const bounded = new RegExp(`(?<![\\w@/.\\-])${
|
|
18181
|
+
const esc4 = escapeRe3(key);
|
|
18182
|
+
const bounded = new RegExp(`(?<![\\w@/.\\-])${esc4}(?![\\w])`);
|
|
18183
18183
|
if (!bounded.test(hay)) continue;
|
|
18184
|
-
const verMatch = new RegExp(`${
|
|
18184
|
+
const verMatch = new RegExp(`${esc4}\\s*@?\\s*v?(\\d+(?:\\.\\d+){0,2})\\b`).exec(hay);
|
|
18185
18185
|
const hasSep = NAME_SEPARATOR.test(key);
|
|
18186
18186
|
if (!hasSep && !verMatch) continue;
|
|
18187
18187
|
if (seen.has(node2.id)) continue;
|
|
@@ -22579,7 +22579,7 @@ function renderSnapshot(s) {
|
|
|
22579
22579
|
lines.push("");
|
|
22580
22580
|
lines.push("### \u270D\uFE0F CAPTURE PROTOCOL \u2014 tags are the record");
|
|
22581
22581
|
lines.push(
|
|
22582
|
-
"errata records ONLY inline tags: `[!one line]` for every problem you state, `(fix:[id])` when your edit fixed a shown problem. Untagged prose is silently lost \u2014 tag as you write (no fences), we filter downstream."
|
|
22582
|
+
"errata records ONLY inline tags: `[!one line]` for every problem you state, `(fix:[id])` when your edit fixed a shown problem, and to JUDGE a prior shown below \u2014 `(confirm:[id])` if it held, `(refute:[id] why)` if it's wrong or didn't hold. Untagged prose is silently lost \u2014 tag as you write (no fences), we filter downstream."
|
|
22583
22583
|
);
|
|
22584
22584
|
lines.push("");
|
|
22585
22585
|
lines.push(SEARCH_IMPERATIVE_HEADER);
|
|
@@ -26981,6 +26981,13 @@ function linkBullet(ref) {
|
|
|
26981
26981
|
` \xB7 your fix vs a shown solution: (builds-on:[${ref}]) \xB7 (supersedes:[${ref}]) \xB7 (alternative:[h]) \u2014 pick one`
|
|
26982
26982
|
].join("\n");
|
|
26983
26983
|
}
|
|
26984
|
+
function verdictBullet(ref) {
|
|
26985
|
+
return [
|
|
26986
|
+
" \u2022 judge a prior we SHOWED you \u2014 a verdict on it, not a re-use of it; this is how a",
|
|
26987
|
+
` shown prior earns or loses trust: ${TAG_EXAMPLE.confirm(ref)} if it held \xB7`,
|
|
26988
|
+
` ${TAG_EXAMPLE.refute(ref)} if it's wrong or didn't hold (the reason is required)`
|
|
26989
|
+
].join("\n");
|
|
26990
|
+
}
|
|
26984
26991
|
function attemptBullet() {
|
|
26985
26992
|
return [
|
|
26986
26993
|
` \u2022 attempting an approach / an attempt failed \u2192 ${TAG_EXAMPLE.tried()} \xB7`,
|
|
@@ -26991,13 +26998,13 @@ function attemptBullet() {
|
|
|
26991
26998
|
function buildAgentInstruction(opts = {}) {
|
|
26992
26999
|
const signals = opts.signals ?? ["prior", "problem", "domain", "fix", "constraint", "triage", "attempt", "link"];
|
|
26993
27000
|
const ref = opts.referent ?? "its-handle";
|
|
26994
|
-
const token = (s) => s === "problem" ? TAG_EXAMPLE.problem() : s === "constraint" ? TAG_EXAMPLE.constraint() : s === "attempt" ? TAG_EXAMPLE.tried() : s === "domain" ? TAG_EXAMPLE.domain() : s === "link" ? TAG_EXAMPLE.pattern() : TAG_EXAMPLE[s](ref);
|
|
27001
|
+
const token = (s) => s === "problem" ? TAG_EXAMPLE.problem() : s === "constraint" ? TAG_EXAMPLE.constraint() : s === "attempt" ? TAG_EXAMPLE.tried() : s === "domain" ? TAG_EXAMPLE.domain() : s === "link" ? TAG_EXAMPLE.pattern() : s === "verdict" ? TAG_EXAMPLE.confirm(ref) : TAG_EXAMPLE[s](ref);
|
|
26995
27002
|
const head2 = `We tag the priors we show you with a short handle like [${opts.handleExample ?? "chokidar-glob"}]. Tags are the ONLY signal recorded \u2014 anything you state but don't tag is silently lost. Weave each tag inline in your prose as you state it (no fences or backticks, no extra calls); tag everything, we filter downstream:`;
|
|
26996
27003
|
const tail = "Mid-turn text (between tool calls) can be dropped by the harness \u2014 RESTATE every tag in your turn-final message; the final message is what reliably survives \u2014 EXCEPT one already shown above with an id: that is captured, so cite `[its-handle]` rather than retyping it (drift mints a duplicate).";
|
|
26997
27004
|
return [
|
|
26998
27005
|
head2,
|
|
26999
27006
|
...signals.map(
|
|
27000
|
-
(s) => s === "triage" ? triageBullet(ref) : s === "attempt" ? attemptBullet() : s === "link" ? linkBullet(ref) : ` \u2022 ${GLOSS[s]} \u2192 ${token(s)}`
|
|
27007
|
+
(s) => s === "triage" ? triageBullet(ref) : s === "attempt" ? attemptBullet() : s === "link" ? linkBullet(ref) : s === "verdict" ? verdictBullet(ref) : ` \u2022 ${GLOSS[s]} \u2192 ${token(s)}`
|
|
27001
27008
|
),
|
|
27002
27009
|
tail
|
|
27003
27010
|
].join("\n");
|
|
@@ -27048,7 +27055,15 @@ var init_agent_signals = __esm({
|
|
|
27048
27055
|
// knowledge can cross to the collective.
|
|
27049
27056
|
package: () => `(package: the-package-name)`,
|
|
27050
27057
|
component: () => `(component: The Component)`,
|
|
27051
|
-
aids: (ref) => `(aids:[${ref}])
|
|
27058
|
+
aids: (ref) => `(aids:[${ref}])`,
|
|
27059
|
+
// VERDICT (VS-verdict-tags) — a judgment on a SHOWN prior, distinct from leaning on it.
|
|
27060
|
+
// `confirm` rides the corroborate channel (it held); `refute` the contradict channel
|
|
27061
|
+
// (it's wrong / didn't hold) and REQUIRES a reason. This is the inline producer the
|
|
27062
|
+
// evidence channels lacked — refute sat dead (contradictionPressure 0) until now, while
|
|
27063
|
+
// lean-on corroboration lived, because only corroboration had an inline path. Grammar
|
|
27064
|
+
// single-sourced with parseInlineTags' CONFIRM_PREFIX/REFUTE_PREFIX.
|
|
27065
|
+
confirm: (ref) => `(confirm:[${ref}])`,
|
|
27066
|
+
refute: (ref) => `(refute:[${ref}] one line why)`
|
|
27052
27067
|
};
|
|
27053
27068
|
GLOSS = {
|
|
27054
27069
|
prior: "a shown prior helped, or you work in a primed language/package",
|
|
@@ -27076,7 +27091,8 @@ var init_agent_signals = __esm({
|
|
|
27076
27091
|
// clause; the pattern convergence hook now rides here too (it fell 0/4 when it
|
|
27077
27092
|
// only appeared in the link bullet's tail).
|
|
27078
27093
|
domain: "a problem with no single file \u2014 name the area it's about (Title Case). Also name the general shape it instantiates: (pattern: the shape) \u2014 needs no code anchor, and two agents naming the same shape converge on one node",
|
|
27079
|
-
link: "the problem you flagged is an instance of priors/abstractions you can name \u2014 (instance:[h1],[h2],\u2026) / (pattern: \u2026) / (aids:[h]); rendered whole via linkBullet"
|
|
27094
|
+
link: "the problem you flagged is an instance of priors/abstractions you can name \u2014 (instance:[h1],[h2],\u2026) / (pattern: \u2026) / (aids:[h]); rendered whole via linkBullet",
|
|
27095
|
+
verdict: "you can judge a prior we SHOWED you \u2014 confirm it if it held, refute it (with why) if it didn't; rendered whole via verdictBullet"
|
|
27080
27096
|
};
|
|
27081
27097
|
}
|
|
27082
27098
|
});
|
|
@@ -27387,6 +27403,54 @@ var init_src8 = __esm({
|
|
|
27387
27403
|
}
|
|
27388
27404
|
});
|
|
27389
27405
|
|
|
27406
|
+
// ../../packages/privacy-edge/src/self-reference.ts
|
|
27407
|
+
function locatorTerms(loc, full, part) {
|
|
27408
|
+
if (!loc) return;
|
|
27409
|
+
full.add(loc);
|
|
27410
|
+
const segs = loc.split("/").filter(Boolean);
|
|
27411
|
+
if (segs.length >= 2) {
|
|
27412
|
+
part.add(segs[segs.length - 1]);
|
|
27413
|
+
part.add(segs[segs.length - 2]);
|
|
27414
|
+
}
|
|
27415
|
+
}
|
|
27416
|
+
function scrubSelfReferences(text, project) {
|
|
27417
|
+
let out2 = text;
|
|
27418
|
+
out2 = out2.replace(
|
|
27419
|
+
/\b(MRs?|PRs?|merge requests?|pull requests?|issues?|tickets?)\s+#?[0-9]+\b/gi,
|
|
27420
|
+
(_m, kind) => {
|
|
27421
|
+
const k = kind.toLowerCase();
|
|
27422
|
+
if (k.startsWith("p")) return "a pull request";
|
|
27423
|
+
if (k.startsWith("i")) return "an issue";
|
|
27424
|
+
if (k.startsWith("t")) return "a ticket";
|
|
27425
|
+
return "a merge request";
|
|
27426
|
+
}
|
|
27427
|
+
).replace(new RegExp(`${L}![0-9]{1,6}(?![0-9])`, "g"), "a merge request").replace(new RegExp(`(?<![A-Za-z0-9#])#[0-9]{2,6}(?![0-9])`, "g"), "an issue");
|
|
27428
|
+
const full = /* @__PURE__ */ new Set();
|
|
27429
|
+
const part = /* @__PURE__ */ new Set();
|
|
27430
|
+
locatorTerms(project.repoLocator, full, part);
|
|
27431
|
+
for (const a of project.aliases ?? []) locatorTerms(a, full, part);
|
|
27432
|
+
if (project.name) part.add(project.name);
|
|
27433
|
+
for (const a of project.aka ?? []) part.add(a);
|
|
27434
|
+
const ordered = [
|
|
27435
|
+
...[...full].map((t) => ({ t, repl: "the repository" })),
|
|
27436
|
+
...[...part].map((t) => ({ t, repl: "the project" }))
|
|
27437
|
+
].filter((x) => x.t && x.t.length >= 2).sort((a, b) => b.t.length - a.t.length);
|
|
27438
|
+
for (const { t, repl } of ordered) {
|
|
27439
|
+
out2 = out2.replace(new RegExp(`${L}${esc2(t)}${R}`, "gi"), repl);
|
|
27440
|
+
}
|
|
27441
|
+
out2 = out2.replace(/\b(the|a|an|its|our|this)\s+the\s+(project|repository)\b/gi, "the $2");
|
|
27442
|
+
return out2;
|
|
27443
|
+
}
|
|
27444
|
+
var L, R, esc2;
|
|
27445
|
+
var init_self_reference = __esm({
|
|
27446
|
+
"../../packages/privacy-edge/src/self-reference.ts"() {
|
|
27447
|
+
"use strict";
|
|
27448
|
+
L = "(?<![A-Za-z0-9])";
|
|
27449
|
+
R = "(?![A-Za-z0-9])";
|
|
27450
|
+
esc2 = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
27451
|
+
}
|
|
27452
|
+
});
|
|
27453
|
+
|
|
27390
27454
|
// ../../packages/privacy-edge/src/generalize.ts
|
|
27391
27455
|
function generalize(text, opts = {}) {
|
|
27392
27456
|
const level = opts.level ?? 1;
|
|
@@ -27399,6 +27463,7 @@ function generalize(text, opts = {}) {
|
|
|
27399
27463
|
return generalizePhrase(cls, level);
|
|
27400
27464
|
});
|
|
27401
27465
|
}
|
|
27466
|
+
if (opts.project) out2 = scrubSelfReferences(out2, opts.project);
|
|
27402
27467
|
return { text: out2, report: { level, classes: [...seen] } };
|
|
27403
27468
|
}
|
|
27404
27469
|
var TOKEN_RULES;
|
|
@@ -27408,6 +27473,7 @@ var init_generalize = __esm({
|
|
|
27408
27473
|
init_src8();
|
|
27409
27474
|
init_date_shapes();
|
|
27410
27475
|
init_ontology();
|
|
27476
|
+
init_self_reference();
|
|
27411
27477
|
TOKEN_RULES = [
|
|
27412
27478
|
{ re: /<api-key:[0-9a-f]+>/gi, cls: "credential" },
|
|
27413
27479
|
{ re: /<email:[0-9a-f]+>/gi, cls: "email" },
|
|
@@ -27429,6 +27495,7 @@ var init_src9 = __esm({
|
|
|
27429
27495
|
init_ontology();
|
|
27430
27496
|
init_date_shapes();
|
|
27431
27497
|
init_generalize();
|
|
27498
|
+
init_self_reference();
|
|
27432
27499
|
}
|
|
27433
27500
|
});
|
|
27434
27501
|
|
|
@@ -48873,13 +48940,13 @@ var init_witness_ledger = __esm({
|
|
|
48873
48940
|
var report_render_exports = {};
|
|
48874
48941
|
__export(report_render_exports, {
|
|
48875
48942
|
LIVE_VERBS: () => LIVE_VERBS,
|
|
48876
|
-
esc: () =>
|
|
48943
|
+
esc: () => esc3,
|
|
48877
48944
|
renderRepoPage: () => renderRepoPage,
|
|
48878
48945
|
renderReport: () => renderReport,
|
|
48879
48946
|
renderRollupIndex: () => renderRollupIndex,
|
|
48880
48947
|
slug: () => slug
|
|
48881
48948
|
});
|
|
48882
|
-
function
|
|
48949
|
+
function esc3(s) {
|
|
48883
48950
|
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
48884
48951
|
}
|
|
48885
48952
|
function slug(name2) {
|
|
@@ -48893,9 +48960,9 @@ function nextHtml(n, opts) {
|
|
|
48893
48960
|
const cmd2 = `errata ${n.verb}${n.arg ? " " + n.arg : ""}`;
|
|
48894
48961
|
const live = isLive2(n.verb);
|
|
48895
48962
|
if (!live && !opts.includeFutureVerbs) return "";
|
|
48896
|
-
const hint = n.hint ? ` \u2014 ${
|
|
48963
|
+
const hint = n.hint ? ` \u2014 ${esc3(n.hint)}` : "";
|
|
48897
48964
|
const cls = live ? "next" : "next soon";
|
|
48898
|
-
const tag = live ? `<code>${
|
|
48965
|
+
const tag = live ? `<code>${esc3(cmd2)}</code>` : `<span class="vsoon">${esc3(cmd2)} \xB7 soon</span>`;
|
|
48899
48966
|
return `<div class="${cls}">next: ${tag}${hint}</div>`;
|
|
48900
48967
|
}
|
|
48901
48968
|
function shell(title, body2) {
|
|
@@ -48905,7 +48972,7 @@ function shell(title, body2) {
|
|
|
48905
48972
|
<meta charset="utf-8">
|
|
48906
48973
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
48907
48974
|
<meta name="robots" content="noindex">
|
|
48908
|
-
<title>${
|
|
48975
|
+
<title>${esc3(title)}</title>
|
|
48909
48976
|
<style>
|
|
48910
48977
|
:root{
|
|
48911
48978
|
--bg:#0c0809; --panel:#160f10; --panel2:#1d1416; --line:#2c1f22; --ink:#efe7e9; --mut:#a6939a; --faint:#7c6a70;
|
|
@@ -49016,17 +49083,17 @@ function trustHtml(t, note) {
|
|
|
49016
49083
|
function learnedCard(c, opts) {
|
|
49017
49084
|
const segs = [];
|
|
49018
49085
|
if (c.chain.causedBy)
|
|
49019
|
-
segs.push(`<span class="e">CAUSED_BY</span> <span class="rc">${
|
|
49086
|
+
segs.push(`<span class="e">CAUSED_BY</span> <span class="rc">${esc3(c.chain.causedBy)}</span>`);
|
|
49020
49087
|
if (c.chain.fixedBy) {
|
|
49021
49088
|
const verified = c.chain.verified ? " \xB7 verified" : "";
|
|
49022
|
-
segs.push(`<span class="e">FIXED_BY</span> <span class="fix">${
|
|
49089
|
+
segs.push(`<span class="e">FIXED_BY</span> <span class="fix">${esc3(c.chain.fixedBy)}${verified}</span>`);
|
|
49023
49090
|
}
|
|
49024
49091
|
if (c.chain.instanceOf)
|
|
49025
|
-
segs.push(`<span class="e">INSTANCE_OF</span> <span class="rc">${
|
|
49092
|
+
segs.push(`<span class="e">INSTANCE_OF</span> <span class="rc">${esc3(c.chain.instanceOf)}</span>`);
|
|
49026
49093
|
const chain = segs.length > 0 ? `\u2514\u2500 ${segs.join(" \u2500 ")}` : '\u2514\u2500 <span class="rc">(no causal chain yet)</span>';
|
|
49027
49094
|
return `<div class="lcard">
|
|
49028
49095
|
<div class="row1">
|
|
49029
|
-
<span class="prob">${
|
|
49096
|
+
<span class="prob">${esc3(c.problem)}</span>
|
|
49030
49097
|
<span class="badge ${PROV_CLASS[c.provenance]}">${BADGE2[c.provenance]} ${PROV_LABEL[c.provenance]}</span>
|
|
49031
49098
|
</div>
|
|
49032
49099
|
<div class="chain">${chain}</div>
|
|
@@ -49035,9 +49102,9 @@ function learnedCard(c, opts) {
|
|
|
49035
49102
|
}
|
|
49036
49103
|
function hotspotsPanel(hs) {
|
|
49037
49104
|
const rows = hs.map(
|
|
49038
|
-
(h) => `<div class="hs"><span class="f">${
|
|
49105
|
+
(h) => `<div class="hs"><span class="f">${esc3(h.file)}</span><div class="bar"><i style="width:${Math.round(
|
|
49039
49106
|
Math.max(0, Math.min(1, h.weight)) * 100
|
|
49040
|
-
)}%"></i></div><span class="n">${h.problemCount} ${
|
|
49107
|
+
)}%"></i></div><span class="n">${h.problemCount} ${esc3(h.unit ?? "probs")}</span></div>`
|
|
49041
49108
|
).join("\n ");
|
|
49042
49109
|
return `<div class="panel">
|
|
49043
49110
|
<h3>hotspots \xB7 risk concentration</h3>
|
|
@@ -49046,7 +49113,7 @@ function hotspotsPanel(hs) {
|
|
|
49046
49113
|
}
|
|
49047
49114
|
function revisitPanel(items) {
|
|
49048
49115
|
const rows = items.map(
|
|
49049
|
-
(r) => `<div class="rev"><span class="id">${
|
|
49116
|
+
(r) => `<div class="rev"><span class="id">${esc3(r.id)}</span><p><b>${esc3(r.claim)}</b> \u2014 ${esc3(
|
|
49050
49117
|
r.reason
|
|
49051
49118
|
)}</p></div>`
|
|
49052
49119
|
).join("\n ");
|
|
@@ -49139,7 +49206,7 @@ function spineViz(spine, idSuffix) {
|
|
|
49139
49206
|
</script>`;
|
|
49140
49207
|
}
|
|
49141
49208
|
function renderRepoPage(repo, data, opts = {}) {
|
|
49142
|
-
const consent = `consent in/out: <span style="color:var(--grn)">${
|
|
49209
|
+
const consent = `consent in/out: <span style="color:var(--grn)">${esc3(data.consent.inbound)}</span> / <span style="color:var(--grn)">${esc3(
|
|
49143
49210
|
data.consent.outbound
|
|
49144
49211
|
)}</span>`;
|
|
49145
49212
|
const learned = repo.learned.length > 0 ? `<div class="learn">
|
|
@@ -49148,8 +49215,8 @@ ${repo.learned.map((c) => learnedCard(c, opts)).join("\n")}
|
|
|
49148
49215
|
const body2 = `<p class="next"><a href="report.html">\u2190 all repos</a></p>
|
|
49149
49216
|
<div class="rhead">
|
|
49150
49217
|
<div class="rh-top">
|
|
49151
|
-
<div class="rh-title">errata report \xB7 <span class="repo">${
|
|
49152
|
-
<div class="rh-stamp">snapshot ${
|
|
49218
|
+
<div class="rh-title">errata report \xB7 <span class="repo">${esc3(repo.name)}</span></div>
|
|
49219
|
+
<div class="rh-stamp">snapshot ${esc3(data.generatedAt)}<br>static html \xB7 generated by the daemon \xB7 ${consent}</div>
|
|
49153
49220
|
</div>
|
|
49154
49221
|
${statRow(repo.stats)}
|
|
49155
49222
|
</div>
|
|
@@ -49177,21 +49244,21 @@ ${healthStrip(repo.health)}
|
|
|
49177
49244
|
}
|
|
49178
49245
|
function renderRollupIndex(data, opts = {}) {
|
|
49179
49246
|
const r = data.rollup;
|
|
49180
|
-
const consent = `consent in/out: <span style="color:var(--grn)">${
|
|
49247
|
+
const consent = `consent in/out: <span style="color:var(--grn)">${esc3(data.consent.inbound)}</span> / <span style="color:var(--grn)">${esc3(
|
|
49181
49248
|
data.consent.outbound
|
|
49182
49249
|
)}</span>`;
|
|
49183
49250
|
const rows = data.repos.map((repo) => {
|
|
49184
49251
|
const href = `report-${slug(repo.name)}.html`;
|
|
49185
49252
|
return `<a class="rrow" href="${href}">
|
|
49186
49253
|
<span class="live ${repo.live ? "on" : "off"}">${repo.live ? "\u25CF live" : "\u25CB idle"}</span>
|
|
49187
|
-
<span><span class="nm">${
|
|
49254
|
+
<span><span class="nm">${esc3(repo.name)}</span><br><span class="pth">${esc3(repo.path)}</span></span>
|
|
49188
49255
|
<span class="mini">${repo.stats.nodes.toLocaleString("en-US")} nodes \xB7 ${repo.health.openProblems} open \xB7 ${repo.health.humanValidated}<span style="color:var(--gold)">\u25B2h</span></span>
|
|
49189
49256
|
</a>`;
|
|
49190
49257
|
}).join("\n ");
|
|
49191
49258
|
const body2 = `<div class="rhead">
|
|
49192
49259
|
<div class="rh-top">
|
|
49193
49260
|
<div class="rh-title">errata report \xB7 <span class="repo">${data.repos.length} repo${data.repos.length === 1 ? "" : "s"}</span></div>
|
|
49194
|
-
<div class="rh-stamp">snapshot ${
|
|
49261
|
+
<div class="rh-stamp">snapshot ${esc3(data.generatedAt)}<br>static html \xB7 generated by the daemon \xB7 ${consent}</div>
|
|
49195
49262
|
</div>
|
|
49196
49263
|
<div class="statrow">
|
|
49197
49264
|
<div class="stat"><div class="v">${r.nodes.toLocaleString("en-US")}</div><div class="k">nodes</div></div>
|
|
@@ -51970,6 +52037,9 @@ var BUILDS_ON_PREFIX = /^\s*builds-on:(?:#([a-z][\w-]{0,63}))?\s*/i;
|
|
|
51970
52037
|
var SUPERSEDES_PREFIX = /^\s*supersedes:(?:#([a-z][\w-]{0,63}))?\s*/i;
|
|
51971
52038
|
var ALTERNATIVE_PREFIX = /^\s*alternative:(?:#([a-z][\w-]{0,63}))?\s*/i;
|
|
51972
52039
|
var INSTANCE_PREFIX = /^\s*instance:\s*/i;
|
|
52040
|
+
var CONFIRM_PREFIX = /^\s*confirm:\s*/i;
|
|
52041
|
+
var REFUTE_PREFIX = /^\s*refute:\s*/i;
|
|
52042
|
+
var REFUTE_REASON_MIN = 4;
|
|
51973
52043
|
var PATTERN_RE = /\(\s*pattern:\s*([^()\n]{3,}?)\s*\)/gi;
|
|
51974
52044
|
var DOMAIN_RE = /\(\s*domain:\s*([^()\n]{3,}?)\s*\)/gi;
|
|
51975
52045
|
var PACKAGE_RE = /\(\s*package:\s*([^()\n]{2,}?)\s*\)/gi;
|
|
@@ -52014,7 +52084,7 @@ function parseInlineTags(text) {
|
|
|
52014
52084
|
const seqStart = out2.length;
|
|
52015
52085
|
const sentence = raw2.replace(
|
|
52016
52086
|
/`[^`]*`/g,
|
|
52017
|
-
(m) => /\[[!?]|\((?:fix|cause|constraint|tried|failed):|\(\[/.test(m) ? " " : m
|
|
52087
|
+
(m) => /\[[!?]|\((?:fix|cause|constraint|tried|failed|confirm|refute):|\(\[/.test(m) ? " " : m
|
|
52018
52088
|
);
|
|
52019
52089
|
const sfield = sentence.replace(/\s+/g, " ").trim().slice(0, 160);
|
|
52020
52090
|
const citeMatched = /* @__PURE__ */ new Set();
|
|
@@ -52029,6 +52099,8 @@ function parseInlineTags(text) {
|
|
|
52029
52099
|
const aidsM = fixM || causeM ? null : AIDS_PREFIX.exec(content);
|
|
52030
52100
|
const instM = fixM || causeM || aidsM ? null : INSTANCE_PREFIX.exec(content);
|
|
52031
52101
|
const ssM = fixM || causeM || aidsM || instM ? null : BUILDS_ON_PREFIX.exec(content) && { re: BUILDS_ON_PREFIX, kind: "builds-on" } || SUPERSEDES_PREFIX.exec(content) && { re: SUPERSEDES_PREFIX, kind: "supersedes" } || ALTERNATIVE_PREFIX.exec(content) && { re: ALTERNATIVE_PREFIX, kind: "alternative" };
|
|
52102
|
+
const confirmM = fixM || causeM || aidsM || instM || ssM ? null : CONFIRM_PREFIX.exec(content);
|
|
52103
|
+
const refuteM = fixM || causeM || aidsM || instM || ssM || confirmM ? null : REFUTE_PREFIX.exec(content);
|
|
52032
52104
|
const isFix = fixM !== null;
|
|
52033
52105
|
const isCause = causeM !== null;
|
|
52034
52106
|
if (aidsM || instM || ssM) {
|
|
@@ -52054,6 +52126,21 @@ function parseInlineTags(text) {
|
|
|
52054
52126
|
}
|
|
52055
52127
|
continue;
|
|
52056
52128
|
}
|
|
52129
|
+
if (confirmM || refuteM) {
|
|
52130
|
+
const body2 = content.replace(confirmM ? CONFIRM_PREFIX : REFUTE_PREFIX, "");
|
|
52131
|
+
HANDLE_RE.lastIndex = 0;
|
|
52132
|
+
const h2 = HANDLE_RE.exec(body2);
|
|
52133
|
+
const handle2 = h2 ? h2[1] ?? h2[2] : void 0;
|
|
52134
|
+
if (handle2) {
|
|
52135
|
+
if (refuteM) {
|
|
52136
|
+
const reason = body2.replace(new RegExp(HANDLE_RE.source, "gi"), " ").replace(/\s+/g, " ").trim();
|
|
52137
|
+
if (reason.length >= REFUTE_REASON_MIN) out2.push({ kind: "refute", handle: handle2, statement: reason, sentence: sfield });
|
|
52138
|
+
} else {
|
|
52139
|
+
out2.push({ kind: "confirm", handle: handle2, sentence: sfield });
|
|
52140
|
+
}
|
|
52141
|
+
}
|
|
52142
|
+
continue;
|
|
52143
|
+
}
|
|
52057
52144
|
const verbThread = fixM?.[1] ?? causeM?.[1] ?? void 0;
|
|
52058
52145
|
if (isFix) content = content.replace(FIX_PREFIX, "");
|
|
52059
52146
|
else if (isCause) content = content.replace(CAUSE_PREFIX, "");
|
|
@@ -52604,6 +52691,27 @@ function harvestInlineTags(store, text, opts) {
|
|
|
52604
52691
|
boundStatement: b.statement
|
|
52605
52692
|
});
|
|
52606
52693
|
}
|
|
52694
|
+
} else if (tag.kind === "confirm" || tag.kind === "refute") {
|
|
52695
|
+
const targetId = resolveHandle(store, tag.handle, opts.handleMap);
|
|
52696
|
+
const target = targetId ? store.getNode(targetId) : null;
|
|
52697
|
+
const citedLabel = target?.label ?? opts.handleMap[tag.handle]?.label;
|
|
52698
|
+
if (targetId && citedLabel && CORROBORATABLE_LABELS.has(citedLabel)) {
|
|
52699
|
+
if (tag.kind === "confirm") {
|
|
52700
|
+
const witnessKey = `corrob:${targetId}:confirm:${digest({ h: tag.handle })}`.slice(0, 72);
|
|
52701
|
+
if (!plan.corroborations.some((c) => c.witnessKey === witnessKey)) {
|
|
52702
|
+
const exposure = typeof store.currentIngestSeq === "function" ? priorExposure(store, targetId, store.currentIngestSeq()) : "unshown";
|
|
52703
|
+
if (exposure === "shown") plan.exposureShown++;
|
|
52704
|
+
else if (exposure === "evicted") plan.exposureEvicted++;
|
|
52705
|
+
else plan.exposureUnshown++;
|
|
52706
|
+
plan.corroborations.push({ nodeId: targetId, witnessKey, exposure });
|
|
52707
|
+
}
|
|
52708
|
+
} else {
|
|
52709
|
+
const witnessKey = `refute:${targetId}:${digest({ s: tag.statement ?? "" })}`.slice(0, 72);
|
|
52710
|
+
if (!plan.refutes.some((r) => r.witnessKey === witnessKey)) {
|
|
52711
|
+
plan.refutes.push({ nodeId: targetId, witnessKey });
|
|
52712
|
+
}
|
|
52713
|
+
}
|
|
52714
|
+
}
|
|
52607
52715
|
} else if (tag.kind === "prior") {
|
|
52608
52716
|
const targetId = resolveHandle(store, tag.handle, opts.handleMap);
|
|
52609
52717
|
const target = targetId ? store.getNode(targetId) : null;
|
|
@@ -54800,7 +54908,7 @@ function startLoopLagMonitor(thresholdMs = 1e3) {
|
|
|
54800
54908
|
}
|
|
54801
54909
|
|
|
54802
54910
|
// src/engine.ts
|
|
54803
|
-
var DAEMON_VERSION = true ? "2.0.2-dev.
|
|
54911
|
+
var DAEMON_VERSION = true ? "2.0.2-dev.633" : "2.0.0-alpha.0";
|
|
54804
54912
|
var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
|
|
54805
54913
|
var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
|
|
54806
54914
|
var GIT_OP_MUTE_MS = 4e3;
|
|
@@ -56009,9 +56117,14 @@ function createWorkspaceEngine(opts) {
|
|
|
56009
56117
|
});
|
|
56010
56118
|
};
|
|
56011
56119
|
if (typeof cloud.reportContradictions === "function") {
|
|
56120
|
+
const emitRefutes = plan.refutes.filter((r) => !mintedHere(r.nodeId));
|
|
56121
|
+
const refuteSkipped = plan.refutes.length - emitRefutes.length;
|
|
56122
|
+
if (refuteSkipped > 0) {
|
|
56123
|
+
appendWitnessLedger(paths.configDir, { ts: Date.now(), channel: "contradict", clientSelfSkipped: refuteSkipped });
|
|
56124
|
+
}
|
|
56012
56125
|
await sendWitnesses(
|
|
56013
56126
|
"contradict",
|
|
56014
|
-
|
|
56127
|
+
emitRefutes,
|
|
56015
56128
|
(items2, session) => cloud.reportContradictions({
|
|
56016
56129
|
daemonVersion: DAEMON_VERSION,
|
|
56017
56130
|
projectId: profile.id,
|
|
@@ -57152,10 +57265,16 @@ function buildInstanceIngest(store, profile, daemonVersion, ignorePatterns = [],
|
|
|
57152
57265
|
};
|
|
57153
57266
|
const symbolIndex = opts.workspaceRoot ? publicSymbolIndex(store, opts.workspaceRoot) : null;
|
|
57154
57267
|
const ownLexicon = buildSymbolLexicon(store);
|
|
57268
|
+
const projectIdentity = {
|
|
57269
|
+
...profile.name ? { name: profile.name } : {},
|
|
57270
|
+
...profile.repoLocator ? { repoLocator: profile.repoLocator } : {},
|
|
57271
|
+
...profile.repoLocatorAliases ? { aliases: profile.repoLocatorAliases } : {},
|
|
57272
|
+
...profile.aka ? { aka: profile.aka } : {}
|
|
57273
|
+
};
|
|
57155
57274
|
const fileLexicon = buildFileLexicon(store);
|
|
57156
57275
|
const shareable = (n) => {
|
|
57157
57276
|
const preserved = symbolIndex ? preservedSymbolsFor(n.description, symbolIndex) : [];
|
|
57158
|
-
const shippedText = generalize(n.description, { level }).text;
|
|
57277
|
+
const shippedText = generalize(n.description, { level, project: projectIdentity }).text;
|
|
57159
57278
|
const internalSyms = internalSymbolsFor(shippedText, (t) => ownLexicon.has(t), symbolIndex);
|
|
57160
57279
|
const internalFiles = internalFilesFor(shippedText, fileLexicon);
|
|
57161
57280
|
const internal = [.../* @__PURE__ */ new Set([...internalFiles, ...internalSyms])].slice(
|
|
@@ -57351,7 +57470,7 @@ function buildInstanceIngest(store, profile, daemonVersion, ignorePatterns = [],
|
|
|
57351
57470
|
if (sidecar[tok]) continue;
|
|
57352
57471
|
const entry = lexicon.get(tok);
|
|
57353
57472
|
if (!entry?.summary) continue;
|
|
57354
|
-
const scrubbed = generalize(entry.summary, { level }).text.trim();
|
|
57473
|
+
const scrubbed = generalize(entry.summary, { level, project: projectIdentity }).text.trim();
|
|
57355
57474
|
if (!scrubbed || summaryRejectionReason(scrubbed, isKnown) !== null) continue;
|
|
57356
57475
|
if (count >= MAX_SIDECAR_SYMBOLS) break outer;
|
|
57357
57476
|
sidecar[tok] = { kind: entry.kind, summary: scrubbed };
|