@codyswann/lisa 4.108.2 → 4.109.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/all/copy-overwrite/scripts/lib/usage-ledger.mjs +120 -2
- package/all/copy-overwrite/scripts/npm-updater-helper-graph.json +1 -1
- package/dist/cli/gate-commands.d.ts +11 -10
- package/dist/cli/gate-commands.d.ts.map +1 -1
- package/dist/cli/gate-commands.js +23 -0
- package/dist/cli/gate-commands.js.map +1 -1
- package/dist/cli/learnings-retire-cmd.d.ts +26 -0
- package/dist/cli/learnings-retire-cmd.d.ts.map +1 -0
- package/dist/cli/learnings-retire-cmd.js +64 -0
- package/dist/cli/learnings-retire-cmd.js.map +1 -0
- package/dist/core/learnings-document.d.ts +35 -2
- package/dist/core/learnings-document.d.ts.map +1 -1
- package/dist/core/learnings-document.js +89 -17
- package/dist/core/learnings-document.js.map +1 -1
- package/dist/core/learnings-file-safety.d.ts +5 -2
- package/dist/core/learnings-file-safety.d.ts.map +1 -1
- package/dist/core/learnings-file-safety.js +34 -13
- package/dist/core/learnings-file-safety.js.map +1 -1
- package/dist/core/learnings-retire.d.ts +7 -0
- package/dist/core/learnings-retire.d.ts.map +1 -1
- package/dist/core/learnings-retire.js +41 -9
- package/dist/core/learnings-retire.js.map +1 -1
- package/dist/core/learnings-writer.d.ts.map +1 -1
- package/dist/core/learnings-writer.js +117 -17
- package/dist/core/learnings-writer.js.map +1 -1
- package/dist/core/lisa-owned-hash-ledger.d.ts.map +1 -1
- package/dist/core/lisa-owned-hash-ledger.js +6 -0
- package/dist/core/lisa-owned-hash-ledger.js.map +1 -1
- package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
- package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
- package/dist/core/upstream-evidence-manifest.js +15 -3
- package/dist/core/upstream-evidence-manifest.js.map +1 -1
- package/package.json +4 -4
- package/plugins/lisa/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/skills/lisa-learnings-audit/SKILL.md +4 -0
- package/plugins/lisa/skills/lisa-learnings-audit/SKILL.md +4 -0
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-agy/skills/lisa-learnings-audit/SKILL.md +4 -0
- package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-agy/plugin.json +1 -1
- package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/skills/lisa-learnings-audit/SKILL.md +4 -0
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/skills/lisa-learnings-audit/SKILL.md +4 -0
- package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/skills/lisa-learnings-audit/SKILL.md +4 -0
- package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-agy/plugin.json +1 -1
- package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-agy/plugin.json +1 -1
- package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-agy/plugin.json +1 -1
- package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-agy/plugin.json +1 -1
- package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-agy/plugin.json +1 -1
- package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-agy/plugin.json +1 -1
- package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-agy/plugin.json +1 -1
- package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/src/base/skills/lisa-learnings-audit/SKILL.md +4 -0
|
@@ -98,11 +98,129 @@ function findUsageSectionRange(document) {
|
|
|
98
98
|
}
|
|
99
99
|
const afterHeading = start + heading.length;
|
|
100
100
|
const nextHeadingOffset = document.slice(afterHeading).search(/^##\s+/m);
|
|
101
|
-
const
|
|
101
|
+
const windowEnd =
|
|
102
102
|
nextHeadingOffset === -1
|
|
103
103
|
? document.length
|
|
104
104
|
: afterHeading + nextHeadingOffset;
|
|
105
|
-
|
|
105
|
+
const window = document.slice(afterHeading, windowEnd);
|
|
106
|
+
return { start, end: afterHeading + findManagedBlockLength(window) };
|
|
107
|
+
}
|
|
108
|
+
const ROLLUP_LINE_START_PATTERN = /^[ \t]*<!-- lisa:usage-rollup\s/m;
|
|
109
|
+
const MANAGED_NOTE_PREFIX = "_This section is managed by Lisa";
|
|
110
|
+
/**
|
|
111
|
+
* Measure how much of the heading-bounded window Lisa's rendered block owns.
|
|
112
|
+
*
|
|
113
|
+
* The next `##` heading alone is not the block's end: anything a host or a
|
|
114
|
+
* person appended after the block without a heading (an Evidence `<details>`
|
|
115
|
+
* block, a paragraph) would otherwise be owned by the section and deleted on
|
|
116
|
+
* every upsert (#4697). Lisa always renders the rollup token last, on a line of
|
|
117
|
+
* its own, so a window holding a line that starts with one ends at that line (a
|
|
118
|
+
* rollup token quoted inline in prose is not a line start and is ignored). No
|
|
119
|
+
* writer emits tokens after the rollup, but the block is extended through any
|
|
120
|
+
* `lisa:usage` token lines (and blank lines) that follow it so a hand-edited or
|
|
121
|
+
* externally repaired section keeps those tokens parsed. Table rows after the
|
|
122
|
+
* rollup are never absorbed, so a person's own table survives. A legacy or
|
|
123
|
+
* damaged section with no rollup token ends after its last usage-token line
|
|
124
|
+
* (see {@link findLastTokenLineEnd}). Neither reading needs a stored-document
|
|
125
|
+
* migration.
|
|
126
|
+
*
|
|
127
|
+
* @param window Text between the `## Lisa Usage` heading line and the next
|
|
128
|
+
* `##` heading (or the end of the document).
|
|
129
|
+
* @returns The managed block's length in characters from the window start.
|
|
130
|
+
*/
|
|
131
|
+
function findManagedBlockLength(window) {
|
|
132
|
+
const rollup = ROLLUP_LINE_START_PATTERN.exec(window);
|
|
133
|
+
if (rollup === null) {
|
|
134
|
+
return (
|
|
135
|
+
findLastTokenLineEnd(window) ??
|
|
136
|
+
measureLineRun(window, 0, isManagedShapedLine)
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
const lineEnd = window.indexOf("\n", rollup.index);
|
|
140
|
+
if (lineEnd === -1) {
|
|
141
|
+
return window.length;
|
|
142
|
+
}
|
|
143
|
+
return measureLineRun(window, lineEnd + 1, isUsageTokenOrBlankLine);
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Measure the contiguous run of lines, starting at a line boundary, that all
|
|
147
|
+
* satisfy a predicate.
|
|
148
|
+
*
|
|
149
|
+
* @param window Heading-bounded section window.
|
|
150
|
+
* @param from Offset of the first line to test; must start a line.
|
|
151
|
+
* @param belongs Predicate deciding whether a line is part of the block.
|
|
152
|
+
* @returns The offset just past the run (the window length when it reaches
|
|
153
|
+
* the end of the window).
|
|
154
|
+
*/
|
|
155
|
+
function measureLineRun(window, from, belongs) {
|
|
156
|
+
const lines = window.slice(from).split("\n");
|
|
157
|
+
const firstForeign = lines.findIndex(line => !belongs(line));
|
|
158
|
+
if (firstForeign === -1) {
|
|
159
|
+
return window.length;
|
|
160
|
+
}
|
|
161
|
+
return lines
|
|
162
|
+
.slice(0, firstForeign)
|
|
163
|
+
.reduce((offset, line) => offset + line.length + 1, from);
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Find the end of the last line in a rollup-less window that carries a usage
|
|
167
|
+
* token. Legacy layouts put free-form lines (a `### Direct Usage` sub-heading,
|
|
168
|
+
* an older managed note) between the heading and their tokens, so a run of
|
|
169
|
+
* managed-shaped lines would stop before the tokens and drop their entries;
|
|
170
|
+
* the last token line is the one boundary every such layout shares.
|
|
171
|
+
*
|
|
172
|
+
* @param window Heading-bounded section window without a rollup token.
|
|
173
|
+
* @returns The offset just past the last token line, or null when the window
|
|
174
|
+
* has no token line at all.
|
|
175
|
+
*/
|
|
176
|
+
function findLastTokenLineEnd(window) {
|
|
177
|
+
const lines = window.split("\n");
|
|
178
|
+
const lastTokenLine = lines.findLastIndex(isTokenCarryingLine);
|
|
179
|
+
if (lastTokenLine === -1) {
|
|
180
|
+
return null;
|
|
181
|
+
}
|
|
182
|
+
const end = lines
|
|
183
|
+
.slice(0, lastTokenLine + 1)
|
|
184
|
+
.reduce((offset, line) => offset + line.length + 1, 0);
|
|
185
|
+
return Math.min(end, window.length);
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Decide whether a line carries a usage token: a token line of its own, or a
|
|
189
|
+
* legacy table row with an entry token trailing its cells.
|
|
190
|
+
*
|
|
191
|
+
* @param line One line of the section window, without its newline.
|
|
192
|
+
* @returns True for usage-token lines and token-carrying table rows.
|
|
193
|
+
*/
|
|
194
|
+
function isTokenCarryingLine(line) {
|
|
195
|
+
const trimmed = line.trim();
|
|
196
|
+
return (
|
|
197
|
+
trimmed.startsWith("<!-- lisa:usage") ||
|
|
198
|
+
(trimmed.startsWith("|") && trimmed.includes("<!-- lisa:usage-entry"))
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Decide whether a line is blank or carries a `lisa:usage` token.
|
|
203
|
+
*
|
|
204
|
+
* @param line One line of the section window, without its newline.
|
|
205
|
+
* @returns True for blank and usage-token lines.
|
|
206
|
+
*/
|
|
207
|
+
function isUsageTokenOrBlankLine(line) {
|
|
208
|
+
const trimmed = line.trim();
|
|
209
|
+
return trimmed.length === 0 || trimmed.startsWith("<!-- lisa:usage");
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Decide whether a line could have been written by Lisa's section renderer.
|
|
213
|
+
*
|
|
214
|
+
* @param line One line of the section window, without its newline.
|
|
215
|
+
* @returns True for blank, table-row, usage-token, and managed-note lines.
|
|
216
|
+
*/
|
|
217
|
+
function isManagedShapedLine(line) {
|
|
218
|
+
const trimmed = line.trim();
|
|
219
|
+
return (
|
|
220
|
+
isUsageTokenOrBlankLine(line) ||
|
|
221
|
+
trimmed.startsWith("|") ||
|
|
222
|
+
trimmed.startsWith(MANAGED_NOTE_PREFIX)
|
|
223
|
+
);
|
|
106
224
|
}
|
|
107
225
|
/**
|
|
108
226
|
* Parse the managed rollup and its optional token-completeness extension.
|
|
@@ -1260,7 +1260,7 @@
|
|
|
1260
1260
|
"children": []
|
|
1261
1261
|
},
|
|
1262
1262
|
"lib/usage-ledger.mjs": {
|
|
1263
|
-
"sha256": "
|
|
1263
|
+
"sha256": "fce4aebf272d4170083abf492781f20f6d726f5352d7dd9823714c1e1f2ccaf6",
|
|
1264
1264
|
"staticImports": [
|
|
1265
1265
|
"lib/usage-effectiveness.mjs"
|
|
1266
1266
|
],
|
|
@@ -5,15 +5,16 @@ import type { FileUpstreamOptions } from "./file-upstream-cmd.js";
|
|
|
5
5
|
* Gate runners kept structural to avoid importing the whole CLI dependency
|
|
6
6
|
* record.
|
|
7
7
|
*
|
|
8
|
-
* `merge-learnings`, `install-merge-driver`,
|
|
9
|
-
* deliberately NOT members. They are invoked by git, by
|
|
10
|
-
* repository, or by the gardener draining its buffer
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
8
|
+
* `merge-learnings`, `install-merge-driver`, `learnings-overflow`, and
|
|
9
|
+
* `learnings-retire` are deliberately NOT members. They are invoked by git, by
|
|
10
|
+
* an operator repairing a repository, or by the gardener draining its buffer
|
|
11
|
+
* or retiring a ledger entry — never substituted by the root CLI — and all
|
|
12
|
+
* four mutate real state: the merge driver overwrites the file git hands it,
|
|
13
|
+
* the installer writes local git config, the drain removes entries from the
|
|
14
|
+
* only durable copy of a dropped capture, and the retire removes a ledger
|
|
15
|
+
* entry. An optional, defaulted field would be the worst shape here: a caller
|
|
16
|
+
* that believed it had stubbed every gate command would silently run the real
|
|
17
|
+
* driver against real files. Leaving them off the record makes non-injectability
|
|
17
18
|
* explicit; they are covered directly by unit tests and by end-to-end tests
|
|
18
19
|
* that drive real `git merge`.
|
|
19
20
|
*/
|
|
@@ -30,7 +31,7 @@ export interface GateCommandDependencies {
|
|
|
30
31
|
* ledger, so a network update check would stall the merge and pollute the
|
|
31
32
|
* driver's output.
|
|
32
33
|
*/
|
|
33
|
-
export declare const GATE_COMMAND_NAMES: readonly ["check-learnings-budget", "file-upstream", "learnings-overflow", "merge-learnings", "install-merge-driver"];
|
|
34
|
+
export declare const GATE_COMMAND_NAMES: readonly ["check-learnings-budget", "file-upstream", "learnings-overflow", "learnings-retire", "merge-learnings", "install-merge-driver"];
|
|
34
35
|
/**
|
|
35
36
|
* Register all non-project gate commands.
|
|
36
37
|
* @param program - Commander program
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gate-commands.d.ts","sourceRoot":"","sources":["../../src/cli/gate-commands.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"gate-commands.d.ts","sourceRoot":"","sources":["../../src/cli/gate-commands.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAelE;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,uBAAuB;IACtC,uBAAuB,EAAE,CACvB,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,KACtC,OAAO,CAAC,MAAM,CAAC,CAAC;IACrB,eAAe,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CACpE;AAED;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,2IAOrB,CAAC;AAyJX;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,uBAAuB,GACpC,IAAI,CAON"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { runInstallMergeDriver } from "./install-merge-driver-cmd.js";
|
|
2
2
|
import { runLearningsOverflow, } from "./learnings-overflow-cmd.js";
|
|
3
|
+
import { runLearningsRetire, } from "./learnings-retire-cmd.js";
|
|
3
4
|
import { runMergeLearnings, } from "./merge-learnings-cmd.js";
|
|
4
5
|
/**
|
|
5
6
|
* Gate commands skip the root npm update check.
|
|
@@ -12,6 +13,7 @@ export const GATE_COMMAND_NAMES = [
|
|
|
12
13
|
"check-learnings-budget",
|
|
13
14
|
"file-upstream",
|
|
14
15
|
"learnings-overflow",
|
|
16
|
+
"learnings-retire",
|
|
15
17
|
"merge-learnings",
|
|
16
18
|
"install-merge-driver",
|
|
17
19
|
];
|
|
@@ -68,6 +70,26 @@ function addLearningsOverflowCommand(program) {
|
|
|
68
70
|
process.exitCode = code;
|
|
69
71
|
});
|
|
70
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* Register the fingerprint-guarded ledger retire the gardener uses.
|
|
75
|
+
*
|
|
76
|
+
* Not injectable, for the same reason as the overflow drain: it removes a
|
|
77
|
+
* ledger entry, so a caller must never be able to stub it away.
|
|
78
|
+
* @param program - Commander program
|
|
79
|
+
*/
|
|
80
|
+
function addLearningsRetireCommand(program) {
|
|
81
|
+
program
|
|
82
|
+
.command("learnings-retire")
|
|
83
|
+
.description("Remove one fingerprint-stamped entry from the learnings ledger (JSON output)")
|
|
84
|
+
.requiredOption("--id <id>", "Stable id of the entry to retire")
|
|
85
|
+
.requiredOption("--fingerprint <fingerprint>", "Fingerprint observed at that id; a mismatch refuses and writes nothing")
|
|
86
|
+
.requiredOption("--reason <text>", "Why the entry is retired (echoed into the JSON proof record)")
|
|
87
|
+
.action(async (options) => {
|
|
88
|
+
const code = await runLearningsRetire(options);
|
|
89
|
+
if (code !== 0)
|
|
90
|
+
process.exitCode = code;
|
|
91
|
+
});
|
|
92
|
+
}
|
|
71
93
|
/**
|
|
72
94
|
* Register the project-learnings union merge driver.
|
|
73
95
|
*
|
|
@@ -114,6 +136,7 @@ export function addGateCommands(program, dependencies) {
|
|
|
114
136
|
addCheckLearningsBudgetCommand(program, dependencies);
|
|
115
137
|
addFileUpstreamCommand(program, dependencies);
|
|
116
138
|
addLearningsOverflowCommand(program);
|
|
139
|
+
addLearningsRetireCommand(program);
|
|
117
140
|
addMergeLearningsCommand(program);
|
|
118
141
|
addInstallMergeDriverCommand(program);
|
|
119
142
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gate-commands.js","sourceRoot":"","sources":["../../src/cli/gate-commands.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EACL,oBAAoB,GAErB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,iBAAiB,GAElB,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"gate-commands.js","sourceRoot":"","sources":["../../src/cli/gate-commands.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EACL,oBAAoB,GAErB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,kBAAkB,GAEnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,iBAAiB,GAElB,MAAM,0BAA0B,CAAC;AA2BlC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,wBAAwB;IACxB,eAAe;IACf,oBAAoB;IACpB,kBAAkB;IAClB,iBAAiB;IACjB,sBAAsB;CACd,CAAC;AAEX;;;;GAIG;AACH,SAAS,8BAA8B,CACrC,OAAgB,EAChB,YAAqC;IAErC,OAAO;SACJ,OAAO,CAAC,wBAAwB,CAAC;SACjC,WAAW,CACV,kFAAkF,CACnF;SACA,QAAQ,CACP,QAAQ,EACR,oEAAoE,CACrE;SACA,MAAM,CACL,YAAY,EACZ,+EAA+E,CAChF;SACA,MAAM,CACL,KAAK,EACH,UAA8B,EAC9B,OAAwC,EACxC,EAAE;QACF,MAAM,IAAI,GAAG,MAAM,YAAY,CAAC,uBAAuB,CAAC,UAAU,EAAE;YAClE,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,KAAK;SACpC,CAAC,CAAC;QACH,IAAI,IAAI,KAAK,CAAC;YAAE,OAAO,CAAC,QAAQ,GA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AC,CAAC;IAC9C,2BAA2B,CAAC,OAAO,CAAC,CAAC;IACrC,yBAAyB,CAAC,OAAO,CAAC,CAAC;IACnC,wBAAwB,CAAC,OAAO,CAAC,CAAC;IAClC,4BAA4B,CAAC,OAAO,CAAC,CAAC;AACxC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** Command-line options for {@link runLearningsRetire}. */
|
|
2
|
+
export interface LearningsRetireOptions {
|
|
3
|
+
/** Stable id of the entry to retire. */
|
|
4
|
+
readonly id: string;
|
|
5
|
+
/** FULL fingerprint the caller observed at that id (never the marker hash). */
|
|
6
|
+
readonly fingerprint: string;
|
|
7
|
+
/** Human-readable proof, echoed into the JSON output only. */
|
|
8
|
+
readonly reason: string;
|
|
9
|
+
}
|
|
10
|
+
/** Injectable collaborators for {@link runLearningsRetire}. */
|
|
11
|
+
export interface LearningsRetireDependencies {
|
|
12
|
+
/** Working directory used to resolve the project config (defaults to cwd). */
|
|
13
|
+
readonly cwd?: string;
|
|
14
|
+
/** Sink for the JSON payload (defaults to stdout). */
|
|
15
|
+
readonly log?: (message: string) => void;
|
|
16
|
+
/** Sink for the failure diagnostic (defaults to stderr). */
|
|
17
|
+
readonly error?: (message: string) => void;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Retire one stamped entry and print the outcome as JSON.
|
|
21
|
+
* @param options - Parsed command-line options
|
|
22
|
+
* @param dependencies - Injectable collaborators for tests
|
|
23
|
+
* @returns Process exit code: 0 only when the entry was retired
|
|
24
|
+
*/
|
|
25
|
+
export declare function runLearningsRetire(options: LearningsRetireOptions, dependencies?: LearningsRetireDependencies): Promise<number>;
|
|
26
|
+
//# sourceMappingURL=learnings-retire-cmd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"learnings-retire-cmd.d.ts","sourceRoot":"","sources":["../../src/cli/learnings-retire-cmd.ts"],"names":[],"mappings":"AAsBA,2DAA2D;AAC3D,MAAM,WAAW,sBAAsB;IACrC,wCAAwC;IACxC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,+EAA+E;IAC/E,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,8DAA8D;IAC9D,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,+DAA+D;AAC/D,MAAM,WAAW,2BAA2B;IAC1C,8EAA8E;IAC9E,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,sDAAsD;IACtD,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,4DAA4D;IAC5D,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAC5C;AAED;;;;;GAKG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,sBAAsB,EAC/B,YAAY,GAAE,2BAAgC,GAC7C,OAAO,CAAC,MAAM,CAAC,CA4BjB"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `lisa learnings-retire` — remove one fingerprint-stamped entry from the
|
|
3
|
+
* project learnings ledger (CodySwannGT/lisa#4536), through the
|
|
4
|
+
* fingerprint-guarded `retireLearningEntry` API (CodySwannGT/lisa#4530).
|
|
5
|
+
*
|
|
6
|
+
* This is the gardener's RETIRE handle. The audit skill is forbidden from
|
|
7
|
+
* hand-parsing or hand-editing any learnings surface, so a RETIRE verdict needs
|
|
8
|
+
* a command that carries the contract's containment checks, cross-process lock,
|
|
9
|
+
* fingerprint guard, and atomic write — exactly as `learnings-overflow` ships
|
|
10
|
+
* the drain. It also works on a ledger that is already over its cap, which is
|
|
11
|
+
* the state a retire most often exists to repair.
|
|
12
|
+
*
|
|
13
|
+
* Output is JSON because the consumer is an agent. Only an applied retire exits
|
|
14
|
+
* 0: a stale fingerprint or an unknown id writes nothing and exits 1, so a
|
|
15
|
+
* script cannot mistake a refused retire for a completed one.
|
|
16
|
+
* @module cli/learnings-retire-cmd
|
|
17
|
+
*/
|
|
18
|
+
import { retireLearningEntry, } from "../core/learnings-retire.js";
|
|
19
|
+
/**
|
|
20
|
+
* Retire one stamped entry and print the outcome as JSON.
|
|
21
|
+
* @param options - Parsed command-line options
|
|
22
|
+
* @param dependencies - Injectable collaborators for tests
|
|
23
|
+
* @returns Process exit code: 0 only when the entry was retired
|
|
24
|
+
*/
|
|
25
|
+
export async function runLearningsRetire(options, dependencies = {}) {
|
|
26
|
+
const cwd = dependencies.cwd ?? process.cwd();
|
|
27
|
+
const log = dependencies.log ?? ((message) => console.log(message));
|
|
28
|
+
const error = dependencies.error ?? ((message) => console.error(message));
|
|
29
|
+
try {
|
|
30
|
+
if (typeof options.reason !== "string" || options.reason.trim() === "") {
|
|
31
|
+
throw new Error("Invalid --reason: expected a non-empty proof string");
|
|
32
|
+
}
|
|
33
|
+
const result = await retireLearningEntry(cwd, options.id, options.fingerprint);
|
|
34
|
+
// The reason is the caller's proof record, not ledger content: it is
|
|
35
|
+
// echoed for the deleting PR to cite and never written anywhere.
|
|
36
|
+
log(JSON.stringify({ ...result, reason: options.reason }, null, 2));
|
|
37
|
+
const refusal = describeRefusal(result);
|
|
38
|
+
if (refusal === undefined) {
|
|
39
|
+
return 0;
|
|
40
|
+
}
|
|
41
|
+
error(`learnings-retire: ${refusal}`);
|
|
42
|
+
return 1;
|
|
43
|
+
}
|
|
44
|
+
catch (caught) {
|
|
45
|
+
const detail = caught instanceof Error ? caught.message : String(caught);
|
|
46
|
+
error(`learnings-retire: ${detail}`);
|
|
47
|
+
return 1;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Explain a no-write outcome in one line, or nothing for an applied retire.
|
|
52
|
+
* @param result - Structured retire outcome
|
|
53
|
+
* @returns Operator-readable refusal, or undefined when the entry was retired
|
|
54
|
+
*/
|
|
55
|
+
function describeRefusal(result) {
|
|
56
|
+
if (result.status === "stale") {
|
|
57
|
+
return `entry '${result.id}' is stale: expected fingerprint ${result.expectedFingerprint} but the ledger holds ${result.actualFingerprint}. Nothing was written; re-read the ledger and retry with the current fingerprint.`;
|
|
58
|
+
}
|
|
59
|
+
if (result.status === "not-found") {
|
|
60
|
+
return `entry '${result.id}' not found in the project learnings ledger. Nothing was written.`;
|
|
61
|
+
}
|
|
62
|
+
return undefined;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=learnings-retire-cmd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"learnings-retire-cmd.js","sourceRoot":"","sources":["../../src/cli/learnings-retire-cmd.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EACL,mBAAmB,GAEpB,MAAM,6BAA6B,CAAC;AAsBrC;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,OAA+B,EAC/B,eAA4C,EAAE;IAE9C,MAAM,GAAG,GAAG,YAAY,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IAC9C,MAAM,GAAG,GAAG,YAAY,CAAC,GAAG,IAAI,CAAC,CAAC,OAAe,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;IAC5E,MAAM,KAAK,GACT,YAAY,CAAC,KAAK,IAAI,CAAC,CAAC,OAAe,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;IACtE,IAAI,CAAC;QACH,IAAI,OAAO,OAAO,CAAC,MAAM,KAAK,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;YACvE,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;QACzE,CAAC;QACD,MAAM,MAAM,GAAG,MAAM,mBAAmB,CACtC,GAAG,EACH,OAAO,CAAC,EAAE,EACV,OAAO,CAAC,WAAW,CACpB,CAAC;QACF,qEAAqE;QACrE,iEAAiE;QACjE,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QACpE,MAAM,OAAO,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;QACxC,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC1B,OAAO,CAAC,CAAC;QACX,CAAC;QACD,KAAK,CAAC,qBAAqB,OAAO,EAAE,CAAC,CAAC;QACtC,OAAO,CAAC,CAAC;IACX,CAAC;IAAC,OAAO,MAAM,EAAE,CAAC;QAChB,MAAM,MAAM,GAAG,MAAM,YAAY,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACzE,KAAK,CAAC,qBAAqB,MAAM,EAAE,CAAC,CAAC;QACrC,OAAO,CAAC,CAAC;IACX,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,SAAS,eAAe,CAAC,MAA4B;IACnD,IAAI,MAAM,CAAC,MAAM,KAAK,OAAO,EAAE,CAAC;QAC9B,OAAO,UAAU,MAAM,CAAC,EAAE,oCAAoC,MAAM,CAAC,mBAAmB,yBAAyB,MAAM,CAAC,iBAAiB,mFAAmF,CAAC;IAC/N,CAAC;IACD,IAAI,MAAM,CAAC,MAAM,KAAK,WAAW,EAAE,CAAC;QAClC,OAAO,UAAU,MAAM,CAAC,EAAE,mEAAmE,CAAC;IAChG,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -22,19 +22,42 @@ export interface ParsedLearningsDocument {
|
|
|
22
22
|
/** Byte ceiling that governed the source version before normalization. */
|
|
23
23
|
readonly sourceMaxTokens: number;
|
|
24
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Hard ceiling for a deliberately tolerant, over-budget ledger read.
|
|
27
|
+
*
|
|
28
|
+
* A ledger that slipped over `maxTokens` (two merges that each fit, racing)
|
|
29
|
+
* must stay openable by the writers that would SHRINK it — otherwise the state
|
|
30
|
+
* they exist to repair locks them out (CodySwannGT/lisa#4536). The tolerance is
|
|
31
|
+
* bounded rather than open-ended: four times the cap is far past any real race
|
|
32
|
+
* yet still keeps a hostile or runaway file from being loaded wholesale.
|
|
33
|
+
*/
|
|
34
|
+
export declare const LEARNINGS_OVER_BUDGET_READ_CEILING: number;
|
|
35
|
+
/** Read policy shared by the ledger reader and parser. */
|
|
36
|
+
export interface LearningsReadOptions {
|
|
37
|
+
/**
|
|
38
|
+
* Accept a document above `maxTokens` (up to
|
|
39
|
+
* {@link LEARNINGS_OVER_BUDGET_READ_CEILING}) and skip the document budget.
|
|
40
|
+
* Only shrink-only writers — retire, and supersede on an over-cap ledger —
|
|
41
|
+
* pass this; conflict markers, format, entry schema, and identity uniqueness
|
|
42
|
+
* are still enforced.
|
|
43
|
+
*/
|
|
44
|
+
readonly allowOverBudget?: boolean;
|
|
45
|
+
}
|
|
25
46
|
/**
|
|
26
47
|
* Parse and revalidate an existing file before it participates in a write.
|
|
27
48
|
* @param content - Existing learnings document
|
|
49
|
+
* @param options - Read policy; defaults to the strict in-budget read
|
|
28
50
|
* @returns Revalidated entries from the document
|
|
29
51
|
*/
|
|
30
|
-
export declare function parseLearningsFile(content: string): LearningEntry[];
|
|
52
|
+
export declare function parseLearningsFile(content: string, options?: LearningsReadOptions): LearningEntry[];
|
|
31
53
|
/**
|
|
32
54
|
* Parse a v1 or v2 document while retaining the source-version facts writers
|
|
33
55
|
* need to migrate only when they already have a reason to mutate.
|
|
34
56
|
* @param content - Existing learnings document
|
|
57
|
+
* @param options - Read policy; defaults to the strict in-budget read
|
|
35
58
|
* @returns Normalized entries plus source-version and canonicality metadata
|
|
36
59
|
*/
|
|
37
|
-
export declare function parseLearningsDocument(content: string): ParsedLearningsDocument;
|
|
60
|
+
export declare function parseLearningsDocument(content: string, options?: LearningsReadOptions): ParsedLearningsDocument;
|
|
38
61
|
/**
|
|
39
62
|
* A document that does not fit the hard entry-count or token budget.
|
|
40
63
|
*
|
|
@@ -53,6 +76,16 @@ export declare class LearningsBudgetError extends Error {
|
|
|
53
76
|
*/
|
|
54
77
|
constructor(message: string);
|
|
55
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* The one definition of "this ledger is over its hard budget" that every
|
|
81
|
+
* shrink-only writer shares (CodySwannGT/lisa#4536): over the byte cap OR over
|
|
82
|
+
* the entry cap. Retire and over-cap supersede must agree on it, or one writer
|
|
83
|
+
* can repair a ledger the other refuses to touch.
|
|
84
|
+
* @param bytes - Measured document size
|
|
85
|
+
* @param count - Number of entries in the document
|
|
86
|
+
* @returns True when either hard budget is exceeded
|
|
87
|
+
*/
|
|
88
|
+
export declare function isLedgerOverBudget(bytes: number, count: number): boolean;
|
|
56
89
|
/**
|
|
57
90
|
* Enforce the shared entry-count and model-agnostic token upper bounds.
|
|
58
91
|
* @param content - Canonical document
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"learnings-document.d.ts","sourceRoot":"","sources":["../../src/core/learnings-document.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,OAAO,EAIL,KAAK,aAAa,EACnB,MAAM,yBAAyB,CAAC;AAsCjC;;;GAGG;AACH,eAAO,MAAM,yBAAyB,0DACmB,CAAC;AAE1D;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,SAAS,aAAa,EAAE,GAAG,MAAM,CAG7E;AAED,yEAAyE;AACzE,MAAM,WAAW,uBAAuB;IACtC,qDAAqD;IACrD,QAAQ,CAAC,aAAa,EAAE,CAAC,GAAG,CAAC,CAAC;IAC9B,kEAAkE;IAClE,QAAQ,CAAC,OAAO,EAAE,SAAS,aAAa,EAAE,CAAC;IAC3C,yEAAyE;IACzE,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;IAClC,0EAA0E;IAC1E,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;CAClC;AAED
|
|
1
|
+
{"version":3,"file":"learnings-document.d.ts","sourceRoot":"","sources":["../../src/core/learnings-document.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,OAAO,EAIL,KAAK,aAAa,EACnB,MAAM,yBAAyB,CAAC;AAsCjC;;;GAGG;AACH,eAAO,MAAM,yBAAyB,0DACmB,CAAC;AAE1D;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,SAAS,aAAa,EAAE,GAAG,MAAM,CAG7E;AAED,yEAAyE;AACzE,MAAM,WAAW,uBAAuB;IACtC,qDAAqD;IACrD,QAAQ,CAAC,aAAa,EAAE,CAAC,GAAG,CAAC,CAAC;IAC9B,kEAAkE;IAClE,QAAQ,CAAC,OAAO,EAAE,SAAS,aAAa,EAAE,CAAC;IAC3C,yEAAyE;IACzE,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;IAClC,0EAA0E;IAC1E,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;CAClC;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,kCAAkC,QACb,CAAC;AAEnC,0DAA0D;AAC1D,MAAM,WAAW,oBAAoB;IACnC;;;;;;OAMG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;CACpC;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,oBAAyB,GACjC,aAAa,EAAE,CAEjB;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,oBAAyB,GACjC,uBAAuB,CAqDzB;AAsHD;;;;;;;;;;GAUG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C;;;OAGG;gBACS,OAAO,EAAE,MAAM;CAI5B;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAKxE;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,SAAS,GAAE,MAAqC,GAC/C,IAAI,CAYN;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAK1E;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAIvD;AAED;;;;;;;;;GASG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,UAAU,GACjB,MAAM,GAAG,SAAS,CAEpB"}
|
|
@@ -43,21 +43,33 @@ export function renderLearningsFile(entries) {
|
|
|
43
43
|
const lines = entries.map(entry => JSON.stringify(entry)).join("\n");
|
|
44
44
|
return `${FILE_HEADER}${JSON_FENCE_START}${lines}${JSON_FENCE_END}`;
|
|
45
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* Hard ceiling for a deliberately tolerant, over-budget ledger read.
|
|
48
|
+
*
|
|
49
|
+
* A ledger that slipped over `maxTokens` (two merges that each fit, racing)
|
|
50
|
+
* must stay openable by the writers that would SHRINK it — otherwise the state
|
|
51
|
+
* they exist to repair locks them out (CodySwannGT/lisa#4536). The tolerance is
|
|
52
|
+
* bounded rather than open-ended: four times the cap is far past any real race
|
|
53
|
+
* yet still keeps a hostile or runaway file from being loaded wholesale.
|
|
54
|
+
*/
|
|
55
|
+
export const LEARNINGS_OVER_BUDGET_READ_CEILING = 4 * LEARNINGS_CONTRACT.maxTokens;
|
|
46
56
|
/**
|
|
47
57
|
* Parse and revalidate an existing file before it participates in a write.
|
|
48
58
|
* @param content - Existing learnings document
|
|
59
|
+
* @param options - Read policy; defaults to the strict in-budget read
|
|
49
60
|
* @returns Revalidated entries from the document
|
|
50
61
|
*/
|
|
51
|
-
export function parseLearningsFile(content) {
|
|
52
|
-
return [...parseLearningsDocument(content).entries];
|
|
62
|
+
export function parseLearningsFile(content, options = {}) {
|
|
63
|
+
return [...parseLearningsDocument(content, options).entries];
|
|
53
64
|
}
|
|
54
65
|
/**
|
|
55
66
|
* Parse a v1 or v2 document while retaining the source-version facts writers
|
|
56
67
|
* need to migrate only when they already have a reason to mutate.
|
|
57
68
|
* @param content - Existing learnings document
|
|
69
|
+
* @param options - Read policy; defaults to the strict in-budget read
|
|
58
70
|
* @returns Normalized entries plus source-version and canonicality metadata
|
|
59
71
|
*/
|
|
60
|
-
export function parseLearningsDocument(content) {
|
|
72
|
+
export function parseLearningsDocument(content, options = {}) {
|
|
61
73
|
// Diagnose concurrent-write corruption BEFORE the byte budget. A conflicted
|
|
62
74
|
// merge duplicates the whole JSONL block, so a nearly-full ledger lands over
|
|
63
75
|
// budget and would otherwise report "exceeds maxTokens" — advice that sends
|
|
@@ -66,15 +78,18 @@ export function parseLearningsDocument(content) {
|
|
|
66
78
|
if (conflictLine !== undefined) {
|
|
67
79
|
throw conflictMarkerError(conflictLine);
|
|
68
80
|
}
|
|
69
|
-
|
|
70
|
-
|
|
81
|
+
const tolerant = options.allowOverBudget === true;
|
|
82
|
+
const sizeError = readableSizeError(content, LEARNINGS_CONTRACT.maxTokens, tolerant);
|
|
83
|
+
if (sizeError !== undefined) {
|
|
84
|
+
throw sizeError;
|
|
71
85
|
}
|
|
72
86
|
const sourceVersion = readSourceVersion(content);
|
|
73
87
|
const sourceMaxTokens = sourceVersion === 1
|
|
74
88
|
? LEGACY_LEARNINGS_MAX_TOKENS
|
|
75
89
|
: LEARNINGS_CONTRACT.maxTokens;
|
|
76
|
-
|
|
77
|
-
|
|
90
|
+
const sourceSizeError = readableSizeError(content, sourceMaxTokens, tolerant);
|
|
91
|
+
if (sourceSizeError !== undefined) {
|
|
92
|
+
throw sourceSizeError;
|
|
78
93
|
}
|
|
79
94
|
const sourceHeader = fileHeader(sourceVersion);
|
|
80
95
|
if (!content.startsWith(`${sourceHeader}${JSON_FENCE_START}`) ||
|
|
@@ -84,26 +99,70 @@ export function parseLearningsDocument(content) {
|
|
|
84
99
|
const jsonStart = sourceHeader.length + JSON_FENCE_START.length;
|
|
85
100
|
const jsonEnd = content.length - JSON_FENCE_END.length;
|
|
86
101
|
const entries = validateEveryParsedEntry(parseJsonLines(content.slice(jsonStart, jsonEnd)), sourceVersion);
|
|
102
|
+
const identityError = duplicateIdentityError(entries);
|
|
103
|
+
if (identityError !== undefined) {
|
|
104
|
+
throw identityError;
|
|
105
|
+
}
|
|
106
|
+
if (!tolerant) {
|
|
107
|
+
assertSourceBudget(content, entries, sourceVersion, sourceMaxTokens);
|
|
108
|
+
}
|
|
109
|
+
return {
|
|
110
|
+
sourceVersion,
|
|
111
|
+
entries,
|
|
112
|
+
canonicalSource: content === renderLearningsSource(entries, sourceVersion),
|
|
113
|
+
sourceMaxTokens,
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Diagnose a document larger than the read policy allows, before JSONL parsing.
|
|
118
|
+
*
|
|
119
|
+
* Typed as a budget breach (CodySwannGT/lisa#4536): the plain `Error` this used
|
|
120
|
+
* to be made a capture against an over-cap ledger fail outright instead of
|
|
121
|
+
* reaching the overflow, which is exactly where a budget refusal belongs.
|
|
122
|
+
* @param content - Untrusted document bytes
|
|
123
|
+
* @param maxTokens - Byte cap for the declared (or current) source version
|
|
124
|
+
* @param tolerant - Whether the bounded over-budget ceiling applies instead
|
|
125
|
+
* @returns The budget refusal to throw, or undefined when the size is readable
|
|
126
|
+
*/
|
|
127
|
+
function readableSizeError(content, maxTokens, tolerant) {
|
|
128
|
+
const measured = estimateLearningTokens(content);
|
|
129
|
+
if (!tolerant && measured > maxTokens) {
|
|
130
|
+
return new LearningsBudgetError(`Project learnings payload exceeds maxTokens ${maxTokens}`);
|
|
131
|
+
}
|
|
132
|
+
if (measured > LEARNINGS_OVER_BUDGET_READ_CEILING) {
|
|
133
|
+
return new LearningsBudgetError(`Project learnings payload exceeds the over-budget read ceiling ${LEARNINGS_OVER_BUDGET_READ_CEILING} (maxTokens ${maxTokens})`);
|
|
134
|
+
}
|
|
135
|
+
return undefined;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Diagnose duplicate ids or fingerprints, which no read policy may tolerate.
|
|
139
|
+
* @param entries - Validated entries in document order
|
|
140
|
+
* @returns The refusal to throw, or undefined when every identity is unique
|
|
141
|
+
*/
|
|
142
|
+
function duplicateIdentityError(entries) {
|
|
87
143
|
if (new Set(entries.map(entry => entry.id)).size !== entries.length) {
|
|
88
|
-
|
|
144
|
+
return new Error("Invalid project learnings payload: duplicate ids");
|
|
89
145
|
}
|
|
90
146
|
if (new Set(entries.map(entry => entry.fingerprint)).size !== entries.length) {
|
|
91
|
-
|
|
147
|
+
return new Error("Invalid project learnings payload: duplicate fingerprints");
|
|
92
148
|
}
|
|
149
|
+
return undefined;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Enforce the source and (for v1) normalized document budgets on a strict read.
|
|
153
|
+
* @param content - Source document bytes
|
|
154
|
+
* @param entries - Validated entries
|
|
155
|
+
* @param sourceVersion - Declared contract version
|
|
156
|
+
* @param sourceMaxTokens - Byte ceiling of the declared version
|
|
157
|
+
*/
|
|
158
|
+
function assertSourceBudget(content, entries, sourceVersion, sourceMaxTokens) {
|
|
93
159
|
assertDocumentBudget(content, entries.length, "Project learnings payload", sourceMaxTokens);
|
|
94
160
|
if (sourceVersion === 1) {
|
|
95
161
|
// Compatibility is migration-closed, not merely readable: accepting a v1
|
|
96
162
|
// shape that cannot be published as bounded v2 would defer a guaranteed
|
|
97
163
|
// failure until the next legitimate append, confirmation, drain, or merge.
|
|
98
|
-
|
|
99
|
-
assertDocumentBudget(normalized, entries.length, "Normalized v1 project learnings payload");
|
|
164
|
+
assertDocumentBudget(renderLearningsFile(entries), entries.length, "Normalized v1 project learnings payload");
|
|
100
165
|
}
|
|
101
|
-
return {
|
|
102
|
-
sourceVersion,
|
|
103
|
-
entries,
|
|
104
|
-
canonicalSource: content === renderLearningsSource(entries, sourceVersion),
|
|
105
|
-
sourceMaxTokens,
|
|
106
|
-
};
|
|
107
166
|
}
|
|
108
167
|
/**
|
|
109
168
|
* Determine which compatibility contract the source declares.
|
|
@@ -155,6 +214,19 @@ export class LearningsBudgetError extends Error {
|
|
|
155
214
|
this.name = "LearningsBudgetError";
|
|
156
215
|
}
|
|
157
216
|
}
|
|
217
|
+
/**
|
|
218
|
+
* The one definition of "this ledger is over its hard budget" that every
|
|
219
|
+
* shrink-only writer shares (CodySwannGT/lisa#4536): over the byte cap OR over
|
|
220
|
+
* the entry cap. Retire and over-cap supersede must agree on it, or one writer
|
|
221
|
+
* can repair a ledger the other refuses to touch.
|
|
222
|
+
* @param bytes - Measured document size
|
|
223
|
+
* @param count - Number of entries in the document
|
|
224
|
+
* @returns True when either hard budget is exceeded
|
|
225
|
+
*/
|
|
226
|
+
export function isLedgerOverBudget(bytes, count) {
|
|
227
|
+
return (bytes > LEARNINGS_CONTRACT.maxTokens ||
|
|
228
|
+
count > LEARNINGS_CONTRACT.maxEntries);
|
|
229
|
+
}
|
|
158
230
|
/**
|
|
159
231
|
* Enforce the shared entry-count and model-agnostic token upper bounds.
|
|
160
232
|
* @param content - Canonical document
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"learnings-document.js","sourceRoot":"","sources":["../../src/core/learnings-document.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,OAAO,EACL,2BAA2B,EAC3B,kBAAkB,EAClB,sBAAsB,GAEvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,qBAAqB,EACrB,2BAA2B,GAC5B,MAAM,sBAAsB,CAAC;AAE9B,MAAM,UAAU,GAAG;;CAElB,CAAC;AACF,MAAM,UAAU,GAAG,CACjB,OAAe,EACP,EAAE,CAAC,GAAG,UAAU,iCAAiC,OAAO;;CAEjE,CAAC;AACF,MAAM,WAAW,GAAG,UAAU,CAAC,kBAAkB,CAAC,O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