@codyswann/lisa 4.19.0 → 4.21.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-contents/.gitattributes +2 -1
- package/all/create-only/.lisa/PROJECT_LEARNINGS.md +1 -1
- package/dist/core/learnings-alias.d.ts +26 -45
- package/dist/core/learnings-alias.d.ts.map +1 -1
- package/dist/core/learnings-alias.js +29 -48
- package/dist/core/learnings-alias.js.map +1 -1
- package/dist/core/learnings-budget-check.d.ts +2 -1
- package/dist/core/learnings-budget-check.d.ts.map +1 -1
- package/dist/core/learnings-budget-check.js +13 -11
- package/dist/core/learnings-budget-check.js.map +1 -1
- package/dist/core/learnings-contract.d.ts +27 -10
- package/dist/core/learnings-contract.d.ts.map +1 -1
- package/dist/core/learnings-contract.js +37 -9
- package/dist/core/learnings-contract.js.map +1 -1
- package/dist/core/learnings-document.d.ts +20 -1
- package/dist/core/learnings-document.d.ts.map +1 -1
- package/dist/core/learnings-document.js +81 -14
- package/dist/core/learnings-document.js.map +1 -1
- package/dist/core/learnings-entry.d.ts +11 -1
- package/dist/core/learnings-entry.d.ts.map +1 -1
- package/dist/core/learnings-entry.js +98 -24
- package/dist/core/learnings-entry.js.map +1 -1
- package/dist/core/learnings-merge-driver.d.ts +4 -2
- package/dist/core/learnings-merge-driver.d.ts.map +1 -1
- package/dist/core/learnings-merge-driver.js +6 -3
- package/dist/core/learnings-merge-driver.js.map +1 -1
- package/dist/core/learnings-merge.d.ts.map +1 -1
- package/dist/core/learnings-merge.js +96 -10
- package/dist/core/learnings-merge.js.map +1 -1
- package/dist/core/learnings-overflow.d.ts.map +1 -1
- package/dist/core/learnings-overflow.js +72 -3
- package/dist/core/learnings-overflow.js.map +1 -1
- package/dist/core/learnings-supersede.d.ts +56 -0
- package/dist/core/learnings-supersede.d.ts.map +1 -0
- package/dist/core/learnings-supersede.js +199 -0
- package/dist/core/learnings-supersede.js.map +1 -0
- package/dist/core/learnings-writer.d.ts +9 -7
- package/dist/core/learnings-writer.d.ts.map +1 -1
- package/dist/core/learnings-writer.js +31 -58
- package/dist/core/learnings-writer.js.map +1 -1
- package/dist/core/learnings.d.ts +3 -0
- package/dist/core/learnings.d.ts.map +1 -1
- package/dist/core/learnings.js +3 -0
- package/dist/core/learnings.js.map +1 -1
- package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
- package/dist/core/upstream-evidence-manifest.js +24 -7
- package/dist/core/upstream-evidence-manifest.js.map +1 -1
- package/package.json +3 -2
- 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-debrief-apply/SKILL.md +5 -4
- package/plugins/lisa/.codex-plugin/skills/lisa-persist-learning/SKILL.md +2 -2
- package/plugins/lisa/.codex-plugin/skills/lisa-secrets-access/scripts/publish-aws-bootstrap.mjs +349 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-setup-remote-aws/SKILL.md +23 -5
- package/plugins/lisa/agents/learner.md +7 -6
- package/plugins/lisa/rules/reference/project-learnings.md +34 -1
- package/plugins/lisa/skills/lisa-debrief-apply/SKILL.md +5 -4
- package/plugins/lisa/skills/lisa-persist-learning/SKILL.md +2 -2
- package/plugins/lisa/skills/lisa-secrets-access/scripts/publish-aws-bootstrap.mjs +349 -0
- package/plugins/lisa/skills/lisa-setup-remote-aws/SKILL.md +23 -5
- package/plugins/lisa-agy/agents/learner.md +7 -6
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-agy/skills/lisa-debrief-apply/SKILL.md +5 -4
- package/plugins/lisa-agy/skills/lisa-persist-learning/SKILL.md +2 -2
- package/plugins/lisa-agy/skills/lisa-secrets-access/scripts/publish-aws-bootstrap.mjs +349 -0
- package/plugins/lisa-agy/skills/lisa-setup-remote-aws/SKILL.md +23 -5
- 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-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/agents/learner.agent.md +7 -6
- package/plugins/lisa-copilot/rules/reference/project-learnings.md +34 -1
- package/plugins/lisa-copilot/skills/lisa-debrief-apply/SKILL.md +5 -4
- package/plugins/lisa-copilot/skills/lisa-persist-learning/SKILL.md +2 -2
- package/plugins/lisa-copilot/skills/lisa-secrets-access/scripts/publish-aws-bootstrap.mjs +349 -0
- package/plugins/lisa-copilot/skills/lisa-setup-remote-aws/SKILL.md +23 -5
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/agents/learner.md +7 -6
- package/plugins/lisa-cursor/rules/project-learnings-reference.mdc +34 -1
- package/plugins/lisa-cursor/skills/lisa-debrief-apply/SKILL.md +5 -4
- package/plugins/lisa-cursor/skills/lisa-persist-learning/SKILL.md +2 -2
- package/plugins/lisa-cursor/skills/lisa-secrets-access/scripts/publish-aws-bootstrap.mjs +349 -0
- package/plugins/lisa-cursor/skills/lisa-setup-remote-aws/SKILL.md +23 -5
- 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-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-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-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-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-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-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-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/src/base/agents/learner.md +7 -6
- package/plugins/src/base/rules/reference/project-learnings.md +34 -1
- package/plugins/src/base/skills/lisa-debrief-apply/SKILL.md +5 -4
- package/plugins/src/base/skills/lisa-persist-learning/SKILL.md +2 -2
- package/plugins/src/base/skills/lisa-secrets-access/scripts/publish-aws-bootstrap.mjs +349 -0
- package/plugins/src/base/skills/lisa-setup-remote-aws/SKILL.md +23 -5
- package/scripts/verify-learner-frontmatter-built.mjs +1 -1
- package/scripts/verify-packed-learnings-contract.mjs +268 -0
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
/** Pure parsing and rendering for the canonical project-learnings document. */
|
|
2
|
-
import { LEARNINGS_CONTRACT, estimateLearningTokens, } from "./learnings-contract.js";
|
|
3
|
-
import { validateLearningEntry } from "./learnings-entry.js";
|
|
4
|
-
const
|
|
2
|
+
import { LEGACY_LEARNINGS_MAX_TOKENS, LEARNINGS_CONTRACT, estimateLearningTokens, } from "./learnings-contract.js";
|
|
3
|
+
import { validateLearningEntry, validateLegacyLearningEntry, } from "./learnings-entry.js";
|
|
4
|
+
const FILE_TITLE = `# Project Learnings
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
`;
|
|
7
|
+
const fileHeader = (version) => `${FILE_TITLE}<!-- lisa-learnings-contract:v${version} -->
|
|
7
8
|
|
|
8
9
|
`;
|
|
10
|
+
const FILE_HEADER = fileHeader(LEARNINGS_CONTRACT.version);
|
|
9
11
|
const JSON_FENCE_START = "```jsonl\n";
|
|
10
12
|
const JSON_FENCE_END = "\n```\n";
|
|
11
13
|
/**
|
|
@@ -47,6 +49,15 @@ export function renderLearningsFile(entries) {
|
|
|
47
49
|
* @returns Revalidated entries from the document
|
|
48
50
|
*/
|
|
49
51
|
export function parseLearningsFile(content) {
|
|
52
|
+
return [...parseLearningsDocument(content).entries];
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Parse a v1 or v2 document while retaining the source-version facts writers
|
|
56
|
+
* need to migrate only when they already have a reason to mutate.
|
|
57
|
+
* @param content - Existing learnings document
|
|
58
|
+
* @returns Normalized entries plus source-version and canonicality metadata
|
|
59
|
+
*/
|
|
60
|
+
export function parseLearningsDocument(content) {
|
|
50
61
|
// Diagnose concurrent-write corruption BEFORE the byte budget. A conflicted
|
|
51
62
|
// merge duplicates the whole JSONL block, so a nearly-full ledger lands over
|
|
52
63
|
// budget and would otherwise report "exceeds maxTokens" — advice that sends
|
|
@@ -58,18 +69,70 @@ export function parseLearningsFile(content) {
|
|
|
58
69
|
if (estimateLearningTokens(content) > LEARNINGS_CONTRACT.maxTokens) {
|
|
59
70
|
throw new Error(`Project learnings payload exceeds maxTokens ${LEARNINGS_CONTRACT.maxTokens}`);
|
|
60
71
|
}
|
|
61
|
-
|
|
72
|
+
const sourceVersion = readSourceVersion(content);
|
|
73
|
+
const sourceMaxTokens = sourceVersion === 1
|
|
74
|
+
? LEGACY_LEARNINGS_MAX_TOKENS
|
|
75
|
+
: LEARNINGS_CONTRACT.maxTokens;
|
|
76
|
+
if (estimateLearningTokens(content) > sourceMaxTokens) {
|
|
77
|
+
throw new Error(`Project learnings payload exceeds maxTokens ${sourceMaxTokens}`);
|
|
78
|
+
}
|
|
79
|
+
const sourceHeader = fileHeader(sourceVersion);
|
|
80
|
+
if (!content.startsWith(`${sourceHeader}${JSON_FENCE_START}`) ||
|
|
62
81
|
!content.endsWith(JSON_FENCE_END)) {
|
|
63
82
|
throw new Error("Invalid project learnings file format");
|
|
64
83
|
}
|
|
65
|
-
const jsonStart =
|
|
84
|
+
const jsonStart = sourceHeader.length + JSON_FENCE_START.length;
|
|
66
85
|
const jsonEnd = content.length - JSON_FENCE_END.length;
|
|
67
|
-
const entries = parseJsonLines(content.slice(jsonStart, jsonEnd)).map(validateParsedLearningEntry);
|
|
86
|
+
const entries = parseJsonLines(content.slice(jsonStart, jsonEnd)).map((candidate, index) => validateParsedLearningEntry(candidate, index, sourceVersion));
|
|
68
87
|
if (new Set(entries.map(entry => entry.id)).size !== entries.length) {
|
|
69
88
|
throw new Error("Invalid project learnings payload: duplicate ids");
|
|
70
89
|
}
|
|
71
|
-
|
|
72
|
-
|
|
90
|
+
if (new Set(entries.map(entry => entry.fingerprint)).size !== entries.length) {
|
|
91
|
+
throw new Error("Invalid project learnings payload: duplicate fingerprints");
|
|
92
|
+
}
|
|
93
|
+
assertDocumentBudget(content, entries.length, "Project learnings payload", sourceMaxTokens);
|
|
94
|
+
if (sourceVersion === 1) {
|
|
95
|
+
// Compatibility is migration-closed, not merely readable: accepting a v1
|
|
96
|
+
// shape that cannot be published as bounded v2 would defer a guaranteed
|
|
97
|
+
// failure until the next legitimate append, confirmation, drain, or merge.
|
|
98
|
+
const normalized = renderLearningsFile(entries);
|
|
99
|
+
assertDocumentBudget(normalized, entries.length, "Normalized v1 project learnings payload");
|
|
100
|
+
}
|
|
101
|
+
return {
|
|
102
|
+
sourceVersion,
|
|
103
|
+
entries,
|
|
104
|
+
canonicalSource: content === renderLearningsSource(entries, sourceVersion),
|
|
105
|
+
sourceMaxTokens,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Determine which compatibility contract the source declares.
|
|
110
|
+
* @param content - Untrusted document bytes
|
|
111
|
+
* @returns Supported declared version
|
|
112
|
+
*/
|
|
113
|
+
function readSourceVersion(content) {
|
|
114
|
+
if (content.startsWith(fileHeader(1))) {
|
|
115
|
+
return 1;
|
|
116
|
+
}
|
|
117
|
+
if (content.startsWith(fileHeader(2))) {
|
|
118
|
+
return 2;
|
|
119
|
+
}
|
|
120
|
+
throw new Error("Invalid project learnings file format");
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Render canonical bytes for a declared source version.
|
|
124
|
+
* @param entries - Current-schema normalized entries
|
|
125
|
+
* @param version - Source contract version to reproduce
|
|
126
|
+
* @returns Canonical source-version document
|
|
127
|
+
*/
|
|
128
|
+
function renderLearningsSource(entries, version) {
|
|
129
|
+
if (version === 2) {
|
|
130
|
+
return renderLearningsFile(entries);
|
|
131
|
+
}
|
|
132
|
+
const lines = entries
|
|
133
|
+
.map(({ fingerprint: _fingerprint, ...entry }) => JSON.stringify(entry))
|
|
134
|
+
.join("\n");
|
|
135
|
+
return `${fileHeader(1)}${JSON_FENCE_START}${lines}${JSON_FENCE_END}`;
|
|
73
136
|
}
|
|
74
137
|
/**
|
|
75
138
|
* A document that does not fit the hard entry-count or token budget.
|
|
@@ -97,14 +160,15 @@ export class LearningsBudgetError extends Error {
|
|
|
97
160
|
* @param content - Canonical document
|
|
98
161
|
* @param entryCount - Number of entries in the document
|
|
99
162
|
* @param context - Error-message prefix
|
|
163
|
+
* @param maxTokens - Source-version byte ceiling to enforce
|
|
100
164
|
*/
|
|
101
|
-
export function assertDocumentBudget(content, entryCount, context) {
|
|
165
|
+
export function assertDocumentBudget(content, entryCount, context, maxTokens = LEARNINGS_CONTRACT.maxTokens) {
|
|
102
166
|
if (entryCount > LEARNINGS_CONTRACT.maxEntries) {
|
|
103
167
|
throw new LearningsBudgetError(`${context} exceeds maxEntries: measured ${entryCount}, allowed ${LEARNINGS_CONTRACT.maxEntries}`);
|
|
104
168
|
}
|
|
105
169
|
const estimatedTokens = estimateLearningTokens(content);
|
|
106
|
-
if (estimatedTokens >
|
|
107
|
-
throw new LearningsBudgetError(`${context} exceeds maxTokens ${
|
|
170
|
+
if (estimatedTokens > maxTokens) {
|
|
171
|
+
throw new LearningsBudgetError(`${context} exceeds maxTokens ${maxTokens} (measured ${estimatedTokens})`);
|
|
108
172
|
}
|
|
109
173
|
}
|
|
110
174
|
/**
|
|
@@ -161,11 +225,14 @@ export function findConflictMarkerInBytes(prefix) {
|
|
|
161
225
|
* Add a stable entry identifier to validation failures.
|
|
162
226
|
* @param candidate - Parsed JSONL value
|
|
163
227
|
* @param index - Zero-based JSONL entry index
|
|
228
|
+
* @param sourceVersion - Contract version declared by the source document
|
|
164
229
|
* @returns Validated learning entry
|
|
165
230
|
*/
|
|
166
|
-
function validateParsedLearningEntry(candidate, index) {
|
|
231
|
+
function validateParsedLearningEntry(candidate, index, sourceVersion) {
|
|
167
232
|
try {
|
|
168
|
-
return
|
|
233
|
+
return sourceVersion === 1
|
|
234
|
+
? validateLegacyLearningEntry(candidate)
|
|
235
|
+
: validateLearningEntry(candidate);
|
|
169
236
|
}
|
|
170
237
|
catch (error) {
|
|
171
238
|
const id = readDiagnosticEntryId(candidate);
|
|
@@ -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,kBAAkB,EAClB,sBAAsB,GAEvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,
|
|
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,OAAO,CAAC,CAAC;AAC3D,MAAM,gBAAgB,GAAG,YAAY,CAAC;AACtC,MAAM,cAAc,GAAG,SAAS,CAAC;AAEjC;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,eAAe,GAAG,uCAAuC,CAAC;AAEhE;;;GAGG;AACH,MAAM,CAAC,MAAM,yBAAyB,GACpC,uDAAuD,CAAC;AAE1D;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAiC;IACnE,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,EA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P,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;IAC7D,CAAC;AACH,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Strict validation for
|
|
1
|
+
/** Strict validation for current and compatibility project-learning schemas. */
|
|
2
2
|
import { type LearningEntry } from "./learnings-contract.js";
|
|
3
3
|
/**
|
|
4
4
|
* Validate an untrusted entry and return a normalized immutable copy.
|
|
@@ -6,6 +6,16 @@ import { type LearningEntry } from "./learnings-contract.js";
|
|
|
6
6
|
* @returns Validated learning entry
|
|
7
7
|
*/
|
|
8
8
|
export declare function validateLearningEntry(candidate: unknown): LearningEntry;
|
|
9
|
+
/**
|
|
10
|
+
* Validate a v1 entry and normalize its accidental version token explicitly.
|
|
11
|
+
*
|
|
12
|
+
* v1 used `id` both as public identity and as the content fingerprint. The
|
|
13
|
+
* compatibility reader preserves that fact as `fingerprint = id`; it never
|
|
14
|
+
* invents a new token during a read.
|
|
15
|
+
* @param candidate - Value parsed from a v1 learnings document
|
|
16
|
+
* @returns Frozen current-schema entry carrying the legacy id as fingerprint
|
|
17
|
+
*/
|
|
18
|
+
export declare function validateLegacyLearningEntry(candidate: unknown): LearningEntry;
|
|
9
19
|
/**
|
|
10
20
|
* Require a real calendar date in ISO date form. Exported so the surgical
|
|
11
21
|
* `last_confirmed` writer can validate a caller-supplied date up front instead
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"learnings-entry.d.ts","sourceRoot":"","sources":["../../src/core/learnings-entry.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"learnings-entry.d.ts","sourceRoot":"","sources":["../../src/core/learnings-entry.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,OAAO,EAML,KAAK,aAAa,EACnB,MAAM,yBAAyB,CAAC;AAajC;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,OAAO,GAAG,aAAa,CAUvE;AAED;;;;;;;;GAQG;AACH,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,OAAO,GAAG,aAAa,CAO7E;AAoTD;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAWpE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/** Strict validation for
|
|
2
|
-
import { LEARNINGS_CONTRACT, LEARNING_CONFIDENCE_VALUES, } from "./learnings-contract.js";
|
|
1
|
+
/** Strict validation for current and compatibility project-learning schemas. */
|
|
2
|
+
import { LEGACY_LEARNING_ENTRY_FIELDS, LEARNINGS_CONTRACT, LEARNING_CONFIDENCE_VALUES, MAX_STABLE_TOKEN_BYTES, } from "./learnings-contract.js";
|
|
3
3
|
const ISO_DATE = /^\d{4}-\d{2}-\d{2}$/;
|
|
4
4
|
const STABLE_ID = /^[a-z0-9]+(?:[._-][a-z0-9]+)*$/;
|
|
5
5
|
/**
|
|
@@ -8,9 +8,35 @@ const STABLE_ID = /^[a-z0-9]+(?:[._-][a-z0-9]+)*$/;
|
|
|
8
8
|
* @returns Validated learning entry
|
|
9
9
|
*/
|
|
10
10
|
export function validateLearningEntry(candidate) {
|
|
11
|
-
const descriptors = requireEntryDescriptors(candidate);
|
|
11
|
+
const descriptors = requireEntryDescriptors(candidate, LEARNINGS_CONTRACT.fields);
|
|
12
12
|
const value = (field) => readDataProperty(descriptors, field);
|
|
13
13
|
const id = requireStableId(value("id"));
|
|
14
|
+
const fingerprint = requireFingerprint(value("fingerprint"));
|
|
15
|
+
return buildLearningEntry(descriptors, id, fingerprint);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Validate a v1 entry and normalize its accidental version token explicitly.
|
|
19
|
+
*
|
|
20
|
+
* v1 used `id` both as public identity and as the content fingerprint. The
|
|
21
|
+
* compatibility reader preserves that fact as `fingerprint = id`; it never
|
|
22
|
+
* invents a new token during a read.
|
|
23
|
+
* @param candidate - Value parsed from a v1 learnings document
|
|
24
|
+
* @returns Frozen current-schema entry carrying the legacy id as fingerprint
|
|
25
|
+
*/
|
|
26
|
+
export function validateLegacyLearningEntry(candidate) {
|
|
27
|
+
const descriptors = requireEntryDescriptors(candidate, LEGACY_LEARNING_ENTRY_FIELDS);
|
|
28
|
+
const id = requireStableId(readDataProperty(descriptors, "id"));
|
|
29
|
+
return buildLearningEntry(descriptors, id, id);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Validate the fields shared by both schema versions and build v2 shape.
|
|
33
|
+
* @param descriptors - Exact accessor-free source field descriptors
|
|
34
|
+
* @param id - Valid stable public identity
|
|
35
|
+
* @param fingerprint - Valid stable content-version token
|
|
36
|
+
* @returns Frozen normalized learning entry
|
|
37
|
+
*/
|
|
38
|
+
function buildLearningEntry(descriptors, id, fingerprint) {
|
|
39
|
+
const value = (field) => readDataProperty(descriptors, field);
|
|
14
40
|
const rule = requireRule(value("rule"));
|
|
15
41
|
const why = requireWhy(value("why"));
|
|
16
42
|
const provenance = requireProvenance(value("provenance"));
|
|
@@ -22,6 +48,7 @@ export function validateLearningEntry(candidate) {
|
|
|
22
48
|
}
|
|
23
49
|
return Object.freeze({
|
|
24
50
|
id,
|
|
51
|
+
fingerprint,
|
|
25
52
|
rule,
|
|
26
53
|
why,
|
|
27
54
|
provenance: Object.freeze(provenance),
|
|
@@ -31,26 +58,35 @@ export function validateLearningEntry(candidate) {
|
|
|
31
58
|
});
|
|
32
59
|
}
|
|
33
60
|
/**
|
|
34
|
-
* Require an object with exactly
|
|
61
|
+
* Require an object with exactly the selected version's accessor-free fields.
|
|
62
|
+
* Inspect the candidate itself and retain descriptors in a prototype-free
|
|
63
|
+
* tuple sequence: an ordinary descriptor-map object inherits Object.prototype,
|
|
64
|
+
* so pollution under a missing field could impersonate a candidate descriptor.
|
|
35
65
|
* @param candidate - Untrusted candidate object
|
|
36
|
-
* @
|
|
66
|
+
* @param fields - Exact field vocabulary for the source contract version
|
|
67
|
+
* @returns Exact own-property descriptor sequence
|
|
37
68
|
*/
|
|
38
|
-
function requireEntryDescriptors(candidate) {
|
|
69
|
+
function requireEntryDescriptors(candidate, fields) {
|
|
39
70
|
if (candidate === null ||
|
|
40
71
|
typeof candidate !== "object" ||
|
|
41
72
|
Array.isArray(candidate)) {
|
|
42
73
|
throw new Error("Invalid learning entry: expected an object");
|
|
43
74
|
}
|
|
44
|
-
const
|
|
45
|
-
const ownKeys = Reflect.ownKeys(descriptors);
|
|
75
|
+
const ownKeys = Reflect.ownKeys(candidate);
|
|
46
76
|
if (ownKeys.some(key => typeof key !== "string")) {
|
|
47
77
|
throw new Error("Invalid learning entry fields: symbol keys are not allowed");
|
|
48
78
|
}
|
|
49
|
-
if (ownKeys.length !==
|
|
50
|
-
|
|
51
|
-
throw new Error(`Invalid learning entry fields: expected exactly ${
|
|
79
|
+
if (ownKeys.length !== fields.length ||
|
|
80
|
+
fields.some(field => !Object.hasOwn(candidate, field))) {
|
|
81
|
+
throw new Error(`Invalid learning entry fields: expected exactly ${fields.join(", ")}`);
|
|
52
82
|
}
|
|
53
|
-
return
|
|
83
|
+
return fields.map(field => {
|
|
84
|
+
const descriptor = Object.getOwnPropertyDescriptor(candidate, field);
|
|
85
|
+
if (descriptor === undefined) {
|
|
86
|
+
throw new Error(`Invalid learning entry fields: expected exactly ${fields.join(", ")}`);
|
|
87
|
+
}
|
|
88
|
+
return [field, descriptor];
|
|
89
|
+
});
|
|
54
90
|
}
|
|
55
91
|
/**
|
|
56
92
|
* Read one exact-schema field without invoking an accessor.
|
|
@@ -59,7 +95,7 @@ function requireEntryDescriptors(candidate) {
|
|
|
59
95
|
* @returns Stored data value
|
|
60
96
|
*/
|
|
61
97
|
function readDataProperty(descriptors, field) {
|
|
62
|
-
const descriptor = descriptors[field];
|
|
98
|
+
const descriptor = descriptors.find(([key]) => key === field)?.[1];
|
|
63
99
|
if (descriptor === undefined || !("value" in descriptor)) {
|
|
64
100
|
throw new Error(`Invalid ${field}: accessors are not allowed`);
|
|
65
101
|
}
|
|
@@ -72,12 +108,37 @@ function readDataProperty(descriptors, field) {
|
|
|
72
108
|
*/
|
|
73
109
|
function requireStableId(value) {
|
|
74
110
|
const id = requireNonEmptyString(value, "id");
|
|
75
|
-
|
|
111
|
+
assertStableTokenBudget(id, "id");
|
|
76
112
|
if (!STABLE_ID.test(id)) {
|
|
77
113
|
throw new Error("Invalid learning id: use lowercase letters, numbers, dots, underscores, or hyphens");
|
|
78
114
|
}
|
|
79
115
|
return id;
|
|
80
116
|
}
|
|
117
|
+
/**
|
|
118
|
+
* Require a stable persisted content-version token.
|
|
119
|
+
* @param value - Untrusted fingerprint value
|
|
120
|
+
* @returns Valid stable fingerprint
|
|
121
|
+
*/
|
|
122
|
+
function requireFingerprint(value) {
|
|
123
|
+
const fingerprint = requireNonEmptyString(value, "fingerprint");
|
|
124
|
+
assertStableTokenBudget(fingerprint, "fingerprint");
|
|
125
|
+
if (!STABLE_ID.test(fingerprint)) {
|
|
126
|
+
throw new Error("Invalid learning fingerprint: use lowercase letters, numbers, dots, underscores, or hyphens");
|
|
127
|
+
}
|
|
128
|
+
return fingerprint;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Bound machine identity keys independently from prose and document capacity.
|
|
132
|
+
* This limit is what makes every accepted v1 id safe to duplicate into a v2
|
|
133
|
+
* fingerprint without opening an unbounded migration expansion.
|
|
134
|
+
* @param value - Stable-token candidate
|
|
135
|
+
* @param field - `id` or `fingerprint`
|
|
136
|
+
*/
|
|
137
|
+
function assertStableTokenBudget(value, field) {
|
|
138
|
+
if (Buffer.byteLength(value, "utf8") > MAX_STABLE_TOKEN_BYTES) {
|
|
139
|
+
throw new Error(`${field} exceeds max stable token bytes ${MAX_STABLE_TOKEN_BYTES}`);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
81
142
|
/**
|
|
82
143
|
* Require a rule within both hard character and line caps.
|
|
83
144
|
* @param value - Untrusted rule value
|
|
@@ -112,6 +173,8 @@ function requireWhy(value) {
|
|
|
112
173
|
}
|
|
113
174
|
/**
|
|
114
175
|
* Validate a dense, accessor-free provenance list with bounded allocation.
|
|
176
|
+
* Exact own keys keep sparse holes from resolving through inherited numeric
|
|
177
|
+
* properties and prevent expandos from carrying unvalidated caller data.
|
|
115
178
|
* @param value - Untrusted provenance value
|
|
116
179
|
* @returns Valid provenance references
|
|
117
180
|
*/
|
|
@@ -119,15 +182,26 @@ function requireProvenance(value) {
|
|
|
119
182
|
if (!Array.isArray(value)) {
|
|
120
183
|
throw new Error("Invalid provenance: expected an array of references");
|
|
121
184
|
}
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
185
|
+
const lengthDescriptor = Object.getOwnPropertyDescriptor(value, "length");
|
|
186
|
+
if (lengthDescriptor === undefined ||
|
|
187
|
+
!("value" in lengthDescriptor) ||
|
|
188
|
+
typeof lengthDescriptor.value !== "number" ||
|
|
189
|
+
!Number.isSafeInteger(lengthDescriptor.value) ||
|
|
190
|
+
lengthDescriptor.value < 1 ||
|
|
191
|
+
lengthDescriptor.value > LEARNINGS_CONTRACT.maxProvenanceReferences) {
|
|
128
192
|
throw new Error(`Invalid provenance: expected 1-${LEARNINGS_CONTRACT.maxProvenanceReferences} references`);
|
|
129
193
|
}
|
|
130
|
-
const
|
|
194
|
+
const length = lengthDescriptor.value;
|
|
195
|
+
const expectedKeys = new Set([
|
|
196
|
+
"length",
|
|
197
|
+
...Array.from({ length }, (_unused, index) => String(index)),
|
|
198
|
+
]);
|
|
199
|
+
const ownKeys = Reflect.ownKeys(value);
|
|
200
|
+
if (ownKeys.length !== expectedKeys.size ||
|
|
201
|
+
ownKeys.some(key => typeof key !== "string" || !expectedKeys.has(key))) {
|
|
202
|
+
throw new Error("Invalid provenance array: expected dense own indexed values without extra or symbol fields");
|
|
203
|
+
}
|
|
204
|
+
const provenance = Array.from({ length }, (_unused, index) => requireProvenanceItem(value, index));
|
|
131
205
|
if (new Set(provenance).size !== provenance.length) {
|
|
132
206
|
throw new Error("Invalid provenance: duplicate references are not allowed");
|
|
133
207
|
}
|
|
@@ -135,12 +209,12 @@ function requireProvenance(value) {
|
|
|
135
209
|
}
|
|
136
210
|
/**
|
|
137
211
|
* Read and bound one accessor-free provenance element.
|
|
138
|
-
* @param
|
|
212
|
+
* @param provenance - Provenance array already checked for exact own keys
|
|
139
213
|
* @param index - Reference index
|
|
140
214
|
* @returns Valid provenance reference
|
|
141
215
|
*/
|
|
142
|
-
function requireProvenanceItem(
|
|
143
|
-
const descriptor =
|
|
216
|
+
function requireProvenanceItem(provenance, index) {
|
|
217
|
+
const descriptor = Object.getOwnPropertyDescriptor(provenance, String(index));
|
|
144
218
|
if (descriptor === undefined || !("value" in descriptor)) {
|
|
145
219
|
throw new Error(`Invalid provenance[${index}]: accessors are not allowed`);
|
|
146
220
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"learnings-entry.js","sourceRoot":"","sources":["../../src/core/learnings-entry.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"learnings-entry.js","sourceRoot":"","sources":["../../src/core/learnings-entry.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,OAAO,EACL,4BAA4B,EAC5B,kBAAkB,EAClB,0BAA0B,EAC1B,sBAAsB,GAGvB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,QAAQ,GAAG,qBAAqB,CAAC;AACvC,MAAM,SAAS,GAAG,gCAAgC,CAAC;AAUnD;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,SAAkB;IACtD,MAAM,WAAW,GAAG,uBAAuB,CACzC,SAAS,EACT,kBAAkB,CAAC,MAAM,CAC1B,CAAC;IACF,MAAM,KAAK,GAAG,CAAC,KAAiB,EAAW,EAAE,CAC3C,gBAAgB,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IACvC,MAAM,EAAE,GAAG,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IACxC,MAAM,WAA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AC;AAED;;;;GAIG;AACH,SAAS,4BAA4B,CAAC,KAAa;IACjD,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE;QACxC,MAAM,IAAI,GAAG,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QACrC,OAAO,CACL,IAAI,IAAI,CAAC;YACT,IAAI,KAAK,EAAE;YACX,IAAI,KAAK,EAAE;YACX,CAAC,IAAI,IAAI,EAAE,IAAI,IAAI,IAAI,EAAE,CAAC;YAC1B,IAAI,KAAK,GAAG,CACb,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -47,8 +47,10 @@ export declare function buildLearningsAttributeLine(ledgerPath: string): string;
|
|
|
47
47
|
* Both halves of the learnings surface are bound. The overflow file
|
|
48
48
|
* (CodySwannGT/lisa#1996) is written by the same concurrent learner passes, on
|
|
49
49
|
* the same per-fingerprint branches, in the same canonical document format — so
|
|
50
|
-
* it has the ledger's exact merge problem and the
|
|
51
|
-
* resolution.
|
|
50
|
+
* it has the ledger's exact merge problem and the same id-keyed three-way
|
|
51
|
+
* resolution. Fingerprints disambiguate concurrent stable-id successors so the
|
|
52
|
+
* driver can preserve both without depending on ours/theirs orientation.
|
|
53
|
+
* Binding only the ledger would leave the overflow on git's default
|
|
52
54
|
* text merge, silently re-introducing the corruption this driver exists to
|
|
53
55
|
* remove, on the one file whose whole job is not losing content.
|
|
54
56
|
* @param ledgerPath - Project-relative learnings file path
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"learnings-merge-driver.d.ts","sourceRoot":"","sources":["../../src/core/learnings-merge-driver.ts"],"names":[],"mappings":"AAmCA,iFAAiF;AACjF,eAAO,MAAM,2BAA2B,mBAAmB,CAAC;AAE5D,iEAAiE;AACjE,eAAO,MAAM,kCAAkC,wCACR,CAAC;AAExC,wEAAwE;AACxE,eAAO,MAAM,0BAA0B,2BAA2B,CAAC;AAEnE,wEAAwE;AACxE,eAAO,MAAM,wBAAwB,yBAAyB,CAAC;AAE/D;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,gCAAgC,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE3E;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAEtE;AAED
|
|
1
|
+
{"version":3,"file":"learnings-merge-driver.d.ts","sourceRoot":"","sources":["../../src/core/learnings-merge-driver.ts"],"names":[],"mappings":"AAmCA,iFAAiF;AACjF,eAAO,MAAM,2BAA2B,mBAAmB,CAAC;AAE5D,iEAAiE;AACjE,eAAO,MAAM,kCAAkC,wCACR,CAAC;AAExC,wEAAwE;AACxE,eAAO,MAAM,0BAA0B,2BAA2B,CAAC;AAEnE,wEAAwE;AACxE,eAAO,MAAM,wBAAwB,yBAAyB,CAAC;AAE/D;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,gCAAgC,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE3E;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAEtE;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,iCAAiC,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAmC5E"}
|
|
@@ -85,8 +85,10 @@ export function buildLearningsAttributeLine(ledgerPath) {
|
|
|
85
85
|
* Both halves of the learnings surface are bound. The overflow file
|
|
86
86
|
* (CodySwannGT/lisa#1996) is written by the same concurrent learner passes, on
|
|
87
87
|
* the same per-fingerprint branches, in the same canonical document format — so
|
|
88
|
-
* it has the ledger's exact merge problem and the
|
|
89
|
-
* resolution.
|
|
88
|
+
* it has the ledger's exact merge problem and the same id-keyed three-way
|
|
89
|
+
* resolution. Fingerprints disambiguate concurrent stable-id successors so the
|
|
90
|
+
* driver can preserve both without depending on ours/theirs orientation.
|
|
91
|
+
* Binding only the ledger would leave the overflow on git's default
|
|
90
92
|
* text merge, silently re-introducing the corruption this driver exists to
|
|
91
93
|
* remove, on the one file whose whole job is not losing content.
|
|
92
94
|
* @param ledgerPath - Project-relative learnings file path
|
|
@@ -98,7 +100,8 @@ export function renderLearningsGitattributesBlock(ledgerPath) {
|
|
|
98
100
|
"",
|
|
99
101
|
"# The project learnings ledger is written by concurrent learner passes that",
|
|
100
102
|
"# each run on their own branch. Git's default line merge corrupts it with",
|
|
101
|
-
"# conflict markers; this driver
|
|
103
|
+
"# conflict markers; this driver merges entries by id and fingerprint. The",
|
|
104
|
+
"# driver preserves concurrent stable-id successors instead of guessing. Its",
|
|
102
105
|
"# command is machine-local — run `lisa install-merge-driver` to register it.",
|
|
103
106
|
// Named at the SYMPTOM site on purpose. A person arriving from the effect —
|
|
104
107
|
// conflict markers in a file mapped to a union driver — reads this file;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"learnings-merge-driver.js","sourceRoot":"","sources":["../../src/core/learnings-merge-driver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AAEvE,iFAAiF;AACjF,MAAM,CAAC,MAAM,2BAA2B,GAAG,gBAAgB,CAAC;AAE5D,iEAAiE;AACjE,MAAM,CAAC,MAAM,kCAAkC,GAC7C,qCAAqC,CAAC;AAExC,wEAAwE;AACxE,MAAM,CAAC,MAAM,0BAA0B,GAAG,wBAAwB,CAAC;AAEnE,wEAAwE;AACxE,MAAM,CAAC,MAAM,wBAAwB,GAAG,sBAAsB,CAAC;AAE/D;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,gCAAgC,CAAC,UAAkB;IACjE,OAAO,GAAG,UAAU,4DAA4D,CAAC;AACnF,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,2BAA2B,CAAC,UAAkB;IAC5D,OAAO,GAAG,UAAU,UA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2EAA2E;QAC3E,4EAA4E;QAC5E,0BAA0B;QAC1B,2BAA2B,CAAC,4BAA4B,CAAC,UAAU,CAAC,CAAC;QACrE,EAAE;QACF,wBAAwB;QACxB,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"learnings-merge.d.ts","sourceRoot":"","sources":["../../src/core/learnings-merge.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"learnings-merge.d.ts","sourceRoot":"","sources":["../../src/core/learnings-merge.ts"],"names":[],"mappings":"AAwDA,iDAAiD;AACjD,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,mDAAmD;IACnD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,gEAAgE;AAChE,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,gDAAgD;IAChD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,0CAA0C;AAC1C,MAAM,MAAM,oBAAoB,GAC5B,oBAAoB,GACpB,sBAAsB,CAAC;AAE3B;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,GACb,oBAAoB,CAgBtB"}
|