yadflow 4.10.0 → 4.11.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 (106) hide show
  1. package/CHANGELOG.md +97 -0
  2. package/README.md +12 -3
  3. package/bin/commands.mjs +5 -1
  4. package/bin/yad.mjs +109 -15
  5. package/cli/agent-guard-worker.mjs +13 -0
  6. package/cli/agent-guard.mjs +1053 -57
  7. package/cli/agent-rules.mjs +34 -3
  8. package/cli/argv-flags.mjs +2 -2
  9. package/cli/brain/vendor/LICENSE-graphology-library.txt +21 -0
  10. package/cli/brain/vendor/LICENSE-graphology.txt +21 -0
  11. package/cli/brain/vendor/LICENSE-sigma.txt +12 -0
  12. package/cli/brain/vendor/graphology-library.min.js +2 -0
  13. package/cli/brain/vendor/graphology.umd.min.js +2 -0
  14. package/cli/brain/vendor/sigma.min.js +1369 -0
  15. package/cli/brain/view/app.js +382 -0
  16. package/cli/brain/view/index.html +63 -0
  17. package/cli/brain/view/live.css +228 -0
  18. package/cli/brain/view/live.html +110 -0
  19. package/cli/brain/view/live.js +884 -0
  20. package/cli/brain/view/style.css +141 -0
  21. package/cli/brain-about.mjs +206 -0
  22. package/cli/brain-activity.mjs +285 -0
  23. package/cli/brain-skills.mjs +118 -0
  24. package/cli/brain-vendor.mjs +71 -0
  25. package/cli/brain-view.mjs +344 -0
  26. package/cli/brain.mjs +810 -0
  27. package/cli/ci-check.mjs +3 -3
  28. package/cli/doctor.mjs +80 -13
  29. package/cli/epic-state.mjs +93 -1
  30. package/cli/epic.mjs +15 -3
  31. package/cli/errors.mjs +2 -1
  32. package/cli/find-product.mjs +69 -15
  33. package/cli/foundation-publish.mjs +256 -0
  34. package/cli/gate.mjs +29 -3
  35. package/cli/git-read.mjs +38 -0
  36. package/cli/guard-stream.mjs +409 -0
  37. package/cli/hook.mjs +59 -9
  38. package/cli/issues-act.mjs +57 -13
  39. package/cli/issues-write.mjs +19 -6
  40. package/cli/issues.mjs +62 -23
  41. package/cli/lib.mjs +37 -2
  42. package/cli/local-page.mjs +138 -0
  43. package/cli/machine.mjs +1 -1
  44. package/cli/manifest.mjs +50 -0
  45. package/cli/map/view/app.js +712 -0
  46. package/cli/map/view/index.html +50 -0
  47. package/cli/map/view/style.css +142 -0
  48. package/cli/map-view.mjs +186 -0
  49. package/cli/map.mjs +637 -0
  50. package/cli/members.mjs +9 -15
  51. package/cli/next.mjs +1 -1
  52. package/cli/openpr.mjs +2 -2
  53. package/cli/plan.mjs +125 -0
  54. package/cli/platform.mjs +5 -5
  55. package/cli/product-index.mjs +1 -1
  56. package/cli/protection.mjs +32 -0
  57. package/cli/reconcile.mjs +8 -2
  58. package/cli/report.mjs +9 -3
  59. package/cli/reports-dir.mjs +391 -0
  60. package/cli/reports.mjs +65 -0
  61. package/cli/run-checks.mjs +5 -2
  62. package/cli/scan.mjs +1 -1
  63. package/cli/setup.mjs +30 -5
  64. package/cli/standup.mjs +87 -71
  65. package/cli/status.mjs +6 -5
  66. package/cli/test-agents-file.mjs +614 -8
  67. package/cli/test-brain-activity.mjs +753 -0
  68. package/cli/test-brain-view.mjs +381 -0
  69. package/cli/test-brain.mjs +795 -0
  70. package/cli/test-guide.mjs +211 -0
  71. package/cli/test-machine.mjs +59 -0
  72. package/cli/test-map.mjs +615 -0
  73. package/cli/test-reports.mjs +382 -0
  74. package/cli/test-run-checks.mjs +4 -0
  75. package/cli/test-worktree.mjs +24 -3
  76. package/cli/toolbox-connect.mjs +21 -6
  77. package/cli/toolbox.mjs +59 -4
  78. package/cli/update-commit.mjs +101 -9
  79. package/cli/usage.mjs +8 -4
  80. package/package.json +8 -4
  81. package/skills/yad-architecture/SKILL.md +22 -4
  82. package/skills/yad-change/SKILL.md +3 -1
  83. package/skills/yad-change/references/triage.md +2 -0
  84. package/skills/yad-checks/SKILL.md +2 -0
  85. package/skills/yad-checks/references/check-gates.md +8 -5
  86. package/skills/yad-checks/templates/checks/build-test-lint.sh +7 -0
  87. package/skills/yad-checks/templates/checks/install-deps.sh +6 -0
  88. package/skills/yad-checks/templates/checks/package-manager.sh +42 -0
  89. package/skills/yad-checks/templates/github/yad-checks.yml +3 -2
  90. package/skills/yad-checks/templates/gitlab/yad-checks.gitlab-ci.yml +3 -2
  91. package/skills/yad-checks/templates/hooks/yad-activity.mjs +238 -0
  92. package/skills/yad-connect-repos/SKILL.md +14 -0
  93. package/skills/yad-discovery/SKILL.md +11 -0
  94. package/skills/yad-discovery/references/foundation-schema.md +11 -0
  95. package/skills/yad-docs/templates/app/package-lock.json +18 -10
  96. package/skills/yad-docs/templates/app/package.json +6 -1
  97. package/skills/yad-epic/SKILL.md +3 -0
  98. package/skills/yad-epic/references/state-schema.md +35 -1
  99. package/skills/yad-guide/SKILL.md +4 -4
  100. package/skills/yad-implement/SKILL.md +76 -15
  101. package/skills/yad-issues/SKILL.md +2 -1
  102. package/skills/yad-pr-template/templates/checks/pr-template.sh +8 -4
  103. package/skills/yad-pr-template/templates/checks/pr-title.sh +8 -4
  104. package/skills/yad-spec/SKILL.md +19 -0
  105. package/skills/yad-stories/SKILL.md +22 -4
  106. package/skills/yad-stories/references/story-schema.md +1 -1
@@ -104,6 +104,8 @@ export const COMMAND_CLASS = {
104
104
  'epic new': { class: 'local-write', flags: { issue: 'on-request' } },
105
105
  'foundation new': { class: 'local-write' },
106
106
  'foundation status': { class: 'read' },
107
+ // E174: creates items on the platform; `--dry-run` only reads.
108
+ 'foundation publish': { class: 'on-request' },
107
109
  status: { class: 'read' },
108
110
  next: { class: 'read' },
109
111
  // Skipping, deferring or clearing a blocker is a decision about the work: the person's.
@@ -173,6 +175,15 @@ export const COMMAND_CLASS = {
173
175
  'worktree list': { class: 'read' },
174
176
  'worktree remove': { class: 'local-write' },
175
177
  standup: { class: 'read' },
178
+ // E181: `yad map` starts a local server and runs until Ctrl-C (as `brain view` does); --html writes one file into
179
+ // the local reports folder — or `--html <file>`, ANY path named, replacing a plain file there — and --fetch
180
+ // downloads. Local only, so local-write; never on the read allow list, so the prompt still covers the path.
181
+ map: { class: 'local-write' },
182
+ // E180: the local reports folder. `list` reads; `open` starts the browser; `prune` alone is a dry run, and
183
+ // `prune --apply` deletes saved reports, so only when the person asks.
184
+ 'reports list': { class: 'read' },
185
+ 'reports open': { class: 'local-write' },
186
+ 'reports prune': { class: 'read', flags: { apply: 'on-request' } },
176
187
  'issues list': { class: 'read' },
177
188
  // Adds labels on the team's repos: asked for, never a side effect.
178
189
  'issues labels': { class: 'on-request' },
@@ -202,6 +213,18 @@ export const COMMAND_CLASS = {
202
213
  'history list': { class: 'read' },
203
214
  'history show': { class: 'read' },
204
215
  'history search': { class: 'read' },
216
+ // E176: runs Graphify in each code repo and writes only the brain's own ignored folder (and a local
217
+ // .git/info/exclude line). The two reads print names taken from the code, which anyone can write.
218
+ 'brain build': { class: 'local-write' },
219
+ 'brain query': { class: 'read' },
220
+ 'brain status': { class: 'read' },
221
+ // E179: the focused questions the planning and building skills ask before they plan or edit.
222
+ 'brain file': { class: 'read' },
223
+ 'brain story': { class: 'read' },
224
+ // E177: starts a local server (127.0.0.1, a one-time key), or with --html writes one file — the brain's own
225
+ // ignored folder, or any path named. Local only, so local-write; never pre-approved (a prefix rule would let
226
+ // `--html <file>` overwrite any file, as `standup --out` could).
227
+ 'brain view': { class: 'local-write' },
205
228
  'repo list': { class: 'read' },
206
229
  'repo refresh': { class: 'local-write', flags: { push: 'default-push', 'allow-branch': 'on-request' } },
207
230
  'repo sync': { class: 'local-write' },
@@ -236,7 +259,8 @@ const stronger = (a, b) => (STRENGTH.indexOf(b) > STRENGTH.indexOf(a) ? b : a);
236
259
  // A test holds this to bin/yad.mjs.
237
260
  export const DEFAULT_ACTION = {
238
261
  skill: 'list', history: 'list', repo: 'list', 'risk-map': 'check', codeowners: 'check', docs: 'list',
239
- toolbox: 'list', member: 'list', issues: 'list', worktree: 'list', signing: 'check', ci: 'check',
262
+ toolbox: 'list', member: 'list', issues: 'list', worktree: 'list', signing: 'check', ci: 'check', brain: 'status',
263
+ reports: 'list',
240
264
  };
241
265
 
242
266
  // The entry for a command line's words: `<cmd> <action>` when it has one, else `<cmd>` (or its default action).
@@ -300,7 +324,7 @@ export const RULES = [
300
324
  { id: 'update', text: 'When the guide says the install is behind yadflow, run `yad update --open-pr --json` without asking: it commits the update on its own branch in each repo and opens a PR/MR, which a person merges. Show the person every row that has a `hint` (a repo held back, refused, or left half done) with its `reason`, wait for them, then run it again. Never use `yad update --push` unless the person asks for it.' },
301
325
  { id: 'pushes', text: 'Commit, push your own branch, and open a review PR/MR without asking. Open a task PR/MR without asking only when `yad dial open-pr` is `auto`; otherwise ask first. Ask every time, right before anything that pushes straight to the default branch: say what it will push (the branch and the commits), and wait for a yes given then. A request made earlier, or "don\'t ask", is not that yes. Never force-push.' },
302
326
  { id: 'on-request', text: 'Run a command the guide classes `on-request` only when the person asked for that exact change or gave you what it records: `yad dial … --to`, `yad mode solo|team`, `yad kill`, `yad unkill`, `yad skip`, `yad defer`, `yad unblock`, `yad setup`/`new`/`init` (with the answers the person gave to the questions the guide lists), `yad skill bind`, `yad toolbox add`, `yad toolbox connect --verify` (after the yes the connect-tool rule asks for), a flag that passes a guard (`--force`, `--overwrite-local`, `--allow-branch`), and the others the guide marks.' },
303
- { id: 'connect-tool', text: 'Offer to connect a tool when yad hands you its `connect` command (a toolbox finding in `yad setup`, `check` or `update`, a `yad doctor` hint, or a design preflight) or a skill says to: one tool, one question — ask once per tool in a run, whichever offer comes first, and never again after a no. To connect a tool (install it on this machine and record it as the team\'s choice), run `yad toolbox connect <tool> --json` first and show the person its `ask` word for word. Ask once; go on only on a yes. Then run exactly its `agent` steps, in order, with no other source, version or flag; hand over its `person` steps with their `why`, and wait for them. Then run the `verify` command it gave (`--replace` is in it only when the question said what it replaces). If a step fails, stop and show the person its output; never try another way to install it. A new MCP server is loaded when the agent starts: if `verify` passed but your session does not see the server (in Claude Code, `/mcp`), tell the person to restart the agent and run the step again (for a design or testing tool, its connect skill with `action: refresh` and the same `tool` first); never record the tool as unavailable for that. The `claude` steps are Claude Code\'s: with another agent, hand every step to the person.' },
327
+ { id: 'connect-tool', text: 'Offer to connect a tool when yad hands you its `connect` command (a toolbox finding in `yad setup`, `check` or `update`, a `yad doctor` hint, or a design preflight) or a skill says to: one tool, one question — ask once per tool in a run, whichever offer comes first, and never again after a no. To connect a tool (install it on this machine and record it as the team\'s choice), run `yad toolbox connect <tool> --json` first and show the person its `ask` word for word. Ask once; go on only on a yes. Then run exactly its `agent` steps, in order, with no other source, version or flag; hand over its `person` steps with their `why`, and wait for them. Then run the `verify` command it gave (`--replace` is in it only when the question said what it replaces). If a step fails, stop and show the person its output; never try another way to install it. A new MCP server is loaded when the agent starts: if `verify` passed but your session does not see the server (in Claude Code, `/mcp`), tell the person to restart the agent and run the step again (for a design or testing tool, its connect skill with `action: refresh` and the same `tool` first); never record the tool as unavailable for that. A step that names `claude` or `claude-code` is Claude Code\'s: with another agent, hand every step to the person.' },
304
328
  { id: 'build-halts', text: 'A Build step the yad-run skill halted (`blocked`: a failing check, a scope overrun, a contract touch) waits for the person: never move it on (`yad build step … in_progress`) until they say it is resolved.' },
305
329
  { id: 'never-by-hand', text: 'Never hand-write `.sdlc/` files, approvals, or text between yad markers; only `yad` commands and the yad-* skills change them.' },
306
330
  { id: 'record-truly', text: 'When you record Build work you did yourself, say so: `yad build step … --via auto` and `yad build trust … --ran-by machine`, as the yad-run skill does. The defaults record a person\'s work.' },
@@ -381,7 +405,9 @@ export const claudeBlock = () => ['@AGENTS.md'];
381
405
  // command that is not a read (`yad mode` begins `yad mode team`). Written into `.claude/settings.json`
382
406
  // `permissions.allow` as `Bash(yad <words>:*)`; nothing that writes, pushes, posts or approves is ever there.
383
407
  // `standup` reads, but `--out <file>` writes the file named: a prefix rule would let it overwrite any file.
384
- const NOT_PREAPPROVED = new Set(['standup', 'issues list', 'issues show']);
408
+ // `brain query`, `brain status`, `brain file` and `brain story` print names read from the code (E176, E179), which
409
+ // anyone can write, as `issues show` does.
410
+ const NOT_PREAPPROVED = new Set(['standup', 'issues list', 'issues show', 'brain query', 'brain status', 'brain file', 'brain story']);
385
411
  export function readAllowList() {
386
412
  const keys = Object.keys(COMMAND_CLASS);
387
413
  const reads = keys.filter((key) => {
@@ -408,6 +434,11 @@ export const SHIPPED_ALLOW_LISTS = Object.freeze([
408
434
  'gate status', 'gate review', 'gate walkthrough', 'review context', 'review chat', 'review cards', 'review walkthrough', 'member list',
409
435
  'worktree list', 'claims', 'owners', 'history list', 'history show', 'history search', 'repo list', 'risk-map check', 'codeowners check', 'story frames', 'docs list',
410
436
  'thread', 'reconcile check'].map((k) => `Bash(yad ${k}:*)`),
437
+ // next release (E180): `reports list`
438
+ ['guide', 'help', 'doctor', 'detect', 'signing check', 'ci check', 'toolbox list', 'toolbox check', 'skill list', 'skill recommend', 'foundation status', 'status', 'next',
439
+ 'gate status', 'gate review', 'gate walkthrough', 'review context', 'review chat', 'review cards', 'review walkthrough', 'member list',
440
+ 'worktree list', 'reports list', 'claims', 'owners', 'history list', 'history show', 'history search', 'repo list', 'risk-map check', 'codeowners check', 'story frames', 'docs list',
441
+ 'thread', 'reconcile check'].map((k) => `Bash(yad ${k}:*)`),
411
442
  ].map((list) => Object.freeze(list)));
412
443
 
413
444
  // Entries an older yadflow pre-approved that this one does not (a command later reclassed as a write, say).
@@ -1,7 +1,7 @@
1
1
  // The flags `yad` reads a value after (`--dir <path>`), and those it reads a list of (`--approver a --approver b`).
2
2
  // Shared by the parser in bin/yad.mjs and the agent guard (cli/agent-guard.mjs), which must read a command line
3
3
  // the way yad does: `yad --dir ../product gate approve …` is still `gate approve`. `-m` takes a value too.
4
- export const VALUE_FLAGS = new Set(['--dir', '--issue', '--body-file', '--priority', '--status', '--assignee', '--date', '--sort', '--closed-since', '--type', '--message', '--task', '--ai', '--risk', '--repo', '--platform', '--base', '--title', '--scope', '--branch', '--pr', '--epic', '--team', '--body', '--out', '--since', '--until', '--member', '--format', '--reason', '--profile', '--parent', '--inherits', '--to', '--retro-ship', '--merge-commit', '--path', '--ide-targets', '--theme', '--thread', '--by', '--count', '--engagement', '--keep', '--role', '--fallback', '--detect', '--install', '--source', '--tz', '--verdict', '--ran-by', '--note', '--uid', '--run', '--via', '--kind', '--confirm',
4
+ export const VALUE_FLAGS = new Set(['--dir', '--issue', '--body-file', '--priority', '--status', '--assignee', '--date', '--sort', '--closed-since', '--type', '--message', '--task', '--ai', '--risk', '--repo', '--platform', '--base', '--title', '--scope', '--branch', '--pr', '--epic', '--team', '--body', '--out', '--since', '--until', '--member', '--format', '--reason', '--profile', '--parent', '--inherits', '--to', '--retro-ship', '--merge-commit', '--path', '--ide-targets', '--theme', '--thread', '--by', '--count', '--engagement', '--keep', '--role', '--fallback', '--detect', '--install', '--source', '--tz', '--verdict', '--ran-by', '--note', '--uid', '--run', '--via', '--kind', '--confirm', '--limit', '--older-than',
5
5
  // E159: the setup answers an agent passes after asking the person.
6
6
  '--default-branch', '--design', '--design-url', '--testing', '--testing-url', '--learning', '--connect', '--coderabbit']);
7
- export const LIST_FLAGS = new Set(['--signal', '--approver', '--add-repo']);
7
+ export const LIST_FLAGS = new Set(['--signal', '--approver', '--add-repo', '--label', '--add', '--remove']);
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2017-2021 Guillaume Plique (Yomguithereal)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016-2021 Guillaume Plique (Yomguithereal)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,12 @@
1
+ Copyright (C) 2013-2025, Alexis Jacomy, Guillaume Plique, Benoît Simard https://www.sigmajs.org
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
4
+ to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
5
+ and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
10
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
11
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
12
+ IN THE SOFTWARE.