amsd-pipeline-workflow 0.1.14 → 0.1.15

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.
@@ -48,7 +48,7 @@ async function runReleaseLines(ctx, lane, clPrd, laneLog, laneEnv, canonical, ph
48
48
  const id = (JSON.parse(fs.readFileSync(linePrd, 'utf8')).stories[0] || {}).id;
49
49
  if (id) completeLineByCommit(env, wt, lineLog, linePrd, `${env.EPAM_BRANCH_PREFIX || ''}AI-${id}-${slug}`, log);
50
50
  }
51
- const done = fs.existsSync(linePrd) && (() => { const p = JSON.parse(fs.readFileSync(linePrd, 'utf8')); return p.stories.length > 0 && p.stories.every((s) => s.status === 'completed'); })();
51
+ const done = lineIsDone(linePrd);
52
52
  if (bash(env, 'resume_preserves', ['completed-stories']).status === 0 && done
53
53
  && !handler(env, 'spec-predates-plan', [linePrd, canonical || clPrd]).stdout.trim()) { // :96–106
54
54
  rerun = [];
@@ -104,6 +104,20 @@ function completeLineByCommit(env, wt, lineLog, linePrd, branch, log) {
104
104
  if (git(wt, 'rev-parse', '--verify', '--quiet', branch).status !== 0) return;
105
105
  if (git(wt, 'checkout', '-q', branch).status !== 0) { log(`[orch] could not check out ${branch} to read its committed work`); return; }
106
106
  bash({ ...env, PROJECT_ROOT: wt }, 'story_resume_completed_by_commit', [wt, lineLog, linePrd], { log });
107
+ // THE PIPELINE'S FUNCTION SETS completed ONLY; the line's done test reads status (lib/release-lines.sh:96), so a line
108
+ // completed by its commit read as not done, took the --reset path and was rewritten (LIVE-AMSD-2974-11, 2026-10-20).
109
+ // A Writer-completed story carries both; this one does too.
110
+ const p = JSON.parse(fs.readFileSync(linePrd, 'utf8'));
111
+ let changed = false;
112
+ for (const s of p.stories || []) if (s.completed === true && s.status !== 'completed' && s.status !== 'deprecated') { s.status = 'completed'; changed = true; }
113
+ if (changed) fs.writeFileSync(linePrd, JSON.stringify(p, null, 2));
107
114
  }
108
115
 
109
- module.exports = { runReleaseLines, completeLineByCommit };
116
+ /** A line whose every story is completed — the pipeline's own test (lib/release-lines.sh:96). */
117
+ function lineIsDone(linePrd) {
118
+ if (!fs.existsSync(linePrd)) return false;
119
+ const p = JSON.parse(fs.readFileSync(linePrd, 'utf8'));
120
+ return (p.stories || []).length > 0 && p.stories.every((s) => s.status === 'completed');
121
+ }
122
+
123
+ module.exports = { runReleaseLines, completeLineByCommit, lineIsDone };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "amsd-pipeline-workflow",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
4
4
  "description": "The AMSD pipeline as Claude workflows. Installed by the amsd-pipeline installer: install.sh --workflows",
5
5
  "license": "UNLICENSED",
6
6
  "bin": {