yadflow 4.5.2 → 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.
- package/CHANGELOG.md +206 -0
- package/README.md +4 -1
- package/bin/commands.mjs +5 -1
- package/bin/yad.mjs +174 -18
- package/cli/artifact-status.mjs +88 -20
- package/cli/build.mjs +1372 -0
- package/cli/checkpoint.mjs +2 -2
- package/cli/commit.mjs +1 -0
- package/cli/dial.mjs +21 -1
- package/cli/docs.mjs +6 -1
- package/cli/doctor.mjs +133 -26
- package/cli/epic-state.mjs +396 -123
- package/cli/errors.mjs +2 -0
- package/cli/find-product.mjs +36 -2
- package/cli/fold.mjs +9 -5
- package/cli/gate-local.mjs +9 -1
- package/cli/gate.mjs +442 -33
- package/cli/history.mjs +22 -2
- package/cli/hook.mjs +3 -1
- package/cli/index-command.mjs +2 -2
- package/cli/ledger.mjs +60 -0
- package/cli/lib.mjs +12 -1
- package/cli/lifecycle/defaults/1.json +96 -0
- package/cli/lifecycle/lifecycle.schema.json +121 -0
- package/cli/lifecycle.mjs +695 -0
- package/cli/next.mjs +34 -11
- package/cli/openpr.mjs +81 -5
- package/cli/platform.mjs +21 -0
- package/cli/pr-list.mjs +49 -3
- package/cli/product-index.mjs +6 -3
- package/cli/product-token.mjs +186 -0
- package/cli/productcommit.mjs +33 -0
- package/cli/recommend.mjs +3 -1
- package/cli/repo-publish.mjs +2 -2
- package/cli/run-checks.mjs +586 -0
- package/cli/ship-drift.mjs +384 -0
- package/cli/standup.mjs +1 -1
- package/cli/status.mjs +282 -0
- package/cli/test-build.mjs +1559 -0
- package/cli/test-run-checks.mjs +603 -0
- package/cli/test-worktree.mjs +520 -0
- package/cli/thread.mjs +50 -3
- package/cli/tidy.mjs +2 -2
- package/cli/toolbox.mjs +36 -5
- package/cli/workspace.mjs +4 -1
- package/cli/worktree-record.mjs +53 -0
- package/cli/worktree.mjs +379 -0
- package/package.json +4 -3
- package/skills/sdlc/config.yaml +28 -20
- package/skills/sdlc/module-help.csv +1 -1
- package/skills/yad-backfill/references/backfill.md +8 -1
- package/skills/yad-backfill/templates/checks/backfill-check.sh +54 -6
- package/skills/yad-change/SKILL.md +3 -0
- package/skills/yad-checks/SKILL.md +47 -5
- package/skills/yad-checks/references/check-gates.md +124 -12
- package/skills/yad-checks/templates/checks/build-test-lint.sh +22 -3
- package/skills/yad-checks/templates/checks/commit-message.sh +8 -2
- package/skills/yad-checks/templates/checks/contract-check.sh +354 -48
- package/skills/yad-checks/templates/checks/epic-open.sh +87 -14
- package/skills/yad-checks/templates/checks/ledger-guard.sh +3 -3
- package/skills/yad-checks/templates/checks/lineage-check.sh +88 -15
- package/skills/yad-checks/templates/checks/member-check.mjs +206 -35
- package/skills/yad-checks/templates/checks/package-manager.sh +41 -4
- package/skills/yad-checks/templates/checks/product-checkout.sh +161 -13
- package/skills/yad-checks/templates/checks/reconcile-debt-check.sh +94 -15
- package/skills/yad-checks/templates/checks/risk-map-check.sh +2 -2
- package/skills/yad-checks/templates/checks/spec-link.sh +63 -4
- package/skills/yad-checks/templates/checks/verified-commits.sh +23 -5
- package/skills/yad-checks/templates/github/yad-checks.yml +8 -8
- package/skills/yad-checks/templates/gitlab/.gitlab-ci.yml +3 -0
- package/skills/yad-checks/templates/gitlab/yad-checks.gitlab-ci.yml +4 -4
- package/skills/yad-checks/templates/gitlab/yad-product-checks.gitlab-ci.yml +16 -3
- package/skills/yad-checks/templates/gitlab/yad-update-guard.gitlab-ci.yml +5 -1
- package/skills/yad-checks/templates/gitlab/yad-verified-commits.gitlab-ci.yml +5 -1
- package/skills/yad-commit/SKILL.md +4 -2
- package/skills/yad-docs/templates/app/package-lock.json +395 -106
- package/skills/yad-docs/templates/app/package.json +2 -2
- package/skills/yad-engineer-review/SKILL.md +45 -20
- package/skills/yad-engineer-review/references/ship-and-record.md +42 -8
- package/skills/yad-epic/references/state-schema.md +83 -20
- package/skills/yad-implement/SKILL.md +75 -13
- package/skills/yad-implement/references/implement-conventions.md +8 -1
- package/skills/yad-implement/templates/.gitmessage +3 -0
- package/skills/yad-open-pr/SKILL.md +21 -0
- package/skills/yad-pr-template/SKILL.md +6 -2
- package/skills/yad-pr-template/templates/checks/pr-template.sh +85 -4
- package/skills/yad-pr-template/templates/checks/pr-title.sh +1 -1
- package/skills/yad-pr-template/templates/github/pull_request_template.md +1 -1
- package/skills/yad-pr-template/templates/gitlab/merge_request_templates/Default.md +1 -1
- package/skills/yad-product-bridge/SKILL.md +14 -1
- package/skills/yad-product-bridge/references/bridge.md +29 -5
- package/skills/yad-product-bridge/templates/gitlab/yad-gate-sync.gitlab-ci.yml +9 -4
- package/skills/yad-reconcile/SKILL.md +30 -0
- package/skills/yad-review-gate/SKILL.md +8 -2
- package/skills/yad-review-gate/references/gating.md +26 -1
- package/skills/yad-run/SKILL.md +52 -28
- package/skills/yad-run/references/run-loop.md +42 -21
- package/skills/yad-spec/SKILL.md +142 -17
- package/skills/yad-spec/references/spec-handoff.md +68 -5
- package/skills/yad-status/SKILL.md +7 -0
- package/skills/yad-stories/references/story-schema.md +1 -1
package/cli/productcommit.mjs
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
// strand required checks and fail verified-commits). This module is the single home of that guard.
|
|
5
5
|
import { warn, fail, hand, run, forTerminal } from './lib.mjs';
|
|
6
6
|
import { SETTINGS_EDIT_HINT, settingsEditHint } from './manifest.mjs';
|
|
7
|
+
import { worktreeAt } from './worktree-record.mjs';
|
|
7
8
|
|
|
8
9
|
export const productGit = (root) => (...args) => run('git', args, { cwd: root });
|
|
9
10
|
|
|
@@ -30,6 +31,32 @@ export function resolveDefaultBranch(git, productConfig) {
|
|
|
30
31
|
|| 'main';
|
|
31
32
|
}
|
|
32
33
|
|
|
34
|
+
// The branch a default-branch command commits on: the current one — or, in an epic's Product worktree
|
|
35
|
+
// (#115), which sits DETACHED because the default branch is checked out in the main tree, the default
|
|
36
|
+
// branch itself, so the commit is pushed as HEAD:<default>. Only when every commit HEAD holds that the
|
|
37
|
+
// default branch lacks (fetched first) is one of yad's own default-branch commits — each subject is
|
|
38
|
+
// `chore(product|gate): … [skip ci]`, so a `Revert "…"` of one, or a step's commit, is not. One a run made
|
|
39
|
+
// without --push, or whose push failed, is pushed by the next run, as in the main checkout. Anything else (a step's unreviewed work) must never reach the default branch. A detached
|
|
40
|
+
// HEAD anywhere else stays 'HEAD', and the guard below refuses it as before.
|
|
41
|
+
// `fetch: false` judges by the local origin/<default> — for a caller that writes a derived file and pushes
|
|
42
|
+
// nothing (the index refresh): a stale or missing ref can only make it skip — unless the default branch
|
|
43
|
+
// was rewound — and it asks no network.
|
|
44
|
+
export function branchToCommitOn(root, git, defaultBranch, { fetch = true } = {}) {
|
|
45
|
+
const branch = git('rev-parse', '--abbrev-ref', 'HEAD').stdout;
|
|
46
|
+
return branch === 'HEAD' && worktreeAt(root)?.repo === null && onlyYadCommitsAhead(git, defaultBranch, { fetch }) ? defaultBranch : branch;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// The subject every yad default-branch commit has (checkpoint, tidy, repo refresh, gate ci/repair/reopen).
|
|
50
|
+
export const YAD_COMMIT_SUBJECT = /^chore\((product|gate)\): .* \[skip ci\]$/;
|
|
51
|
+
// HEAD holds nothing origin/<default> lacks but yad's own `[skip ci]` commits. False when the fetch or the
|
|
52
|
+
// read fails: unknown is not safe.
|
|
53
|
+
export function onlyYadCommitsAhead(git, defaultBranch, { fetch = true } = {}) {
|
|
54
|
+
if (fetch && !git('fetch', '--quiet', 'origin', `+refs/heads/${defaultBranch}:refs/remotes/origin/${defaultBranch}`).ok) return false;
|
|
55
|
+
const ahead = git('log', '--format=%s', `origin/${defaultBranch}..HEAD`);
|
|
56
|
+
if (!ahead.ok) return false;
|
|
57
|
+
return ahead.stdout.split('\n').filter(Boolean).every((s) => YAD_COMMIT_SUBJECT.test(s));
|
|
58
|
+
}
|
|
59
|
+
|
|
33
60
|
// Guard: only commit on the default branch. Returns true when OK; on a non-default branch it prints the
|
|
34
61
|
// refusal + sets a non-zero exit code, unless `allowBranch` overrides (with a warning). `--allow-branch`
|
|
35
62
|
// is the SINGLE documented override — never `--force` (which elsewhere only waives the atomic guard).
|
|
@@ -43,6 +70,12 @@ export function guardDefaultBranch(branch, defaultBranch, { allowBranch = false,
|
|
|
43
70
|
return true;
|
|
44
71
|
}
|
|
45
72
|
fail(`on '${b}', not the default branch '${d}' — ${cmd} commits go to the default branch to stay out of PR-checked ranges`);
|
|
73
|
+
// An epic worktree (#115) refused here holds commits origin/<default> lacks, or could not fetch it.
|
|
74
|
+
if (branch === 'HEAD' && root && worktreeAt(root)?.repo === null) {
|
|
75
|
+
hand(`this epic worktree's HEAD has commits origin/${d} does not that are not yad's own (or the fetch failed) — a step's work goes on its branch and through review: \`git switch -c <step>/<epic>\` keeps it, then \`git fetch origin ${d}\` and \`git switch --detach origin/${d}\``);
|
|
76
|
+
process.exitCode = 1;
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
46
79
|
hand(`switch to '${d}' and re-run, or pass --allow-branch to override (if '${d}' is wrong, set default_branch in ${root ? settingsEditHint(root) : SETTINGS_EDIT_HINT})`);
|
|
47
80
|
process.exitCode = 1;
|
|
48
81
|
return false;
|
package/cli/recommend.mjs
CHANGED
|
@@ -142,7 +142,9 @@ export const RECOMMENDATIONS = Object.freeze([
|
|
|
142
142
|
|
|
143
143
|
// ---- checking an entry ------------------------------------------------------------------------------
|
|
144
144
|
|
|
145
|
-
|
|
145
|
+
// The skill pools: the recommended tools `yad skill bind` takes skills from. Docker MCP is recommended too,
|
|
146
|
+
// but it is a gateway, not a pool (#361).
|
|
147
|
+
const POOLS = () => TOOLBOX.filter((t) => t.tier === 'recommended' && t.usedBy.includes('yad skill bind')).map((t) => t.id);
|
|
146
148
|
const bindable = (step) => !!stepDef(step)?.skill && STEPS.some((s) => s.id === step);
|
|
147
149
|
|
|
148
150
|
// Every way an entry is malformed, as sentences; [] means it is well formed. The vetting record is
|
package/cli/repo-publish.mjs
CHANGED
|
@@ -20,7 +20,7 @@ import { c, ok, info, fail, hand, exists, pushWithRebase, forTerminal } from './
|
|
|
20
20
|
import { PROJECT_FILES , productConfigPath } from './manifest.mjs';
|
|
21
21
|
import { loadProduct } from './gate.mjs';
|
|
22
22
|
import { platformLogin } from './platform.mjs';
|
|
23
|
-
import { productGit, resolveDefaultBranch, guardDefaultBranch, preflightGuardReadiness } from './productcommit.mjs';
|
|
23
|
+
import { productGit, resolveDefaultBranch, guardDefaultBranch, preflightGuardReadiness, branchToCommitOn } from './productcommit.mjs';
|
|
24
24
|
import { ensurePackIgnored, PACK_IGNORE_BLOCK } from './setup.mjs';
|
|
25
25
|
import { checkpointAuthor } from './checkpoint.mjs';
|
|
26
26
|
import { codeContextPathOk } from './workspace.mjs';
|
|
@@ -152,8 +152,8 @@ export async function publishCodeContext(root, { push = false, allowBranch = fal
|
|
|
152
152
|
const registry = { repos: repos || [] };
|
|
153
153
|
const git = productGit(root);
|
|
154
154
|
|
|
155
|
-
const branch = git('rev-parse', '--abbrev-ref', 'HEAD').stdout;
|
|
156
155
|
const defaultBranch = resolveDefaultBranch(git, productConfig);
|
|
156
|
+
const branch = branchToCommitOn(root, git, defaultBranch);
|
|
157
157
|
if (!guardDefaultBranch(branch, defaultBranch, { allowBranch, cmd: 'yad repo refresh --push', root })) return;
|
|
158
158
|
|
|
159
159
|
// Stage the EXPLICIT allowlist (code-maps + registry), scoped so an unrelated pre-staged file is never
|