@inerrata-corporation/errata 2.0.2-dev.588 → 2.0.2-dev.592
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 +71 -3
- package/package.json +1 -1
package/errata.mjs
CHANGED
|
@@ -22556,6 +22556,21 @@ function renderSnapshot(s) {
|
|
|
22556
22556
|
lines.push(`- **${h.description}** \u2014 \`${h.id}\``);
|
|
22557
22557
|
}
|
|
22558
22558
|
}
|
|
22559
|
+
if (si.remoteHits?.length) {
|
|
22560
|
+
lines.push("");
|
|
22561
|
+
lines.push("_From the Errata Network \u2014 collective priors on this intent:_");
|
|
22562
|
+
for (const h of si.remoteHits) {
|
|
22563
|
+
lines.push(`- **${h.label}:** ${h.description} \u2014 \`${h.id}\``);
|
|
22564
|
+
}
|
|
22565
|
+
}
|
|
22566
|
+
if (si.knownGap) {
|
|
22567
|
+
const g = si.knownGap;
|
|
22568
|
+
const others = g.othersStuck !== null ? `, ${g.othersStuck} other contributor(s) stuck here` : "";
|
|
22569
|
+
lines.push("");
|
|
22570
|
+
lines.push(
|
|
22571
|
+
`_\u26A0 Known gap: the collective graph knows it doesn't know this (open void \u2014 demand ${g.demand.toFixed(1)}, ${g.demandTier}${others}). What you capture on this intent fills a gap someone is already waiting on._`
|
|
22572
|
+
);
|
|
22573
|
+
}
|
|
22559
22574
|
lines.push("");
|
|
22560
22575
|
} else if (s.workingFile) {
|
|
22561
22576
|
const w = s.workingFile;
|
|
@@ -23701,9 +23716,15 @@ var init_client = __esm({
|
|
|
23701
23716
|
if (q.codeFingerprint) qs.set("codeFingerprint", q.codeFingerprint);
|
|
23702
23717
|
if (q.seed?.length) qs.set("seed", q.seed.join(","));
|
|
23703
23718
|
if (q.q) qs.set("q", q.q);
|
|
23719
|
+
if (q.channel) qs.set("channel", q.channel);
|
|
23704
23720
|
const res = await this.json("GET", `/v2/search?${qs.toString()}`);
|
|
23705
23721
|
const { nodes, edges } = this.toCastalia(res);
|
|
23706
|
-
return {
|
|
23722
|
+
return {
|
|
23723
|
+
nodes,
|
|
23724
|
+
edges,
|
|
23725
|
+
generatedAt: res.generatedAt,
|
|
23726
|
+
...res.voidSignal ? { voidSignal: res.voidSignal } : {}
|
|
23727
|
+
};
|
|
23707
23728
|
}
|
|
23708
23729
|
/**
|
|
23709
23730
|
* The castalia wire shape → local-mergeable graph. Extracted so the priming fetch
|
|
@@ -54420,7 +54441,7 @@ function startLoopLagMonitor(thresholdMs = 1e3) {
|
|
|
54420
54441
|
}
|
|
54421
54442
|
|
|
54422
54443
|
// src/engine.ts
|
|
54423
|
-
var DAEMON_VERSION = true ? "2.0.2-dev.
|
|
54444
|
+
var DAEMON_VERSION = true ? "2.0.2-dev.592" : "2.0.0-alpha.0";
|
|
54424
54445
|
var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
|
|
54425
54446
|
var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
|
|
54426
54447
|
var GIT_OP_MUTE_MS = 4e3;
|
|
@@ -54759,6 +54780,8 @@ function createWorkspaceEngine(opts) {
|
|
|
54759
54780
|
let lastRemoteAt = 0;
|
|
54760
54781
|
let remoteInFlight = false;
|
|
54761
54782
|
const REMOTE_REFRESH_MS = 5 * 6e4;
|
|
54783
|
+
let intentRemote = null;
|
|
54784
|
+
let intentRemoteInFlight = false;
|
|
54762
54785
|
let ctxRefreshInFlight = false;
|
|
54763
54786
|
let ctxRefreshQueued = false;
|
|
54764
54787
|
let lastSelfCiteSkips = 0;
|
|
@@ -54820,12 +54843,14 @@ function createWorkspaceEngine(opts) {
|
|
|
54820
54843
|
const pendingUpdate = opts.pendingUpdate?.() ?? null;
|
|
54821
54844
|
const reviewItems = pickReviewItems();
|
|
54822
54845
|
const liveIntent = intents.mostRecent(Date.now());
|
|
54846
|
+
maybeRefreshIntentPriors(liveIntent ?? null);
|
|
54823
54847
|
const intentHits = liveIntent ? searchByIntent(store, liveIntent, { limit: 4 }).map((h) => ({
|
|
54824
54848
|
id: h.node.id,
|
|
54825
54849
|
label: h.node.label,
|
|
54826
54850
|
description: h.node.description,
|
|
54827
54851
|
coverage: h.coverage
|
|
54828
54852
|
})) : [];
|
|
54853
|
+
const intentCollective = liveIntent && intentRemote?.forIntent === liveIntent ? intentRemote : null;
|
|
54829
54854
|
const { body: body2, snapshot, ledger } = assembleAgentContext({
|
|
54830
54855
|
store,
|
|
54831
54856
|
...snapOpts,
|
|
@@ -54834,7 +54859,20 @@ function createWorkspaceEngine(opts) {
|
|
|
54834
54859
|
...prebuilt ? { snapshot: prebuilt } : {},
|
|
54835
54860
|
...pendingUpdate ? { pendingUpdate } : {},
|
|
54836
54861
|
...reviewItems.length ? { reviewItems } : {},
|
|
54837
|
-
...liveIntent ? {
|
|
54862
|
+
...liveIntent ? {
|
|
54863
|
+
statedIntent: {
|
|
54864
|
+
text: liveIntent,
|
|
54865
|
+
hits: intentHits,
|
|
54866
|
+
...intentCollective && intentCollective.hits.length > 0 ? {
|
|
54867
|
+
remoteHits: intentCollective.hits.slice(0, 4).map((n) => ({
|
|
54868
|
+
id: n.id,
|
|
54869
|
+
label: n.label,
|
|
54870
|
+
description: n.description
|
|
54871
|
+
}))
|
|
54872
|
+
} : {},
|
|
54873
|
+
...intentCollective?.voidSignal ? { knownGap: intentCollective.voidSignal } : {}
|
|
54874
|
+
}
|
|
54875
|
+
} : {}
|
|
54838
54876
|
});
|
|
54839
54877
|
doneRender?.();
|
|
54840
54878
|
try {
|
|
@@ -54888,6 +54926,10 @@ function createWorkspaceEngine(opts) {
|
|
|
54888
54926
|
domains: norm(profile.domains),
|
|
54889
54927
|
kinds: ["Pattern", "Technique", "AntiPattern"],
|
|
54890
54928
|
...seed.length ? { seed } : {},
|
|
54929
|
+
// VD-priorsearch: this is the AMBIENT lane — declaring it keeps its
|
|
54930
|
+
// misses from masquerading as asks (the 1515-miss mega-void was this
|
|
54931
|
+
// exact query, unlabeled).
|
|
54932
|
+
channel: "priming",
|
|
54891
54933
|
limit: 8
|
|
54892
54934
|
};
|
|
54893
54935
|
cloud.search(q).then((res) => {
|
|
@@ -54901,6 +54943,32 @@ function createWorkspaceEngine(opts) {
|
|
|
54901
54943
|
remoteInFlight = false;
|
|
54902
54944
|
}
|
|
54903
54945
|
};
|
|
54946
|
+
const maybeRefreshIntentPriors = (liveIntent) => {
|
|
54947
|
+
if (!liveIntent || opts.skipContextWriter || intentRemoteInFlight) return;
|
|
54948
|
+
if (intentRemote?.forIntent === liveIntent) return;
|
|
54949
|
+
const syncOk = opts.syncConsent ?? loadConfig().consent.sync;
|
|
54950
|
+
if (!syncOk) return;
|
|
54951
|
+
if (typeof cloud.search !== "function") return;
|
|
54952
|
+
intentRemoteInFlight = true;
|
|
54953
|
+
cloud.search({
|
|
54954
|
+
stack: [],
|
|
54955
|
+
domains: [],
|
|
54956
|
+
kinds: ["Pattern", "Technique", "AntiPattern", "Problem", "Solution"],
|
|
54957
|
+
q: liveIntent,
|
|
54958
|
+
channel: "intent",
|
|
54959
|
+
limit: 6
|
|
54960
|
+
}).then((res) => {
|
|
54961
|
+
intentRemote = {
|
|
54962
|
+
forIntent: liveIntent,
|
|
54963
|
+
hits: res.nodes ?? [],
|
|
54964
|
+
...res.voidSignal ? { voidSignal: res.voidSignal } : {}
|
|
54965
|
+
};
|
|
54966
|
+
contextDirty = true;
|
|
54967
|
+
}).catch(() => {
|
|
54968
|
+
}).finally(() => {
|
|
54969
|
+
intentRemoteInFlight = false;
|
|
54970
|
+
});
|
|
54971
|
+
};
|
|
54904
54972
|
const runNightly = async () => {
|
|
54905
54973
|
if (passWorker) {
|
|
54906
54974
|
try {
|