@adamchanadam/agent-handoff-kit 0.3.47 → 0.3.49
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/README.en.md +1 -1
- package/README.md +1 -1
- package/bin/agent-handoff-kit.mjs +552 -78
- package/bin/migration-baselines/official-origin-catalog.json +1642 -332
- package/bin/official-origin-catalog.mjs +9 -0
- package/bin/upgrade-inventory.mjs +33 -33
- package/package.json +1 -1
- package/runtime-core/PROJECT_INDEX.md +1 -1
|
@@ -5,6 +5,10 @@ import { fileURLToPath } from "node:url";
|
|
|
5
5
|
|
|
6
6
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
7
7
|
const defaultCatalogPath = path.join(__dirname, "migration-baselines", "official-origin-catalog.json");
|
|
8
|
+
const requiredArtifactBoundManagedSegments = Object.freeze([
|
|
9
|
+
Object.freeze({ version: "0.3.38", targetRel: "AGENTS.md" }),
|
|
10
|
+
Object.freeze({ version: "0.3.41", targetRel: "AGENTS.md" })
|
|
11
|
+
]);
|
|
8
12
|
|
|
9
13
|
export const OFFICIAL_ORIGIN_CATALOG_SCHEMA = 1;
|
|
10
14
|
|
|
@@ -45,6 +49,11 @@ export function validateOfficialOriginCatalog(catalog) {
|
|
|
45
49
|
getArtifactBoundManagedSegment({ version, targetRel, catalog });
|
|
46
50
|
}
|
|
47
51
|
}
|
|
52
|
+
for (const required of requiredArtifactBoundManagedSegments) {
|
|
53
|
+
if (!getArtifactBoundManagedSegment({ ...required, catalog })) {
|
|
54
|
+
throw new Error(`official origin catalog missing required managed segment: ${required.version} ${required.targetRel}`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
48
57
|
|
|
49
58
|
for (const [contentId, content] of Object.entries(catalog.contents)) {
|
|
50
59
|
if (contentId !== sha256(`${content.targetRel}\0${content.text}`)) {
|
|
@@ -15,11 +15,11 @@ const formalEntryTargets = Object.freeze([
|
|
|
15
15
|
"START_NEXT_SESSION_PROMPT.txt"
|
|
16
16
|
]);
|
|
17
17
|
|
|
18
|
-
const dynamicDirectories = Object.freeze([
|
|
19
|
-
{ relative: "dev/governance_migrations", classification: "transaction-state" },
|
|
20
|
-
{ relative: "dev/SESSION_LOG_archive", classification: "session-log-archive" },
|
|
21
|
-
{ relative: "dev/session_log_archive", classification: "legacy-session-log-archive" }
|
|
22
|
-
]);
|
|
18
|
+
const dynamicDirectories = Object.freeze([
|
|
19
|
+
{ relative: "dev/governance_migrations", classification: "transaction-state" },
|
|
20
|
+
{ relative: "dev/SESSION_LOG_archive", classification: "session-log-archive" },
|
|
21
|
+
{ relative: "dev/session_log_archive", classification: "legacy-session-log-archive" }
|
|
22
|
+
]);
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* Builds a read-only, hash-bound description of the Kit data that an upgrade
|
|
@@ -155,14 +155,14 @@ export async function buildUpgradeInventory({ root, contracts = installedFileCon
|
|
|
155
155
|
formalEntryTargets: formalEntryTargets.filter((target) => entries.has(target))
|
|
156
156
|
});
|
|
157
157
|
|
|
158
|
-
async function addTree(relativeDirectory, classification) {
|
|
159
|
-
const normalized = normalizeProjectRelative(relativeDirectory);
|
|
160
|
-
if (!normalized) {
|
|
161
|
-
addBlocker(String(relativeDirectory), "dynamic directory escapes the selected project root");
|
|
162
|
-
return;
|
|
163
|
-
}
|
|
164
|
-
if (!(await hasExactProjectPath(rootPath, normalized))) return;
|
|
165
|
-
const absolute = path.resolve(rootPath, normalized);
|
|
158
|
+
async function addTree(relativeDirectory, classification) {
|
|
159
|
+
const normalized = normalizeProjectRelative(relativeDirectory);
|
|
160
|
+
if (!normalized) {
|
|
161
|
+
addBlocker(String(relativeDirectory), "dynamic directory escapes the selected project root");
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
if (!(await hasExactProjectPath(rootPath, normalized))) return;
|
|
165
|
+
const absolute = path.resolve(rootPath, normalized);
|
|
166
166
|
const stats = await lstat(absolute).catch((error) => {
|
|
167
167
|
if (error?.code === "ENOENT") return null;
|
|
168
168
|
throw error;
|
|
@@ -183,26 +183,26 @@ export async function buildUpgradeInventory({ root, contracts = installedFileCon
|
|
|
183
183
|
else if (item.isFile()) await addFile(child, classification, { from: "dynamic-state", via: normalized }, false);
|
|
184
184
|
else addBlocker(child, "dynamic inventory source is not a regular file or directory");
|
|
185
185
|
}
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
async function hasExactProjectPath(rootPath, normalized) {
|
|
190
|
-
const parts = normalized.split("/");
|
|
191
|
-
let current = rootPath;
|
|
192
|
-
for (const part of parts) {
|
|
193
|
-
const entries = await readdir(current, { withFileTypes: true }).catch((error) => {
|
|
194
|
-
if (error?.code === "ENOENT") return null;
|
|
195
|
-
throw error;
|
|
196
|
-
});
|
|
197
|
-
if (!entries) return false;
|
|
198
|
-
const exact = entries.find((entry) => entry.name === part);
|
|
199
|
-
if (!exact) return false;
|
|
200
|
-
current = path.join(current, exact.name);
|
|
201
|
-
}
|
|
202
|
-
return true;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
/**
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
async function hasExactProjectPath(rootPath, normalized) {
|
|
190
|
+
const parts = normalized.split("/");
|
|
191
|
+
let current = rootPath;
|
|
192
|
+
for (const part of parts) {
|
|
193
|
+
const entries = await readdir(current, { withFileTypes: true }).catch((error) => {
|
|
194
|
+
if (error?.code === "ENOENT") return null;
|
|
195
|
+
throw error;
|
|
196
|
+
});
|
|
197
|
+
if (!entries) return false;
|
|
198
|
+
const exact = entries.find((entry) => entry.name === part);
|
|
199
|
+
if (!exact) return false;
|
|
200
|
+
current = path.join(current, exact.name);
|
|
201
|
+
}
|
|
202
|
+
return true;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
206
|
* Gate 5 needs a stronger closure than the shared semantic-candidate
|
|
207
207
|
* inventory: every regular project source under the selected root receives a
|
|
208
208
|
* raw-byte witness, even when no currently known Kit reader reaches it. The
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@ Purpose: give a stateless AI a compact map of the project before it reads or edi
|
|
|
6
6
|
|
|
7
7
|
| Field | Value | Last verified |
|
|
8
8
|
|---|---|---|
|
|
9
|
-
| Agent Handoff Kit template version | 0.3.47 | current template version |
|
|
9
|
+
| Agent Handoff Kit template version | 0.3.47 | current template version |
|
|
10
10
|
| Runtime | TBD | TBD |
|
|
11
11
|
| Framework | TBD | TBD |
|
|
12
12
|
| Package manager | TBD | TBD |
|