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
package/CHANGELOG.md CHANGED
@@ -1,3 +1,100 @@
1
+ # [4.11.0](https://github.com/abdelrahmannasr/yadflow/compare/v4.10.0...v4.11.0) (2026-11-14)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **agent-guard:** a reading stopped by the deadline says it took too long ([#542](https://github.com/abdelrahmannasr/yadflow/issues/542)) ([aac2c5f](https://github.com/abdelrahmannasr/yadflow/commit/aac2c5fd520f772c1920253f226281df1cd8f647)), closes [#492](https://github.com/abdelrahmannasr/yadflow/issues/492) [#535](https://github.com/abdelrahmannasr/yadflow/issues/535) [#535](https://github.com/abdelrahmannasr/yadflow/issues/535)
7
+ * **agent-guard:** judge text that reaches a shell: process substitutions, known $(…) output, files written then run ([#498](https://github.com/abdelrahmannasr/yadflow/issues/498), rows 1, 2, 8) ([#519](https://github.com/abdelrahmannasr/yadflow/issues/519)) ([37d9ea3](https://github.com/abdelrahmannasr/yadflow/commit/37d9ea3c6ebd504ff59542e547adf0193c1c6545)), closes [#518](https://github.com/abdelrahmannasr/yadflow/issues/518) [#518](https://github.com/abdelrahmannasr/yadflow/issues/518)
8
+ * **agent-guard:** read a line by each shell's $(…) end rule, and bash's brace rule ([#498](https://github.com/abdelrahmannasr/yadflow/issues/498), rows 3–7) ([#517](https://github.com/abdelrahmannasr/yadflow/issues/517)) ([69b2c5b](https://github.com/abdelrahmannasr/yadflow/commit/69b2c5bf2d3dd54e904e6aa1a70b8f134ad71d08)), closes [#516](https://github.com/abdelrahmannasr/yadflow/issues/516)
9
+ * **agent-guard:** read text printed with no newline as run on into what is printed next ([#518](https://github.com/abdelrahmannasr/yadflow/issues/518)) ([fa93d0e](https://github.com/abdelrahmannasr/yadflow/commit/fa93d0ef431b6d357deba0f2ed8828e470b7fba8))
10
+ * **agent-guard:** read the rarer places bash 3.2 and zsh end a $(…) ([#516](https://github.com/abdelrahmannasr/yadflow/issues/516)) ([35fef40](https://github.com/abdelrahmannasr/yadflow/commit/35fef408947d6445baef19263735e031997d935d))
11
+ * **agent-guard:** read the word after >& and <& as bash 3.2 and zsh do, and zsh's >! ([#518](https://github.com/abdelrahmannasr/yadflow/issues/518)) ([f399957](https://github.com/abdelrahmannasr/yadflow/commit/f399957258ab6d521322c7f4f7c53d24f37cf230))
12
+ * **agent-guard:** review 1 — a group record never changes main's write list ([#532](https://github.com/abdelrahmannasr/yadflow/issues/532)) ([12f940b](https://github.com/abdelrahmannasr/yadflow/commit/12f940b52ff02a2d6a7d196a22e96a1771ebe89e))
13
+ * **agent-guard:** review 1 — main's case-word bound kept; the rarer readings run once per text ([#516](https://github.com/abdelrahmannasr/yadflow/issues/516)) ([4a92879](https://github.com/abdelrahmannasr/yadflow/commit/4a92879f5b7156a3ee4fa12d8d3c80b159c55810))
14
+ * **agent-guard:** review 1 — readings with no newline are kept apart from those paired by place; the mark passes through tee, cat and filters ([#518](https://github.com/abdelrahmannasr/yadflow/issues/518)) ([cd899ee](https://github.com/abdelrahmannasr/yadflow/commit/cd899ee9c9cd83676d5c22fb01419fe6729511f5))
15
+ * **agent-guard:** review 1 — the output pass reads the twins of each gap ([#532](https://github.com/abdelrahmannasr/yadflow/issues/532)) ([b7d98a3](https://github.com/abdelrahmannasr/yadflow/commit/b7d98a35dc2b0561dfac801c6aebbfddf613c5ea))
16
+ * **agent-guard:** review 1 — the output pass refuses no line main allows for its own reasons ([#532](https://github.com/abdelrahmannasr/yadflow/issues/532)) ([db7de77](https://github.com/abdelrahmannasr/yadflow/commit/db7de77f8f68461579d4ae5c23828414a88acb04))
17
+ * **agent-guard:** review 1 — the shells' redirect readings are their own dimension, crossed with every $(…) end rule ([#518](https://github.com/abdelrahmannasr/yadflow/issues/518)) ([de0af0a](https://github.com/abdelrahmannasr/yadflow/commit/de0af0abc4685e71f21e6e1413182cf7febd9650))
18
+ * **agent-guard:** review 2 — a `#` at the case-word bound ends the loop; the rarer readings keep the `)#` reading ([#516](https://github.com/abdelrahmannasr/yadflow/issues/516)) ([f8af846](https://github.com/abdelrahmannasr/yadflow/commit/f8af84692de032c626bd0b27d53ad0acde1fe432))
19
+ * **agent-guard:** review 2 — a word's spellings kept apart stay apart through substituted, printedOf and here-strings ([#518](https://github.com/abdelrahmannasr/yadflow/issues/518)) ([9f3fe37](https://github.com/abdelrahmannasr/yadflow/commit/9f3fe37116e0eac287a7983480b7d3d15df667b3))
20
+ * **agent-guard:** review 2 — close the holes the round-1 output fixes opened ([#532](https://github.com/abdelrahmannasr/yadflow/issues/532)) ([21c9b52](https://github.com/abdelrahmannasr/yadflow/commit/21c9b52c711680966bb37dce2062859d390968a7))
21
+ * **agent-guard:** review 2 — what a $(…) prints is read by each shell's redirect reading; a nested $(…) keeps its reading's shell ([#518](https://github.com/abdelrahmannasr/yadflow/issues/518)) ([779adad](https://github.com/abdelrahmannasr/yadflow/commit/779adad8e198c65f1163b61499262e21da91f954))
22
+ * **agent-guard:** review 3 — a shell passes its stdin on, missed groups keep their output, nests are bounded ([#532](https://github.com/abdelrahmannasr/yadflow/issues/532)) ([e671f95](https://github.com/abdelrahmannasr/yadflow/commit/e671f958e19341539d2fa252b0b60f618b2e66b2))
23
+ * **agent-guard:** review 3 — the rarer readings keep the `|#` reading too; a never-ending heredoc's text is kept once ([#516](https://github.com/abdelrahmannasr/yadflow/issues/516)) ([d381d3f](https://github.com/abdelrahmannasr/yadflow/commit/d381d3f43ba7b4819a7a576d0f930cd483ccb097))
24
+ * **agent-guard:** review 4 — closed groups are read once, and a one-word `if` in a case may be a block ([#532](https://github.com/abdelrahmannasr/yadflow/issues/532)) ([17e5b81](https://github.com/abdelrahmannasr/yadflow/commit/17e5b81f2049dc557eed6f40afb76cf19a1ce30a))
25
+ * **agent-guard:** review 5 — a fold reads back to the group a block overlaps; a pattern stands only straight inside a case ([#532](https://github.com/abdelrahmannasr/yadflow/issues/532)) ([414e147](https://github.com/abdelrahmannasr/yadflow/commit/414e1478fa131a766d709e045bc72a3cb3afa5a4))
26
+ * **brain:** CI — the test runner passes git's ENOBUFS; no 'hub' in a comment ([7c47234](https://github.com/abdelrahmannasr/yadflow/commit/7c47234e8e3d86e97fe564caf72775c9b1cfb81b))
27
+ * **brain:** CodeQL — cut the served script tags by markers, not an HTML pattern (E177) ([e09137f](https://github.com/abdelrahmannasr/yadflow/commit/e09137f871d946839531c35261ff2e9d830078d2))
28
+ * **brain:** E179 review 1 — --repo limits the file; the skills read a moved repo as behind ([efb9cb5](https://github.com/abdelrahmannasr/yadflow/commit/efb9cb51cd1bfca9cbea001f6220fb9fb1dc7a8a))
29
+ * **brain:** E179 review 2 — the stories question has a place; the light spec is judged again ([8842784](https://github.com/abdelrahmannasr/yadflow/commit/8842784880c400edf741eae0c1bc0f7868452233))
30
+ * **brain:** E179 review 3 — an added file that ends the light spec is asked about first ([f1b6605](https://github.com/abdelrahmannasr/yadflow/commit/f1b6605a92f6ad207c57389bd1dfe9cb9f0647e4))
31
+ * **brain:** E179 review 4 — a contract file ends the light spec; a high-risk one is a choice ([b200a09](https://github.com/abdelrahmannasr/yadflow/commit/b200a09a586bb54f7b536af60cc23d9e35966316)), closes [hi#risk](https://github.com/hi/issues/risk) [hi#risk](https://github.com/hi/issues/risk)
32
+ * **brain:** E179 review 5 — a contract file never leaves a light spec on record ([0af058b](https://github.com/abdelrahmannasr/yadflow/commit/0af058b9d4a4fd1245414be109cb1a1a43c8b655)), closes [hi#risk](https://github.com/hi/issues/risk)
33
+ * **brain:** labels follow the page theme, light on the dark one (E177 view) ([44f000f](https://github.com/abdelrahmannasr/yadflow/commit/44f000f51c703a33572984ab3d6acef06ee89ca9))
34
+ * **brain:** review — a held node keeps its heat; at most 60 neighbours named ([36bd6e6](https://github.com/abdelrahmannasr/yadflow/commit/36bd6e6b86981b6c661338b1ed1deed5f682b744))
35
+ * **brain:** review — a theme switch keeps the camera, labels stay put on hover ([b06b0cb](https://github.com/abdelrahmannasr/yadflow/commit/b06b0cb4264fdef144e07f79d684a65549bc2055))
36
+ * **brain:** review — only the left button drags a node ([5fbff4a](https://github.com/abdelrahmannasr/yadflow/commit/5fbff4a426a69e75b5d69a2ff44ba5fc9b89f6ac))
37
+ * **brain:** review 1 — filters, the All-the-code toggle, Windows --open and the --html key placeholder (E177) ([0e3b61a](https://github.com/abdelrahmannasr/yadflow/commit/0e3b61ab2a9769b1a47540ea4af187eb8054442c))
38
+ * **brain:** review 1 — removal only of yad's copy and never through a link, real paths, the reader, per-page models (E178) ([7c0d419](https://github.com/abdelrahmannasr/yadflow/commit/7c0d41998ec28b9aeca4899105dba54f5e4cfc1c))
39
+ * **brain:** review 2 — --json says when no opener was found; the vendored libraries keep their spelling (E177) ([d7b7011](https://github.com/abdelrahmannasr/yadflow/commit/d7b701178c032d910a8025aabdac23b4e72eabd3))
40
+ * **brain:** review 2 — the task follows edits, no unrelated parent repo, the attach order (E178) ([13c7923](https://github.com/abdelrahmannasr/yadflow/commit/13c7923f6684a721ac286523fd30c07cbd277e28))
41
+ * **brain:** review 3 — big folders, the doctor's question, a shared file's task, one span for every panel (E178) ([3a18ea5](https://github.com/abdelrahmannasr/yadflow/commit/3a18ea553419a0519d38c363b3936414c951a5ac))
42
+ * **brain:** review 4 — no doubles at a rotation during a page's connect; a shared file stays tentative (E178) ([9800485](https://github.com/abdelrahmannasr/yadflow/commit/9800485b16d33f765ef7dfc50acaf397a6bebb21))
43
+ * **brain:** review 5 — trust file numbers only when they can tell files apart; read the current log first (E178) ([cb3eb5d](https://github.com/abdelrahmannasr/yadflow/commit/cb3eb5d003167f136b40249246186e4662e727a9))
44
+ * **docs:** force minimatch 11 under typescript-eslint in the docs template ([88901fa](https://github.com/abdelrahmannasr/yadflow/commit/88901fab630e5c46708e4838f7a0a5cda9970613)), closes [#199](https://github.com/abdelrahmannasr/yadflow/issues/199)
45
+ * **docs:** raise the docs shell version to 0.0.5 for the zod bump ([876a2a5](https://github.com/abdelrahmannasr/yadflow/commit/876a2a516020bf64358dded5cd06a8b4bb15f074))
46
+ * **foundation:** a changed Foundation can be reviewed again, in every setup ([cbf2c69](https://github.com/abdelrahmannasr/yadflow/commit/cbf2c69f1796d051f5d299cce987476a24bb8442)), closes [#418](https://github.com/abdelrahmannasr/yadflow/issues/418)
47
+ * **foundation:** review round 1 — a failed CI read fails, all readers agree, platforms number apart ([ea51d29](https://github.com/abdelrahmannasr/yadflow/commit/ea51d29d1996298f535b41e1249330b3c3fa6022))
48
+ * **foundation:** review round 2 — fail only for a merge still due, name the step's own branch ([ea170a2](https://github.com/abdelrahmannasr/yadflow/commit/ea170a2f232c7217756bad86e4b5498b01a3a4fc))
49
+ * **gates:** a PR of issue-links files alone may come from any branch ([#512](https://github.com/abdelrahmannasr/yadflow/issues/512)) ([#520](https://github.com/abdelrahmannasr/yadflow/issues/520)) ([21b66fb](https://github.com/abdelrahmannasr/yadflow/commit/21b66fb233e667238a242775a21c51ffa1201a96)), closes [#426](https://github.com/abdelrahmannasr/yadflow/issues/426)
50
+ * **gates:** a Unity project skips build/test/lint with a note ([#496](https://github.com/abdelrahmannasr/yadflow/issues/496)) ([#511](https://github.com/abdelrahmannasr/yadflow/issues/511)) ([08c686a](https://github.com/abdelrahmannasr/yadflow/commit/08c686a499636b7d36b740a4a631b0c947d035bf))
51
+ * **gates:** the genesis lineage header yad-change adds keeps an epic's approvals live ([#499](https://github.com/abdelrahmannasr/yadflow/issues/499)) ([#524](https://github.com/abdelrahmannasr/yadflow/issues/524)) ([a3863f3](https://github.com/abdelrahmannasr/yadflow/commit/a3863f3941049ec93be9bb5f9c2c31548547ff27))
52
+ * **git:** a push through glab's login helper shows git's real error, not glab's warning ([#526](https://github.com/abdelrahmannasr/yadflow/issues/526)) ([edb1117](https://github.com/abdelrahmannasr/yadflow/commit/edb1117b8bff3fb1f737d107221b64c8cdee5dab)), closes [#509](https://github.com/abdelrahmannasr/yadflow/issues/509)
53
+ * **git:** review 1 — every copy of glab's warning is dropped, not only the first ([#526](https://github.com/abdelrahmannasr/yadflow/issues/526)) ([35a6d44](https://github.com/abdelrahmannasr/yadflow/commit/35a6d449c4bcac816f21effe9f308082d656beca))
54
+ * **map:** E181 review 1 — --anonymous masks names joined by dots, underscores or nothing; the waited-on person and release authors are on the people list ([93dd003](https://github.com/abdelrahmannasr/yadflow/commit/93dd0038dd03fbf6d4a9f82876b6d1483725fe3b))
55
+ * **map:** E181 review 10 — --anonymous never masks the words of the address placeholder; the raw values are masked as before ([5db9324](https://github.com/abdelrahmannasr/yadflow/commit/5db9324fdae7d89533d6f95ae32e96b1e1e4882b))
56
+ * **map:** E181 review 10 — an address's names are the union of the word-by-word cut and the unwrapped cut, so no change masks less; names keep combining marks, ' and +; only a space after an @ joins it ([9931101](https://github.com/abdelrahmannasr/yadflow/commit/9931101f2215ca662023fa76c856511b6588c9c9))
57
+ * **map:** E181 review 2 — a port names its task by any separator and by number, a story-only port counts for every task; the --html path caveat is back in the agent rules ([2350133](https://github.com/abdelrahmannasr/yadflow/commit/235013334c9af1fcb7f96a05fd0dc3070aa0bace))
58
+ * **map:** E181 review 3 — a story-only port has no task id anywhere after the story id; the watch test restores fs.watch whatever happens ([3e65c64](https://github.com/abdelrahmannasr/yadflow/commit/3e65c64801b7c53933cd1cbfa33a22ddbda34870))
59
+ * **map:** E181 review 4 — a story-only port is judged from the first place the story id appears ([ddfa496](https://github.com/abdelrahmannasr/yadflow/commit/ddfa4968d91783c3d5b5fe54085558ef0eff53e2))
60
+ * **map:** E181 review 6 — any value with an @, even a leading one, is never shown; the test proves no part of the address leaks and every script tag is checked ([69a56bb](https://github.com/abdelrahmannasr/yadflow/commit/69a56bbd22dbfc5890e87ca11eaafb15c3440051))
61
+ * **map:** E181 review 7 — --anonymous no longer masks the words of the address placeholder or an address's domain; it masks the part before the @, and a handle without its @ ([3d35f02](https://github.com/abdelrahmannasr/yadflow/commit/3d35f02158e40f1eb9cf295c7eb38a27414c5de3))
62
+ * **map:** E181 review 7 — a branch name or member login holding an address never shows it, named or anonymous ([8e0e414](https://github.com/abdelrahmannasr/yadflow/commit/8e0e414824d9dae252d1cb9950ca08e078fd2d47))
63
+ * **map:** E181 review 8 — --anonymous cuts each address word on its own, so a name beside an address stays masked, and every part between two @ signs is masked ([cb38509](https://github.com/abdelrahmannasr/yadflow/commit/cb38509d657d2b26e532c2aa2a17d57275f20018))
64
+ * **map:** E181 review 8 — masked address parts keep a fingerprint so ids stay apart; the epic is read before masking; the checkout branch and links with an address are masked ([0d81c04](https://github.com/abdelrahmannasr/yadflow/commit/0d81c04edf5ecdd508b1afe56ab203d681aa12ed))
65
+ * **map:** E181 review 9 — an anonymous map numbers masked addresses instead of keeping their hash, and masks the checkout branch ([4896a59](https://github.com/abdelrahmannasr/yadflow/commit/4896a5964eb92280f3fa3959704dc46353ef9c89))
66
+ * **map:** E181 review 9 — one rule for every way a value holds an address: spaces round the @ closed, any non-name character splits, the words beside an address are masked joined too, and no empty piece is a name ([1017dc5](https://github.com/abdelrahmannasr/yadflow/commit/1017dc5312aeef850bf837dbb3566424dffcf56f))
67
+ * **open-pr:** a git worktree of a registered repo is that repo, worked in its own folder ([#515](https://github.com/abdelrahmannasr/yadflow/issues/515)) ([#521](https://github.com/abdelrahmannasr/yadflow/issues/521)) ([df85950](https://github.com/abdelrahmannasr/yadflow/commit/df8595062af4100b29df264931934bc42107b6e5)), closes [#115](https://github.com/abdelrahmannasr/yadflow/issues/115)
68
+ * **platform:** a Product git_url that names only a host is no repo — reads use origin, doctor says so, setup repairs it ([#513](https://github.com/abdelrahmannasr/yadflow/issues/513)) ([#523](https://github.com/abdelrahmannasr/yadflow/issues/523)) ([581a709](https://github.com/abdelrahmannasr/yadflow/commit/581a709031683f7e570e69c4cd35c6b4e30b53e1))
69
+ * **platform:** glab's two-config warning no longer hides why a glab call failed ([#509](https://github.com/abdelrahmannasr/yadflow/issues/509)) ([#522](https://github.com/abdelrahmannasr/yadflow/issues/522)) ([8ff6079](https://github.com/abdelrahmannasr/yadflow/commit/8ff60798ce0d566b1957d649db14a0bb1ae1c135))
70
+ * read shell-bound output in the agent guard ([#532](https://github.com/abdelrahmannasr/yadflow/issues/532)) ([f1d5693](https://github.com/abdelrahmannasr/yadflow/commit/f1d56934e46ef573c86cf0b3d0a42e98cbcbaa15))
71
+ * **reports:** E180 review 1 — prune never leaves the folder through a link, says why before deleting, and two runs never lose a report ([ffb66e0](https://github.com/abdelrahmannasr/yadflow/commit/ffb66e0e1a304b5af56311b00e5ef23d747c6efb))
72
+ * **reports:** E180 review 2 — a lock is taken by one run and released only by its owner; prune --missing drops gone entries without deleting ([e00a6b3](https://github.com/abdelrahmannasr/yadflow/commit/e00a6b35d1fa4b919475f2f01ec6a3bd055a5850))
73
+ * **reports:** E180 review 3 — the catalog lock appears whole, a takeover checks what it moved, and an unreadable lock ends at the deadline ([2d1537c](https://github.com/abdelrahmannasr/yadflow/commit/2d1537cdd366f1bffa741395dbd3610c0a4c4b2a))
74
+ * **reports:** E180 review 4 — a disk with no hard links locks with a plain create, and no temp lock file is left on a failed write ([1cc2a05](https://github.com/abdelrahmannasr/yadflow/commit/1cc2a052b774ebd5db803b6acabe2321d009472c))
75
+ * **reports:** E180 review 5 — a fresh lock moved by a takeover is put back on a disk with no hard links too ([9e89177](https://github.com/abdelrahmannasr/yadflow/commit/9e891778e004817ad60ffc3ec5183b3855e74bb9))
76
+ * **toolbox:** review 1 — pin the AI Game Developer plugin too, and test the reach order (E175) ([7040cab](https://github.com/abdelrahmannasr/yadflow/commit/7040cab9b86d9587f72dca59b477e526bd856559))
77
+ * **toolbox:** review 4 — stdio transport, compile by error code, no hidden Unity (E175) ([4bb8784](https://github.com/abdelrahmannasr/yadflow/commit/4bb8784f8234d7a0cb953f1a905710372e8a9c8e))
78
+ * **update:** a git add an ignore rule refused names the rule, not a lock ([#508](https://github.com/abdelrahmannasr/yadflow/issues/508)) ([#525](https://github.com/abdelrahmannasr/yadflow/issues/525)) ([8a50f63](https://github.com/abdelrahmannasr/yadflow/commit/8a50f632a055c38fba57bb8e37385ae35e749beb))
79
+
80
+
81
+ ### Features
82
+
83
+ * **brain:** agents consult the brain while planning and building (E179) ([6bc19e0](https://github.com/abdelrahmannasr/yadflow/commit/6bc19e09f757372be00e8236c367630777148239))
84
+ * **brain:** drag a node on the live page, its links lit (E178) ([a0d9e3d](https://github.com/abdelrahmannasr/yadflow/commit/a0d9e3d5d44c4437ac353ee2c47aae69636fd87e))
85
+ * **brain:** press and hold a node to drag it (E177 view) ([966bf67](https://github.com/abdelrahmannasr/yadflow/commit/966bf67baf74d27ed927edb189702767bf4f2d62))
86
+ * **brain:** the live activity record — a hook that notes each agent tool call (E178) ([3c79ee6](https://github.com/abdelrahmannasr/yadflow/commit/3c79ee6fb8d1494f1bcb79027b7f1b2af15b2537))
87
+ * **brain:** vendor sigma.js, graphology and graphology-library for the brain viewer (E177) ([6e16dce](https://github.com/abdelrahmannasr/yadflow/commit/6e16dce0516186c8c2679232c2f2daf941ce3a8e))
88
+ * **brain:** yad brain — one knowledge graph of the code and the work (E176) ([#541](https://github.com/abdelrahmannasr/yadflow/issues/541)) ([15024d0](https://github.com/abdelrahmannasr/yadflow/commit/15024d0431793a8d036cca90385cd63dac672761))
89
+ * **brain:** yad brain view --live — the Observatory (E178) ([8d2974f](https://github.com/abdelrahmannasr/yadflow/commit/8d2974f33d2b4b3d27ba42067a17acb39e460457))
90
+ * **brain:** yad brain view — the brain drawn in a browser, served locally or as one file (E177) ([6fa514c](https://github.com/abdelrahmannasr/yadflow/commit/6fa514c67b390c6722f3cda581e9de637cf0f33c))
91
+ * **issues:** filter by, show and set any label, not just priority and type ([#514](https://github.com/abdelrahmannasr/yadflow/issues/514)) ([#527](https://github.com/abdelrahmannasr/yadflow/issues/527)) ([5a0ebea](https://github.com/abdelrahmannasr/yadflow/commit/5a0ebea13ce5b1a6366339b52070076d612a23a2))
92
+ * **map:** E181 — yad map, the road to Production in the prototype's design, with who owns, built, reviewed and approved each part ([3aa9d70](https://github.com/abdelrahmannasr/yadflow/commit/3aa9d705ec7e38e9826be84c5bd20c66ce647bfd))
93
+ * **reports:** E180 — every report is saved on this machine, beside the Product ([32edfe6](https://github.com/abdelrahmannasr/yadflow/commit/32edfe677f9863941e6230b9fb5a0407db245f38))
94
+ * the approved roadmap becomes work items in the Product repo (E174) ([#510](https://github.com/abdelrahmannasr/yadflow/issues/510)) ([e0bd082](https://github.com/abdelrahmannasr/yadflow/commit/e0bd082ccb67d00208b66644a6a4eb8e59ce8d0d))
95
+ * **toolbox:** add Unity MCP (AI Game Developer) beside MCP for Unity ([c604f6b](https://github.com/abdelrahmannasr/yadflow/commit/c604f6ba48f24cd28d5f2df3e9006183d966a615))
96
+ * **toolbox:** AI Game Developer is the default Unity tool; the agent helps install and connect it (E175) ([1a93f96](https://github.com/abdelrahmannasr/yadflow/commit/1a93f96b3e47ee6c32d6fe9af95b4a11c2619099))
97
+
1
98
  # [4.10.0](https://github.com/abdelrahmannasr/yadflow/compare/v4.9.0...v4.10.0) (2026-11-10)
2
99
 
3
100
 
package/README.md CHANGED
@@ -3,6 +3,8 @@
3
3
  [![npm version](https://img.shields.io/npm/v/yadflow?logo=npm)](https://www.npmjs.com/package/yadflow)
4
4
  [![CI](https://github.com/abdelrahmannasr/yadflow/actions/workflows/ci.yml/badge.svg)](https://github.com/abdelrahmannasr/yadflow/actions/workflows/ci.yml)
5
5
  [![node](https://img.shields.io/node/v/yadflow?logo=node.js)](https://github.com/abdelrahmannasr/yadflow/blob/main/package.json)
6
+ [![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/abdelrahmannasr/yadflow/badge)](https://scorecard.dev/viewer/?uri=github.com/abdelrahmannasr/yadflow)
7
+ [![license: MIT](https://img.shields.io/npm/l/yadflow)](https://github.com/abdelrahmannasr/yadflow/blob/main/LICENSE)
6
8
 
7
9
  Coordinate work, automate repetitive delivery tasks, and keep the decisions behind your software.
8
10
  Yadflow connects plans, architecture, code and reviews in a versioned project record. Your team and
@@ -295,10 +297,13 @@ The record is worth trusting because people approve what goes into it.
295
297
  - the Shape and Build steps with review gates
296
298
  - linked changes and `yad thread`
297
299
  - `yad history`, `yad next` and `yad usage`
300
+ - `yad brain`, the project brain: one knowledge graph of your code and your work items (which story touches which file, which code handles which contract surface), built on your machine with [Graphify](https://github.com/Graphify-Labs/graphify) and never committed; `yad brain query` searches it, and `yad brain view` draws it in your browser (a locked-down local page, or one offline file); `yad brain view --live` lets you watch an agent work through it, against the plan; `yad brain file` and `yad brain story` answer what an agent asks before it plans or edits (who declares a file, what uses it), and the planning and building skills ask them when a brain is built
298
301
  - `yad guide`, the step brief an AI coding agent reads before each step — what the step is for, whether it can be skipped, who does it, the skills that fit, what the agent runs, and what only the person can do
299
302
  - `yad status --brief`, where the work stands in about 20 lines — this checkout's task, each open epic's next action, your open PRs/MRs and what is owed — for picking up after a break or an AI context reset
300
303
  - `yad standup`, a daily status for each team member — what they did since the last working day, what they are on now, and what is waiting — rebuilt live from git, the ledgers and the platform, facts only
301
- - `yad issues`, the team's GitHub issues and GitLab issues and tasks, with priority, type, status and assignee, as a list or an HTML page you can sort and filter. Items link to epics, update from epic status, and appear in `yad standup`. Ask the agent to open, assign, label, edit, comment on, close or reopen an item, and it does. `yad-run` and `yad-implement` also scan each implementation and file security findings, technical debt and suggestions there
304
+ - `yad issues`, the team's GitHub issues and GitLab issues and tasks, with priority, type, status and assignee, as a list or an HTML page you can sort and filter. Items link to epics, update from epic status, and appear in `yad standup`. Ask the agent to open, assign, label, edit, comment on, close or reopen an item, and it does. Once the Foundation review passes, `yad foundation publish` turns each roadmap feature into an item, with a milestone per phase. `yad-run` and `yad-implement` also scan each implementation and file security findings, technical debt and suggestions there
305
+ - `yad map`, the road to Production as one moving picture — epics, stories, tasks and branches flowing through Development into Production — with who owns, built, reviewed and approved each part (roles, never counts; `--anonymous` for sharing)
306
+ - `yad reports`, the reports you saved (standup, usage, issues, the brain view page, the progress map), kept on your machine only in `<product>--reports/` beside the Product, each named by date, kind, scope and state, and marked fresh or stale
302
307
  - `yad detect`, which lists the skills, agents, MCP servers and plugins installed for each AI agent
303
308
  - `yad toolbox list`, which shows the external tools yadflow can use, which ones you have, and what happens without each; `yad toolbox add` / `remove` record the tools your team uses, and `yad toolbox check` lists the ones not ready on your machine (`yad setup`, `check`, `update` and `join` print the same list, and never install anything without asking: your agent can connect a tool after one yes, with `yad toolbox connect`); each skill that uses a tool reads the same answer and says what it does without it
304
309
  - `yad skill recommend`, which lists hand-picked skills from the recommended skill collections for each step, why each fits, and the command to bind one; it binds nothing, and every pick was checked against its source
@@ -316,9 +321,13 @@ The record is worth trusting because people approve what goes into it.
316
321
 
317
322
  ## Documentation
318
323
 
319
- - **Learn:** the [guided tutorial](https://abdelrahmannasr.github.io/yadflow/tutorial/) (setup to
320
- your first shipped feature) · the [team guide](TEAM-GUIDE.md) · the
324
+ - **Learn:** [yadflow, explained](docs/YADFLOW-EXPLAINED.md) (every part in plain words, for technical
325
+ and non-technical readers) · the [guided tutorial](https://abdelrahmannasr.github.io/yadflow/tutorial/)
326
+ (setup to your first shipped feature) · the [team guide](TEAM-GUIDE.md) · the
321
327
  [terminology and workflow report](https://abdelrahmannasr.github.io/yadflow/)
328
+ - **Talk:** [GitHub Discussions](https://github.com/abdelrahmannasr/yadflow/discussions) — ask
329
+ questions in Q&A, suggest ideas, and share what you build. Bugs go to
330
+ [Issues](https://github.com/abdelrahmannasr/yadflow/issues/new/choose).
322
331
  - **Reference:**
323
332
  - [every `yad` command](docs/CLI.md#commands)
324
333
  - [working together: capture, claims, owners, fold](docs/CLI.md#working-together-capture-claims-owners-and-fold)
package/bin/commands.mjs CHANGED
@@ -12,7 +12,7 @@
12
12
 
13
13
  export { runSetup } from '../cli/setup.mjs';
14
14
  export { runNew, runInit, runJoin } from '../cli/workspace.mjs';
15
- export { findProduct, hasProduct, workspaceProduct, registryEntryFor, toolsFolder, WORKSPACE_FILE } from '../cli/find-product.mjs';
15
+ export { findProduct, hasProduct, workspaceProduct, registryEntryFor, registeredCheckoutFor, toolsFolder, WORKSPACE_FILE } from '../cli/find-product.mjs';
16
16
  export { reconcile } from '../cli/reconcile.mjs';
17
17
  export { gateOpen, gateSync, gateComments, gateStatus, gateCi, gateReview, gateTrailer, gateWalkthrough, gateRepair, gateReopen } from '../cli/gate.mjs';
18
18
  export { gateApprove, gateComment, gateAdvance } from '../cli/gate-local.mjs';
@@ -36,13 +36,17 @@ export { runAssign, runUnassign, runOwners } from '../cli/owners.mjs';
36
36
  export { runMemberAdd, runMemberList, runMemberRemove } from '../cli/members.mjs';
37
37
  export { runWorktreeAdd, runWorktreeList, runWorktreeRemove } from '../cli/worktree.mjs';
38
38
  export { runStandup, foreignFlags as standupForeignFlags } from '../cli/standup.mjs';
39
+ export { runReports } from '../cli/reports.mjs';
40
+ export { runMap, MAP_USAGE } from '../cli/map-view.mjs';
39
41
  export { runIssuesNew, runIssuesAssign, runIssuesLabel, runIssuesEdit, runIssuesComment, runIssuesClose, runIssuesReopen, ACT_ACTIONS, actForeignFlags } from '../cli/issues-act.mjs';
42
+ export { runFoundationPublish } from '../cli/foundation-publish.mjs';
40
43
  export { runScanFile } from '../cli/scan.mjs';
41
44
  export { runIssuesSync, syncAfterGate } from '../cli/issues-write.mjs';
42
45
  export { runIssuesShow, runIssuesLink, runIssuesUnlink, runEpicNewFromIssue, seedForeignFlags as seedForeign } from '../cli/issues-write.mjs';
43
46
  export { runIssuesList, runIssuesLabels, foreignFlags as issuesForeignFlags } from '../cli/issues.mjs';
44
47
  export { runIndex } from '../cli/index-command.mjs';
45
48
  export { runHistory, HISTORY_FLAGS } from '../cli/history.mjs';
49
+ export { runBrain, BRAIN_USAGE, BRAIN_FLAGS } from '../cli/brain.mjs';
46
50
  export { runRepo } from '../cli/repo.mjs';
47
51
  export { runRiskMap } from '../cli/riskmap-command.mjs';
48
52
  export { runCodeowners } from '../cli/codeowners-command.mjs';
package/bin/yad.mjs CHANGED
@@ -135,15 +135,16 @@ ${c.bold('Team members')} ${c.dim('(identity only — no roles, no reviewers, no
135
135
 
136
136
  ${c.bold('Issues and work items')} ${c.dim('(read live from GitHub issues and GitLab issues, tasks and incidents)')}
137
137
  yad issues [list] Items of the Product and every registered repo, with priority,
138
- type, status and assignee. Filter with --priority --type --status
139
- --assignee --me --repo --since --until --date; order with --sort.
138
+ type, status, assignee and other labels. Filter with --priority
139
+ --type --status --label --assignee --me --repo --since --until
140
+ --date; order with --sort. Repeat --label to need every one.
140
141
  --format html writes a page you can sort and filter; titles are
141
142
  included, so check it before sharing it outside the team
142
143
  yad issues labels [--dry-run] Create the predefined priority, type and status labels each repo lacks
143
144
  yad scan file <f> --repo <r> File a scan's findings on the repo's tracker, by category and priority (the yad-scan skill runs it)
144
145
  yad issues new --title <t> [--body-file <f>] [--type <t>] [--priority P1] [--assignee <login>|--me] [--repo <r>]
145
146
  Open an issue / work item (in the Product repo unless --repo names one)
146
- yad issues assign <ref> <login>|--me|--none · label <ref> --priority P1 --type bug
147
+ yad issues assign <ref> <login>|--me|--none · label <ref> --priority P1 --type bug --add <l> --remove <l>
147
148
  yad issues edit <ref> [--title] [--body-file] · comment <ref> --body-file <f> · close <ref> · reopen <ref>
148
149
  yad issues sync [--dry-run] Update linked items: status and type labels, and close once every epic shipped
149
150
  yad issues show <ref> One item in full. <ref> is 12 (Product repo) or <repo>#12
@@ -162,10 +163,34 @@ ${c.bold('Daily standup')} ${c.dim('(derived live, read-only, facts only — no
162
163
  flags: --since <YYYY-MM-DD>|<N>h|<N>d, --tz <zone> (default UTC),
163
164
  --member <login> | --me, --format md|html, --out <file>, --json
164
165
 
166
+ ${c.bold('Progress map')} ${c.dim('(E181 — read-only; names as roles, no score, no ranking)')}
167
+ yad map [--open] The road to Production as one moving picture: epics, stories, tasks
168
+ and branches flowing through each repo's Development branch into
169
+ Production, with who owns, built, reviewed and approved each part.
170
+ A local page on 127.0.0.1 with a one-time key; Ctrl-C stops it
171
+ yad map --html [<file>] [--open] The same page as one file, saved in the local reports folder; it
172
+ lights what moved since the last saved map
173
+ yad map --live [--open] The page draws itself again when the ledger or a repo changes
174
+ flags: --anonymous (every person as "Person A…", for sharing
175
+ outside the team), --fetch (git fetch origin first; downloads
176
+ only), --json. The Production branch is "map.production" in
177
+ product.json, else guessed (and the page says so)
178
+
179
+ ${c.bold('Saved reports')} ${c.dim('(E180 — on this machine only, never committed)')}
180
+ yad reports [list] [--json] Every report saved in the local reports folder, newest first, each
181
+ marked fresh or stale (the Product changed since it was made).
182
+ The folder is <product>--reports beside the Product, or
183
+ $YAD_REPORTS_DIR. Reports land there when no --out is given:
184
+ standup, usage, issues list --format, brain view --html
185
+ yad reports open <n|file> Open one in the browser
186
+ yad reports prune --older-than <days> | --missing [--apply]
187
+ Remove saved reports older than that, or with --missing only drop
188
+ catalog entries whose file is gone (a dry run without --apply)
189
+
165
190
  ${c.bold('Team usage (EM adoption & behavior report)')}
166
191
  yad usage Build a per-member report (HTML) from git + the SDLC ledgers
167
192
  (derived, read-only — writes no tracked state)
168
- flags: --out <path> (default ./usage-report.html),
193
+ flags: --out <path> (default: the local reports folder),
169
194
  --since <YYYY-MM-DD> --until <YYYY-MM-DD> | --all,
170
195
  --member <name>, --format html|json|md, --repos (code commits)
171
196
 
@@ -196,6 +221,7 @@ ${c.bold('Where am I / what next')}
196
221
  per product, before any epic — then the yad-discovery skill
197
222
  authors its sections. Refuses a second one, and a product still
198
223
  on the old epics/EP-discovery/ (yad migrate converts that)
224
+ yad foundation publish [--dry-run] After the Foundation review: one issue / work item per roadmap feature, a milestone per phase
199
225
  yad foundation status [--json] Which roadmap features are started: reads each proposed epic id
200
226
  in roadmap.md and reports planned / in-shape / in-build /
201
227
  shipped from the epic ledgers. Read-only — the roadmap's Status
@@ -236,7 +262,7 @@ ${c.bold('Where am I / what next')}
236
262
  command (pool skill first, yadflow's skill last). Binds nothing
237
263
  yad toolbox list [--json] [--dir <folder>]
238
264
  The external tools yadflow can use — core (offered at setup),
239
- recommended (skill pools, Docker MCP, Unity MCP), the connectors and
265
+ recommended (skill pools, Docker MCP, two Unity MCPs), the connectors and
240
266
  this project's own — whether each is found here, whether this
241
267
  project uses it, and what yadflow does without it. Installs nothing
242
268
  yad toolbox check [--json] The tools this project uses that are not ready here, each with
@@ -432,6 +458,34 @@ ${c.bold('Build helpers')}
432
458
  yad history search <text> [filters] [--json]
433
459
  Match text in ids, titles, themes, types, repos, and in who
434
460
  closed or merged a step, its PR and its commit
461
+ yad brain build [--repo <name>] [--json]
462
+ The project brain (E176): run Graphify (local, no LLM) in each
463
+ connected code repo, then merge its code graph with the work items
464
+ (epics, stories, tasks, contract surfaces, ships) into
465
+ .sdlc/brain/graph.json — on this machine only, never committed
466
+ yad brain query <text> [--limit <n>] [--json]
467
+ The brain's nodes whose name holds <text>, each with its neighbours
468
+ yad brain file <repo>/<path> [--repo <name>] [--limit <n>] [--json]
469
+ One file (E179): the tasks and stories that declare it, the code it
470
+ defines, the files that use it and that it uses, its ships, and the
471
+ contract surfaces that reach it — what to know before editing it
472
+ yad brain story <story-id> [--limit <n>] [--json]
473
+ One story (E179): its epic, repos, tasks, every file they declare,
474
+ and its ships
475
+ yad brain status [--json] Is the brain current, and is each repo's code graph current
476
+ yad brain view [--open] Draw the brain in a browser (E177): a local page on 127.0.0.1 with a
477
+ one-time key, the code and the work in one graph — filter, search, a
478
+ node's neighbours. Ctrl-C stops it
479
+ yad brain view --html [<file>] [--open]
480
+ The same page as one file that needs no server and no network
481
+ (default: the local reports folder, never committed)
482
+ yad brain view --live [--open] Watch an agent work (E178): each file it reads, searches or edits and
483
+ each command it runs lights up the brain, with a Now card, Plan vs
484
+ reality and a timeline to replay. Needs "activity": true in the
485
+ Product config (then yad check --fix). Shows what, never why
486
+ yad brain view --html --live [<file>]
487
+ The recorded activity as an offline replay file
488
+ (default: the local reports folder, never committed)
435
489
  yad review trailer --repo <r> --pr <n> --body <text> Post the companion's 60-sec briefing to a code PR/MR
436
490
  yad review context --repo <r> --pr <n> Print the grounding bundle for cards/chat
437
491
  yad review walkthrough --repo <r> --pr <n> Bundle + ordered risk-tagged stops for the
@@ -517,7 +571,7 @@ ${c.bold('Environment')}
517
571
  YAD_PLATFORM_LOGIN=0 Name a record's author by git user.name; never ask gh/glab who is logged in`;
518
572
 
519
573
  const REPORT_USAGE = 'usage: yad report [-m <text>] [--kind bug|enhancement] [--json] | yad report -m <text> [--kind …] --post --confirm <value>';
520
- const ISSUES_USAGE = 'usage: yad issues new --title <t> [--body-file <f>] [--type <t>] [--priority P0-P3] [--assignee <login>|--me] [--repo <name>] | assign <ref> <login>|--me|--none | label <ref> [--priority P0-P3] [--type <t>] | edit <ref> [--title <t>] [--body-file <f>] | comment <ref> --body-file <f> | close <ref> | reopen <ref> | show <ref> | link <ref> <EP-id> | unlink <ref> <EP-id> | sync [--dry-run] | labels [--dry-run] | [list] [--priority P0,P1] [--type bug,feature,enhancement,security,tech-debt,suggestion] [--status todo,"in progress",done] [--assignee <login>|none|--me] [--repo <name>] [--since <date>] [--until <date>] [--date created|updated|due] [--sort priority|type|status|due|updated] [--closed-since <date>|<N>d] [--format md|html] [--out <file>] [--json] | yad issues labels [--dry-run] [--json]';
574
+ const ISSUES_USAGE = 'usage: yad issues new --title <t> [--body-file <f>] [--type <t>] [--priority P0-P3] [--assignee <login>|--me] [--repo <name>] | assign <ref> <login>|--me|--none | label <ref> [--priority P0-P3] [--type <t>] [--add <label>]... [--remove <label>]... | edit <ref> [--title <t>] [--body-file <f>] | comment <ref> --body-file <f> | close <ref> | reopen <ref> | show <ref> | link <ref> <EP-id> | unlink <ref> <EP-id> | sync [--dry-run] | labels [--dry-run] | [list] [--priority P0,P1] [--type bug,feature,enhancement,security,tech-debt,suggestion] [--status todo,"in progress",done] [--label <name>[,<name>]]... [--assignee <login>|none|--me] [--repo <name>] [--since <date>] [--until <date>] [--date created|updated|due] [--sort priority|type|status|due|updated] [--closed-since <date>|<N>d] [--format md|html] [--out <file>] [--json] | yad issues labels [--dry-run] [--json]';
521
575
  const STANDUP_USAGE = 'usage: yad standup [--since <YYYY-MM-DD>|<N>h|<N>d] [--tz <zone>] [--member <login>|--me] [--format md|html] [--out <file>] [--json]';
522
576
 
523
577
 
@@ -552,7 +606,12 @@ function parseArgs(argv) {
552
606
  else if (a === '--check') { const v = argv[i + 1]; o.check = (o._[0] === 'next' && v !== undefined && !v.startsWith('-')) ? argv[++i] : true; }
553
607
  else if (a === '--all') o.all = true;
554
608
  else if (a === '--brief') o.brief = true;
609
+ else if (a === '--missing') o.missing = true;
555
610
  else if (a === '--open') o.open = true;
611
+ else if (a === '--html') o.html = true;
612
+ else if (a === '--live') o.live = true;
613
+ else if (a === '--anonymous') o.anonymous = true;
614
+ else if (a === '--fetch') o.fetch = true;
556
615
  else if (a === '--done') o.done = true;
557
616
  else if (a === '--undo') o.undo = true;
558
617
  else if (a === '--debt') o.debt = true;
@@ -638,12 +697,13 @@ let runningCmd = null;
638
697
  // refusal of `yad gate frobnicate` names `gate`, not a command that does not exist.
639
698
  const ACTIONS = {
640
699
  epic: { known: ['new'] },
641
- foundation: { known: ['new', 'status'] },
700
+ foundation: { known: ['new', 'status', 'publish'] },
642
701
  skill: { known: ['list', 'bind', 'unbind', 'recommend'], default: 'list' },
643
702
  gate: { known: ['open', 'sync', 'comments', 'status', 'repair', 'reopen', 'review', 'walkthrough', 'trailer', 'ci', 'approve', 'comment', 'advance'] },
644
703
  review: { known: ['trailer', 'context', 'chat', 'cards', 'walkthrough', 'nudge', 'reconcile'] },
645
704
  tidy: { known: ['up'] },
646
705
  history: { known: ['list', 'show', 'search'], default: 'list' },
706
+ brain: { known: ['build', 'query', 'file', 'story', 'status', 'view'], default: 'status' },
647
707
  repo: { known: ['list', 'refresh', 'sync', 'clone', 'preview'], default: 'list' },
648
708
  'risk-map': { known: ['check', 'draft'], default: 'check' },
649
709
  codeowners: { known: ['check'], default: 'check' },
@@ -660,6 +720,7 @@ const ACTIONS = {
660
720
  worktree: { known: ['add', 'list', 'remove'], default: 'list' },
661
721
  run: { known: ['checks'] },
662
722
  build: { known: ['start', 'step', 'trust', 'ship', 'merged', 'done', 'sync'] },
723
+ reports: { known: ['list', 'open', 'prune'], default: 'list' },
663
724
  };
664
725
  // E80 — how each command finds its folder. A PRODUCT command works on the Product; a REPO command works
665
726
  // on the code repo it runs in and reads the Product beside it. The rest take their folder as given:
@@ -669,7 +730,7 @@ const PRODUCT_CMDS = new Set([
669
730
  'skip', 'unskip', 'defer', 'undefer', 'dial', 'mode', 'kill', 'unkill', 'unblock', 'gate', 'checkpoint',
670
731
  'capture', 'claims', 'assign', 'unassign', 'owners', 'fold', 'tidy', 'index', 'history', 'repo',
671
732
  'risk-map', 'codeowners', 'docs', 'thread', 'reconcile', 'member', 'standup', 'issues', 'scan', 'build', 'worktree', 'ci',
672
- 'story',
733
+ 'story', 'brain', 'reports', 'map',
673
734
  ]);
674
735
  // `status` reads the Product but must keep the folder it ran in: "here" is that checkout's task branch (#349).
675
736
  const REPO_CMDS = new Set(['commit', 'open-pr', 'ship', 'review', 'run', 'status', 'guide']);
@@ -682,6 +743,9 @@ function writesProduct(cmd, o) {
682
743
  // `build merged` only asks the platform, unless --ship records what it found.
683
744
  if (cmd === 'build') return action === 'sync' ? !o.dryRun : action !== 'merged' || !!o.ship;
684
745
  if (cmd === 'check') return !!o.fix;
746
+ // `brain build` writes the brain into the Product. `brain view --html` with no file named saves into the
747
+ // Product's local reports folder (E180), so it needs the Product found too: else the shared refusal.
748
+ if (cmd === 'brain') return action === 'build' || (action === 'view' && !!o.html);
685
749
  if (cmd === 'epic' || cmd === 'foundation') return action === 'new';
686
750
  if (cmd === 'skill') return action === 'bind' || action === 'unbind';
687
751
  if (cmd === 'dial') return o.to !== undefined;
@@ -743,7 +807,7 @@ async function main() {
743
807
  // so it takes no --json (E1).
744
808
  if (inJSON()) return refuse('yad hook takes no --json — its output is the protocol the agent reads', 'run it without --json');
745
809
  // E158: the agent guard, before an agent's shell command.
746
- if (action === 'agent-guard') { runAgentGuardHook({ format: o.format ?? null }); return; }
810
+ if (action === 'agent-guard') { await runAgentGuardHook({ format: o.format ?? null }); return; }
747
811
  if (action !== 'ledger-guard') return refuse(`unknown hook: ${action ?? '(none)'} (ledger-guard, agent-guard)`);
748
812
  // `--staged` is the git pre-commit half (E48): the files come from the index, never from stdin.
749
813
  if (o.staged) { runStagedLedgerGuard(); return; }
@@ -790,14 +854,15 @@ async function main() {
790
854
  process.stderr.write(c.dim(`Product: ${shown(found.root)} (${found.worktree ? `${found.worktree}'s worktree` : found.via === 'workspace' ? `from ${commands.WORKSPACE_FILE}` : 'above this folder'})\n`));
791
855
  // Run from inside one code repo, the per-repo commands work on THAT repo, not on every one the
792
856
  // Product registers (they take the repo's name as their second word).
793
- // The CHECKOUT must be the registered repo (a worktree or nested repo inside it is another one).
857
+ // The CHECKOUT must be the registered repo's own: these commands work on `<Product>/<path>`, so from a
858
+ // worktree (on another branch) or a nested repo they cover every repo instead (E80 review 3, #515).
794
859
  if ((cmd === 'risk-map' || cmd === 'codeowners') && o._[2] === undefined) {
795
- const hit = commands.registryEntryFor(found.root, dirGiven ? o.dir : shellCwd());
860
+ const hit = commands.registeredCheckoutFor(found.root, dirGiven ? o.dir : shellCwd());
796
861
  if (typeof hit?.meta?.name === 'string') o._[2] = hit.meta.name;
797
862
  }
798
863
  // `yad ci check` the same way: that repo, unless --repo or --all says otherwise.
799
864
  if (cmd === 'ci' && o.repo === undefined && !o.all) {
800
- const hit = commands.registryEntryFor(found.root, dirGiven ? o.dir : shellCwd());
865
+ const hit = commands.registeredCheckoutFor(found.root, dirGiven ? o.dir : shellCwd());
801
866
  if (typeof hit?.meta?.name === 'string') o.repo = hit.meta.name;
802
867
  }
803
868
  }
@@ -1021,8 +1086,10 @@ async function main() {
1021
1086
  case 'foundation': {
1022
1087
  const [, action] = o._;
1023
1088
  if (action === 'status') { result = await commands.runFoundationStatus(o.dir, { json: o.json }); break; }
1089
+ // E174: the approved roadmap becomes work items in the Product repo.
1090
+ if (action === 'publish') { if (noProduct()) break; result = await commands.runFoundationPublish(o.dir, { dryRun: !!o.dryRun, json: !!o.json }); break; }
1024
1091
  if (action !== 'new') {
1025
- refuse(`unknown foundation action: ${action ?? '(none)'} (new, status)`, 'usage: yad foundation new [--json] | yad foundation status [--json]');
1092
+ refuse(`unknown foundation action: ${action ?? '(none)'} (new, status, publish)`, 'usage: yad foundation new [--json] | yad foundation status [--json] | yad foundation publish [--dry-run] [--json]');
1026
1093
  break;
1027
1094
  }
1028
1095
  if (noProduct()) break;
@@ -1282,7 +1349,7 @@ async function main() {
1282
1349
  const common = { json: !!o.json };
1283
1350
  if (action === 'new') result = await commands.runIssuesNew(o.dir, { ...common, title: o.title, body: o.body ?? null, bodyFile: o['body-file'] ?? null, type: o.type ?? null, priority: o.priority ?? null, assignee: o.assignee ?? null, me: !!o.me, repo: o.repo ?? null });
1284
1351
  else if (action === 'assign') result = await commands.runIssuesAssign(o.dir, { ...common, ref: words[0], assignee: words[1] ?? null, me: !!o.me, none: !!o.none });
1285
- else if (action === 'label') result = await commands.runIssuesLabel(o.dir, { ...common, ref: words[0], priority: o.priority ?? null, type: o.type ?? null });
1352
+ else if (action === 'label') result = await commands.runIssuesLabel(o.dir, { ...common, ref: words[0], priority: o.priority ?? null, type: o.type ?? null, add: o.add ?? [], remove: o.remove ?? [] });
1286
1353
  else if (action === 'edit') result = await commands.runIssuesEdit(o.dir, { ...common, ref: words[0], title: o.title ?? null, body: o.body ?? null, bodyFile: o['body-file'] ?? null });
1287
1354
  else if (action === 'comment') result = await commands.runIssuesComment(o.dir, { ...common, ref: words[0], body: o.body ?? null, bodyFile: o['body-file'] ?? null });
1288
1355
  else result = await (action === 'close' ? commands.runIssuesClose : commands.runIssuesReopen)(o.dir, { ...common, ref: words[0] });
@@ -1302,7 +1369,7 @@ async function main() {
1302
1369
  if (action === 'sync') { result = await commands.runIssuesSync(o.dir, { dryRun: !!o.dryRun, json: !!o.json }); break; }
1303
1370
  if (action === 'labels') { result = await commands.runIssuesLabels(o.dir, { dryRun: !!o.dryRun, json: !!o.json }); break; }
1304
1371
  result = await commands.runIssuesList(o.dir, {
1305
- priority: o.priority ?? null, type: o.type ?? null, status: o.status ?? null, assignee: o.assignee ?? null, me: !!o.me, repo: o.repo ?? null,
1372
+ priority: o.priority ?? null, type: o.type ?? null, status: o.status ?? null, label: o.label ?? [], assignee: o.assignee ?? null, me: !!o.me, repo: o.repo ?? null,
1306
1373
  since: o.since ?? null, until: o.until ?? null, date: o.date ?? null, sort: o.sort ?? null, closedSince: o['closed-since'] ?? null,
1307
1374
  format: o.format ?? null, out: o.out ?? null, json: !!o.json,
1308
1375
  });
@@ -1329,6 +1396,21 @@ async function main() {
1329
1396
  });
1330
1397
  break;
1331
1398
  }
1399
+ case 'map': {
1400
+ // E181. Read-only, except --fetch (download only) and the file --html writes.
1401
+ const MAP_OWN = new Set(['--open', '--html', '--live', '--anonymous', '--fetch', '--json', '--dir']);
1402
+ const foreign = [...new Set(process.argv.slice(2).filter((t) => /^--./.test(t) || /^-[A-Za-z]$/.test(t)).map((t) => t.split('=')[0]).filter((f) => !MAP_OWN.has(f)))];
1403
+ if (foreign.length) { refuse(`yad map does not take ${foreign.join(', ')}`, commands.MAP_USAGE); break; }
1404
+ if (noProduct()) break;
1405
+ result = await commands.runMap(o.dir, { args: o._.slice(1), html: !!o.html, open: !!o.open, live: !!o.live, anonymous: !!o.anonymous, fetch: !!o.fetch, json: !!o.json });
1406
+ break;
1407
+ }
1408
+ case 'reports': {
1409
+ // E180. The local reports folder; nothing here touches the Product or any repo.
1410
+ const [, action, ...args] = o._;
1411
+ result = await commands.runReports(o.dir, { action: action || 'list', args, olderThan: o['older-than'] ?? null, missing: !!o.missing, apply: !!o.apply, json: !!o.json });
1412
+ break;
1413
+ }
1332
1414
  case 'claims': {
1333
1415
  // E46. Read from the capture branches; nothing is recorded here.
1334
1416
  const [, epic, extra] = o._;
@@ -1394,6 +1476,18 @@ async function main() {
1394
1476
  });
1395
1477
  break;
1396
1478
  }
1479
+ case 'brain': {
1480
+ const [, action, ...args] = o._;
1481
+ // As history does: a flag brain does not take is refused, read from the raw arguments — `parseArgs`
1482
+ // turns an unknown flag into a plain word, which `query` would take as search text.
1483
+ const BRAIN_OWN = new Set(commands.BRAIN_FLAGS);
1484
+ const unknownFlags = [...new Set(process.argv.slice(2)
1485
+ .filter((t) => /^--./.test(t) || /^-[A-Za-z]$/.test(t))
1486
+ .map((t) => t.split('=')[0])
1487
+ .filter((f) => !BRAIN_OWN.has(f)))];
1488
+ result = await commands.runBrain(o.dir, { action: action || 'status', args, repo: o.repo ?? null, limit: o.limit ?? null, json: !!o.json, open: !!o.open, html: !!o.html, live: !!o.live, unknownFlags });
1489
+ break;
1490
+ }
1397
1491
  case 'repo': {
1398
1492
  const [, action, name] = o._;
1399
1493
  // `yad repo preview <name> [<pattern>]` (#359): the one action with a third word.
@@ -0,0 +1,13 @@
1
+ // The agent guard's decision, run in a worker thread by `yad hook agent-guard` (cli/hook.mjs, #498). The worker
2
+ // has a memory cap and a time limit: a line that would run the guard out of memory, or past its time, ends the
3
+ // worker, not the hook, and the hook refuses the line. A crashed hook exits with a code the harness reads as
4
+ // "no answer", and the command runs.
5
+ import { parentPort, workerData } from 'node:worker_threads';
6
+ import { agentGuardDecision, agentGuardPreapproval } from './agent-guard.mjs';
7
+
8
+ const { command, preapproval } = workerData;
9
+ // The verdict first: pre-approval (E167) reads the same line again, under the same limits, and when it runs out
10
+ // of time the verdict stands, only not pre-approved.
11
+ const verdict = agentGuardDecision(command);
12
+ parentPort.postMessage({ verdict });
13
+ if (verdict.allow && preapproval) parentPort.postMessage({ pre: agentGuardPreapproval(command, preapproval) });