amsd-pipeline-shared 0.5.32 → 0.5.33

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.
@@ -143,7 +143,7 @@ function cache({ install, project, codeline, variant = process.env.EPAM_BROWNFIE
143
143
  if (minted.length) problems.push(`minted files missing: ${minted.join(', ')}`);
144
144
  const marker = path.join(O, 'projects', project, '.prompt-cache', `.complete-${codeline}${variant ? `.${variant}` : ''}`);
145
145
  if (!fs.existsSync(marker)) problems.push(`no completion marker ${path.basename(marker)}`);
146
- const list = b.provisioningList({ bootstrap: readJson(path.join(O, 'prompts', 'bootstrap.json'), {}), registry: readJson(path.join(O, 'agents', 'invocation-profiles.json'), {}), templateExists: (t) => fs.existsSync(tpl(t)) });
146
+ const list = b.provisioningList({ bootstrap: readJson(path.join(O, 'prompts', 'bootstrap.json'), {}), registry: readJson(path.join(O, 'agents', 'invocation-profiles.json'), {}), templateExists: (t) => fs.existsSync(tpl(t)), templatesDir: path.join(O, 'prompts', 'templates') });
147
147
  const multi = (t) => Object.prototype.hasOwnProperty.call(readJson(tpl(t), {}), 'bodies');
148
148
  const required = list.filter((i) => prompts.includes(i) && !multi(i));
149
149
  const has = (i) => fs.existsSync(path.join(C, `${i}.json`)) || (variant && fs.existsSync(path.join(C, `${i}.${variant}.json`)));
@@ -448,7 +448,11 @@ function renderGeneratorPrompt({ generatorBody, template, projectContext, codeli
448
448
  * @param {function} [o.templateExists] (id) => bool; defaults to assuming it does
449
449
  * @returns {string[]} template ids needing a generated project copy
450
450
  */
451
- function provisioningList({ bootstrap = {}, registry = {}, templateExists = () => true, declaredProject = [] }) {
451
+ function provisioningList({ bootstrap = {}, registry = {}, templateExists = () => true, templatesDir = '' }) {
452
+ // THE THIRD KIND is read HERE, once, for every reader — the build, the inputs digest a recorded set is judged by, the pre-launch's
453
+ // check (2026-10-24: only the build read it, so a new one never made a set stale and its copy was never made)
454
+ const declaredProject = templatesDir && fs.existsSync(templatesDir) ? fs.readdirSync(templatesDir).filter((f) => f.endsWith('.json'))
455
+ .map((f) => { try { return readJson(path.join(templatesDir, f)); } catch { return null; } }).filter((t) => t && t.layer === 'project' && t.id).map((t) => t.id) : [];
452
456
  const copyVerbatim = Array.isArray(bootstrap.copyVerbatim) ? bootstrap.copyVerbatim : [];
453
457
  const aux = Array.isArray(bootstrap.generated) ? bootstrap.generated : [];
454
458
 
@@ -529,9 +533,7 @@ async function buildProjectPrompts({
529
533
  generated = provisioningList({
530
534
  bootstrap: boot,
531
535
  registry: readJson(registryFile),
532
- templateExists: (id) => fs.existsSync(path.join(templatesDir, `${id}.json`)),
533
- declaredProject: fs.readdirSync(templatesDir).filter((f) => f.endsWith('.json'))
534
- .map((f) => readJson(path.join(templatesDir, f))).filter((t) => t && t.layer === 'project' && t.id).map((t) => t.id),
536
+ templateExists: (id) => fs.existsSync(path.join(templatesDir, `${id}.json`)), templatesDir,
535
537
  });
536
538
  log(`[prompt-builder] ${generated.length} template(s) need a project copy `
537
539
  + '(seam-declared, plus bootstrap auxiliaries)');
@@ -1239,7 +1241,7 @@ function promptInputIds({ dir, registryFile }) {
1239
1241
  const exists = (id) => fs.existsSync(path.join(dir, `${id}.json`));
1240
1242
  const ids = new Set();
1241
1243
  const copy = Array.isArray(boot.copyVerbatim) ? boot.copyVerbatim : [];
1242
- for (const id of [...copy, ...provisioningList({ bootstrap: boot, registry, templateExists: exists })]) {
1244
+ for (const id of [...copy, ...provisioningList({ bootstrap: boot, registry, templateExists: exists, templatesDir: dir })]) {
1243
1245
  ids.add(id);
1244
1246
  ids.add(variantIdFor(id, exists));
1245
1247
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "amsd-pipeline-shared",
3
- "version": "0.5.32",
3
+ "version": "0.5.33",
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": {