create-pmos 0.819.0 → 0.821.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 (32) hide show
  1. package/package.json +38 -38
  2. package/payload/KIT-VERSION +1 -1
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/scripts/workflows.js +26 -6
  6. package/payload/state/discoveries.md +1 -1
  7. package/workspace/changelog.json +37 -24
  8. package/workspace/guide/cli.md +12 -0
  9. package/workspace/lib/driver.js +2 -0
  10. package/workspace/lib/engine/workflows.js +26 -6
  11. package/workspace/lib/hire-draft.js +172 -0
  12. package/workspace/lib/line-driver.js +40 -12
  13. package/workspace/lib/line.js +30 -8
  14. package/workspace/lib/pmos-verbs.js +4 -1
  15. package/workspace/lib/route-modules.js +1 -0
  16. package/workspace/lib/routes-boards.js +1 -1
  17. package/workspace/lib/routes-stage-signoffs.js +71 -0
  18. package/workspace/lib/routes-your-move.js +10 -1
  19. package/workspace/lib/signoff-cli.js +13 -3
  20. package/workspace/lib/signoffs.js +24 -4
  21. package/workspace/lib/stage-signoffs.js +207 -0
  22. package/workspace/lib/vendor/scripts/workflows.js +26 -6
  23. package/workspace/package-lock.json +2 -2
  24. package/workspace/package.json +1 -1
  25. package/workspace/public/pm/cozy-today-app.js +61 -1
  26. package/workspace/public/pm/cozy-today-model.js +20 -4
  27. package/workspace/public/pm/cozy-today-view.js +17 -2
  28. package/workspace/public/pm/home-app.js +1 -1
  29. package/workspace/run-tests.js +37 -4
  30. package/workspace/test-lists/factory-signoffs-reach-you.json +9 -0
  31. package/workspace/test-lists/next-hire-draft.json +9 -0
  32. package/workspace/test-timings.json +499 -114
@@ -2452,7 +2452,7 @@ mountPanels({
2452
2452
  if (TD_PAGE) TDY = mountToday({ S, VW, POP, pmGet, pmPost, toast, toastUndo, isPhone, now: NOW,
2453
2453
  rank: () => { S.topRank = rankMove({ ...rankIn(), calls: YD.callsOf((S.M && S.M.move) || []), now: NOW() }); return S.topRank; },
2454
2454
  rows: () => new Map(allRows().map((r) => [r.id, r])), titleOf: (id) => (iniRowOf(id) ? iniTitle(id) : String(id || '').replace(/[-_]+/g, ' ').replace(/^./, (c) => c.toUpperCase())), hasIni: (id) => !!(id && iniRowOf(id)), boardWs, boardId,
2455
- goIni: (id, o) => goIni(id, o || {}), select: (id) => select(id),
2455
+ goIni: (id, o) => goIni(id, o || {}), select: (id) => select(id), openFile: (f) => openFile(f),
2456
2456
  // a mention row opens that one mention (Today round 3), never the Mentions list
2457
2457
  openMention: (id, o) => { const L = MEN.mentionsOf(S.D), m = [...L.waiting, ...L.toread, ...L.answered].find((x) => x.id === id) || (o && o.m); if (!m) return false; MEN.openOneMention(m, menCtx(), o || {}); return true; },
2458
2458
  mentions: () => MEN.mentionsOf(S.D), mentionAct: (id, act) => pmPost('/api/mentions/act', { id, act }), reloadMentions: () => MEN.load(menCtx()).then(() => drawList()),
@@ -2,7 +2,7 @@
2
2
  'use strict';
3
3
  /* run-tests.js — run the workspace suites side by side.
4
4
  *
5
- * node run-tests.js <group> [--jobs=N] [--shard=I/N] [--changed[=REF]] [--retry-browser] [--timings-out=FILE] [--list] [--verbose]
5
+ * node run-tests.js <group> [--jobs=N] [--shard=I/N] [--changed[=REF]] [--retry-browser] [--timings-out=FILE] [--list] [--plan] [--verbose]
6
6
  * node run-tests.js --check
7
7
  * node run-tests.js --merge-timings=DIR
8
8
  *
@@ -172,6 +172,7 @@ const WIDE = new Set([
172
172
  * - lib/routes-<x>.js (a route module that lib/route-modules.js loads): every '/api/…' route the file names under the
173
173
  * prefixes it declares (a route it only calls through ctx is left out). With no prefixes it can read: every route it names.
174
174
  * - lib/pmos-verbs.js, when the diff only adds a verb (its module line and its help line): the suites that name pmos-verbs or the new module.
175
+ * - lib/needs-providers.js, when the diff only adds a provider name to PROVIDERS: the suites that name needs-providers or the new provider.
175
176
  * - lib/route-modules.js, when the diff only adds module names to its list: what each added lib/routes-<x>.js reaches. Any other change to it is the rule below.
176
177
  * - Any other file: the files that name it (a require, an import or a path string), followed the same way: server.js
177
178
  * through the names it binds the module to, a lib/ file through its own users, a suite directly. A lib/ file that no
@@ -725,6 +726,11 @@ function traceChanges(changes, ctx) {
725
726
  for (const s of list) { const t = get(s) || ''; if (t.includes('pmos-verbs') || nv.some((m) => t.includes(m))) picked.add(s); }
726
727
  continue;
727
728
  }
729
+ const np = f === PROVIDERS_FILE ? newProviderOnly(sget(f), lines) : null;
730
+ if (np) { // a new needs provider: only its own rows are new, so the suites that name the provider table or the new provider
731
+ for (const s of list) { const t = get(s) || ''; if (t.includes('needs-providers') || np.some((m) => t.includes(m))) picked.add(s); }
732
+ continue;
733
+ }
728
734
  let why = null;
729
735
  const before = picked.size;
730
736
  if (get(f) == null) { // removed: only the names in the suites can say who used it
@@ -766,6 +772,28 @@ function newVerbOnly(src, lines) {
766
772
  return mods.length ? mods : null;
767
773
  }
768
774
 
775
+ /* decision-journal-outcome-checks: server.js folds every needs provider into deriveNeeds through lib/needs-providers.js, so a change there
776
+ * reaches every suite. A change that only ADDS a provider's name to PROVIDERS (` '<name>-needs',`) adds that provider's rows and nothing
777
+ * else: a provider that fails gives one error row of its own. Returns the new providers' names, or null when any changed line is something
778
+ * else. `src` is without comments. */
779
+ const PROVIDERS_FILE = ['lib', 'needs-providers'].join('/') + '.js'; // built, so this file does not read as a user of it
780
+ function newProviderOnly(src, lines) {
781
+ if (src == null || !Array.isArray(lines) || !lines.length) return null;
782
+ const all = src.split('\n'), names = [];
783
+ for (const n of lines) {
784
+ const l = all[n - 1];
785
+ if (l == null) return null;
786
+ if (!l.trim()) continue;
787
+ const m = /^\s*'([\w-]+-needs)',\s*$/.exec(l);
788
+ if (!m) return null;
789
+ names.push(m[1]);
790
+ }
791
+ if (!names.length) return null;
792
+ const start = all.findIndex((l) => /^const PROVIDERS = Object\.freeze\(\[\s*$/.test(l));
793
+ const end = start < 0 ? -1 : all.findIndex((l, i) => i > start && /^\]\);\s*$/.test(l));
794
+ return start >= 0 && end > start && lines.every((n) => n - 1 > start && n - 1 < end) ? names : null;
795
+ }
796
+
769
797
  /* live-round (W1): lib/headless.js decides the kind of EVERY spawn through kindFor(), so a change there reaches every suite. A change that
770
798
  * only ADDS a kind is narrower: a new `const X_ORIGINS = Object.freeze(['p:'])`, its `if (X_ORIGINS.some(...)) return 'k';` line in kindFor,
771
799
  * its TOOLS entry and its name on WRITE_DIR_KINDS or WRITE_PATH_KINDS change only runs whose origin starts with 'p:'. Returns the new
@@ -983,15 +1011,20 @@ async function main() {
983
1011
  }
984
1012
  let list = GROUPS[group];
985
1013
  const shard = flag('shard');
986
- list = shard ? shardOf(list, shard) : bySlowest(list);
1014
+ // --changed first, then --shard (ci-dynamic-shards): the shards split the suites the diff reaches, so they finish
1015
+ // together. Sharding the whole group first left a wide diff's reached suites piled into one or two shards.
987
1016
  const changed = flag('changed');
988
1017
  if (changed) {
989
1018
  const ref = changed === true ? 'origin/main' : changed;
990
1019
  const pick = changedSuites(list, ref);
991
- console.log(`run-tests: --changed against ${ref}: ${pick.why}. ${pick.suites.length} of ${list.length} suites run here; a workflow_dispatch run runs every suite.`);
1020
+ console.log(`run-tests: --changed against ${ref}: ${pick.why}. ${pick.suites.length} of ${list.length} suites run${shard ? ', split across the shards' : ' here'}; a workflow_dispatch run runs every suite.`);
992
1021
  list = pick.suites;
993
- if (!list.length) return;
994
1022
  }
1023
+ // --plan: one JSON line, {"suites":N,"seconds":S}, the suites this command would run and their CI time added up. The
1024
+ // Workspace CI scope job reads it to choose how many shards each group gets.
1025
+ if (flag('plan')) { console.log(JSON.stringify({ suites: list.length, seconds: Math.round(list.reduce((t, f) => t + secs(f), 0)) })); return; }
1026
+ if (changed && !list.length) return;
1027
+ list = shard ? shardOf(list, shard) : bySlowest(list);
995
1028
  // --skip-passed / --since: suites that passed on an earlier head of this PR and that the new commits cannot reach
996
1029
  let carried = [];
997
1030
  const passedIn = flag('skip-passed'); const since = flag('since');
@@ -0,0 +1,9 @@
1
+ {
2
+ "_comment": "factory-signoffs-reach-you (job #1861, Factory page slice A): a stage's sign-offs reach Today's Your move, ✓ records one and moves the stage, one Undo. An IDPF-shaped repository; no browser, no network.",
3
+ "modules": [
4
+ "stage-signoffs.test.js"
5
+ ],
6
+ "seconds": {
7
+ "stage-signoffs.test.js": 8
8
+ }
9
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "_comment": "Draft the next hire (initiative next-hire-draft, done test H1-H5, N1, N2): the pure load per role, the brief, the pmos hire verb on a scratch repository, its wiring and words. No server, browser, model or network.",
3
+ "modules": [
4
+ "hire-draft.test.js"
5
+ ],
6
+ "seconds": {
7
+ "hire-draft.test.js": 2
8
+ }
9
+ }