amsd-pipeline-shared 0.5.0 → 0.5.2

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.
Files changed (50) hide show
  1. package/docs/gateway-baseline-2.0.80.md5 +47 -0
  2. package/docs/gateway-files.txt +47 -0
  3. package/orchestrations/config/repo-artifacts.json +23 -0
  4. package/orchestrations/config/resume-preserves.json +25 -0
  5. package/orchestrations/config/run-modes.json +47 -0
  6. package/orchestrations/scripts/lib/checkpoints.sh +175 -0
  7. package/orchestrations/scripts/lib/codeline-lanes.sh +1664 -0
  8. package/orchestrations/scripts/lib/codeline-packages.js +67 -0
  9. package/orchestrations/scripts/lib/codeline-write-perimeter.sh +318 -0
  10. package/orchestrations/scripts/lib/common.sh +66 -0
  11. package/orchestrations/scripts/lib/control-plane.sh +506 -0
  12. package/orchestrations/scripts/lib/ecosystem-registry.js +148 -0
  13. package/orchestrations/scripts/lib/engine-paths.sh +52 -0
  14. package/orchestrations/scripts/lib/flags.sh +38 -0
  15. package/orchestrations/scripts/lib/git-ops.sh +975 -0
  16. package/orchestrations/scripts/lib/halt-recovery.sh +56 -0
  17. package/orchestrations/scripts/lib/handlers/_read-input.js +88 -0
  18. package/orchestrations/scripts/lib/handlers/carry-plan.js +25 -0
  19. package/orchestrations/scripts/lib/handlers/cl-entries.js +10 -0
  20. package/orchestrations/scripts/lib/handlers/codeline-ecosystem.js +164 -0
  21. package/orchestrations/scripts/lib/handlers/codeline-manifests.js +148 -0
  22. package/orchestrations/scripts/lib/handlers/filtered-prd.js +85 -0
  23. package/orchestrations/scripts/lib/handlers/merge-lane-into-canonical.js +39 -0
  24. package/orchestrations/scripts/lib/handlers/package-engines-node.js +25 -0
  25. package/orchestrations/scripts/lib/handlers/prd-phases.js +46 -0
  26. package/orchestrations/scripts/lib/handlers/rebuild-cross-contract.js +7 -0
  27. package/orchestrations/scripts/lib/handlers/record-declared-pass.js +23 -0
  28. package/orchestrations/scripts/lib/handlers/release-line-prd.js +31 -0
  29. package/orchestrations/scripts/lib/handlers/release-lines.js +31 -0
  30. package/orchestrations/scripts/lib/handlers/repo-exclude-patterns.js +108 -0
  31. package/orchestrations/scripts/lib/handlers/resume-spec-output-present.js +16 -0
  32. package/orchestrations/scripts/lib/handlers/sibling-providers.js +43 -0
  33. package/orchestrations/scripts/lib/handlers/spanning-stories-incomplete.js +50 -0
  34. package/orchestrations/scripts/lib/handlers/spec-inputs-digest.js +48 -0
  35. package/orchestrations/scripts/lib/handlers/spec-predates-plan.js +40 -0
  36. package/orchestrations/scripts/lib/handlers/stories-lacking-spec.js +64 -0
  37. package/orchestrations/scripts/lib/handlers/write-missing-plans.js +92 -0
  38. package/orchestrations/scripts/lib/orchestration-resume.sh +74 -0
  39. package/orchestrations/scripts/lib/phase-exit.sh +90 -0
  40. package/orchestrations/scripts/lib/pipeline-commit.sh +19 -0
  41. package/orchestrations/scripts/lib/plan-hash.js +19 -0
  42. package/orchestrations/scripts/lib/plan-scope.js +73 -0
  43. package/orchestrations/scripts/lib/qa-gate-evidence.sh +235 -0
  44. package/orchestrations/scripts/lib/release-lines.sh +166 -0
  45. package/orchestrations/scripts/lib/resume-semantics.sh +31 -0
  46. package/orchestrations/scripts/lib/run-checkpoint.sh +842 -0
  47. package/orchestrations/scripts/lib/run-modes.sh +93 -0
  48. package/orchestrations/scripts/lib/story-outputs.sh +322 -0
  49. package/orchestrations/scripts/lib/story-retry-state.sh +355 -0
  50. package/package.json +1 -1
@@ -0,0 +1,52 @@
1
+ #!/usr/bin/env bash
2
+ # What the ENGINE owns — the bash half of src/config/enginePaths.ts.
3
+ #
4
+ # These directories hold epam-cli's own state: knowledge base, agent profiles, run logs,
5
+ # code indexes, telemetry, contracts. None of it is client content, none of it is writer
6
+ # output, and none of it may be committed into a client codeline.
7
+ #
8
+ # ONE definition, because this rule has already drifted three ways. lib/git-ops.sh carried
9
+ # the full list, worktree-health-check.sh excluded only orchestrations/logs/* (so
10
+ # orchestrations/agents/KB.md passed straight through), Step 9's auto-commit excluded
11
+ # nothing, and lib/story-outputs.sh had its own separate regex covering only two of the
12
+ # five. Live metrolinx 20260804T225443Z: the engine's KB.md was written into the upexpress
13
+ # client repo and recorded as writer output in that lane's manifest.
14
+ #
15
+ # The real perimeter is the WRITE seam (src/config/enginePaths.ts, enforced in
16
+ # WriteFileTool). Everything here is defence in depth.
17
+
18
+ _ENGINE_OWNED_DIRS=( 'orchestrations' '.epam' '.codegraph' '.deepeval' '.contracts' )
19
+
20
+ # engine_paths_filter — stdin: repo-relative paths. stdout: those that are NOT engine-owned.
21
+ #
22
+ # Matches whole path SEGMENTS, never a substring: `src/orchestrations-ui/App.tsx` is client
23
+ # code and must survive, while `orchestrations/agents/KB.md` and
24
+ # `packages/web/.epam/settings.json` must both be dropped.
25
+ engine_paths_filter() {
26
+ local _line
27
+ local _owned_list
28
+ _owned_list=$(printf '%s\n' "${_ENGINE_OWNED_DIRS[@]}")
29
+ while IFS= read -r _line; do
30
+ [ -n "$_line" ] || continue
31
+ # -x -F: exact, literal, whole-segment. No pattern matching.
32
+ if printf '%s\n' "$_line" | tr '/' '\n' | grep -qxF "$_owned_list" 2>/dev/null; then
33
+ continue
34
+ fi
35
+ printf '%s\n' "$_line"
36
+ done
37
+ }
38
+
39
+ # engine_paths_pathspec — the same owned set, as git pathspec exclusions.
40
+ #
41
+ # engine_paths_filter above filters a LIST of paths. Some callers need the exclusion applied by
42
+ # git itself, because their output is a patch rather than a list and there are no paths to filter.
43
+ # Both read _ENGINE_OWNED_DIRS, so the set is defined once: restating it in pathspec form at a
44
+ # call site is how this rule has already drifted three ways.
45
+ #
46
+ # Usage: mapfile -t _ex < <(engine_paths_pathspec); git diff <ref> -- . "${_ex[@]}"
47
+ engine_paths_pathspec() {
48
+ local _d
49
+ for _d in "${_ENGINE_OWNED_DIRS[@]}"; do
50
+ printf ':!%s/*\n:!*/%s/*\n' "$_d" "$_d"
51
+ done
52
+ }
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env bash
2
+ # ─────────────────────────────────────────────────────────────────────────────
3
+ # lib/flags.sh — ONE helper owns whether a boolean env flag is on.
4
+ #
5
+ # THE BUG THIS EXISTS FOR (hit live 2026-08-03): a run was launched with
6
+ # SKIP_REGRESSION_GUARD=1 and Step 5 ran anyway, because that check was
7
+ # `[ "${SKIP_REGRESSION_GUARD:-false}" != "true" ]` — only the literal string
8
+ # `true` worked. The flag silently did nothing and the operator had no signal.
9
+ #
10
+ # THE ACTUAL DEFECT was not one flag: the codebase ran TWO conventions at once —
11
+ # != "true" : SKIP_REGRESSION_GUARD, SKIP_PRE_REVIEW_GATE, SKIP_LINT_GATE, SKIP_AUTO_PR
12
+ # != "1" : SKIP_CPA, SKIP_TC_WRITER, SKIP_SKILL_ASSESSMENT, SKIP_GATE_REMEDIATION
13
+ # so `SKIP_REGRESSION_GUARD=1` failed precisely BECAUSE it matched the other half
14
+ # of the same codebase. Every flag was a coin flip. A flag that silently does
15
+ # nothing is the same failure class as a gate that logs instead of blocking: the
16
+ # operator believes an instruction took effect when it did not.
17
+ #
18
+ # Usage — always pass a `:-` default so `set -u` cannot trip:
19
+ # if is_truthy "${SKIP_SOMETHING:-}"; then ... ; fi
20
+ # ! is_truthy "${SKIP_SOMETHING:-}" && run_the_thing
21
+ #
22
+ # Unset or empty is FALSE, so a gate is never skipped by accident — the safe
23
+ # default survives a typo in the variable name.
24
+ #
25
+ # Guarded by test/unit/orchestration/env-flags-truthy.test.ts, which also fails
26
+ # if any SKIP_* flag anywhere goes back to a bare literal comparison.
27
+ # ─────────────────────────────────────────────────────────────────────────────
28
+
29
+ # is_truthy <value> — 0 (success) when the value means "on".
30
+ # Accepts 1 / true / yes / on, case-insensitive. Everything else is off.
31
+ is_truthy() {
32
+ local _v="${1:-}"
33
+ _v="$(printf '%s' "$_v" | tr '[:upper:]' '[:lower:]')"
34
+ case "$_v" in
35
+ 1|true|yes|on) return 0 ;;
36
+ *) return 1 ;;
37
+ esac
38
+ }