tldr-experts 0.3.1 → 0.4.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/CHANGELOG.md +963 -0
- package/README.md +73 -5
- package/dist/hooks/answer-capture.js +8 -8
- package/dist/hooks/budget-gate.js +78 -14
- package/dist/hooks/{chunk-zdxgragg.js → chunk-4cp363kv.js} +118 -7
- package/dist/hooks/{chunk-afamdvyn.js → chunk-7y2dq0pj.js} +1 -1
- package/dist/hooks/{chunk-458wgg9j.js → chunk-9zsqxr6y.js} +70 -2
- package/dist/hooks/{chunk-s5qsb4k6.js → chunk-b8kxzna2.js} +1 -1
- package/dist/hooks/{chunk-9kkm6q0t.js → chunk-c6t5nx0r.js} +35 -3
- package/dist/hooks/{chunk-sznsenee.js → chunk-m3mewgnw.js} +36 -17
- package/dist/hooks/{chunk-0z27twdk.js → chunk-phmdk72a.js} +10 -5
- package/dist/hooks/{chunk-3t91gvpp.js → chunk-rpcxsqh3.js} +8 -2
- package/dist/hooks/{chunk-ybacnpxd.js → chunk-rz541e2b.js} +3 -0
- package/dist/hooks/{chunk-xpxe94qe.js → chunk-s1c5h7yx.js} +54 -25
- package/dist/hooks/{chunk-ztczwtj0.js → chunk-sq44k6g2.js} +152 -14
- package/dist/hooks/{chunk-ytvmc5ns.js → chunk-t1ywrfr4.js} +19 -23
- package/dist/hooks/{chunk-3g61yg59.js → chunk-tzzwddct.js} +1 -1
- package/dist/hooks/claim-sources.js +28 -20
- package/dist/hooks/dod-gate.js +5 -5
- package/dist/hooks/no-reask.js +8 -8
- package/dist/hooks/session-start.js +12 -12
- package/dist/hooks/statusline.js +9 -9
- package/dist/tldrx.js +10962 -6172
- package/package.json +3 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/stages/build/stage.yml +2 -1
- package/stages/plan/stage.md +11 -0
- package/templates/epic.md +5 -3
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
emitFactsYaml,
|
|
3
3
|
withWorkspaceLock,
|
|
4
|
-
workspaceRootOfFactsPath
|
|
5
|
-
|
|
4
|
+
workspaceRootOfFactsPath,
|
|
5
|
+
writeAtomic
|
|
6
|
+
} from "./chunk-c6t5nx0r.js";
|
|
6
7
|
import {
|
|
7
8
|
FACT_CONFIDENCES,
|
|
8
9
|
FACT_KINDS,
|
|
@@ -10,9 +11,10 @@ import {
|
|
|
10
11
|
MAX_FACT_CHARS,
|
|
11
12
|
factNumber,
|
|
12
13
|
formatFactId,
|
|
14
|
+
isLive,
|
|
13
15
|
isRetired,
|
|
14
16
|
noteDeprecations
|
|
15
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-rpcxsqh3.js";
|
|
16
18
|
import {
|
|
17
19
|
asDocument,
|
|
18
20
|
isRecord,
|
|
@@ -25,11 +27,10 @@ import {
|
|
|
25
27
|
} from "./chunk-39zh2e44.js";
|
|
26
28
|
import {
|
|
27
29
|
parseYaml
|
|
28
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-sq44k6g2.js";
|
|
29
31
|
|
|
30
32
|
// src/core/facts/FactsStore.ts
|
|
31
|
-
import { existsSync,
|
|
32
|
-
import { dirname } from "node:path";
|
|
33
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
33
34
|
|
|
34
35
|
// src/core/facts/validateFactsFile.ts
|
|
35
36
|
var ID_RE = /^F\d{3,6}$/;
|
|
@@ -153,7 +154,7 @@ function findDuplicate(question, area, facts, threshold = DEFAULT_JACCARD_THRESH
|
|
|
153
154
|
for (const fact of facts) {
|
|
154
155
|
if (fact.area !== area)
|
|
155
156
|
continue;
|
|
156
|
-
if (
|
|
157
|
+
if (!isLive(fact))
|
|
157
158
|
continue;
|
|
158
159
|
const score = jaccard(asked, tokenize(fact.fact));
|
|
159
160
|
if (score < threshold)
|
|
@@ -199,7 +200,7 @@ class FactsStore {
|
|
|
199
200
|
return this.rows;
|
|
200
201
|
}
|
|
201
202
|
get active() {
|
|
202
|
-
return this.rows.filter(
|
|
203
|
+
return this.rows.filter(isLive);
|
|
203
204
|
}
|
|
204
205
|
get(id) {
|
|
205
206
|
return this.rows.find((f) => f.id === id);
|
|
@@ -226,6 +227,15 @@ class FactsStore {
|
|
|
226
227
|
this.rows.push(fact);
|
|
227
228
|
return fact;
|
|
228
229
|
}
|
|
230
|
+
headOf(id) {
|
|
231
|
+
let fact = this.get(id);
|
|
232
|
+
for (let step = 0;fact !== undefined && fact.superseded_by !== null; step++) {
|
|
233
|
+
if (step >= this.rows.length)
|
|
234
|
+
return;
|
|
235
|
+
fact = this.get(fact.superseded_by);
|
|
236
|
+
}
|
|
237
|
+
return fact;
|
|
238
|
+
}
|
|
229
239
|
supersede(oldId, input) {
|
|
230
240
|
const index = this.rows.findIndex((f) => f.id === oldId);
|
|
231
241
|
if (index === -1)
|
|
@@ -269,7 +279,7 @@ class FactsStore {
|
|
|
269
279
|
throw new Error(`refusing to write an invalid facts.yml: ${first?.path ?? ""} ${first?.message ?? ""}`);
|
|
270
280
|
}
|
|
271
281
|
withWorkspaceLock(workspaceRootOfFactsPath(path), () => {
|
|
272
|
-
|
|
282
|
+
writeAtomic(path, text);
|
|
273
283
|
});
|
|
274
284
|
}
|
|
275
285
|
static update(path, fn) {
|
|
@@ -281,19 +291,5 @@ class FactsStore {
|
|
|
281
291
|
});
|
|
282
292
|
}
|
|
283
293
|
}
|
|
284
|
-
function writeFactsAtomic(path, text) {
|
|
285
|
-
const temp = `${path}.tmp-${String(process.pid)}`;
|
|
286
|
-
mkdirSync(dirname(path), { recursive: true });
|
|
287
|
-
try {
|
|
288
|
-
writeFileSync(temp, text, "utf8");
|
|
289
|
-
renameSync(temp, path);
|
|
290
|
-
} catch (error) {
|
|
291
|
-
try {
|
|
292
|
-
if (existsSync(temp))
|
|
293
|
-
rmSync(temp, { force: true });
|
|
294
|
-
} catch {}
|
|
295
|
-
throw error;
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
294
|
|
|
299
295
|
export { FactsStore };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
wouldBeContent
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7y2dq0pj.js";
|
|
5
5
|
import {
|
|
6
6
|
claimSourcesDeny,
|
|
7
7
|
claimSourcesEmptySectionDeny,
|
|
@@ -16,18 +16,19 @@ import {
|
|
|
16
16
|
postContext,
|
|
17
17
|
readPayload,
|
|
18
18
|
runHook
|
|
19
|
-
} from "./chunk-
|
|
20
|
-
import"./chunk-
|
|
19
|
+
} from "./chunk-tzzwddct.js";
|
|
20
|
+
import"./chunk-b8kxzna2.js";
|
|
21
21
|
import {
|
|
22
22
|
isHandoff,
|
|
23
|
+
validateCitations,
|
|
23
24
|
validateHandoff
|
|
24
|
-
} from "./chunk-
|
|
25
|
-
import"./chunk-
|
|
25
|
+
} from "./chunk-9zsqxr6y.js";
|
|
26
|
+
import"./chunk-m3mewgnw.js";
|
|
26
27
|
import {
|
|
27
28
|
loadWorkspace,
|
|
28
29
|
locateWork,
|
|
29
30
|
toSrcContext
|
|
30
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-sq44k6g2.js";
|
|
31
32
|
|
|
32
33
|
// src/hooks/claim-sources.ts
|
|
33
34
|
await runHook("claim-sources", async () => {
|
|
@@ -43,24 +44,31 @@ await runHook("claim-sources", async () => {
|
|
|
43
44
|
const wouldBe = wouldBeContent(payload, filePath);
|
|
44
45
|
if (wouldBe.kind !== "content")
|
|
45
46
|
return;
|
|
46
|
-
const looksLikeHandoff = filePath.endsWith("handoff.md") || isHandoff(wouldBe.text);
|
|
47
|
-
if (!looksLikeHandoff)
|
|
48
|
-
return;
|
|
49
47
|
const workspace = loadWorkspace(location.root);
|
|
50
|
-
const
|
|
51
|
-
if (report.ok)
|
|
52
|
-
return;
|
|
48
|
+
const srcCtx = toSrcContext(workspace, location.runDir);
|
|
53
49
|
const relPath = `tldrx-work/${location.run}/${location.relative}`;
|
|
54
50
|
const parts = [];
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
51
|
+
const looksLikeHandoff = filePath.endsWith("handoff.md") || isHandoff(wouldBe.text);
|
|
52
|
+
if (looksLikeHandoff) {
|
|
53
|
+
const report = validateHandoff(wouldBe.text, srcCtx);
|
|
54
|
+
if (report.ok)
|
|
55
|
+
return;
|
|
56
|
+
if (report.unsourced.length > 0)
|
|
57
|
+
parts.push(claimSourcesDeny(relPath, report.unsourced));
|
|
58
|
+
if (report.malformed.length > 0)
|
|
59
|
+
parts.push(claimSourcesMalformedDeny(relPath, report.malformed));
|
|
60
|
+
if (report.emptySections.length > 0) {
|
|
61
|
+
parts.push(claimSourcesEmptySectionDeny(relPath, [...report.emptySections]));
|
|
62
|
+
}
|
|
63
|
+
if (report.unresolved.length > 0)
|
|
64
|
+
parts.push(claimSourcesUnresolvedDeny(relPath, report.unresolved));
|
|
65
|
+
} else {
|
|
66
|
+
const report = validateCitations(wouldBe.text, srcCtx);
|
|
67
|
+
if (report.malformed.length > 0)
|
|
68
|
+
parts.push(claimSourcesMalformedDeny(relPath, report.malformed));
|
|
69
|
+
if (report.unresolved.length > 0)
|
|
70
|
+
parts.push(claimSourcesUnresolvedDeny(relPath, report.unresolved));
|
|
61
71
|
}
|
|
62
|
-
if (report.unresolved.length > 0)
|
|
63
|
-
parts.push(claimSourcesUnresolvedDeny(relPath, report.unresolved));
|
|
64
72
|
if (parts.length === 0)
|
|
65
73
|
return;
|
|
66
74
|
const message = parts.join(`
|
package/dist/hooks/dod-gate.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
wouldBeContent
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7y2dq0pj.js";
|
|
5
5
|
import {
|
|
6
6
|
dodGateDeny,
|
|
7
7
|
dodGateInternalErrorDeny,
|
|
@@ -15,18 +15,18 @@ import {
|
|
|
15
15
|
filePathOf,
|
|
16
16
|
isWriteOrEdit,
|
|
17
17
|
readPayload
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
import"./chunk-
|
|
18
|
+
} from "./chunk-tzzwddct.js";
|
|
19
|
+
import"./chunk-b8kxzna2.js";
|
|
20
20
|
import {
|
|
21
21
|
parseDodBlock
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-phmdk72a.js";
|
|
23
23
|
import"./chunk-39zh2e44.js";
|
|
24
24
|
import {
|
|
25
25
|
loadWorkspace,
|
|
26
26
|
locateWork,
|
|
27
27
|
repoPath,
|
|
28
28
|
runtime
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-sq44k6g2.js";
|
|
30
30
|
|
|
31
31
|
// src/hooks/dod-gate.ts
|
|
32
32
|
import { basename, join } from "node:path";
|
package/dist/hooks/no-reask.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
wouldBeContent
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7y2dq0pj.js";
|
|
5
5
|
import {
|
|
6
6
|
noReAskDeny
|
|
7
7
|
} from "./chunk-9gb21660.js";
|
|
8
8
|
import {
|
|
9
9
|
FactsStore
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-t1ywrfr4.js";
|
|
11
11
|
import {
|
|
12
12
|
allow,
|
|
13
13
|
deny,
|
|
@@ -15,19 +15,19 @@ import {
|
|
|
15
15
|
isWriteOrEdit,
|
|
16
16
|
readPayload,
|
|
17
17
|
runHook
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
import"./chunk-
|
|
20
|
-
import"./chunk-
|
|
18
|
+
} from "./chunk-tzzwddct.js";
|
|
19
|
+
import"./chunk-b8kxzna2.js";
|
|
20
|
+
import"./chunk-c6t5nx0r.js";
|
|
21
21
|
import {
|
|
22
22
|
openBlocks,
|
|
23
23
|
parseQuestions
|
|
24
|
-
} from "./chunk-
|
|
25
|
-
import"./chunk-
|
|
24
|
+
} from "./chunk-rpcxsqh3.js";
|
|
25
|
+
import"./chunk-m3mewgnw.js";
|
|
26
26
|
import"./chunk-39zh2e44.js";
|
|
27
27
|
import {
|
|
28
28
|
factsPath,
|
|
29
29
|
locateWork
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-sq44k6g2.js";
|
|
31
31
|
|
|
32
32
|
// src/hooks/no-reask.ts
|
|
33
33
|
import { existsSync, readFileSync } from "node:fs";
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-t1ywrfr4.js";
|
|
3
3
|
import {
|
|
4
4
|
allow,
|
|
5
5
|
readPayload,
|
|
6
6
|
runHook,
|
|
7
7
|
sessionContext
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import"./chunk-
|
|
8
|
+
} from "./chunk-tzzwddct.js";
|
|
9
|
+
import"./chunk-b8kxzna2.js";
|
|
10
10
|
import {
|
|
11
11
|
RunStore,
|
|
12
12
|
isMovable,
|
|
13
13
|
openQuestions,
|
|
14
14
|
runSnapshot,
|
|
15
15
|
whatIsWaiting
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-s1c5h7yx.js";
|
|
17
17
|
import {
|
|
18
18
|
evidencePath,
|
|
19
19
|
expertsDir,
|
|
@@ -24,16 +24,16 @@ import {
|
|
|
24
24
|
pathsIntersect,
|
|
25
25
|
readExpertDomain,
|
|
26
26
|
stackExpertNames
|
|
27
|
-
} from "./chunk-
|
|
28
|
-
import"./chunk-
|
|
29
|
-
import"./chunk-
|
|
30
|
-
import"./chunk-
|
|
31
|
-
import"./chunk-
|
|
27
|
+
} from "./chunk-4cp363kv.js";
|
|
28
|
+
import"./chunk-rz541e2b.js";
|
|
29
|
+
import"./chunk-9zsqxr6y.js";
|
|
30
|
+
import"./chunk-phmdk72a.js";
|
|
31
|
+
import"./chunk-c6t5nx0r.js";
|
|
32
32
|
import {
|
|
33
33
|
openBlocks,
|
|
34
34
|
parseQuestions
|
|
35
|
-
} from "./chunk-
|
|
36
|
-
import"./chunk-
|
|
35
|
+
} from "./chunk-rpcxsqh3.js";
|
|
36
|
+
import"./chunk-m3mewgnw.js";
|
|
37
37
|
import {
|
|
38
38
|
isRecord
|
|
39
39
|
} from "./chunk-39zh2e44.js";
|
|
@@ -45,7 +45,7 @@ import {
|
|
|
45
45
|
findWorkspaceRoot,
|
|
46
46
|
listRunDirs,
|
|
47
47
|
parseYaml
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-sq44k6g2.js";
|
|
49
49
|
|
|
50
50
|
// src/core/status/PendingItem.ts
|
|
51
51
|
function isPending(item) {
|
package/dist/hooks/statusline.js
CHANGED
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
import {
|
|
3
3
|
bar,
|
|
4
4
|
runSnapshot
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import"./chunk-
|
|
7
|
-
import"./chunk-
|
|
8
|
-
import"./chunk-
|
|
9
|
-
import"./chunk-
|
|
10
|
-
import"./chunk-
|
|
11
|
-
import"./chunk-
|
|
12
|
-
import"./chunk-
|
|
5
|
+
} from "./chunk-s1c5h7yx.js";
|
|
6
|
+
import"./chunk-4cp363kv.js";
|
|
7
|
+
import"./chunk-rz541e2b.js";
|
|
8
|
+
import"./chunk-9zsqxr6y.js";
|
|
9
|
+
import"./chunk-phmdk72a.js";
|
|
10
|
+
import"./chunk-c6t5nx0r.js";
|
|
11
|
+
import"./chunk-rpcxsqh3.js";
|
|
12
|
+
import"./chunk-m3mewgnw.js";
|
|
13
13
|
import"./chunk-39zh2e44.js";
|
|
14
14
|
import {
|
|
15
15
|
findWorkspaceRoot,
|
|
16
16
|
runtime
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-sq44k6g2.js";
|
|
18
18
|
|
|
19
19
|
// src/core/statusline/renderStatusLine.ts
|
|
20
20
|
var NO_SESSION_DATA = "[tldrx] no session data";
|