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/cli/standup.mjs CHANGED
@@ -43,10 +43,11 @@ import { gitAuthors, personKey } from './people.mjs';
43
43
  import { isBot } from './riskmap.mjs';
44
44
  import { accountId, buildIssues, mdEscape, mdUrl } from './issues.mjs';
45
45
  import { readMembers, memberStatuses, memberMatches, productIdentity, ttlDays, accountLabel, accessCheck } from './members.mjs';
46
- import { ledgerEvents, esc, mdText, writeReport } from './usage.mjs';
46
+ import { ledgerEvents, esc, mdText } from './usage.mjs';
47
+ import { writeOrSave } from './reports-dir.mjs';
47
48
  import { readRegistry, judgeRepo, runnable } from './workspace.mjs';
48
49
  import { listPrs, prTarget } from './pr-list.mjs';
49
- import { shown } from './protection.mjs';
50
+ import { shown, configuredGitUrl } from './protection.mjs';
50
51
  import { platformLogin } from './platform.mjs';
51
52
 
52
53
  const DAY_MS = 86_400_000;
@@ -170,8 +171,8 @@ function wipSaves(root, env, startMs) {
170
171
  // The repos to read: the Product and every registered repo. `dir` is set only when git may run there
171
172
  // (judged first, E81); `gitUrl` is what the platform is asked about.
172
173
  export function repoSources(root, identity, productConfig, notRead, env, { localPaths = true } = {}) {
173
- const productUrl = typeof productConfig?.git_url === 'string' && productConfig.git_url ? productConfig.git_url
174
- : (gitIn(root, env)(['remote', 'get-url', 'origin']).out.trim() || '');
174
+ // A git_url that names only a host is no repo: origin then (#513).
175
+ const productUrl = configuredGitUrl(productConfig?.git_url, () => gitIn(root, env)(['remote', 'get-url', 'origin']).out);
175
176
  const out = [{ label: 'Product', dir: root, gitUrl: productUrl, platform: identity.platform }];
176
177
  const { registry, problem } = readRegistry(root);
177
178
  if (problem) notRead.push(`${safe(problem)} — the code repos are not read`);
@@ -193,14 +194,14 @@ export function repoSources(root, identity, productConfig, notRead, env, { local
193
194
 
194
195
  // The one member a piece of evidence belongs to: `{ member }`, `{ ambiguous: [...] }` when more than one
195
196
  // matches, or `{}` when none does.
196
- function whose(members, e) {
197
+ export function whose(members, e) {
197
198
  const hit = members.filter((m) => memberMatches(m, e));
198
199
  if (hit.length === 1) return { member: hit[0] };
199
200
  return hit.length ? { ambiguous: hit } : {};
200
201
  }
201
202
  // A git name made branch-safe (an owner file, a claim, a capture branch) — compared with the same form of
202
203
  // each name a member file holds.
203
- function whoseWip(members, w) {
204
+ export function whoseWip(members, w) {
204
205
  const hit = members.filter((m) => m.names.some((n) => wipName(n) === w));
205
206
  if (hit.length === 1) return { member: hit[0] };
206
207
  return hit.length ? { ambiguous: hit } : {};
@@ -262,6 +263,70 @@ const plural = (n, one, many = `${one}s`) => `${n} ${n === 1 ? one : many}`;
262
263
  const prWord = (platform) => (platform === 'gitlab' ? 'MR !' : 'PR #');
263
264
 
264
265
  // The whole report as data. `now` is epoch milliseconds (injected, so a test can pin the day).
266
+ // WAITING — gates, by the owner of the step they review: the live E47 owner, else the epic's `owner`.
267
+ // Each epic on its own: a shared file that is not what yad writes stops that epic's lines, said in
268
+ // "not read", never the whole report. → { waits: [{ owner: { at, display, key } | null, item }], notRead }
269
+ // Shared by `yad standup` and `yad map` (E181), so the gate rule is read in one place.
270
+ export function gateWaits(root, { ledgers, members, productConfig, identity, places = [] }) {
271
+ const solo = isSolo(productConfig);
272
+ const engagement = requireEngagement(productConfig);
273
+ const waits = [];
274
+ const notRead = [];
275
+ const mergeWord = identity.platform ? `its review ${identity.platform === 'gitlab' ? 'MR' : 'PR'} to merge` : '`yad gate advance` (no platform: the gate moves on when it is advanced)';
276
+ for (const [epic, led] of ledgers) {
277
+ try {
278
+ const state = led.state;
279
+ if (!state?.steps) continue;
280
+ const owners = new Map(readOwners(root, epic).filter((o) => !o.error && o.live).map((o) => [o.step, o]));
281
+ const front = readFrontmatter(path.join(epicRoot(root, epic), 'epic.md')).owner || readFrontmatter(path.join(epicRoot(root, epic), 'roadmap.md')).owner;
282
+ const epicOwner = typeof front === 'string' && front.trim() ? front.trim() : null;
283
+ const ownerOf = (stepId) => {
284
+ const o = owners.get(stepId);
285
+ if (o) return { at: whoseWip(members, o.owner), display: o.name || o.owner, key: `wip:${o.owner}` };
286
+ if (epicOwner) return { at: whose(members, { login: epicOwner, name: epicOwner }), display: epicOwner, key: personKey({ login: epicOwner }) };
287
+ return null;
288
+ };
289
+ const put = (stepId, item) => { waits.push({ owner: ownerOf(stepId), item }); };
290
+ const approvals = records(led.approvals);
291
+ const comments = records(led.comments);
292
+ const reviewPrs = records(led.productPrs);
293
+ // (b) the current step is an author step someone owns, and it is not done.
294
+ const cur = state.steps.find((s) => s?.id === state.currentStep);
295
+ const curDef = STEPS.find((d) => d.id === cur?.id);
296
+ if (cur && !isPassed(cur) && curDef && curDef.kind !== 'review' && cur.type !== 'review+approve' && ownerOf(cur.id)) {
297
+ put(cur.id, { kind: 'next-move', epic, step: cur.id, state: stepStatus(cur), text: `${epic} ${safe(cur.id)} is the current step and theirs to author (${stepStatus(cur) || 'unknown state'})` });
298
+ }
299
+ // (a) an open gate: its author step passed, the review not yet. Read through the gate's own predicate,
300
+ // so this line never says more than `yad gate status` would (engagement, revoked approvals, solo).
301
+ for (const s of state.steps.filter((x) => x?.type === 'review+approve' && !isPassed(x))) {
302
+ const a = authorStepFor(state, s);
303
+ if (!a || !isPassed(a)) continue;
304
+ const verdict = gatePredicate({ step: s, approvals, acceptedHashes: acceptedHashes(epicRoot(root, epic), s.artifact), solo, requireEngagement: engagement, optional: optionalStepsFor(state) });
305
+ const rule = gateRuleFor(s);
306
+ const pr = reviewPrs.find((p) => (typeof p.step === 'string' && p.step === s.id) || (typeof p.artifact === 'string' && p.artifact === s.artifact));
307
+ const prNo = pr && Number.isSafeInteger(pr.number) ? pr.number : null;
308
+ const via = prNo != null ? `${prWord(identity.platform)}${prNo}` : null;
309
+ const asks = rule.riskStep ? `; the count asks ${gateRuleSum(rule)} (risk step advisory)` : '';
310
+ const waitsFor = solo
311
+ ? `waits for ${via ? `review ${via} to merge` : mergeWord} (solo mode: approvals waived)`
312
+ : verdict.approvalsSatisfied
313
+ ? `has the ${plural(verdict.have ?? 0, 'approval')} it needs to pass; waits for ${via ? `review ${via} to merge` : mergeWord}${asks}`
314
+ : `waits for approval — missing: ${verdict.missing.map(safe).join('; ')}${asks}${via ? `; review ${via}` : ''}`;
315
+ put(a.id, { kind: 'gate', epic, step: s.id, approvals: verdict.have ?? null, needed: rule.base, asks: rule.needed, missing: verdict.missing, pr: prNo, text: `${epic} ${safe(s.id)} ${waitsFor}` });
316
+ const rounds = comments.filter((x) => x.step === s.id && Number.isSafeInteger(x.round) && x.round >= 0);
317
+ if (rounds.length) {
318
+ const round = Math.max(...rounds.map((x) => x.round));
319
+ const count = rounds.filter((x) => x.round === round).reduce((n, x) => n + (Number.isSafeInteger(x.count) && x.count >= 0 && x.count <= 100_000 ? x.count : 1), 0);
320
+ put(a.id, { kind: 'comments', epic, step: s.id, round, count, text: `${epic} ${safe(s.id)}: ${plural(count, 'comment')} recorded in review round ${round} (yad does not know which are answered)` });
321
+ }
322
+ }
323
+ } catch (e) {
324
+ notRead.push(`${epic}: its gates could not be read (${why(e, places)}) — nothing is said about what waits there`);
325
+ }
326
+ }
327
+ return { waits, notRead };
328
+ }
329
+
265
330
  export function buildStandup(root, { now = Date.now(), tz = 'UTC', since = null, env = process.env, runner, fetch = true, access = accessCheck } = {}) {
266
331
  const win = windowFor(now, { tz, since });
267
332
  if (win.error) return win;
@@ -425,67 +490,13 @@ export function buildStandup(root, { now = Date.now(), tz = 'UTC', since = null,
425
490
  byWip(w.name, w.name, 'working', { kind: 'drafts', epic: w.epic, last: new Date(w.at).toISOString(), text: `saved drafts on ${safe(w.epic)} (${zoneStamp(w.at, tz)}; nothing unmerged is open now)` });
426
491
  }
427
492
 
428
- // WAITING — gates, by the owner of the step they review: the live E47 owner, else the epic's `owner`.
429
- // Each epic on its own: a shared file that is not what yad writes stops that epic's lines, said in
430
- // "not read", never the whole report.
431
- const solo = isSolo(productConfig);
432
- const engagement = requireEngagement(productConfig);
493
+ // WAITING — gates, by the owner of the step they review (gateWaits).
433
494
  const ownerless = [];
434
- const mergeWord = identity.platform ? `its review ${identity.platform === 'gitlab' ? 'MR' : 'PR'} to merge` : '`yad gate advance` (no platform: the gate moves on when it is advanced)';
435
- for (const [epic, led] of ledgers) {
436
- try {
437
- const state = led.state;
438
- if (!state?.steps) continue;
439
- const owners = new Map(readOwners(root, epic).filter((o) => !o.error && o.live).map((o) => [o.step, o]));
440
- const front = readFrontmatter(path.join(epicRoot(root, epic), 'epic.md')).owner || readFrontmatter(path.join(epicRoot(root, epic), 'roadmap.md')).owner;
441
- const epicOwner = typeof front === 'string' && front.trim() ? front.trim() : null;
442
- const ownerOf = (stepId) => {
443
- const o = owners.get(stepId);
444
- if (o) return { at: whoseWip(members, o.owner), display: o.name || o.owner, key: `wip:${o.owner}` };
445
- if (epicOwner) return { at: whose(members, { login: epicOwner, name: epicOwner }), display: epicOwner, key: personKey({ login: epicOwner }) };
446
- return null;
447
- };
448
- const put = (stepId, item) => {
449
- const o = ownerOf(stepId);
450
- if (!o) { ownerless.push(item); return; }
451
- place(o.at, o.display, o.key, 'waiting', item);
452
- };
453
- const approvals = records(led.approvals);
454
- const comments = records(led.comments);
455
- const reviewPrs = records(led.productPrs);
456
- // (b) the current step is an author step someone owns, and it is not done.
457
- const cur = state.steps.find((s) => s?.id === state.currentStep);
458
- const curDef = STEPS.find((d) => d.id === cur?.id);
459
- if (cur && !isPassed(cur) && curDef && curDef.kind !== 'review' && cur.type !== 'review+approve' && ownerOf(cur.id)) {
460
- put(cur.id, { kind: 'next-move', epic, step: cur.id, state: stepStatus(cur), text: `${epic} ${safe(cur.id)} is the current step and theirs to author (${stepStatus(cur) || 'unknown state'})` });
461
- }
462
- // (a) an open gate: its author step passed, the review not yet. Read through the gate's own predicate,
463
- // so this line never says more than `yad gate status` would (engagement, revoked approvals, solo).
464
- for (const s of state.steps.filter((x) => x?.type === 'review+approve' && !isPassed(x))) {
465
- const a = authorStepFor(state, s);
466
- if (!a || !isPassed(a)) continue;
467
- const verdict = gatePredicate({ step: s, approvals, acceptedHashes: acceptedHashes(epicRoot(root, epic), s.artifact), solo, requireEngagement: engagement, optional: optionalStepsFor(state) });
468
- const rule = gateRuleFor(s);
469
- const pr = reviewPrs.find((p) => (typeof p.step === 'string' && p.step === s.id) || (typeof p.artifact === 'string' && p.artifact === s.artifact));
470
- const prNo = pr && Number.isSafeInteger(pr.number) ? pr.number : null;
471
- const via = prNo != null ? `${prWord(identity.platform)}${prNo}` : null;
472
- const asks = rule.riskStep ? `; the count asks ${gateRuleSum(rule)} (risk step advisory)` : '';
473
- const waitsFor = solo
474
- ? `waits for ${via ? `review ${via} to merge` : mergeWord} (solo mode: approvals waived)`
475
- : verdict.approvalsSatisfied
476
- ? `has the ${plural(verdict.have ?? 0, 'approval')} it needs to pass; waits for ${via ? `review ${via} to merge` : mergeWord}${asks}`
477
- : `waits for approval — missing: ${verdict.missing.map(safe).join('; ')}${asks}${via ? `; review ${via}` : ''}`;
478
- put(a.id, { kind: 'gate', epic, step: s.id, approvals: verdict.have ?? null, needed: rule.base, asks: rule.needed, missing: verdict.missing, pr: prNo, text: `${epic} ${safe(s.id)} ${waitsFor}` });
479
- const rounds = comments.filter((x) => x.step === s.id && Number.isSafeInteger(x.round) && x.round >= 0);
480
- if (rounds.length) {
481
- const round = Math.max(...rounds.map((x) => x.round));
482
- const count = rounds.filter((x) => x.round === round).reduce((n, x) => n + (Number.isSafeInteger(x.count) && x.count >= 0 && x.count <= 100_000 ? x.count : 1), 0);
483
- put(a.id, { kind: 'comments', epic, step: s.id, round, count, text: `${epic} ${safe(s.id)}: ${plural(count, 'comment')} recorded in review round ${round} (yad does not know which are answered)` });
484
- }
485
- }
486
- } catch (e) {
487
- notRead.push(`${epic}: its gates could not be read (${why(e, places)}) — nothing is said about what waits there`);
488
- }
495
+ const gw = gateWaits(root, { ledgers, members, productConfig, identity, places });
496
+ notRead.push(...gw.notRead);
497
+ for (const { owner, item } of gw.waits) {
498
+ if (!owner) ownerless.push(item);
499
+ else place(owner.at, owner.display, owner.key, 'waiting', item);
489
500
  }
490
501
  // WAITING / WORKING — their own open PRs/MRs.
491
502
  for (const p of prRead) {
@@ -537,6 +548,9 @@ export function buildStandup(root, { now = Date.now(), tz = 'UTC', since = null,
537
548
  };
538
549
  }
539
550
 
551
+ // How many things wait, across every person in the model — the state word in a saved report's name.
552
+ export const waitingCount = (model) => [...(model.team || []), ...(model.unlisted || []), ...(model.left || [])].reduce((n, p) => n + (Array.isArray(p.waiting) ? p.waiting.length : 0), 0);
553
+
540
554
  // Narrow the report to one member: by any of their logins (any account), case-insensitive.
541
555
  export function onlyMember(model, login) {
542
556
  const want = String(login).toLowerCase();
@@ -724,11 +738,13 @@ export async function runStandup(root, { now = Date.now(), tz = 'UTC', since = n
724
738
  if (model.error) return refuse(model.error, model.hint);
725
739
  if (who) model = onlyMember(model, who);
726
740
  if (format) {
727
- const dest = out || `standup-report.${format}`;
728
- writeReport(dest, format === 'md' ? renderMarkdown(model) : renderHtml(model));
729
- if (json) note(`wrote ${format.toUpperCase()} report → ${dest}`);
730
- else info(`wrote ${format.toUpperCase()} report → ${c.bold(dest)}`);
731
- return { ...model, out: dest };
741
+ // E180: with no --out, saved in the local reports folder, named by who it covers and how much waits.
742
+ const saved = writeOrSave(root, { out, kind: 'standup', scope: who || 'team', state: `${waitingCount(model)} waiting`, ext: format, content: format === 'md' ? renderMarkdown(model) : renderHtml(model), command: 'standup', env });
743
+ if (saved.problem) return refuse(saved.problem);
744
+ for (const w of saved.warnings) warn(w);
745
+ if (json) note(`wrote ${format.toUpperCase()} report → ${saved.file}`);
746
+ else info(`wrote ${format.toUpperCase()} report → ${c.bold(saved.file)}`);
747
+ return { ...model, out: saved.file };
732
748
  }
733
749
  if (!json) renderText(model);
734
750
  return { ...model, out: null };
package/cli/status.mjs CHANGED
@@ -60,11 +60,12 @@ function finished(root, id, ledger, a) {
60
60
  const laneSteps = (lane) => (Array.isArray(lane?.steps) ? lane.steps.filter((s) => s && typeof s.id === 'string') : []);
61
61
  const real = (p) => { try { return fs.realpathSync(p); } catch { return path.resolve(p); } };
62
62
 
63
- // The registered repo this checkout is. A monorepo registers the Product's own folder (`path: "."`), which
64
- // `registryEntryFor` never answers (it is a code-repo command's guard), so that one case is matched here.
65
- // So is a git worktree of a registered repo (agents often work in one): `registryEntryFor` refuses it on
66
- // purpose — a command that WRITES must not swap one checkout for another — but this view only reads, and
67
- // the branch it reports is the worktree's own. The worktree's main checkout names the repo.
63
+ // The registered repo this checkout is. A git worktree of a registered repo (agents often work in one) is
64
+ // that repo, and `registryEntryFor` answers it (#515); the branch reported is the worktree's own. This view
65
+ // only reads, so it is more lenient than a command that writes: a worktree moved by hand, whose git
66
+ // back-link is stale (`git worktree repair` not yet run), still names its repo by git's common folder. A
67
+ // monorepo registers the Product's own folder (`path: "."`), which `registryEntryFor` never answers (it is
68
+ // a code-repo command's guard), so that one case is matched here.
68
69
  function repoHere(root, cwd, top) {
69
70
  const hit = registryEntryFor(root, cwd)?.meta?.name;
70
71
  if (typeof hit === 'string') return hit;