create-pmos 0.854.0 → 0.856.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-pmos",
3
- "version": "0.854.0",
3
+ "version": "0.856.0",
4
4
  "description": "Scaffold the PMOS portable kit — run the PMOS product-management workflow (initiative → lane-fit spec → contract → build → three gates, with work-type lanes for features, research, maintenance, incidents, and content) entirely inside your own repo, with all state as git-versioned files. Includes `workflow-sweep`, which audits the state every board derives from and separates real defects from work you simply have not done. `create-pmos workspace` also installs + launches the local Terminal Workspace GUI. No database, no network, no telemetry.",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -34,8 +34,31 @@
34
34
  ],
35
35
  "pmosChanges": [
36
36
  {
37
- "v": "0.854.0",
38
- "at": "2026-11-25T22:19:08.732Z",
37
+ "v": "0.856.0",
38
+ "at": "2026-11-25T23:09:00.881Z",
39
+ "f": 4,
40
+ "prs": [
41
+ {
42
+ "n": 2009,
43
+ "t": "Today fills the width 2 : 1",
44
+ "s": "Today fills the width 2 : 1",
45
+ "k": "new",
46
+ "i": "today-balanced-width",
47
+ "try": {
48
+ "steps": [
49
+ "Open Today on a wide screen (1600 px or more)",
50
+ "See Your move and the log on the left two thirds and the agenda on the right third, with no empty right half",
51
+ "Make the window narrower than 1100 px and see one column"
52
+ ],
53
+ "see": "Today fills the width 2 : 1 at any wide size. Nothing is cut. Work and the other pages are unchanged until their own release.",
54
+ "open": "/today.html"
55
+ }
56
+ }
57
+ ]
58
+ },
59
+ {
60
+ "v": "0.855.0",
61
+ "at": "2026-11-25T22:25:06.723Z",
39
62
  "f": 4,
40
63
  "prs": [
41
64
  {
@@ -43,8 +66,8 @@
43
66
  "t": "The strip and the 2:1 layout on This sprint, Backlog Jira links counted (job #2016)",
44
67
  "s": "The strip and the 2:1 layout on This sprint, Backlog Jira links counted (job #2016)",
45
68
  "k": "new",
46
- "h": "The strip and the 2:1 layout on This sprint, Backlog Jira links counted (job #2016)",
47
69
  "i": "tb-sprint-balanced",
70
+ "h": "The strip and the 2:1 layout on This sprint, Backlog Jira links counted (job #2016)",
48
71
  "try": {
49
72
  "steps": [
50
73
  "Open Work and press This sprint",
@@ -54,6 +77,13 @@
54
77
  "see": "The Summary card gives the same To do, In progress and Done counts as the Tasks tabs, all work in the sprint's dates, Jira and not. Each count with work has one ✦ sentence written from the tickets,…",
55
78
  "open": "/premium-board.html"
56
79
  }
80
+ },
81
+ {
82
+ "n": 2064,
83
+ "t": "Ctrl K does things — typed change, old → new, ✓ applies, Undo (A490)",
84
+ "s": "Ctrl K does things — typed change, old → new, ✓ applies, Undo (A490)",
85
+ "k": "new",
86
+ "i": "ctrlk-do"
57
87
  }
58
88
  ]
59
89
  },
@@ -744,107 +774,6 @@
744
774
  "i": "milestone-strip-pages"
745
775
  }
746
776
  ]
747
- },
748
- {
749
- "v": "0.832.0",
750
- "at": "2026-11-25T14:27:37.866Z",
751
- "f": 4,
752
- "prs": [
753
- {
754
- "n": 2033,
755
- "t": "An initiative's anchor is one id (A547)",
756
- "s": "An initiative's anchor is one id (A547)",
757
- "k": "new",
758
- "i": "anchor-ids"
759
- },
760
- {
761
- "n": 1993,
762
- "t": "Big summary cards fold away, kept per person",
763
- "s": "Big summary cards fold away, kept per person",
764
- "k": "new",
765
- "i": "card-fold"
766
- },
767
- {
768
- "n": 2023,
769
- "t": "PMOS drafts an initiative's Lessons when its experiment closes (job #1971)",
770
- "s": "PMOS drafts an initiative's Lessons when its experiment closes (job #1971)",
771
- "k": "new",
772
- "i": "lessons-on-close",
773
- "h": "PMOS drafts an initiative's Lessons when its experiment closes (job #1971)",
774
- "try": {
775
- "steps": [
776
- "On Today, keep PMOS's outcome check for an initiative whose check date has passed",
777
- "Open the chat (Ask PMOS). On a desk the chat opens from the menu button at the bottom left, then the speech bubble. Ask it for that…",
778
- "Read the lines PMOS drafted from what the experiment set out to do and what happened"
779
- ],
780
- "see": "Within a minute of the check closing, the initiative has up to five Lessons lines, each naming what it came from (the experiment, the done test, the result or a decision). Lessons you wrote yourself…",
781
- "open": "/premium-board.html"
782
- }
783
- },
784
- {
785
- "n": 2030,
786
- "t": "Work › Initiatives grouped by the objective they serve (job #2015)",
787
- "s": "Work › Initiatives grouped by the objective they serve (job #2015)",
788
- "k": "new",
789
- "i": "tb-initiatives-by-objective",
790
- "h": "Work › Initiatives grouped by the objective they serve (job #2015)",
791
- "try": {
792
- "steps": [
793
- "Open Work",
794
- "Read the Initiatives tab: each initiative sits under the objective it serves, with 'Serves KR…' under its name",
795
- "Read the Tasks done, Owner and Jira epic columns"
796
- ],
797
- "see": "Objective heads in the OKR file's order (O1 · …, O2 · …), then health budgets, then No goal yet. Each row names the key result it serves. Tasks done reads 'N of M'; a row with no owner reads 'no…"
798
- }
799
- },
800
- {
801
- "n": 1991,
802
- "t": "Events shows the meetings of a past day, with their notes",
803
- "s": "Events shows the meetings of a past day, with their notes",
804
- "k": "fix",
805
- "i": "events-past-meetings"
806
- },
807
- {
808
- "n": 1980,
809
- "t": "Balance meter counts an initiative by its workflow's kind",
810
- "s": "Balance meter counts an initiative by its workflow's kind",
811
- "k": "fix"
812
- },
813
- {
814
- "n": 1955,
815
- "t": "Who has which switch, per customer, on Work; turning one waits for you (job #1908, A263)",
816
- "s": "Who has which switch, per customer, on Work; turning one waits for you (job #1908, A263)",
817
- "k": "new",
818
- "i": "switch-owners",
819
- "h": "Who has which switch, per customer, on Work; turning one waits for you (job #1908, A263)",
820
- "try": {
821
- "steps": [
822
- "Open Today and read Your move: a switch turn that waits shows as Turn <switch> off for <customer> (it shows by itself once one waits)",
823
- "Press ✓ (I turned it) or ✕ (keep it) on that row",
824
- "Open Work with one product shown and read the Switches block under the strategy"
825
- ],
826
- "see": "A waiting turn shows by itself in Your move on Today with ✓ and ✕; with none waiting there is no row. The Switches block lists each customer's switch with why and who agreed, and marks one with no…",
827
- "open": "/today.html"
828
- }
829
- },
830
- {
831
- "n": 1976,
832
- "t": "Three layouts for a new screen, pick one (job #1904, A317)",
833
- "s": "Three layouts for a new screen, pick one (job #1904, A317)",
834
- "k": "new",
835
- "i": "three-layouts",
836
- "h": "Three layouts for a new screen, pick one (job #1904, A317)",
837
- "try": {
838
- "steps": [
839
- "Open Work and open an initiative whose title adds a new screen, page or view",
840
- "Under the stages, find Layouts: three layouts side by side and one ✦ line",
841
- "Press ✓ under the one you want"
842
- ],
843
- "see": "The one you picked is marked as the one to build and the other two stay under it. Undo puts it back. The next new screen's ✦ recommends the kind you pick most for this product.",
844
- "open": "/premium-board.html"
845
- }
846
- }
847
- ]
848
777
  }
849
778
  ]
850
779
  }
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@a66f20615
1
+ kernel-source: pmos@e29dcf2a9
2
2
  assembled: 2026-11-25
3
3
  mode: vendor
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Eval calibration log"
4
4
  description: "Append-only record of every PM override of an evaluator verdict."
5
- generated: {by: process:create-pmos, at: "2026-11-25T22:19:05Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-25T23:08:56Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Health budgets"
4
4
  description: "Closed registry of health-budget anchors (D59), edited only by the PM."
5
- generated: {by: process:create-pmos, at: "2026-11-25T22:19:05Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-25T23:08:56Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Discoveries and friction log"
4
4
  description: "Append-only record of what runs discovered and where the process rubbed."
5
- generated: {by: process:create-pmos, at: "2026-11-25T22:19:05Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-25T23:08:56Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -1,7 +1,30 @@
1
1
  [
2
2
  {
3
- "v": "0.854.0",
4
- "at": "2026-11-25T22:19:08.732Z",
3
+ "v": "0.856.0",
4
+ "at": "2026-11-25T23:09:00.881Z",
5
+ "f": 4,
6
+ "prs": [
7
+ {
8
+ "n": 2009,
9
+ "t": "Today fills the width 2 : 1",
10
+ "s": "Today fills the width 2 : 1",
11
+ "k": "new",
12
+ "i": "today-balanced-width",
13
+ "try": {
14
+ "steps": [
15
+ "Open Today on a wide screen (1600 px or more)",
16
+ "See Your move and the log on the left two thirds and the agenda on the right third, with no empty right half",
17
+ "Make the window narrower than 1100 px and see one column"
18
+ ],
19
+ "see": "Today fills the width 2 : 1 at any wide size. Nothing is cut. Work and the other pages are unchanged until their own release.",
20
+ "open": "/today.html"
21
+ }
22
+ }
23
+ ]
24
+ },
25
+ {
26
+ "v": "0.855.0",
27
+ "at": "2026-11-25T22:25:06.723Z",
5
28
  "f": 4,
6
29
  "prs": [
7
30
  {
@@ -9,8 +32,8 @@
9
32
  "t": "The strip and the 2:1 layout on This sprint, Backlog Jira links counted (job #2016)",
10
33
  "s": "The strip and the 2:1 layout on This sprint, Backlog Jira links counted (job #2016)",
11
34
  "k": "new",
12
- "h": "The strip and the 2:1 layout on This sprint, Backlog Jira links counted (job #2016)",
13
35
  "i": "tb-sprint-balanced",
36
+ "h": "The strip and the 2:1 layout on This sprint, Backlog Jira links counted (job #2016)",
14
37
  "try": {
15
38
  "steps": [
16
39
  "Open Work and press This sprint",
@@ -20,6 +43,13 @@
20
43
  "see": "The Summary card gives the same To do, In progress and Done counts as the Tasks tabs, all work in the sprint's dates, Jira and not. Each count with work has one ✦ sentence written from the tickets,…",
21
44
  "open": "/premium-board.html"
22
45
  }
46
+ },
47
+ {
48
+ "n": 2064,
49
+ "t": "Ctrl K does things — typed change, old → new, ✓ applies, Undo (A490)",
50
+ "s": "Ctrl K does things — typed change, old → new, ✓ applies, Undo (A490)",
51
+ "k": "new",
52
+ "i": "ctrlk-do"
23
53
  }
24
54
  ]
25
55
  },
@@ -194,6 +194,7 @@ Some features, such as Notes, open as a plain card in the Viewer. Each one works
194
194
  - **Guide** (the **?** icon in the menu) opens this guide in the Viewer.
195
195
  - **What PMOS can do** lists every feature by job, each with how to reach it: its command (press it to put it in the chat box), its page, or its keys. Open it from Ctrl K (type "features"), from the ? key list, or from the guide. Features new since you last looked come first.
196
196
  - **Search or ask** (Ctrl K or ⌘K, or `/`) finds initiatives, documents, sessions and files in your work. It always reads the repository and all its worktrees, so it has no worktree picker. It also reaches every page, each Settings section, the themes and the actions of the item you last pointed at: type "lib" to go to Library, or "conn" for Settings › Connectors.
197
+ - **Change something from Ctrl K.** Type a short change to one task: "done checkout redesign", "move survey to friday", "move checkout to next sprint", "give survey to Lee" or "make survey P1". Two changes to the same task can go in one line with "and" ("drop the survey and give it to Lee"). A **Change** row comes first. It shows each field's old value and its new value. Nothing changes while you type. Press ↵ or the row to apply it, and the toast shows **Undo** for 8 seconds. × drops the row. When the words fit more than one task, PMOS asks which one. A person PMOS does not know is underlined. Only these changes work here: Ctrl K never sends anything out of PMOS.
197
198
  - **Dates** show the year only when the year is not this year, for example "Jun 23 ’27". New for you shows a due date as "due 25 Nov".
198
199
  - **Settings** holds the workspace settings. **General** holds the theme (Light, Dark or Auto) and **Product**, which names the product the page reads. **Connectors** shows when PMOS last read each source. A source that is old or failed has an amber dot and ↻ to read it again. ↻ in the Connectors header reads every source again. While a source is old, an amber box at the top of Settings names it, with ↻.
199
200
 
@@ -55,7 +55,7 @@ On a phone, **⋯** at the top right of every screen opens the menu: Today, Work
55
55
 
56
56
  ## Today
57
57
 
58
- On a computer, Today is one page that starts at the left of the panel. At the top are the day and the time, and a greeting. Under them, the Overview and Today's log take the left (at most about 1100 px wide). Today's agenda is in one grey box on the right, about 340 px wide, with the meeting you recorded under it. Today is built from the parts of the PMOS design system: the Overview is a summary card, the log a list card, and the agenda a timeline. Today reads every product. Today's old address (`/premium.html`, and a link that names one item) opens Today; Today's own page is gone.
58
+ On a computer, Today fills the width of the panel. At the top are the day and the time, and a greeting. Under them, the Overview and Today's log take two thirds of the width, and Today's agenda takes the last third (at least 300 px), with the meeting you recorded under it. A wide screen leaves no empty half. Below 1100 px the two parts stack in one column. Today is built from the parts of the PMOS design system: the Overview is a summary card, the log a list card, and the agenda a timeline. Today reads every product. Today's old address (`/premium.html`, and a link that names one item) opens Today; Today's own page is gone.
59
59
 
60
60
  The **Overview** is one card written by PMOS (✦). It says how many things wait on you, the first row of Your move and why it is first ("19 things wait on you; start with the security sign-off, because Friday’s ship waits on it"), how much free time today has and when your first or next meeting is. It names only what the lines themselves say. The name of the row to start with is a link: press it to open it. Under it, PMOS suggests what to clean up with ✓ ✕, only when it is true, for example "Drop the 2 checks carried more than 60 days".
61
61
 
@@ -0,0 +1,156 @@
1
+ 'use strict';
2
+ /* ctrlk-do.js — Ctrl K does things (bet A490, board CtrlKDoDS on the main canvas, agreed by Wawan 2026-11-25).
3
+ *
4
+ * A typed line that reads as a change to one PMOS task becomes a plan: the task, each field's old and new value, the writes that apply
5
+ * it and the writes that undo it. Nothing here writes. The page shows the plan as the Change row of Ctrl K and sends the writes only on ✓.
6
+ *
7
+ * Only known verbs, mapped onto the task writes that already exist (POST /api/boards/tasks/state and /api/boards/tasks/edit):
8
+ * done | finish | complete | close <task> state Done
9
+ * start <task> state In progress
10
+ * reopen <task> state To do
11
+ * drop | cancel <task> state Won't do
12
+ * move | put | push <task> to next sprint start and due = the sprint's days (the first future sprint after the active one)
13
+ * move | put <task> to sprint <name> the same, for a known sprint whose name holds the words
14
+ * move | push | set <task> to <day> due day (YYYY-MM-DD, 9 Dec, Dec 9, today, tomorrow, a weekday)
15
+ * give | assign | hand <task> to <person> owner
16
+ * make | set <task> P1|P2|P3 priority
17
+ * Clauses joined by "and" change the same task ("drop the survey task and give it to Sam"). Anything that would leave PMOS (send, post,
18
+ * email, Jira) is never a verb here: it has no Change row. A line with no verb, or a task that is not found, gives null (zero is silence).
19
+ *
20
+ * looksLikeChange(q) the line starts with a known verb (the page asks the server only then)
21
+ * planLine(q, { tasks, sprints, people, today, ws, pick })
22
+ * tasks: [{ id, board, title, state, owner, due, priority, sprint }] sprints: [{ name, state, start, end }] people: [names]
23
+ * pick: a task id the person chose when the words fit more than one
24
+ * → null | { which: [{ id, title }] } | { task: { id, title }, say, changes: [{ field, label, from, to, unsure? }], apply: [call], undo: [call] }
25
+ * call = { path, body } */
26
+
27
+ const VERB = /^\s*(done|finish|finished|complete|close|start|reopen|drop|cancel|move|put|push|set|give|assign|hand|make|mark)\b/i;
28
+ const looksLikeChange = (q) => VERB.test(String(q || ''));
29
+
30
+ const STATE = { done: 'Done', finish: 'Done', finished: 'Done', complete: 'Done', close: 'Done', start: 'In progress', reopen: 'To do', drop: "Won't do", cancel: "Won't do" };
31
+ const STOP = new Set(['the', 'a', 'an', 'task', 'my', 'our', 'this', 'that']);
32
+ const words = (s) => String(s || '').toLowerCase().split(/[^a-z0-9]+/).filter(Boolean);
33
+ const MONTHS = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'];
34
+ const DAYS = ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'];
35
+ const iso = (d) => d.toISOString().slice(0, 10);
36
+ const say = (d) => { if (!d) return 'none'; const x = new Date(d + 'T00:00:00Z'); return isNaN(x) ? String(d) : x.getUTCDate() + ' ' + MONTHS[x.getUTCMonth()][0].toUpperCase() + MONTHS[x.getUTCMonth()].slice(1); };
37
+
38
+ /** A day typed in words, from today (YYYY-MM-DD); null when it is not a day. */
39
+ function dayOf(text, today) {
40
+ const t = String(text || '').trim().toLowerCase().replace(/^(on|by)\s+/, '');
41
+ const base = new Date((today || iso(new Date())) + 'T00:00:00Z');
42
+ if (/^\d{4}-\d{2}-\d{2}$/.test(t)) return t;
43
+ if (t === 'today') return iso(base);
44
+ if (t === 'tomorrow') return iso(new Date(base.getTime() + 864e5));
45
+ const wd = DAYS.findIndex((d) => d === t || d.slice(0, 3) === t || 'next ' + d === t);
46
+ if (wd >= 0) { const n = ((wd - base.getUTCDay() + 7) % 7) || 7; return iso(new Date(base.getTime() + n * 864e5)); }
47
+ let m = /^(\d{1,2})\s+([a-z]+)$/.exec(t), day, mon;
48
+ if (m) { day = +m[1]; mon = MONTHS.indexOf(m[2].slice(0, 3)); }
49
+ else if ((m = /^([a-z]+)\s+(\d{1,2})$/.exec(t))) { day = +m[2]; mon = MONTHS.indexOf(m[1].slice(0, 3)); }
50
+ if (!m || mon < 0 || day < 1 || day > 31) return null;
51
+ let y = base.getUTCFullYear();
52
+ let d = new Date(Date.UTC(y, mon, day));
53
+ if (d < base) d = new Date(Date.UTC(++y, mon, day)); // a day already past this year means next year's
54
+ return d.getUTCMonth() === mon ? iso(d) : null;
55
+ }
56
+
57
+ /** The tasks the words name: every word (stop words left out) starts a word of the title. Fewest extra title words first. */
58
+ function findTasks(phrase, tasks) {
59
+ const want = words(phrase).filter((w) => !STOP.has(w));
60
+ if (!want.length) return [];
61
+ return tasks.filter((t) => { const have = words(t.title); return want.every((w) => have.some((h) => h.startsWith(w))); })
62
+ .sort((a, b) => words(a.title).length - words(b.title).length);
63
+ }
64
+
65
+ /** One clause → { phrase, field, to } (phrase '' when it says "it"), or null. */
66
+ function clauseOf(c, ctx) {
67
+ const s = c.trim().replace(/[.!]+$/, '');
68
+ let m = /^(done|finish|finished|complete|close|start|reopen|drop|cancel)\s+(.+)$/i.exec(s);
69
+ if (m) return { phrase: m[2], field: 'state', to: STATE[m[1].toLowerCase()] };
70
+ m = /^mark\s+(.+?)\s+(?:as\s+)?(done|finished|complete|started|dropped)$/i.exec(s);
71
+ if (m) return { phrase: m[1], field: 'state', to: { done: 'Done', finished: 'Done', complete: 'Done', started: 'In progress', dropped: "Won't do" }[m[2].toLowerCase()] };
72
+ m = /^(?:move|put|push)\s+(.+?)\s+(?:in)?to\s+(?:the\s+)?next\s+sprint$/i.exec(s);
73
+ if (m) return { phrase: m[1], field: 'sprint', to: nextSprint(ctx.sprints) };
74
+ m = /^(?:move|put|push)\s+(.+?)\s+(?:in)?to\s+sprint\s+(.+)$/i.exec(s);
75
+ if (m) return { phrase: m[1], field: 'sprint', to: namedSprint(ctx.sprints, m[2]) };
76
+ m = /^(?:give|assign|hand)\s+(.+?)\s+to\s+(.+)$/i.exec(s);
77
+ if (m) return { phrase: m[1], field: 'owner', to: personOf(ctx.people, m[2]) };
78
+ m = /^(?:make|set|mark)\s+(.+?)\s+(?:to\s+|as\s+)?(p[1-3])$/i.exec(s);
79
+ if (m) return { phrase: m[1], field: 'priority', to: m[2].toUpperCase() };
80
+ m = /^(?:move|push|set|put)\s+(.+?)\s+(?:due\s+)?(?:to|on|by)\s+(.+)$/i.exec(s);
81
+ if (m) { const d = dayOf(m[2], ctx.today); if (d) return { phrase: m[1].replace(/\s+due$/i, ''), field: 'due', to: d }; }
82
+ return null;
83
+ }
84
+ function nextSprint(sprints) {
85
+ const S = (sprints || []).filter((x) => x && x.name);
86
+ const a = S.findIndex((x) => x.state === 'active');
87
+ const f = S.slice(a + 1).find((x) => x.state === 'future') || S.find((x) => x.state === 'future');
88
+ return f && f.start && f.end ? f : null;
89
+ }
90
+ function namedSprint(sprints, text) {
91
+ const want = words(text);
92
+ const f = (sprints || []).find((x) => x && x.name && want.every((w) => words(x.name).includes(w)));
93
+ return f && f.start && f.end ? f : null;
94
+ }
95
+ function personOf(people, text) {
96
+ const t = String(text || '').trim().replace(/[.!]+$/, '');
97
+ const known = (people || []).find((p) => String(p).toLowerCase() === t.toLowerCase())
98
+ || (people || []).find((p) => words(p).some((w) => w.startsWith(t.toLowerCase())));
99
+ return known ? { name: String(known), unsure: false } : (t ? { name: t.replace(/\b\w/g, (c) => c.toUpperCase()), unsure: true } : null);
100
+ }
101
+
102
+ const LABEL = { state: 'Status', sprint: 'Sprint', owner: 'Owner', priority: 'Priority', due: 'Due' };
103
+ /** The sprint a task sits in today: the one whose dates hold its due day (PMOS tasks join a sprint by its dates, tasks/edit "into sprint"). */
104
+ const sprintOfTask = (t, sprints) => { const d = String(t.due || '').slice(0, 10); const f = d && (sprints || []).find((x) => x && x.start && x.end && String(x.start).slice(0, 10) <= d && d <= String(x.end).slice(0, 10)); return f ? f.name : ''; };
105
+ const showOf = (field, v) => (field === 'due' ? say(v) : v == null || v === '' ? 'none' : String(v));
106
+
107
+ function planLine(q, o = {}) {
108
+ if (!looksLikeChange(q)) return null;
109
+ const tasks = (o.tasks || []).filter((t) => t && t.id && t.title);
110
+ const parts = String(q).split(/\s+and\s+/i);
111
+ const clauses = [];
112
+ for (const p of parts) {
113
+ const c = clauseOf(p, o);
114
+ if (!c) return null; // one part that is not a known change: no Change row at all, never half a change
115
+ clauses.push(c);
116
+ }
117
+ if (clauses.some((c) => c.to == null)) return null; // a sprint or a person that is not there
118
+ const named = clauses.map((c) => (/^(it|that|this)$/i.test(c.phrase.trim()) ? '' : c.phrase)).filter(Boolean);
119
+ if (!named.length) return null;
120
+ let task = null;
121
+ if (o.pick) task = tasks.find((t) => t.id === o.pick) || null;
122
+ if (!task) {
123
+ const found = findTasks(named[0], tasks);
124
+ if (!found.length) return null;
125
+ const exact = found.filter((t) => words(t.title).filter((w) => !STOP.has(w)).length === words(named[0]).filter((w) => !STOP.has(w)).length);
126
+ if (found.length > 1 && exact.length !== 1) return { which: found.slice(0, 3).map((t) => ({ id: t.id, title: t.title })) };
127
+ task = exact.length === 1 ? exact[0] : found[0];
128
+ }
129
+ if (named.slice(1).some((n) => !findTasks(n, [task]).length)) return null; // one line changes one task
130
+ const changes = [], edit = {}, undoEdit = {};
131
+ let state = null, stateFrom = null;
132
+ for (const c of clauses) {
133
+ if (c.field === 'sprint') {
134
+ const was = sprintOfTask(task, o.sprints);
135
+ if (was === c.to.name) continue;
136
+ changes.push({ field: 'sprint', label: LABEL.sprint, from: showOf('sprint', was), to: c.to.name });
137
+ edit.start = String(c.to.start).slice(0, 10); edit.due = String(c.to.end).slice(0, 10); edit.sprint = c.to.name;
138
+ undoEdit.start = String(task.start || '').slice(0, 10); undoEdit.due = String(task.due || '').slice(0, 10);
139
+ continue;
140
+ }
141
+ const to = c.field === 'owner' ? c.to.name : c.to;
142
+ const from = c.field === 'state' ? task.state : task[c.field] == null ? '' : task[c.field];
143
+ if (String(from || '') === String(to)) continue;
144
+ changes.push({ field: c.field, label: LABEL[c.field], from: showOf(c.field, from), to: showOf(c.field, to), ...(c.field === 'owner' && c.to.unsure ? { unsure: true } : {}) });
145
+ if (c.field === 'state') { state = to; stateFrom = from || 'To do'; } else { edit[c.field] = to; undoEdit[c.field] = from || ''; }
146
+ }
147
+ if (!changes.length) return null; // it already says that
148
+ const base = { ws: o.ws || undefined, board: task.board, task: task.id };
149
+ const apply = [], undo = [];
150
+ if (Object.keys(edit).length) { apply.push({ path: '/api/boards/tasks/edit', body: { ...base, ...edit } }); undo.push({ path: '/api/boards/tasks/edit', body: { ...base, ...undoEdit } }); }
151
+ if (state) { apply.push({ path: '/api/boards/tasks/state', body: { ...base, state, why: 'via Ctrl K' } }); undo.push({ path: '/api/boards/tasks/state', body: { ...base, state: stateFrom, why: 'Undo via Ctrl K' } }); }
152
+ const sayIt = changes.map((c) => (c.field === 'state' ? c.to : c.label + ' ' + c.to)).join(', ');
153
+ return { task: { id: task.id, title: task.title }, say: task.title + ': ' + sayIt, changes, apply, undo };
154
+ }
155
+
156
+ module.exports = { looksLikeChange, planLine, dayOf, findTasks };
@@ -11,6 +11,7 @@
11
11
  * GET /api/boards/columns?ws&board&q&owner&cap → { ok, columns: [{ stage, cat, hint, count, rows }] }
12
12
  * GET /api/boards/initiative?ws&board&id → { ok, row, board, history, tools }
13
13
  * GET /api/boards/asks?ws&board&state → { ok, asks } state: open (default) | accepted | declined | all
14
+ * GET /api/boards/do-parse?ws&q[&task] → { ok, plan } Ctrl K does things (A490, lib/ctrlk-do.js planLine), read-only
14
15
  * GET /api/boards/sprints?ws&board → { ok, source: jira|none, readAt, sprints, backlog } (each sprint with goal, summary, themes, frozen; backlog: B.backlogOf)
15
16
  * GET /api/boards/items?ws&board → { ok, build, jira, items, initiatives } PMOS tasks + Jira items (Build and deliver only)
16
17
  * GET /api/boards/anchors?ws&board → { ok, anchors: [{ value, kind, group, label }], error } the declared KRs,
@@ -1158,6 +1159,23 @@ const READS = {
1158
1159
  initiatives: live.map((x) => ({ id: x.id, title: x.title, stage: x.stage, cat: x.cat, status: x.status, signal: x.signal || null, owner: x.owner, anchor: x.anchor || '', rank: x.rank, start: x.start, end: x.end, progress: x.progress, template: x.template, epics: x.epics,
1159
1160
  stages: (x.wfStages || []).map((st) => ({ key: st.key, name: st.name, milestone: !!st.milestone })), ...(x.wfMap ? { map: x.wfMap } : {}) })) }); // the sections a task can sit in (the task Viewer's move icon)
1160
1161
  },
1162
+ '/api/boards/do-parse': (ctx, res, url) => {
1163
+ // Ctrl K does things (bet A490, lib/ctrlk-do.js): the plan for a typed change, read-only. The page sends the plan's writes only on ✓.
1164
+ const w = wsOf(ctx, url.searchParams.get('ws'));
1165
+ if (!w) return fail(ctx, res, 404, 'no such workspace');
1166
+ const q = String(url.searchParams.get('q') || '').slice(0, 300);
1167
+ const DO = require('./ctrlk-do.js');
1168
+ if (!DO.looksLikeChange(q)) return ctx.json(res, { ok: true, plan: null });
1169
+ const fr = frameFor(ctx, w);
1170
+ const P = fr.folded.priorities || new Map();
1171
+ const tasks = [...(fr.folded.tasks || new Map()).values()].filter((t) => t && t.board && fr.boards.some((b) => b.id === t.board))
1172
+ .map((t) => ({ id: t.id, board: t.board, title: t.title, state: t.state, owner: t.owner || '', start: t.start || '', due: t.due || '', priority: P.get(t.id) || '' }));
1173
+ let sprints = [];
1174
+ try { const whole = jiraStatus.readSprints(w.root); sprints = whole ? B.sprintsOf([], () => true, whole, null, {}).sprints || [] : []; } catch { sprints = []; }
1175
+ const people = [...new Set(tasks.map((t) => t.owner).filter(Boolean))];
1176
+ const plan = DO.planLine(q, { tasks, sprints, people, ws: w.id, pick: url.searchParams.get('task') || null });
1177
+ ctx.json(res, { ok: true, plan });
1178
+ },
1161
1179
  '/api/boards/sprints': (ctx, res, url) => {
1162
1180
  const r = boardRead(ctx, res, url);
1163
1181
  if (!r) return;
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.854.0",
3
+ "version": "0.856.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.854.0",
9
+ "version": "0.856.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@anthropic-ai/sdk": "^1.3.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.854.0",
3
+ "version": "0.856.0",
4
4
  "private": true,
5
5
  "description": "PMOS Terminal Workspace — local companion hosting real PTYs beside the library and gates (D62)",
6
6
  "license": "MIT",
@@ -17,8 +17,9 @@
17
17
  * Initiatives", "… · Work-items in Jira"), then everything else Search reads. An initiative the page lists is not listed twice.
18
18
  * closeSearch()
19
19
  * It reads GET /api/find (the repository and every worktree: lib/search-index.js), GET /api/boards/backlog (the initiatives' stage) and
20
- * GET /api/sessions. A result opens in the Viewer when it can: a document of main as its page (premium-vw-doc.js), a meeting as its card,
21
- * any other file read-only from its worktree (GET /api/find/file). Nothing here writes. */
20
+ * GET /api/sessions. A typed change (bet A490) also reads GET /api/boards/do-parse: its Change row writes only on ✓ or ↵ (the task writes
21
+ * that already exist), with Undo in the toast. A result opens in the Viewer when it can: a document of main as its page (premium-vw-doc.js), a meeting as its card,
22
+ * any other file read-only from its worktree (GET /api/find/file). Nothing else here writes. */
22
23
  import { esc, svg, ICON, wsParam, wsQ, skelRows, cantRead, failedItem } from './cozy-evui.js';
23
24
  const ARROW = { up: 'M12 19V5M6 11l6-6 6 6', down: 'M12 5v14M6 13l6 6 6-6', enter: 'M20 5v7a3 3 0 0 1-3 3H5M9 11l-4 4 4 4' }; // the footer's keys, drawn (R28-13: no glyph as a control)
24
25
  import { SEARCH_KINDS, PHONE_KINDS, searchGroups, resultSub, resultTag } from './cozy-evmodel.js';
@@ -28,10 +29,12 @@ import { adler } from './cozy-adler.js'; // session names A: the PM's name win
28
29
 
29
30
  const PHONE = 760;
30
31
  const isPhone = () => innerWidth <= PHONE;
31
- const S = { ask: null, el: null, q: '', kind: 'all', scope: null, at: 0, rows: [], res: null, busy: false, err: '', wt: null, back: null, go: null, seq: 0, boards: null, sessions: null, t: 0 };
32
+ const S = { doit: null, ask: null, el: null, q: '', kind: 'all', scope: null, at: 0, rows: [], res: null, busy: false, err: '', wt: null, back: null, go: null, seq: 0, boards: null, sessions: null, t: 0 };
32
33
  const KIND_ICON = { initiative: ICON.flag, document: ICON.doc, slides: ICON.slides, report: ICON.report, artifact: ICON.design, file: ICON.file, meeting: ICON.meet, session: ICON.session };
33
34
  /** A question: it ends with "?" or starts with a question word, and has 3 words or more (the same rule as lib/search-ask.js isQuestion). */
34
35
  const QW = /^\s*(why|how|what|whats|what's|who|whom|whose|when|where|which|is|are|was|were|do|does|did|can|could|should|would|will|has|have|had)\b/i;
36
+ /** Ctrl K does things (bet A490): a line that starts with a known verb is asked as a change (the same rule as lib/ctrlk-do.js looksLikeChange). */
37
+ const CHANGE = /^\s*(done|finish|finished|complete|close|start|reopen|drop|cancel|move|put|push|set|give|assign|hand|make|mark)\b/i;
35
38
  const isQuestion = (q) => String(q || '').trim().split(/\s+/).filter(Boolean).length >= 3 && (/\?\s*$/.test(String(q).trim()) || QW.test(q));
36
39
  async function getj(p) { try { const r = await fetch(p, { credentials: 'same-origin' }); const j = await r.json().catch(() => null); return j || { ok: false, error: 'the server did not answer' }; } catch { return { ok: false, error: 'the server did not answer' }; } }
37
40
 
@@ -59,6 +62,7 @@ function mount() {
59
62
  const b = e.target.closest('button, input[type="checkbox"]'); if (!b) return;
60
63
  if (b.dataset.ev === 'close') { closeSearch(); return; }
61
64
  if (b.dataset.evKind) { S.kind = b.dataset.evKind; S.at = 0; draw(); q.focus(); return; }
65
+ if ('evDrop' in b.dataset) { if (S.doit) S.doit.dropped = true; S.at = 0; draw(); return; }
62
66
  if (b.dataset.evI != null) { const r = S.rows[+b.dataset.evI]; if (r) go(r); }
63
67
  });
64
68
  return S.el;
@@ -98,6 +102,7 @@ async function run() {
98
102
  S.busy = false;
99
103
  if (!r.ok) { S.err = r.error || 'the server did not answer'; draw(); return; }
100
104
  S.res = r; draw();
105
+ if (CHANGE.test(q)) askChange(q, null);
101
106
  // search-answers-questions: a question the copied sentence did not answer gets an answer written from the user's own files
102
107
  if (!r.answer && isQuestion(q) && !(S.ask && S.ask.q === q)) {
103
108
  S.ask = { q, busy: true, answer: null }; draw();
@@ -107,6 +112,32 @@ async function run() {
107
112
  }
108
113
  }
109
114
 
115
+ /* ── Ctrl K does things (bet A490, board CtrlKDoDS): a Change row first, old → new per field, ✓ applies, Undo takes it back ── */
116
+ async function askChange(q, pick) {
117
+ if (S.doit && S.doit.q === q && !pick) return;
118
+ S.doit = { q, plan: null, busy: true }; draw();
119
+ const p = await getj('/api/boards/do-parse?q=' + encodeURIComponent(q) + (pick ? '&task=' + encodeURIComponent(pick) : '') + wsQ('&'));
120
+ if (!S.doit || S.doit.q !== q) return;
121
+ S.doit = { q, plan: p && p.ok ? p.plan : null, busy: false }; S.at = 0; draw();
122
+ }
123
+ async function post(calls) {
124
+ const H = await import('./http.js');
125
+ for (const c of calls) { const r = await H.pmPost(c.path, c.body); if (!r || !r.ok) return (r && r.error) || 'the save did not land'; }
126
+ return null;
127
+ }
128
+ async function applyChange(plan) {
129
+ closeSearch();
130
+ const T = await import('./c3-toast.js');
131
+ const err = await post(plan.apply);
132
+ if (err) { T.toast({ text: 'Not changed: ' + err, tone: 'error' }); return; }
133
+ T.toast({ text: plan.say, actionLabel: 'Undo', timeout: 8000, onAction: async () => { const e = await post(plan.undo); if (e) T.toast({ text: 'Undo did not land: ' + e, tone: 'error' }); } });
134
+ }
135
+ const OK_D = 'M5 12l5 5 9-11', NO_D = 'M6 6l12 12M18 6L6 18';
136
+ function changeHtml(plan, i) {
137
+ const lines = plan.changes.map((c) => `<span class="ev-small" style="display:flex;gap:8px"><span class="ev-mut" style="min-width:64px">${esc(c.label)}</span><s class="ev-mut">${esc(c.from)}</s><span aria-hidden="true">→</span><b${c.unsure ? ' style="text-decoration:underline dotted"' : ''}>${esc(c.to)}</b></span>`).join('');
138
+ return `<div role="none" style="display:flex;align-items:flex-start;gap:4px"><button type="button" class="ev-mi${i === S.at ? ' hl' : ''}" role="option" id="evo${i}" data-ev-i="${i}" aria-selected="${i === S.at}" aria-label="${esc('Apply: ' + plan.say)}" style="flex:1;height:auto;align-items:flex-start">${svg(OK_D, 18)}<span class="ev-t" style="display:flex;flex-direction:column;gap:2px"><b>${esc(plan.task.title)}</b>${lines}</span></button><button type="button" class="ev-mi" data-ev-drop aria-label="Drop this change" title="Drop this change" style="width:auto;flex:none">${svg(NO_D, 16)}</button></div>`;
139
+ }
140
+
110
141
  /** Every row the palette shows for the query: the search's results, the board's initiatives and the sessions that match, each once. */
111
142
  function allRows() {
112
143
  const q = S.q.trim().toLowerCase();
@@ -165,10 +196,16 @@ function drawList() {
165
196
  const waiting = !ansRow && made && made.busy;
166
197
  // chief-of-staff C5: the one chat is the first row of Search; a page's own find (U2 scope) keeps its own hits first, then the chat
167
198
  const ownRows = own.flatMap((g) => g.rows);
168
- S.rows = (ansRow ? [ansRow] : []).concat(ownRows, ask ? [ask] : [], groups.slice(own.length).flatMap((g) => g.rows));
199
+ const D = S.kind === 'all' && S.doit && S.doit.q === q && !S.doit.dropped ? S.doit : null;
200
+ const doRows = D && D.plan && D.plan.changes ? [{ kind: 'change', plan: D.plan }] : D && D.plan && D.plan.which ? D.plan.which.map((t) => ({ kind: 'which', id: t.id, title: t.title })) : [];
201
+ S.rows = doRows.concat(ansRow ? [ansRow] : [], ownRows, ask ? [ask] : [], groups.slice(own.length).flatMap((g) => g.rows));
169
202
  S.at = Math.min(S.at, Math.max(0, S.rows.length - 1));
170
203
  let h = '', i = 0;
171
204
  const askHtml = () => `<button type="button" class="ev-mi${i === S.at ? ' hl' : ''}" role="option" id="evo${i}" data-ev-i="${i}" aria-selected="${i === S.at}">${svg(ICON.chat, 18)}<span class="ev-t">Ask PMOS: <b>“${esc(q)}”</b></span><span class="ev-k">${onHome() ? 'In the chat' : 'Opens the chat here'}</span></button>`;
205
+ if (doRows.length) {
206
+ h += `<p class="ev-mlbl">${doRows[0].kind === 'which' ? 'Change which one?' : 'Change'}</p>`;
207
+ for (const r of doRows) { h += r.kind === 'change' ? changeHtml(r.plan, i) : `<button type="button" class="ev-mi${i === S.at ? ' hl' : ''}" role="option" id="evo${i}" data-ev-i="${i}" aria-selected="${i === S.at}">${svg(ICON.flag, 18)}<span class="ev-t">${esc(r.title)}</span></button>`; i++; }
208
+ }
172
209
  if (ansRow && !S.err) { h += answerHtml(ansRow.answer, i); i++; }
173
210
  else if (waiting && !S.err) h += `<p class="ev-sp-empty" role="status">Finding an answer in your work…</p>`;
174
211
  // the page's own groups first (UI grill U2): what Search itself could not read is said after them
@@ -212,6 +249,8 @@ addEventListener('resize', () => draw());
212
249
  const onHome = () => /^\/(?:premium(?:\.html)?|index\.html)?$/.test(location.pathname);
213
250
  function homeUrl(params) { const q = new URLSearchParams(params); if (wsParam()) q.set('ws', wsParam()); return '/premium.html?' + q.toString(); }
214
251
  function go(r) {
252
+ if (r.kind === 'change') { applyChange(r.plan); return; }
253
+ if (r.kind === 'which') { askChange(S.q.trim(), r.id); return; }
215
254
  closeSearch();
216
255
  if (r.kind === 'ask') { askClaude(r.title); return; }
217
256
  if (r.kind === 'answer') { const src = r.answer.source; go({ ...src, kind: src.kind || 'document', title: src.title || src.path }); return; }
@@ -11,7 +11,7 @@
11
11
  body.cz-today #hmDesk > .hm-list, body.cz-today #hmDesk > .hm-chat, body.cz-today #hmDesk > .cz-pn-div, body.cz-today .hm-top { display: none !important; }
12
12
  /* the white page panel: the only big container, beside the rail (as the Board's) */
13
13
  body.cz-home.cz-today #hmDesk { display: block; overflow: auto; top: 16px; right: 16px; bottom: 16px; left: var(--cz-railx, 16px); padding: 28px var(--space-32) var(--space-32); background: var(--cz-card); border-radius: 28px; box-shadow: var(--cz-lift); }
14
- /* the page starts at the left edge of the panel, like Work and Library; on a wide screen the log stops at about 1100 px */
14
+ /* the page starts at the left edge of the panel, like Work and Library, and fills its width (main 2 : side 1) */
15
15
  body.cz-today .td-page { display: block; margin: 0; }
16
16
  /* a thing that still opens beside the page (the PM's "open work beside the page", a deep link) slides over Today on the right:
17
17
  the one slide-over of the panel rule, so Today is never squeezed or covered by a column it does not own */
@@ -22,7 +22,8 @@
22
22
  .td-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
23
23
 
24
24
  /* Main + side */
25
- .td { display: grid; grid-template-columns: minmax(0, 1100px) 340px; justify-content: start; gap: var(--space-24); align-items: start; }
25
+ /* today-balanced-width (board TbAfterNeutral): main and side share the width 2 : 1, so a wide screen has no empty right half */
26
+ .td { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: var(--space-24); align-items: start; }
26
27
  @media (max-width: 1100px) { .td { grid-template-columns: minmax(0, 1fr); } }
27
28
  .td-main, .td-side { min-width: 0; display: flex; flex-direction: column; gap: var(--space-16); }
28
29
  .td-top { margin: 0 0 var(--space-16); }
@@ -134,7 +134,7 @@
134
134
  "signals.test.js",
135
135
  "task-jira-sync.test.js",
136
136
  "correction-kinds.test.js",
137
- "answer-cache.test.js"
137
+ "answer-cache.test.js", "ctrlk-do.test.js"
138
138
  ],
139
139
  "panels": [
140
140
  "pm-r7-test.js",
@@ -0,0 +1,9 @@
1
+ {
2
+ "_comment": "Today fills the width, in the neutral colours (today-balanced-width, done test planning/done-tests/today-balanced-width.md B1-B5, N1): the Today grid, the pm-neutral token set in ds-bridge.css and the class on today.html, read as text. No server, network or browser.",
3
+ "modules": [
4
+ "today-balanced.test.js"
5
+ ],
6
+ "seconds": {
7
+ "today-balanced.test.js": 1
8
+ }
9
+ }