amsd-pipeline-shared 0.5.39 → 0.5.41
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/orchestrations/prompts/templates/set-fidelity-check.json +5 -5
- package/orchestrations/prompts/templates/survey-review.json +7 -6
- package/orchestrations/prompts/templates/test-ownership.json +4 -3
- package/orchestrations/scripts/lib/engine-prompt.js +4 -0
- package/orchestrations/scripts/lib/prelaunch.js +22 -11
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "set-fidelity-check",
|
|
3
|
-
"version":
|
|
3
|
+
"version": 2,
|
|
4
4
|
"seams": [],
|
|
5
5
|
"layer": "engine",
|
|
6
6
|
"description": "A judge reads a codeline's minted roster and reusable prompts against the ticket they were minted for and reports what is geared to that ticket rather than to the codeline.",
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
"__CODELINE__",
|
|
9
9
|
"__TICKET_KEY__",
|
|
10
10
|
"__TICKET_TITLE__",
|
|
11
|
-
"__ROSTER__"
|
|
12
|
-
"__PROMPTS__"
|
|
11
|
+
"__ROSTER__"
|
|
13
12
|
],
|
|
14
13
|
"$why": [
|
|
15
|
-
"v1 (operator, 2026-10-24: \"We need some post pause 1 checkpoints to ensure no contamination in codeline level prompts and profiles\"): run 13's roster named every agent after the ticket's subject and ~half its reusable prompts described that one ticket; the sets are cached per codeline and reused for every later story. Judged by an agent, not a word list; run by the pre-launch of the leg after pause 1 and reported at pause 1."
|
|
14
|
+
"v1 (operator, 2026-10-24: \"We need some post pause 1 checkpoints to ensure no contamination in codeline level prompts and profiles\"): run 13's roster named every agent after the ticket's subject and ~half its reusable prompts described that one ticket; the sets are cached per codeline and reused for every later story. Judged by an agent, not a word list; run by the pre-launch of the leg after pause 1 and reported at pause 1.",
|
|
15
|
+
"v2 (live, 2026-10-24): a codeline's whole prompt set in one call was 908 KB and the judge answered about its own context limit; the prompts are judged one by one by the pipeline's own reviewer as they are built (each copy records its judges), so this judge reads the roster only."
|
|
16
16
|
],
|
|
17
|
-
"body": "You judge
|
|
17
|
+
"body": "You judge the agent roster a pipeline minted for ONE codeline and will REUSE for every later story on it: its agents' names and\nbriefs. It was minted while this ticket was in scope:\n\nTicket __TICKET_KEY__: __TICKET_TITLE__\nCodeline: __CODELINE__\n\nTHE ROSTER (each agent: name, kind, brief):\n__ROSTER__\n\nReport every agent that is geared to THIS ticket rather than to the codeline: named after the ticket's subject, component or key, or\nbriefed so that it takes this ticket's subject, components, files or requirements as its subject or as standing instruction — an\nimplementer on a DIFFERENT story of this codeline would be misled. A mention of the ticket's subject or files only as a marked example\nof the codeline's conventions is not geared. Quote the words. Report nothing you cannot quote. Answer in the structured form you are\ngiven; `geared` is empty when nothing is geared."
|
|
18
18
|
}
|
|
@@ -9,22 +9,23 @@
|
|
|
9
9
|
"",
|
|
10
10
|
"Live 2026-08-17: the survey reported a codeline in_scope on a file that codeline does not",
|
|
11
11
|
"have, and an implementer was briefed to apply that codeline's fix in a repository with no",
|
|
12
|
-
"such code. A validator was written to strip false paths, and it SILENTLY REWROTE the survey
|
|
12
|
+
"such code. A validator was written to strip false paths, and it SILENTLY REWROTE the survey —",
|
|
13
13
|
"worse than reporting, and removed. A generated prompt already gets an adversarial reviewer",
|
|
14
14
|
"before anything inherits it (prompt-review); the survey needs the same and had none.",
|
|
15
15
|
"",
|
|
16
16
|
"SCOPE IS DELIBERATELY NARROW, for the reason prompt-review's is: it judges CHECKABLE CLAIMS",
|
|
17
17
|
"ABOUT THE REPOSITORIES, never whether the survey looked hard enough or chose well. A reviewer",
|
|
18
|
-
"invited to improve judgement rewrites correct surveys."
|
|
18
|
+
"invited to improve judgement rewrites correct surveys.",
|
|
19
|
+
"v2 (run 14, 2026-10-24): read INSIDE the mint before any project prompt exists (the estate survey's review; the mint's test-ownership policy), so a never-minted project could not be minted. Bootstrap layer: rendered from the template there, as the registry's bootstrap seams are; the builder still makes the project's own copy for the seams that read it later."
|
|
19
20
|
],
|
|
20
21
|
"id": "survey-review",
|
|
21
|
-
"version":
|
|
22
|
-
"layer": "
|
|
22
|
+
"version": 2,
|
|
23
|
+
"layer": "bootstrap",
|
|
23
24
|
"description": "Falsifies what an estate survey claims about the codelines, before a roster is minted from it.",
|
|
24
25
|
"seams": [
|
|
25
26
|
"survey-review"
|
|
26
27
|
],
|
|
27
|
-
"body": "You are reviewing an ESTATE SURVEY. A roster of agents is about to be minted from it, and every\nclaim below will be inherited as a brief and re-checked by nothing.\n\nTHE SURVEY UNDER REVIEW:\n__SURVEY_BLOCK__\n\nTHE CODELINES IN SCOPE, and where each is checked out:\n__CODELINE_BLOCK__\n\nTHE WORK THE PROJECT WAS ASKED TO DO:\n__TICKET_BLOCK__\n\n__TOOL_LINE__\n\n# What is in scope\n\nONE QUESTION ONLY: does the survey state anything about these repositories that is FALSE?\n\nA claim is in scope when you can check it by opening a repository. Open them and check.\n\n- a file named in `filesRead` that the codeline does not contain\n- a file, module, function or symbol said to exist where it does not\n- a claim attributed to the WRONG codeline
|
|
28
|
+
"body": "You are reviewing an ESTATE SURVEY. A roster of agents is about to be minted from it, and every\nclaim below will be inherited as a brief and re-checked by nothing.\n\nTHE SURVEY UNDER REVIEW:\n__SURVEY_BLOCK__\n\nTHE CODELINES IN SCOPE, and where each is checked out:\n__CODELINE_BLOCK__\n\nTHE WORK THE PROJECT WAS ASKED TO DO:\n__TICKET_BLOCK__\n\n__TOOL_LINE__\n\n# What is in scope\n\nONE QUESTION ONLY: does the survey state anything about these repositories that is FALSE?\n\nA claim is in scope when you can check it by opening a repository. Open them and check.\n\n- a file named in `filesRead` that the codeline does not contain\n- a file, module, function or symbol said to exist where it does not\n- a claim attributed to the WRONG codeline — the commonest and most damaging error, because the\n brief built from it sends an implementer into a repository that has no such code\n- a dependency, script, framework or command the codeline does not declare\n- a codeline reported in_scope on evidence that belongs to a different one\n\nA codeline reported no_work_found or not_investigated is making a WEAK claim, not a false one.\nCheck it only if you can show the work plainly does reach it.\n\n# What is NOT in scope\n\nDo not judge whether the survey looked hard enough, chose the right focus, or recommended the\nright team. Do not propose better wording. Do not supply a FIX SITE of your own — naming which\nfile to edit is not yours to say here any more than it was the surveyor's, and a fix site you add\nfor a repository you swept from the outside is how one codeline's file ends up in another's work.\n\n# Evidence\n\nFor each finding, say what you CHECKED and what you FOUND, naming the repository and the path you\nopened. A finding without a check is an opinion, and an opinion about a survey is not a defect.\n\nIf every claim checks out, return no findings. An empty finding list from a review that RAN is the\ncorrect answer for a sound survey.\n",
|
|
28
29
|
"placeholders": [
|
|
29
30
|
"__CODELINE_BLOCK__",
|
|
30
31
|
"__SURVEY_BLOCK__",
|
|
@@ -34,5 +35,5 @@
|
|
|
34
35
|
"mayBeEmpty": [
|
|
35
36
|
"__SURVEY_BLOCK__"
|
|
36
37
|
],
|
|
37
|
-
"$whyMayBeEmpty": "Declared 2026-08-27 by sweeping the CLASS rather than the instance, after three runs died on it one placeholder at a time. Every call site for these writes an explicit empty branch
|
|
38
|
+
"$whyMayBeEmpty": "Declared 2026-08-27 by sweeping the CLASS rather than the instance, after three runs died on it one placeholder at a time. Every call site for these writes an explicit empty branch — the story is not being split, attempt one carries no forced-retry note, no documentation was fetched, the persona prefix is optional — so absence is a real state, which is the renderer's own test. Placeholders supplied by a lookup that may FAIL (`x || ''`) are deliberately NOT here: for those, empty means broken, and declaring them would hide the blank-brief defect the renderer exists to surface. Unanimity is required — one deliberate branch among several defensive lookups is not a licence."
|
|
38
39
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "test-ownership",
|
|
3
|
-
"layer": "
|
|
4
|
-
"version":
|
|
3
|
+
"layer": "bootstrap",
|
|
4
|
+
"version": 2,
|
|
5
5
|
"description": "Who owns the tests. ONE policy per MODE, rendered into the mint (what a brief may claim), the writer and the reviewer, so no agent holds a belief another contradicts.",
|
|
6
6
|
"$why": [
|
|
7
7
|
"This lived as a heredoc in claude.sh — the WRITER's prompt builder — and nowhere else.",
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
"spec-mode-runner.js ('a dedicated agent of this pipeline writes the tests'), so every greenfield brief",
|
|
24
24
|
"disowned its stories' test files; the roster reviewer then found, correctly, that no stage in a greenfield",
|
|
25
25
|
"run authors feature tests, and blocked the roster on every cycle. In greenfield the implementer owns the",
|
|
26
|
-
"test files its stories declare. The mode picks the body; the mint renders it from here."
|
|
26
|
+
"test files its stories declare. The mode picks the body; the mint renders it from here.",
|
|
27
|
+
"v2 (run 14, 2026-10-24): read INSIDE the mint before any project prompt exists (the estate survey's review; the mint's test-ownership policy), so a never-minted project could not be minted. Bootstrap layer: rendered from the template there, as the registry's bootstrap seams are; the builder still makes the project's own copy for the seams that read it later."
|
|
27
28
|
],
|
|
28
29
|
"placeholders": [],
|
|
29
30
|
"bodies": {
|
|
@@ -202,6 +202,10 @@ function templateLayerOf(id) {
|
|
|
202
202
|
try {
|
|
203
203
|
const own = JSON.parse(fs.readFileSync(path.join(templatesDir(), `${id}.json`), 'utf8'));
|
|
204
204
|
if (own && own.layer === 'project') return 'project';
|
|
205
|
+
// A TEMPLATE THAT DECLARES ITSELF BOOTSTRAP runs inside the mint, before this project's prompt layer exists (survey-review,
|
|
206
|
+
// test-ownership: read by the estate survey and the roster mint), and renders from the template as the registry's bootstrap
|
|
207
|
+
// seams do — run 14, 2026-10-24: a project never minted could not be minted ("project-authority prompt missing")
|
|
208
|
+
if (own && own.layer === 'bootstrap') return 'bootstrap';
|
|
205
209
|
} catch { /* no template of that id here: the registry decides, as before */ }
|
|
206
210
|
const registryPath = path.join(__dirname, '..', '..', 'agents', 'invocation-profiles.json');
|
|
207
211
|
let reg;
|
|
@@ -330,9 +330,13 @@ function checklist({ env, results }) {
|
|
|
330
330
|
/**
|
|
331
331
|
* NOTHING MINTED FOR A CODELINE IS GEARED TO THE TICKET (operator, 2026-10-24: "post pause 1 checkpoints to ensure no contamination in
|
|
332
332
|
* codeline level prompts and profiles"). After pause 1 the Agents phase has minted each codeline's roster and prompt set, which are kept
|
|
333
|
-
* and reused for every later story on that codeline.
|
|
334
|
-
*
|
|
335
|
-
*
|
|
333
|
+
* and reused for every later story on that codeline. Two parts, each what it needs to be:
|
|
334
|
+
* - the ROSTER: a judge agent (template set-fidelity-check, the given `judge` call) reads each codeline's agents against the ticket and
|
|
335
|
+
* quotes what is geared to it;
|
|
336
|
+
* - the PROMPTS: every recorded copy must carry the record of the reviewer that judged it (judgedWith — the pipeline's own prompt review,
|
|
337
|
+
* whose rule is a prompt narrowed to one story); a copy with no record is the exact gap that let run 13's ticket-geared prompts through,
|
|
338
|
+
* and is RED by name. (A whole set in one judge call was 908 KB and the judge answered about its context, not the prompts.)
|
|
339
|
+
* Anything quoted or unjudged is RED, naming the codeline and the words or files. No judge given (a £0 leg): RED, never green by silence.
|
|
336
340
|
*/
|
|
337
341
|
const SET_FIDELITY_SCHEMA = { type: 'object', required: ['geared'], properties: { geared: { type: 'array', items: { type: 'object',
|
|
338
342
|
required: ['where', 'quote', 'why'], properties: { where: { type: 'string' }, quote: { type: 'string' }, why: { type: 'string' } } } } } };
|
|
@@ -343,26 +347,33 @@ async function setFidelity({ install, projectConfigDir, ticket, codelines = [],
|
|
|
343
347
|
const rows = []; let examined = 0;
|
|
344
348
|
for (const codeline of codelines) {
|
|
345
349
|
const rp = b.recordedPromptsDir(projectConfigDir, codeline); const mi = b.mintedSnapshotDir(projectConfigDir, codeline);
|
|
346
|
-
const
|
|
350
|
+
const promptFiles = fs.existsSync(rp) ? fs.readdirSync(rp).filter((n) => n.endsWith('.json')).sort() : [];
|
|
351
|
+
// a generated copy (authority project) with no judging record; a verbatim copy (authority template / copied) carries none by design
|
|
352
|
+
const unjudged = promptFiles.filter((n) => { const d = readJson(path.join(rp, n), {}); return d && d.authority === 'project' && !d.judgedWith; });
|
|
347
353
|
let roster = '(none recorded)';
|
|
348
354
|
try {
|
|
349
355
|
const ag = readJson(path.join(mi, 'roster.json'), {}).agents || {}; const pr = (readJson(path.join(mi, 'agent-profiles.json'), {}).profiles) || {};
|
|
350
356
|
const names = Object.keys(ag);
|
|
351
357
|
if (names.length) roster = names.map((n) => `- ${n} [${(ag[n] || {}).kind || ''}]\n${String(pr[n] || (ag[n] || {}).persona || '(no brief)')}`).join('\n\n');
|
|
352
358
|
} catch { /* judged as recorded */ }
|
|
353
|
-
if (!
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
359
|
+
if (!promptFiles.length && roster === '(none recorded)') { rows.push({ codeline, examined: false, geared: [], unjudged: [] }); continue; }
|
|
360
|
+
let geared = [];
|
|
361
|
+
if (roster !== '(none recorded)') {
|
|
362
|
+
const prompt = renderEngineTemplate('set-fidelity-check', { __CODELINE__: codeline, __TICKET_KEY__: ticket.key || '', __TICKET_TITLE__: ticket.title || '', __ROSTER__: roster });
|
|
363
|
+
const out = await judge({ prompt, schema: SET_FIDELITY_SCHEMA, codeline });
|
|
364
|
+
geared = (out && Array.isArray(out.geared)) ? out.geared : null;
|
|
365
|
+
}
|
|
357
366
|
examined += 1;
|
|
358
|
-
rows.push({ codeline, examined: true, geared
|
|
367
|
+
rows.push({ codeline, examined: true, geared, unjudged });
|
|
359
368
|
}
|
|
360
369
|
const unjudged = rows.filter((r) => r.examined && r.geared === null).map((r) => r.codeline);
|
|
361
370
|
const geared = rows.filter((r) => r.examined && Array.isArray(r.geared) && r.geared.length);
|
|
362
|
-
const
|
|
371
|
+
const unjudgedPrompts = rows.filter((r) => r.examined && r.unjudged.length);
|
|
372
|
+
const ok = examined > 0 && !unjudged.length && !geared.length && !unjudgedPrompts.length;
|
|
363
373
|
const why = [geared.length && geared.map((r) => `${r.codeline}: ${r.geared.length} geared — ${r.geared.slice(0, 3).map((g) => `${g.where}: "${String(g.quote).slice(0, 80)}"`).join('; ')}`).join('; '),
|
|
374
|
+
unjudgedPrompts.length && unjudgedPrompts.map((r) => `${r.codeline}: ${r.unjudged.length} prompt copy(ies) no reviewer is recorded to have judged: ${r.unjudged.slice(0, 4).join(', ')}`).join('; '),
|
|
364
375
|
unjudged.length && `no verdict for ${unjudged.join(', ')}`, !examined && 'nothing minted to examine'].filter(Boolean).join('; ');
|
|
365
|
-
return res('set-fidelity', ok, ok ? `${examined} codeline set(s) judged against ${ticket.key}:
|
|
376
|
+
return res('set-fidelity', ok, ok ? `${examined} codeline set(s) judged against ${ticket.key}: no agent geared to the ticket, every prompt copy judged by the reviewer` : why, { rows });
|
|
366
377
|
}
|
|
367
378
|
|
|
368
379
|
/** The set-fidelity judge a LIVE launch gives setFidelity: the prompt-review seam's own model, ladder and tools (seam-invocation), through the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "amsd-pipeline-shared",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.41",
|
|
4
4
|
"description": "The AMSD pipeline's shared components, one source for the bash pipeline and its Claude workflows: the model-call gateway (llm-handler.sh — retry, ladder, self-heal, cost) and the libraries it runs.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"bin": {
|