yadflow 4.6.0 → 4.7.0

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 (96) hide show
  1. package/CHANGELOG.md +170 -0
  2. package/README.md +4 -1
  3. package/bin/commands.mjs +5 -1
  4. package/bin/yad.mjs +167 -15
  5. package/cli/artifact-status.mjs +88 -20
  6. package/cli/build.mjs +1372 -0
  7. package/cli/checkpoint.mjs +2 -2
  8. package/cli/commit.mjs +1 -0
  9. package/cli/dial.mjs +21 -1
  10. package/cli/docs.mjs +6 -1
  11. package/cli/doctor.mjs +133 -26
  12. package/cli/epic-state.mjs +357 -9
  13. package/cli/errors.mjs +2 -0
  14. package/cli/find-product.mjs +36 -2
  15. package/cli/fold.mjs +9 -5
  16. package/cli/gate-local.mjs +9 -1
  17. package/cli/gate.mjs +364 -22
  18. package/cli/history.mjs +22 -2
  19. package/cli/hook.mjs +3 -1
  20. package/cli/index-command.mjs +2 -2
  21. package/cli/ledger.mjs +60 -0
  22. package/cli/next.mjs +34 -11
  23. package/cli/openpr.mjs +81 -5
  24. package/cli/platform.mjs +21 -0
  25. package/cli/pr-list.mjs +5 -3
  26. package/cli/product-index.mjs +6 -3
  27. package/cli/product-token.mjs +186 -0
  28. package/cli/productcommit.mjs +33 -0
  29. package/cli/recommend.mjs +3 -1
  30. package/cli/repo-publish.mjs +2 -2
  31. package/cli/run-checks.mjs +586 -0
  32. package/cli/ship-drift.mjs +49 -18
  33. package/cli/standup.mjs +1 -1
  34. package/cli/status.mjs +282 -0
  35. package/cli/test-build.mjs +1559 -0
  36. package/cli/test-run-checks.mjs +603 -0
  37. package/cli/test-worktree.mjs +520 -0
  38. package/cli/thread.mjs +4 -0
  39. package/cli/tidy.mjs +2 -2
  40. package/cli/toolbox.mjs +36 -5
  41. package/cli/workspace.mjs +4 -1
  42. package/cli/worktree-record.mjs +53 -0
  43. package/cli/worktree.mjs +379 -0
  44. package/package.json +3 -3
  45. package/skills/sdlc/config.yaml +1 -1
  46. package/skills/sdlc/module-help.csv +1 -1
  47. package/skills/yad-backfill/templates/checks/backfill-check.sh +9 -9
  48. package/skills/yad-change/SKILL.md +3 -0
  49. package/skills/yad-checks/SKILL.md +34 -5
  50. package/skills/yad-checks/references/check-gates.md +69 -10
  51. package/skills/yad-checks/templates/checks/build-test-lint.sh +22 -3
  52. package/skills/yad-checks/templates/checks/commit-message.sh +8 -2
  53. package/skills/yad-checks/templates/checks/contract-check.sh +61 -33
  54. package/skills/yad-checks/templates/checks/epic-open.sh +87 -14
  55. package/skills/yad-checks/templates/checks/ledger-guard.sh +3 -3
  56. package/skills/yad-checks/templates/checks/lineage-check.sh +88 -15
  57. package/skills/yad-checks/templates/checks/member-check.mjs +206 -35
  58. package/skills/yad-checks/templates/checks/package-manager.sh +41 -4
  59. package/skills/yad-checks/templates/checks/product-checkout.sh +161 -13
  60. package/skills/yad-checks/templates/checks/reconcile-debt-check.sh +94 -15
  61. package/skills/yad-checks/templates/checks/risk-map-check.sh +2 -2
  62. package/skills/yad-checks/templates/checks/spec-link.sh +63 -4
  63. package/skills/yad-checks/templates/checks/verified-commits.sh +23 -5
  64. package/skills/yad-checks/templates/github/yad-checks.yml +8 -8
  65. package/skills/yad-checks/templates/gitlab/.gitlab-ci.yml +3 -0
  66. package/skills/yad-checks/templates/gitlab/yad-checks.gitlab-ci.yml +4 -4
  67. package/skills/yad-checks/templates/gitlab/yad-product-checks.gitlab-ci.yml +16 -3
  68. package/skills/yad-checks/templates/gitlab/yad-update-guard.gitlab-ci.yml +5 -1
  69. package/skills/yad-checks/templates/gitlab/yad-verified-commits.gitlab-ci.yml +5 -1
  70. package/skills/yad-commit/SKILL.md +4 -2
  71. package/skills/yad-docs/templates/app/package-lock.json +395 -106
  72. package/skills/yad-docs/templates/app/package.json +2 -2
  73. package/skills/yad-engineer-review/SKILL.md +45 -20
  74. package/skills/yad-engineer-review/references/ship-and-record.md +42 -8
  75. package/skills/yad-epic/references/state-schema.md +75 -16
  76. package/skills/yad-implement/SKILL.md +75 -13
  77. package/skills/yad-implement/references/implement-conventions.md +8 -1
  78. package/skills/yad-implement/templates/.gitmessage +3 -0
  79. package/skills/yad-open-pr/SKILL.md +21 -0
  80. package/skills/yad-pr-template/SKILL.md +6 -2
  81. package/skills/yad-pr-template/templates/checks/pr-template.sh +85 -4
  82. package/skills/yad-pr-template/templates/checks/pr-title.sh +1 -1
  83. package/skills/yad-pr-template/templates/github/pull_request_template.md +1 -1
  84. package/skills/yad-pr-template/templates/gitlab/merge_request_templates/Default.md +1 -1
  85. package/skills/yad-product-bridge/SKILL.md +14 -1
  86. package/skills/yad-product-bridge/references/bridge.md +5 -2
  87. package/skills/yad-product-bridge/templates/gitlab/yad-gate-sync.gitlab-ci.yml +9 -4
  88. package/skills/yad-reconcile/SKILL.md +9 -3
  89. package/skills/yad-review-gate/SKILL.md +4 -0
  90. package/skills/yad-review-gate/references/gating.md +26 -1
  91. package/skills/yad-run/SKILL.md +52 -28
  92. package/skills/yad-run/references/run-loop.md +42 -21
  93. package/skills/yad-spec/SKILL.md +137 -16
  94. package/skills/yad-spec/references/spec-handoff.md +50 -3
  95. package/skills/yad-status/SKILL.md +7 -0
  96. package/skills/yad-stories/references/story-schema.md +1 -1
@@ -27,7 +27,7 @@ product_config() {
27
27
  if [ -n "${SDLC_PRODUCT_CONFIG:-}" ]; then printf '%s' "$SDLC_PRODUCT_CONFIG"; return 0; fi
28
28
  if [ -n "${SDLC_HUB_CONFIG:-}" ]; then printf '%s' "$SDLC_HUB_CONFIG"; return 0; fi
29
29
  if [ -f .sdlc/product.json ] && [ -f .sdlc/hub.json ] && ! cmp -s .sdlc/product.json .sdlc/hub.json; then
30
- echo "FAIL [product-settings]: .sdlc/product.json and .sdlc/hub.json say different things — they are one file under two names until v5. Run \`yad migrate\` in the Product to choose the copy to keep, and commit both." >&2
30
+ echo "FAIL [product-settings]: .sdlc/product.json and .sdlc/hub.json say different things — they are one file under two names until v5. In the Product, run \`yad migrate --apply --keep product\` (or \`--keep hub\`) to choose the copy to keep, then commit both files." >&2
31
31
  return 1
32
32
  fi
33
33
  if [ -f .sdlc/product.json ]; then printf '%s' .sdlc/product.json; else printf '%s' .sdlc/hub.json; fi
@@ -61,7 +61,7 @@ BASE="${1:-${SDLC_BASE:-$(resolve_base)}}"
61
61
 
62
62
  # Fail closed if the base ref can't be resolved (shallow clone / wrong base branch / unfetched ref).
63
63
  if ! git rev-parse --verify --quiet "${BASE}^{commit}" >/dev/null; then
64
- echo "FAIL [spec-link]: base ref '${BASE}' not found — fetch full history / check the base branch."
64
+ echo "FAIL [spec-link]: base ref '${BASE}' not found — check the code out with full history (GitHub: actions/checkout with fetch-depth: 0; GitLab: GIT_DEPTH: \"0\"), and give a base that names a fetched branch (the first argument, or SDLC_BASE)."
65
65
  exit 1
66
66
  fi
67
67
  RANGE="${BASE}..HEAD"
@@ -71,6 +71,61 @@ EXEMPT='ci|chore|build|test'
71
71
  # The letters are spelled out so no locale widens them; matched whole with bash `=~`.
72
72
  STORY_RE='^EP-[abcdefghijklmnopqrstuvwxyz0123456789-]+-S[0123456789]+$'
73
73
 
74
+ # --- shared SHA exemption (byte-identical in spec-link / lineage-check / epic-open / reconcile-debt-check;
75
+ # --- the gates are deliberately standalone, so it is duplicated, not sourced) ---
76
+ # A commit already on a shared branch cannot be reworded without rewriting that branch, so one bad trailer
77
+ # would fail every later PR whose range still holds it — and a release PR to the default branch walks the
78
+ # whole release, so it fails again on every release until that commit reaches the base. `.sdlc/gate-exempt`
79
+ # names such commits, one full SHA per line, `#` comments allowed; every per-commit gate passes
80
+ # them, so a commit is waived once, in a reviewed change, instead of on every pipeline. A listed commit
81
+ # skips EVERY check of the gate, not only its trailer's — a sealed epic or a frozen thread included. SDLC_GATE_EXEMPT
82
+ # names another path in the repo. It comes from the pipeline config, which a PR may change where the PR's
83
+ # own pipeline runs; it still names a file on the BASE whose every entry must be a full SHA, so it cannot
84
+ # list the PR's own commits — and a PR that changes the pipeline could drop the gates anyway, which
85
+ # required checks and branch protection, not this script, prevent. The list is read from the BASE, never from this PR — a PR that could
86
+ # list its own commits would wave itself past every gate; an entry counts once it merges. An entry must be
87
+ # a FULL hex SHA: git reads 40 hex characters (64 in a SHA-256 repo) as a commit, but looks a short one up as a tag or branch name
88
+ # first — so a tag named like a listed short SHA would stand in for another commit, and a short SHA also
89
+ # grows ambiguous as the repo grows. An entry that is not one, or names no commit here, exempts nothing;
90
+ # both are said as notes, so a typo is visible.
91
+ GATE_EXEMPT_FILE="${SDLC_GATE_EXEMPT:-.sdlc/gate-exempt}"
92
+ exempt_shas=''
93
+ load_exempt_shas() {
94
+ # Three dots: against the merge base, so a base that moved on is not mistaken for this PR's change.
95
+ # Only exit 1 means "it changed"; an error (no merge base) says nothing about the file.
96
+ _ex_rc=0
97
+ git diff --quiet "${BASE}...HEAD" -- "$GATE_EXEMPT_FILE" 2>/dev/null || _ex_rc=$?
98
+ if [ "$_ex_rc" -eq 1 ]; then
99
+ echo "note [$1]: ${GATE_EXEMPT_FILE} changes in this PR — the list is read from ${BASE}, not from this PR; the new one counts once it merges."
100
+ fi
101
+ git cat-file -e "${BASE}:${GATE_EXEMPT_FILE}" 2>/dev/null || return 0
102
+ _ex_list="$(git show "${BASE}:${GATE_EXEMPT_FILE}" 2>/dev/null | sed -E 's/#.*//; s/^[[:space:]]+//; s/[[:space:]]+$//')" || _ex_list=""
103
+ while IFS= read -r _ex; do
104
+ [ -z "$_ex" ] && continue
105
+ case "$_ex" in
106
+ *[!0123456789abcdef]*) echo "note [$1]: ${GATE_EXEMPT_FILE} entry '${_ex}' is not a lowercase hex SHA — it exempts nothing." ; continue ;;
107
+ esac
108
+ if [ "${#_ex}" -ne 40 ] && [ "${#_ex}" -ne 64 ]; then
109
+ echo "note [$1]: ${GATE_EXEMPT_FILE} entry '${_ex}' is not a full SHA (40 characters, or 64 in a SHA-256 repo) — it exempts nothing (a short one could be taken over by a tag or branch of that name)."
110
+ continue
111
+ fi
112
+ _ex_full="$(git rev-parse --verify --quiet "${_ex}^{commit}" 2>/dev/null)" || _ex_full=""
113
+ # Only an entry git reads back as exactly itself: hex of the other hash's length (64 in a SHA-1 repo,
114
+ # 40 in a SHA-256 one) is looked up as a tag or branch name first, so a ref of that name would stand in;
115
+ # and an annotated tag's own SHA peels to its commit's — the list names commits, as rev-list walks them.
116
+ if [ -z "$_ex_full" ] || [ "$_ex_full" != "$_ex" ]; then
117
+ echo "note [$1]: ${GATE_EXEMPT_FILE} entry '${_ex}' is not the full SHA of a commit here — it exempts nothing."
118
+ continue
119
+ fi
120
+ exempt_shas="${exempt_shas}${_ex_full}
121
+ "
122
+ done <<EXEMPT_LIST
123
+ $_ex_list
124
+ EXEMPT_LIST
125
+ }
126
+ is_exempt_sha() { [ -n "$exempt_shas" ] && printf '%s' "$exempt_shas" | grep -qxF "$1"; }
127
+ load_exempt_shas spec-link
128
+
74
129
  # Portable across bash 3.2 (macOS) and 4+ — no mapfile; feed the loop via heredoc (not a pipe) so
75
130
  # the failure count survives the loop body.
76
131
  commits="$(git rev-list --no-merges "$RANGE")"
@@ -85,6 +140,10 @@ while IFS= read -r sha; do
85
140
  short="$(git log -1 --format=%h "$sha")"
86
141
  subject="$(git log -1 --format=%s "$sha")"
87
142
  task="$(git log -1 --format='%(trailers:key=Task,valueonly)' "$sha" | awk '!f && length($0) { print; f = 1 }')"
143
+ if is_exempt_sha "$sha"; then
144
+ echo "PASS [spec-link]: ${short} '${subject}' — SHA exemption (${GATE_EXEMPT_FILE} on ${BASE})"
145
+ continue
146
+ fi
88
147
  exempt=0
89
148
  note=''
90
149
  if printf '%s' "$subject" | grep -qE "^(${EXEMPT})(\([a-z0-9._-]+\))?!?: "; then
@@ -99,7 +158,7 @@ while IFS= read -r sha; do
99
158
  continue
100
159
  fi
101
160
  if [ -z "$task" ]; then
102
- echo "FAIL [spec-link]: ${short} '${subject}' has no 'Task:' trailer"
161
+ echo "FAIL [spec-link]: ${short} '${subject}' has no 'Task:' trailer — add one naming the task it implements, as 'Task: EP-<slug>-S<n>-T<NN>'. \`yad commit --task <id>\` writes it, and reads the id from a branch named like feat/EP-<slug>-S01-T01-<words> when no --task is given. For a commit already made, reword it (git commit --amend, or git rebase -i ${BASE}) and force-push. A ci, chore, build or test commit needs no trailer."
103
162
  rc=1
104
163
  continue
105
164
  fi
@@ -122,7 +181,7 @@ while IFS= read -r sha; do
122
181
  if [ -f "specs/${story}/link.md" ]; then
123
182
  echo "PASS [spec-link]: ${short} ${task} -> specs/${story}/link.md${note}"
124
183
  else
125
- echo "FAIL [spec-link]: ${short} ${task} references specs/${story}/ but link.md is missing."
184
+ echo "FAIL [spec-link]: ${short} ${task} references specs/${story}/ but link.md is missing — run the yad-spec skill for ${story} in this repo (it writes specs/${story}/link.md), or fix the story id in the Task trailer."
126
185
  rc=1
127
186
  fi
128
187
  done <<EOF
@@ -42,7 +42,7 @@ product_config() {
42
42
  if [ -n "${SDLC_PRODUCT_CONFIG:-}" ]; then printf '%s' "$SDLC_PRODUCT_CONFIG"; return 0; fi
43
43
  if [ -n "${SDLC_HUB_CONFIG:-}" ]; then printf '%s' "$SDLC_HUB_CONFIG"; return 0; fi
44
44
  if [ -f .sdlc/product.json ] && [ -f .sdlc/hub.json ] && ! cmp -s .sdlc/product.json .sdlc/hub.json; then
45
- echo "FAIL [product-settings]: .sdlc/product.json and .sdlc/hub.json say different things — they are one file under two names until v5. Run \`yad migrate\` in the Product to choose the copy to keep, and commit both." >&2
45
+ echo "FAIL [product-settings]: .sdlc/product.json and .sdlc/hub.json say different things — they are one file under two names until v5. In the Product, run \`yad migrate --apply --keep product\` (or \`--keep hub\`) to choose the copy to keep, then commit both files." >&2
46
46
  return 1
47
47
  fi
48
48
  if [ -f .sdlc/product.json ]; then printf '%s' .sdlc/product.json; else printf '%s' .sdlc/hub.json; fi
@@ -76,7 +76,7 @@ BASE="${1:-${SDLC_BASE:-$(resolve_base)}}"
76
76
 
77
77
  # Fail closed if the base ref can't be resolved (shallow clone / wrong base branch / unfetched ref).
78
78
  if ! git rev-parse --verify --quiet "${BASE}^{commit}" >/dev/null; then
79
- echo "FAIL [verified-commits]: base ref '${BASE}' not found — fetch full history / check the base branch."
79
+ echo "FAIL [verified-commits]: base ref '${BASE}' not found — check the code out with full history (GitHub: actions/checkout with fetch-depth: 0; GitLab: GIT_DEPTH: \"0\"), and give a base that names a fetched branch (the first argument, or SDLC_BASE)."
80
80
  exit 1
81
81
  fi
82
82
  RANGE="${BASE}..HEAD"
@@ -114,13 +114,22 @@ case "$platform" in
114
114
  ;;
115
115
  esac
116
116
 
117
- # 0 when the platform marks the commit's signature verified.
117
+ # 0 when the platform marks the commit's signature verified. On GitHub a failed API call sets
118
+ # sig_api_error=1, so the FAIL can tell "not signed" from "could not ask" (#351). It is read from gh's
119
+ # exit status: on an HTTP error (a bad token, a rate limit) gh still prints the error body to stdout.
120
+ # GitLab answers an unsigned commit with a 404, which `curl -f` cannot tell from a refused token, so it
121
+ # stays one case.
122
+ sig_api_error=0
118
123
  signature_verified() {
119
124
  local sha v body
120
125
  sha="$1"
126
+ sig_api_error=0
121
127
  case "$platform" in
122
128
  github)
123
- v="$(gh api "repos/{owner}/{repo}/commits/${sha}" --jq '.commit.verification.verified' 2>/dev/null || echo api-error)"
129
+ if ! v="$(gh api "repos/{owner}/{repo}/commits/${sha}" --jq '.commit.verification.verified' 2>/dev/null)"; then
130
+ sig_api_error=1
131
+ return 1
132
+ fi
124
133
  [ "$v" = "true" ]
125
134
  ;;
126
135
  gitlab)
@@ -172,7 +181,16 @@ while IFS= read -r sha; do
172
181
  # falls through to FAIL below.
173
182
  echo "WARN [verified-commits]: ${short} unsigned merge commit — introduces no content of its own (covered by verified parents); signature waived. (Self-hosted GitLab does not sign UI merge commits; on a platform that signs its merges an unsigned content-free merge is unusual but still harmless.)"
174
183
  else
175
- echo "FAIL [verified-commits]: ${short} signature missing/unverified — sign commits (GPG/SSH key registered on ${platform}), or the signature API was unreachable (GitLab: set GITLAB_TOKEN/SDLC_API_TOKEN with read_api)."
184
+ if [ "$sig_api_error" = 1 ]; then
185
+ echo "FAIL [verified-commits]: ${short} — the job could not ask GitHub for the commit's signature (gh api failed). The job needs GH_TOKEN set to the workflow's github.token, as the yad workflows set it; then run it again. On your own machine: install gh and run gh auth login."
186
+ else
187
+ resign="sign commits with a GPG or SSH key added to your ${platform} account (git config commit.gpgsign true; for an SSH key also gpg.format ssh and user.signingkey). On a pull request branch, re-sign the commits already made: git rebase --exec 'git commit --amend --no-edit -S' ${BASE}, and force-push. On the default branch, do not force-push: revert the commit, then land the change again through a pull request of signed commits."
188
+ if [ "$platform" = gitlab ]; then
189
+ echo "FAIL [verified-commits]: ${short} signature missing/unverified — ${resign} If the commits are signed, the job could not read GitLab's signature API: set a GITLAB_TOKEN (or SDLC_API_TOKEN) CI/CD variable with the read_api scope."
190
+ else
191
+ echo "FAIL [verified-commits]: ${short} signature missing/unverified — ${resign}"
192
+ fi
193
+ fi
176
194
  rc=1
177
195
  fi
178
196
  fi
@@ -32,9 +32,9 @@ jobs:
32
32
  - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
33
33
  with: { fetch-depth: 0 }
34
34
  # E120: check the Product out where .sdlc/product-link.json says, when the YAD_PRODUCT_TOKEN
35
- # secret is set; without it this prints a note and the gate defers, as before.
35
+ # secret is set; without it the gate defers, with a WARNING unless the PR comes from a fork (#345).
36
36
  - run: bash checks/product-checkout.sh "origin/${{ github.base_ref }}"
37
- env: { YAD_PRODUCT_TOKEN: "${{ secrets.YAD_PRODUCT_TOKEN }}" }
37
+ env: { YAD_PRODUCT_TOKEN: "${{ secrets.YAD_PRODUCT_TOKEN }}", YAD_PR_FORK: "${{ github.event.pull_request.head.repo.full_name != github.repository }}" }
38
38
  - run: bash checks/contract-check.sh "origin/${{ github.base_ref }}"
39
39
 
40
40
  # E65/E66 — the risk map (.sdlc/risk-map: a risk level per directory, no names). Warnings, and the
@@ -93,9 +93,9 @@ jobs:
93
93
  - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
94
94
  with: { fetch-depth: 0 }
95
95
  # E120: check the Product out where .sdlc/product-link.json says, when the YAD_PRODUCT_TOKEN
96
- # secret is set; without it this prints a note and the gate defers, as before.
96
+ # secret is set; without it the gate defers, with a WARNING unless the PR comes from a fork (#345).
97
97
  - run: bash checks/product-checkout.sh "origin/${{ github.base_ref }}"
98
- env: { YAD_PRODUCT_TOKEN: "${{ secrets.YAD_PRODUCT_TOKEN }}" }
98
+ env: { YAD_PRODUCT_TOKEN: "${{ secrets.YAD_PRODUCT_TOKEN }}", YAD_PR_FORK: "${{ github.event.pull_request.head.repo.full_name != github.repository }}" }
99
99
  - run: bash checks/lineage-check.sh "origin/${{ github.base_ref }}"
100
100
 
101
101
  epic-open:
@@ -105,9 +105,9 @@ jobs:
105
105
  - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
106
106
  with: { fetch-depth: 0 }
107
107
  # E120: check the Product out where .sdlc/product-link.json says, when the YAD_PRODUCT_TOKEN
108
- # secret is set; without it this prints a note and the gate defers, as before.
108
+ # secret is set; without it the gate defers, with a WARNING unless the PR comes from a fork (#345).
109
109
  - run: bash checks/product-checkout.sh "origin/${{ github.base_ref }}"
110
- env: { YAD_PRODUCT_TOKEN: "${{ secrets.YAD_PRODUCT_TOKEN }}" }
110
+ env: { YAD_PRODUCT_TOKEN: "${{ secrets.YAD_PRODUCT_TOKEN }}", YAD_PR_FORK: "${{ github.event.pull_request.head.repo.full_name != github.repository }}" }
111
111
  - run: bash checks/epic-open.sh "origin/${{ github.base_ref }}"
112
112
 
113
113
  reconcile-debt:
@@ -117,9 +117,9 @@ jobs:
117
117
  - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
118
118
  with: { fetch-depth: 0 }
119
119
  # E120: check the Product out where .sdlc/product-link.json says, when the YAD_PRODUCT_TOKEN
120
- # secret is set; without it this prints a note and the gate defers, as before.
120
+ # secret is set; without it the gate defers, with a WARNING unless the PR comes from a fork (#345).
121
121
  - run: bash checks/product-checkout.sh "origin/${{ github.base_ref }}"
122
- env: { YAD_PRODUCT_TOKEN: "${{ secrets.YAD_PRODUCT_TOKEN }}" }
122
+ env: { YAD_PRODUCT_TOKEN: "${{ secrets.YAD_PRODUCT_TOKEN }}", YAD_PR_FORK: "${{ github.event.pull_request.head.repo.full_name != github.repository }}" }
123
123
  - run: bash checks/reconcile-debt-check.sh "origin/${{ github.base_ref }}"
124
124
 
125
125
  # Pattern gates: commit subject + PR title + PR body all follow the convention (profile: code).
@@ -5,6 +5,9 @@ stages: [spec-link, contract-check, build-test-lint, verified-commits]
5
5
 
6
6
  default:
7
7
  image: node:${YAD_NODE_VERSION}
8
+ # Runner selection on tag-locked instances (run_untagged: false): set the YAD_RUNNER_TAGS CI/CD variable.
9
+ # When unset, current GitLab (>=15) runs the jobs untagged.
10
+ tags: [$YAD_RUNNER_TAGS]
8
11
 
9
12
  .mr_only:
10
13
  rules:
@@ -52,7 +52,7 @@ yad-contract-check:
52
52
  needs: []
53
53
  script:
54
54
  # E120: check the Product out where .sdlc/product-link.json says, when the YAD_PRODUCT_TOKEN CI/CD
55
- # variable is set (masked); without it this prints a note and the gate defers, as before.
55
+ # variable is set (masked); without it the gate defers, with a WARNING unless the MR comes from a fork (#345).
56
56
  - bash checks/product-checkout.sh "origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME"
57
57
  - bash checks/contract-check.sh "origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME"
58
58
 
@@ -81,7 +81,7 @@ yad-lineage-check:
81
81
  needs: []
82
82
  script:
83
83
  # E120: check the Product out where .sdlc/product-link.json says, when the YAD_PRODUCT_TOKEN CI/CD
84
- # variable is set (masked); without it this prints a note and the gate defers, as before.
84
+ # variable is set (masked); without it the gate defers, with a WARNING unless the MR comes from a fork (#345).
85
85
  - bash checks/product-checkout.sh "origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME"
86
86
  - bash checks/lineage-check.sh "origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME"
87
87
 
@@ -90,7 +90,7 @@ yad-epic-open:
90
90
  needs: []
91
91
  script:
92
92
  # E120: check the Product out where .sdlc/product-link.json says, when the YAD_PRODUCT_TOKEN CI/CD
93
- # variable is set (masked); without it this prints a note and the gate defers, as before.
93
+ # variable is set (masked); without it the gate defers, with a WARNING unless the MR comes from a fork (#345).
94
94
  - bash checks/product-checkout.sh "origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME"
95
95
  - bash checks/epic-open.sh "origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME"
96
96
 
@@ -99,7 +99,7 @@ yad-reconcile-debt:
99
99
  needs: []
100
100
  script:
101
101
  # E120: check the Product out where .sdlc/product-link.json says, when the YAD_PRODUCT_TOKEN CI/CD
102
- # variable is set (masked); without it this prints a note and the gate defers, as before.
102
+ # variable is set (masked); without it the gate defers, with a WARNING unless the MR comes from a fork (#345).
103
103
  - bash checks/product-checkout.sh "origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME"
104
104
  - bash checks/reconcile-debt-check.sh "origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME"
105
105
 
@@ -10,11 +10,24 @@
10
10
  # the gate can tell the two apart. Commit subjects are always Conventional-Commits.
11
11
  # Job names are yad-product-prefixed so they coexist with any code-repo fragment in one pipeline; jobs use
12
12
  # `needs: []` and no `stage:` so a foreign `stages:` list can neither break nor reorder them.
13
- default:
14
- image: node:20
15
- tags: [$YAD_RUNNER_TAGS]
13
+ #
14
+ # `image:`/`tags:` live on the .yad_product_mr_only anchor below — NOT a top-level `default:`. An included
15
+ # top-level `default:` merges into the HOST root pipeline: it would set this image and tag on every one of
16
+ # the Product's own jobs, and if the root already sets a top-level `image:`, GitLab rejects the whole
17
+ # config ("image is defined in top-level and 'default:' entry"). The anchor scopes them to these jobs.
16
18
 
17
19
  .yad_product_mr_only:
20
+ image: node:${YAD_NODE_VERSION}
21
+ variables:
22
+ # A project/group CI/CD variable overrides this YAML value, so the Node line can be changed in project
23
+ # settings without editing the managed fragment (a current 20, 22 or 24 line). A shell-executor runner
24
+ # ignores `image:` — Node must then be on the runner host's PATH, and this value has no effect.
25
+ YAD_NODE_VERSION: "22"
26
+ # Runner selection: set the YAD_RUNNER_TAGS CI/CD variable (e.g. `dind_runner`) to route these jobs on
27
+ # instances whose runners are tag-locked (run_untagged: false) — it lives in project Settings → CI/CD →
28
+ # Variables, so it survives every `yad` sync. When unset, current GitLab (>=15) runs the jobs untagged;
29
+ # older versions may strand them — set a real tag if so. Single value only: `tags: [$VAR]` is one tag.
30
+ tags: [$YAD_RUNNER_TAGS]
18
31
  rules:
19
32
  - if: $CI_PIPELINE_SOURCE == "merge_request_event"
20
33
 
@@ -19,9 +19,13 @@
19
19
 
20
20
  .yad_update_guard_base: &yad_update_guard_base
21
21
  tags: [$YAD_RUNNER_TAGS]
22
- image: node:20
22
+ image: node:${YAD_NODE_VERSION}
23
23
  variables:
24
24
  GIT_DEPTH: "0" # full history so the gates can diff the pushed range
25
+ # A project/group CI/CD variable overrides this YAML value, so the Node line can be changed in project
26
+ # settings without editing the managed fragment (a current 20, 22 or 24 line). A shell-executor runner
27
+ # ignores `image:` — Node must then be on the runner host's PATH, and this value has no effect.
28
+ YAD_NODE_VERSION: "22"
25
29
  before_script:
26
30
  # First push / an unresolvable before-SHA: fall back to the commit's parent (tip commit only —
27
31
  # a rare fail-open for a multi-commit first push, preferred over failing closed).
@@ -17,9 +17,13 @@ yad-product-verified-commits:
17
17
  # project Settings → CI/CD → Variables, so it survives every `yad` sync. When unset, current
18
18
  # GitLab (>=15) runs the job untagged; older versions may strand it — set a real tag if so.
19
19
  tags: [$YAD_RUNNER_TAGS]
20
- image: node:20
20
+ image: node:${YAD_NODE_VERSION}
21
21
  variables:
22
22
  GIT_DEPTH: "0" # full history so the gate can diff against the target branch
23
+ # A project/group CI/CD variable overrides this YAML value, so the Node line can be changed in project
24
+ # settings without editing the managed fragment (a current 20, 22 or 24 line). A shell-executor runner
25
+ # ignores `image:` — Node must then be on the runner host's PATH, and this value has no effect.
26
+ YAD_NODE_VERSION: "22"
23
27
  rules:
24
28
  - if: $CI_PIPELINE_SOURCE == "merge_request_event"
25
29
  script:
@@ -57,9 +57,11 @@ staged, split it into separate commits rather than passing `--force`.
57
57
  ### Step 2 — Commit by convention
58
58
  Run the CLI from the repo root:
59
59
  ```
60
- yad commit --type <type> -m "<subject>" [--ai <id>] [--task <id>] [--contract-change] [--manual --reason "<why>"] [--dry-run]
60
+ yad commit --type <type> -m "<subject>" [--body "<text>"] [--ai <id>] [--task <id>] [--contract-change] [--manual --reason "<why>"] [--dry-run]
61
61
  ```
62
- Use `--dry-run` first to preview the exact message (subject + trailer block) without committing. The
62
+ `--body` adds a body between the subject and the trailers, as its own paragraph — for example the
63
+ `Decisions:` paragraph `yad-implement` writes (#357). `yad ship` takes no body: commit with `yad commit`, and open the
64
+ PR/MR later, when the flow says to (`yad open-pr`). Use `--dry-run` first to preview the exact message (subject + trailer block) without committing. The
63
65
  CLI validates the type, rejects a trailing period, and emits the trailers in the fixed order.
64
66
 
65
67
  ### Step 3 — Stop (no auto-advance)