amsd-pipeline-workflow 0.1.24 → 0.1.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.
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
// DOES THE DETECTIVE'S STRUCTURED ANALYSIS GIVE THIS CODELINE NO CHANGE? (run 11, 2026-10-21.) The pipeline's plan-gives-no-change.js reads prose (the consumer's `change` line must be exactly "none"); the same story carries the
|
|
4
|
+
// detective's structured findings — every fix site has `changeRequired` — and a codeline whose sites ALL say false needs no edit: its files are "NO EDIT REQUIRED", verified, not changed. Exit 0 = no change (and the reason on
|
|
5
|
+
// stdout as JSON); exit 1 = otherwise: no analysis for the lane, no sites, or ANY site that is true or does not say (no evidence is not "no change").
|
|
6
|
+
// plan-no-change-structured.js <prd> <story-id> <lane codeline>
|
|
7
|
+
const fs = require('fs');
|
|
8
|
+
|
|
9
|
+
try {
|
|
10
|
+
const [prdFile, storyId, lane] = process.argv.slice(2);
|
|
11
|
+
const prd = JSON.parse(fs.readFileSync(prdFile, 'utf8'));
|
|
12
|
+
const s = (prd.stories || []).find((x) => x && x.id === storyId);
|
|
13
|
+
if (!s) process.exit(1);
|
|
14
|
+
// ONLY A LANE THE PLAN SAYS MERELY RECEIVES THE CHANGE: a consumer in the story's overall plan and the provider of none of its packages. The provider is where the change is made — and run 9's detective marked the two
|
|
15
|
+
// sites cxshared edited changeRequired:false — so for it the field is not evidence of anything.
|
|
16
|
+
const pkgs = (s.overallPlan && Array.isArray(s.overallPlan.packages)) ? s.overallPlan.packages : [];
|
|
17
|
+
const isConsumer = pkgs.some((p) => p && (p.consumers || []).some((c) => c && c.codeline === lane));
|
|
18
|
+
const isProvider = pkgs.some((p) => p && p.providedBy === lane);
|
|
19
|
+
if (!isConsumer || isProvider) process.exit(1);
|
|
20
|
+
const per = s.fixSiteAnalysisPerCodeline && typeof s.fixSiteAnalysisPerCodeline === 'object' ? s.fixSiteAnalysisPerCodeline : {};
|
|
21
|
+
const sites = Array.isArray(per[lane]) ? per[lane] : (s.codeline === lane && Array.isArray(s.fixSiteAnalysis) ? s.fixSiteAnalysis : null);
|
|
22
|
+
if (!sites || !sites.length || !sites.every((x) => x && x.changeRequired === false)) process.exit(1);
|
|
23
|
+
process.stdout.write(`${JSON.stringify({ sites: sites.length, reason: `none of its ${sites.length} fix sites has changeRequired (the detective's structured analysis)` })}\n`);
|
|
24
|
+
process.exit(0);
|
|
25
|
+
} catch { process.exit(1); }
|
|
@@ -14,7 +14,13 @@ LANE_LOG="${LOG_DIR:-}"
|
|
|
14
14
|
set +e
|
|
15
15
|
for _np in "${PRD_FILE:-}" "${MAIN_PRD_FILE:-}"; do
|
|
16
16
|
[ -n "$_np" ] && [ -f "$_np" ] || continue
|
|
17
|
-
"
|
|
17
|
+
# THE PIPELINE'S ROUTE (the consumer's change line is exactly "none"), else THE STRUCTURED ONE (generator/plan-no-change-structured.js: every fix site of this lane's analysis says changeRequired false) — run 11:
|
|
18
|
+
# the plan's prose was "Verify … no manifest change." and a Writer was sent into 8 failing attempts over files the detective had already marked NO EDIT REQUIRED
|
|
19
|
+
_why=""
|
|
20
|
+
if ! "$NODE_BIN" "$SCRIPT_DIR/lib/handlers/plan-gives-no-change.js" "$_np" "$STORY" "$LANE" 2>/dev/null; then
|
|
21
|
+
_sj=$("$NODE_BIN" "$(dirname "${BASH_SOURCE[0]}")/plan-no-change-structured.js" "$_np" "$STORY" "$LANE" 2>/dev/null) || continue
|
|
22
|
+
_why=" ($(printf '%s' "$_sj" | jq -r '.reason // empty' 2>/dev/null))"
|
|
23
|
+
fi
|
|
18
24
|
_ref=""
|
|
19
25
|
if [ -e "$PROJECT_ROOT/.git" ]; then
|
|
20
26
|
[ -n "$LANE_LOG" ] && [ -f "$LANE_LOG/phase-baseline-sha.txt" ] && _ref=$(tr -d '[:space:]' < "$LANE_LOG/phase-baseline-sha.txt" 2>/dev/null)
|
|
@@ -26,7 +32,7 @@ for _np in "${PRD_FILE:-}" "${MAIN_PRD_FILE:-}"; do
|
|
|
26
32
|
'{noChange:false, message:$m}'
|
|
27
33
|
exit 0
|
|
28
34
|
fi
|
|
29
|
-
jq -cn --arg m "Story $STORY: the story's plan gives $LANE no change — no writer is run; the lane's gates prove it against the release it receives" \
|
|
35
|
+
jq -cn --arg m "Story $STORY: the story's plan gives $LANE no change${_why} — no writer is run; the lane's gates prove it against the release it receives" \
|
|
30
36
|
'{noChange:true, message:$m}'
|
|
31
37
|
exit 0
|
|
32
38
|
done
|
package/hooks/attempt-verify.sh
CHANGED
|
@@ -43,12 +43,27 @@ ruled=false
|
|
|
43
43
|
# the rung attribution.
|
|
44
44
|
retry_count="${ATTEMPT_RETRY:-}"; STORY_MODEL="${ATTEMPT_MODEL:-}"
|
|
45
45
|
_err="$TMPDIR/attempt-verify.log"; _out="$TMPDIR/attempt-output.log"; : > "$_out"
|
|
46
|
-
stage=""
|
|
46
|
+
stage=""; plan_note=""
|
|
47
|
+
# THE STRUCTURED NO-CHANGE ROUTE (run 11, 2026-10-21): verify_story_deliverables excuses "all declared files unchanged" only through the
|
|
48
|
+
# pipeline's prose handler (the consumer's change line is exactly "none"). A consumer whose fix sites ALL say changeRequired:false
|
|
49
|
+
# (generator/plan-no-change-structured.js) has had its plan carried out by a Writer that edited nothing. Only that one failure class
|
|
50
|
+
# (STORY_REJECTION_KEY unchanged-all:) is excused — a missing file or any other finding is not.
|
|
51
|
+
planned_no_change() {
|
|
52
|
+
case "${STORY_REJECTION_KEY:-}" in unchanged-all:*) ;; *) return 1 ;; esac
|
|
53
|
+
local _p _sj
|
|
54
|
+
for _p in "${PRD_FILE:-}" "${MAIN_PRD_FILE:-}"; do
|
|
55
|
+
[ -n "$_p" ] && [ -f "$_p" ] || continue
|
|
56
|
+
_sj=$("$NODE_BIN" "$(dirname "${BASH_SOURCE[0]}")/../generator/plan-no-change-structured.js" "$_p" "$STORY" "$EPAM_CODELINE" 2>/dev/null) || continue
|
|
57
|
+
plan_note="the story's plan gives ${EPAM_CODELINE} no change ($(printf '%s' "$_sj" | jq -r '.reason // empty')) — its declared files are unchanged, as planned"
|
|
58
|
+
STORY_REJECTION_KEY=""; return 0
|
|
59
|
+
done
|
|
60
|
+
return 1
|
|
61
|
+
}
|
|
47
62
|
complete_codeline_manifests "$PROJECT_ROOT" >/dev/null 2>&1
|
|
48
63
|
for s in deliverables typecheck lint tests; do
|
|
49
64
|
: > "$_err"
|
|
50
65
|
case "$s" in
|
|
51
|
-
deliverables) verify_story_deliverables "$STORY" 2>"$_err" ;;
|
|
66
|
+
deliverables) verify_story_deliverables "$STORY" 2>"$_err" || planned_no_change ;;
|
|
52
67
|
typecheck) run_tsc_verification "$STORY" "$_out" 2>"$_err" ;;
|
|
53
68
|
lint) run_repo_lint_verification "$STORY" "$_out" 2>"$_err" ;;
|
|
54
69
|
tests) run_external_verification "$STORY" "$_out" 2>"$_err" \
|
|
@@ -83,6 +98,6 @@ fi
|
|
|
83
98
|
# a passing attempt ends this writer process; a failing one leaves its globals to the failure handling and the next attempt
|
|
84
99
|
if [ "$passed" = true ]; then wp_clear "$STATE"; else wp_save "$STATE/writer-process.json"; fi
|
|
85
100
|
jq -cn --argjson p "$passed" --argjson ruled "$ruled" --arg st "$stage" --argjson d "$det" --arg vf "$VERIFICATION_FAILURE" --rawfile m "$_err" \
|
|
86
|
-
--argjson s "$same" --arg k "$([ "$passed" = false ] && printf '%s' "${STORY_REJECTION_KEY:-}")" --arg t "${LAST_TEST_CMD:-}" \
|
|
101
|
+
--arg pn "$plan_note" --argjson s "$same" --arg k "$([ "$passed" = false ] && printf '%s' "${STORY_REJECTION_KEY:-}")" --arg t "${LAST_TEST_CMD:-}" \
|
|
87
102
|
'{passed:$p, stage:(if $st == "" then null else $st end), deterministic:$d, verificationFailure:$vf, message:$m,
|
|
88
|
-
sameViolation:$s, rejectionKey:$k, testCommand:$t, ruledEnvironmental:$ruled}'
|
|
103
|
+
planNote:$pn, sameViolation:$s, rejectionKey:$k, testCommand:$t, ruledEnvironmental:$ruled}'
|
package/package.json
CHANGED