amsd-pipeline-shared 0.5.24 → 0.5.26

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.
@@ -20,6 +20,13 @@ const PKG = JSON.parse(fs.readFileSync(path.join(ROOT, 'package.json'), 'utf8'))
20
20
  const FILES = fs.readFileSync(path.join(ROOT, 'docs', 'gateway-files.txt'), 'utf8').trim().split('\n').filter(Boolean);
21
21
  const BASE = Object.fromEntries(fs.readFileSync(path.join(ROOT, 'docs', 'gateway-baseline-2.0.80.md5'), 'utf8').trim().split('\n')
22
22
  .map((l) => l.trim().split(/\s+/)).map(([sum, f]) => [f, sum]));
23
+ // KNOWN PREDECESSOR COPIES (docs/gateway-predecessors.md5): a copy an install may hold that is neither the release nor this package's — a bash
24
+ // repo change made after 2.0.80 — named with its source; replaceable like the released copy, restored by revert
25
+ const PRED = {};
26
+ for (const l of fs.readFileSync(path.join(ROOT, 'docs', 'gateway-predecessors.md5'), 'utf8').split('\n')) {
27
+ const m = l.match(/^([0-9a-f]{32})\s+(\S+)/); if (m) (PRED[m[2]] = PRED[m[2]] || []).push(m[1]);
28
+ }
29
+ const known = (f, sum) => sum === BASE[f] || (PRED[f] || []).includes(sum);
23
30
  const md5 = (f) => (fs.existsSync(f) ? crypto.createHash('md5').update(fs.readFileSync(f)).digest('hex') : null);
24
31
  const fail = (m, code = 1) => { process.stderr.write(`amsd-pipeline-shared: ${m}\n`); process.exit(code); };
25
32
 
@@ -62,7 +69,7 @@ if (cmd === 'revert') {
62
69
  if (fs.existsSync(b)) fs.copyFileSync(b, path.join(ORCH, f));
63
70
  else if (!BASE[f]) fs.rmSync(path.join(ORCH, f), { force: true }); // this package's own file: the release has none
64
71
  }
65
- const back = FILES.filter((f) => (BASE[f] ? md5(path.join(ORCH, f)) !== BASE[f] : fs.existsSync(path.join(ORCH, f))));
72
+ const back = FILES.filter((f) => (BASE[f] ? !known(f, md5(path.join(ORCH, f))) : fs.existsSync(path.join(ORCH, f))));
66
73
  if (back.length) fail(`revert incomplete — not the released copy:\n ${back.join('\n ')}`);
67
74
  fs.rmSync(STATE, { recursive: true, force: true });
68
75
  process.stdout.write(`amsd-pipeline-shared: reverted ${FILES.length} file(s) to the released copies\n`);
@@ -77,7 +84,7 @@ const plan = FILES.map((f) => {
77
84
  if (now && now !== ours && PREV[f] === now) return { f, now, ours, state: 'previous' };
78
85
  // a file the release never had (this package's own, e.g. lib/agent-messages.js): installed where absent
79
86
  if (!BASE[f]) return { f, now, ours, state: now === ours ? 'current' : (now === null ? 'new' : 'other') };
80
- return { f, now, ours, state: now === ours ? 'current' : (now === BASE[f] ? 'released' : 'other') };
87
+ return { f, now, ours, state: now === ours ? 'current' : (known(f, now) ? 'released' : 'other') };
81
88
  });
82
89
  const other = plan.filter((p) => p.state === 'other');
83
90
  if (other.length) {
@@ -0,0 +1,3 @@
1
+ # Copies a pipeline install may hold that are neither the 2.0.80 release nor this package's, each with where it came from.
2
+ # The installer backs one up and replaces it as it does the released copy; revert puts it back. Any other copy is refused.
3
+ a4e6e7d7071dfc30dc4ae11eff9050db scripts/pre-run-reset.sh epam-cli a306218f7 (unreleased): ClickHouse removed from the agent-monitor recreate (operator: "CLICKHOUSE OUT")
@@ -5,6 +5,7 @@
5
5
  # override mounting the run's PRD directory at /prd-dir and its LOG_DIR at /logs-dir, nginx's alias, and agent-monitor recreated.
6
6
  # point_dashboards_at_run <prd_file> <log_dir>
7
7
  # What pre-run-reset.sh sets before its Step 1 is taken from the caller when set, else derived from this install as pre-run-reset.sh derives it.
8
+ # CLICKHOUSE OUT (operator; epam-cli a306218f7): the recreate passes no ClickHouse port — the one change from the released step.
8
9
  point_dashboards_at_run() {
9
10
  local PRD_FILE="${1:?prd file}" LOG_DIR="${2:?log dir}"
10
11
  local _here; _here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
@@ -179,7 +180,6 @@ _obs_compose() {
179
180
  # docker, where it is meaningful and cheap.
180
181
  _obs_replace_agent_monitor() {
181
182
  EPAM_OBS_SUBNET="${OBS_SUBNET:-}" \
182
- EPAM_OBS_CLICKHOUSE_PORT="${OBS_CLICKHOUSE_PORT:-}" \
183
183
  EPAM_OBS_LANGFUSE_PORT="${OBS_LANGFUSE_PORT:-}" \
184
184
  EPAM_OBS_DASHBOARD_PORT="${OBS_DASHBOARD_PORT:-}" \
185
185
  EPAM_OBS_GRAFANA_PORT="${OBS_GRAFANA_PORT:-}" \
@@ -187,7 +187,6 @@ _obs_replace_agent_monitor() {
187
187
  _obs_compose -f "$COMPOSE_BASE" -f "$COMPOSE_OVERRIDE" -p "$OBS_PROJECT" \
188
188
  rm -sf agent-monitor >/dev/null 2>&1 || true
189
189
  EPAM_OBS_SUBNET="${OBS_SUBNET:-}" \
190
- EPAM_OBS_CLICKHOUSE_PORT="${OBS_CLICKHOUSE_PORT:-}" \
191
190
  EPAM_OBS_LANGFUSE_PORT="${OBS_LANGFUSE_PORT:-}" \
192
191
  EPAM_OBS_DASHBOARD_PORT="${OBS_DASHBOARD_PORT:-}" \
193
192
  EPAM_OBS_GRAFANA_PORT="${OBS_GRAFANA_PORT:-}" \
@@ -129,6 +129,13 @@ function cache({ install, project, codeline, variant = process.env.EPAM_BROWNFIE
129
129
  const C = path.join(O, 'projects', project, '.prompt-cache', codeline);
130
130
  const b = require(path.join(scriptsOf(install), 'lib', 'project-prompt-builder.js'));
131
131
  const tpl = (t) => path.join(O, 'prompts', 'templates', `${t}.json`);
132
+ // A COMPLETE SET IS REUSED WHOLE (2026-10-22): the mint step keeps a codeline whose set is complete ("completed its agents and
133
+ // prompts — kept") and no prompt is built, so per-prompt entries are not needed — the builder's own test, as the mint step's
134
+ const prev = process.env.EPAM_BROWNFIELD; process.env.EPAM_BROWNFIELD = variant === 'brownfield' ? '1' : '';
135
+ let whole;
136
+ try { whole = b.codelineSetComplete({ projectConfigDir: path.join(O, 'projects', project), codeline, templatesDir: path.join(O, 'prompts', 'templates'), registryFile: path.join(O, 'agents', 'invocation-profiles.json') }); }
137
+ finally { if (prev === undefined) delete process.env.EPAM_BROWNFIELD; else process.env.EPAM_BROWNFIELD = prev; }
138
+ if (whole && whole.complete) return res('cache', true, `${codeline}: its complete set is reused whole by the mint step — nothing rebuilt`, { required: 0, missing: [], willRebuild: [] });
132
139
  const problems = [];
133
140
  const prompts = fs.existsSync(path.join(C, 'prompts')) ? fs.readdirSync(path.join(C, 'prompts')).filter((n) => n.endsWith('.json')).map((n) => n.replace(/\.json$/, '')) : [];
134
141
  if (!prompts.length) problems.push(`no cached prompt set (${path.join(C, 'prompts')})`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "amsd-pipeline-shared",
3
- "version": "0.5.24",
3
+ "version": "0.5.26",
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": {
@@ -11,6 +11,7 @@
11
11
  "orchestrations/",
12
12
  "docs/gateway-files.txt",
13
13
  "docs/gateway-baseline-2.0.80.md5",
14
+ "docs/gateway-predecessors.md5",
14
15
  "docs/CONSUMER-REVIEW-B56.md",
15
16
  "README.md"
16
17
  ],