@bongos/core 1.21.97 → 1.21.98

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.
@@ -3,9 +3,9 @@
3
3
  "generator": "scripts/gds/copy-inventory.js",
4
4
  "goal": 1000074,
5
5
  "counts": {
6
- "strings": 2623,
7
- "unique_ids": 2227,
8
- "certain": 2623,
6
+ "strings": 2625,
7
+ "unique_ids": 2229,
8
+ "certain": 2625,
9
9
  "heuristic": 0,
10
10
  "duplicate_ids": 235
11
11
  },
@@ -13,7 +13,7 @@
13
13
  "builders-hall": {
14
14
  "at": "modules/hall-ui/public",
15
15
  "files": 134,
16
- "strings": 1852
16
+ "strings": 1854
17
17
  },
18
18
  "status-dashboard": {
19
19
  "at": "modules/status-ui/public",
@@ -2015,8 +2015,8 @@
2015
2015
  "text": "Tweak/CopyWrite Flow",
2016
2016
  "occurrences": 2,
2017
2017
  "at": [
2018
- "modules/hall-ui/public/studio.html:117",
2019
- "modules/hall-ui/public/studio.html:147"
2018
+ "modules/hall-ui/public/studio.html:123",
2019
+ "modules/hall-ui/public/studio.html:153"
2020
2020
  ]
2021
2021
  },
2022
2022
  {
@@ -3420,7 +3420,7 @@
3420
3420
  "surface": "builders-hall",
3421
3421
  "text": "Approval queue",
3422
3422
  "file": "modules/hall-ui/public/studio.html",
3423
- "line": 121,
3423
+ "line": 127,
3424
3424
  "origin": "html-text",
3425
3425
  "confidence": "certain"
3426
3426
  },
@@ -3483,7 +3483,7 @@
3483
3483
  "surface": "builders-hall",
3484
3484
  "text": "Artist Review Status",
3485
3485
  "file": "modules/hall-ui/public/studio.html",
3486
- "line": 125,
3486
+ "line": 131,
3487
3487
  "origin": "html-text",
3488
3488
  "confidence": "certain"
3489
3489
  },
@@ -5967,7 +5967,7 @@
5967
5967
  "surface": "builders-hall",
5968
5968
  "text": "Each was filed when a ship changed copy or visuals. No new ones arrive; answer these and the door goes.",
5969
5969
  "file": "modules/hall-ui/public/studio.html",
5970
- "line": 162,
5970
+ "line": 168,
5971
5971
  "origin": "html-text",
5972
5972
  "confidence": "certain"
5973
5973
  },
@@ -6624,7 +6624,7 @@
6624
6624
  "surface": "builders-hall",
6625
6625
  "text": "From the live site",
6626
6626
  "file": "modules/hall-ui/public/studio.html",
6627
- "line": 131,
6627
+ "line": 137,
6628
6628
  "origin": "html-text",
6629
6629
  "confidence": "certain"
6630
6630
  },
@@ -6678,7 +6678,7 @@
6678
6678
  "surface": "builders-hall",
6679
6679
  "text": "Gathering the reviews and flagged copy that wait for you.",
6680
6680
  "file": "modules/hall-ui/public/studio.html",
6681
- "line": 166,
6681
+ "line": 172,
6682
6682
  "origin": "html-text",
6683
6683
  "confidence": "certain"
6684
6684
  },
@@ -6907,15 +6907,33 @@
6907
6907
  "origin": "html-title",
6908
6908
  "confidence": "certain"
6909
6909
  },
6910
+ {
6911
+ "id": "d0f76a295d09",
6912
+ "surface": "builders-hall",
6913
+ "text": "Good afternoon.",
6914
+ "file": "modules/hall-ui/public/studio.js",
6915
+ "line": 951,
6916
+ "origin": "js-text-assign",
6917
+ "confidence": "certain"
6918
+ },
6910
6919
  {
6911
6920
  "id": "80fd51db38d7",
6912
6921
  "surface": "builders-hall",
6913
6922
  "text": "Good evening.",
6914
6923
  "file": "modules/hall-ui/public/studio.html",
6915
- "line": 95,
6924
+ "line": 101,
6916
6925
  "origin": "html-text",
6917
6926
  "confidence": "certain"
6918
6927
  },
6928
+ {
6929
+ "id": "36083f00396d",
6930
+ "surface": "builders-hall",
6931
+ "text": "Good morning.",
6932
+ "file": "modules/hall-ui/public/studio.js",
6933
+ "line": 950,
6934
+ "origin": "js-text-assign",
6935
+ "confidence": "certain"
6936
+ },
6919
6937
  {
6920
6938
  "id": "cab3de254155",
6921
6939
  "surface": "builders-hall",
@@ -9378,7 +9396,7 @@
9378
9396
  "surface": "builders-hall",
9379
9397
  "text": "Nothing is on your desk yet. The Tweak/CopyWrite Flow has a page ready for you.",
9380
9398
  "file": "modules/hall-ui/public/studio.html",
9381
- "line": 96,
9399
+ "line": 102,
9382
9400
  "origin": "html-text",
9383
9401
  "confidence": "certain"
9384
9402
  },
@@ -9846,7 +9864,7 @@
9846
9864
  "surface": "builders-hall",
9847
9865
  "text": "Opening the reviews…",
9848
9866
  "file": "modules/hall-ui/public/studio.html",
9849
- "line": 165,
9867
+ "line": 171,
9850
9868
  "origin": "html-text",
9851
9869
  "confidence": "certain"
9852
9870
  },
@@ -11097,7 +11115,7 @@
11097
11115
  "surface": "builders-hall",
11098
11116
  "text": "Reviews from before Tweak Mode",
11099
11117
  "file": "modules/hall-ui/public/studio.html",
11100
- "line": 159,
11118
+ "line": 165,
11101
11119
  "origin": "html-text",
11102
11120
  "confidence": "certain"
11103
11121
  },
@@ -12789,7 +12807,7 @@
12789
12807
  "surface": "builders-hall",
12790
12808
  "text": "The copy desk — every flagged string",
12791
12809
  "file": "modules/hall-ui/public/studio.html",
12792
- "line": 171,
12810
+ "line": 177,
12793
12811
  "origin": "html-text",
12794
12812
  "confidence": "certain"
12795
12813
  },
@@ -12879,7 +12897,7 @@
12879
12897
  "surface": "builders-hall",
12880
12898
  "text": "The full queues",
12881
12899
  "file": "modules/hall-ui/public/studio.html",
12882
- "line": 170,
12900
+ "line": 176,
12883
12901
  "origin": "html-attr:aria-label",
12884
12902
  "confidence": "certain"
12885
12903
  },
@@ -13482,7 +13500,7 @@
13482
13500
  "surface": "builders-hall",
13483
13501
  "text": "The studio page is yours, but its words could not be read just now. Open it in the editor.",
13484
13502
  "file": "modules/hall-ui/public/studio.js",
13485
- "line": 894,
13503
+ "line": 897,
13486
13504
  "origin": "js-text-assign",
13487
13505
  "confidence": "certain"
13488
13506
  },
@@ -13500,7 +13518,7 @@
13500
13518
  "surface": "builders-hall",
13501
13519
  "text": "The task board — all work",
13502
13520
  "file": "modules/hall-ui/public/studio.html",
13503
- "line": 172,
13521
+ "line": 178,
13504
13522
  "origin": "html-text",
13505
13523
  "confidence": "certain"
13506
13524
  },
@@ -13581,7 +13599,7 @@
13581
13599
  "surface": "builders-hall",
13582
13600
  "text": "These words are the studio page itself. Take the page, type over them here, and submit it from the editor when you are done.",
13583
13601
  "file": "modules/hall-ui/public/studio.html",
13584
- "line": 100,
13602
+ "line": 106,
13585
13603
  "origin": "html-text",
13586
13604
  "confidence": "certain"
13587
13605
  },
@@ -14166,7 +14184,7 @@
14166
14184
  "surface": "builders-hall",
14167
14185
  "text": "Tweak/CopyWrite Flow",
14168
14186
  "file": "modules/hall-ui/public/studio.html",
14169
- "line": 117,
14187
+ "line": 123,
14170
14188
  "origin": "html-text",
14171
14189
  "confidence": "certain"
14172
14190
  },
@@ -14175,7 +14193,7 @@
14175
14193
  "surface": "builders-hall",
14176
14194
  "text": "Tweak/CopyWrite Flow",
14177
14195
  "file": "modules/hall-ui/public/studio.html",
14178
- "line": 147,
14196
+ "line": 153,
14179
14197
  "origin": "html-text",
14180
14198
  "confidence": "certain"
14181
14199
  },
@@ -15975,7 +15993,7 @@
15975
15993
  "surface": "builders-hall",
15976
15994
  "text": "click any words here to rewrite them",
15977
15995
  "file": "modules/hall-ui/public/studio.html",
15978
- "line": 97,
15996
+ "line": 103,
15979
15997
  "origin": "html-text",
15980
15998
  "confidence": "certain"
15981
15999
  },
@@ -16398,7 +16416,7 @@
16398
16416
  "surface": "builders-hall",
16399
16417
  "text": "how far each surface has come",
16400
16418
  "file": "modules/hall-ui/public/studio.html",
16401
- "line": 126,
16419
+ "line": 132,
16402
16420
  "origin": "html-text",
16403
16421
  "confidence": "certain"
16404
16422
  },
@@ -16794,7 +16812,7 @@
16794
16812
  "surface": "builders-hall",
16795
16813
  "text": "not now",
16796
16814
  "file": "modules/hall-ui/public/studio.html",
16797
- "line": 104,
16815
+ "line": 110,
16798
16816
  "origin": "html-text",
16799
16817
  "confidence": "certain"
16800
16818
  },
@@ -17028,7 +17046,7 @@
17028
17046
  "surface": "builders-hall",
17029
17047
  "text": "pages tweaked",
17030
17048
  "file": "modules/hall-ui/public/studio.html",
17031
- "line": 83,
17049
+ "line": 89,
17032
17050
  "origin": "html-text",
17033
17051
  "confidence": "certain"
17034
17052
  },
@@ -17172,7 +17190,7 @@
17172
17190
  "surface": "builders-hall",
17173
17191
  "text": "reviews from before Tweak Mode",
17174
17192
  "file": "modules/hall-ui/public/studio.html",
17175
- "line": 137,
17193
+ "line": 143,
17176
17194
  "origin": "html-text",
17177
17195
  "confidence": "certain"
17178
17196
  },
@@ -17181,7 +17199,7 @@
17181
17199
  "surface": "builders-hall",
17182
17200
  "text": "reviews written on the live site",
17183
17201
  "file": "modules/hall-ui/public/studio.html",
17184
- "line": 132,
17202
+ "line": 138,
17185
17203
  "origin": "html-text",
17186
17204
  "confidence": "certain"
17187
17205
  },
@@ -17433,7 +17451,7 @@
17433
17451
  "surface": "builders-hall",
17434
17452
  "text": "take the studio page",
17435
17453
  "file": "modules/hall-ui/public/studio.html",
17436
- "line": 103,
17454
+ "line": 109,
17437
17455
  "origin": "html-text",
17438
17456
  "confidence": "certain"
17439
17457
  },
@@ -17622,7 +17640,7 @@
17622
17640
  "surface": "builders-hall",
17623
17641
  "text": "the next page to tweak",
17624
17642
  "file": "modules/hall-ui/public/studio.html",
17625
- "line": 118,
17643
+ "line": 124,
17626
17644
  "origin": "html-text",
17627
17645
  "confidence": "certain"
17628
17646
  },
@@ -17649,7 +17667,7 @@
17649
17667
  "surface": "builders-hall",
17650
17668
  "text": "the pages /tweak has applied",
17651
17669
  "file": "modules/hall-ui/public/studio.html",
17652
- "line": 122,
17670
+ "line": 128,
17653
17671
  "origin": "html-text",
17654
17672
  "confidence": "certain"
17655
17673
  },
@@ -17739,7 +17757,7 @@
17739
17757
  "surface": "builders-hall",
17740
17758
  "text": "this week",
17741
17759
  "file": "modules/hall-ui/public/studio.html",
17742
- "line": 85,
17760
+ "line": 91,
17743
17761
  "origin": "html-text",
17744
17762
  "confidence": "certain"
17745
17763
  },
@@ -18162,7 +18180,7 @@
18162
18180
  "surface": "builders-hall",
18163
18181
  "text": "{{worldName}} · studio",
18164
18182
  "file": "modules/hall-ui/public/studio.html",
18165
- "line": 79,
18183
+ "line": 85,
18166
18184
  "origin": "html-text",
18167
18185
  "confidence": "certain"
18168
18186
  },
@@ -3031,5 +3031,7 @@ is load-bearing: the script throws rather than guess if it is missing, and
3031
3031
  landed since 1.21.95 with no explicit bump. run 37914843597. (task 1002620)
3032
3032
  1.21.97 — CI auto-patch (publish-on-merge, ADR 0161): carrier for merges
3033
3033
  landed since 1.21.96 with no explicit bump. run 37920956545. (task 1002620)
3034
+ 1.21.98 — CI auto-patch (publish-on-merge, ADR 0161): carrier for merges
3035
+ landed since 1.21.97 with no explicit bump. run 37925528587. (task 1002620)
3034
3036
  ---------------------------------------------------------------------------
3035
3037
  ```
@@ -3545,7 +3545,7 @@
3545
3545
  "surface": "builders",
3546
3546
  "title": "Studio",
3547
3547
  "states_read": ["home","out","flow","flow-pick","status","words-offer","words-edit","reviews","full","full-back","approvals","approvals-before","approvals-phone","approvals-note","approved","sent-back"],
3548
- "files_hash": "8e3a2af55a0dbdf3",
3548
+ "files_hash": "0dc2b9d838e5cfcd",
3549
3549
  "reading_hash": "7fc21db3071ddf23",
3550
3550
  "counts": {"lines":33,"placed":16,"shared":7,"unplaced":10},
3551
3551
  "omitted": {"data":2},
@@ -3558,20 +3558,20 @@
3558
3558
  {"key":"L0005","section":"top bar","text":"Artistry","placement":"shared"},
3559
3559
  {"key":"L0006","section":"top bar","text":"Ideating","placement":"shared"},
3560
3560
  {"key":"L0007","section":"top bar","text":"Governing","placement":"shared"},
3561
- {"key":"L0008","section":"page top","text":"{{worldName}} · studio","placement":"placed","file":"modules/hall-ui/public/studio.html","line":79,"string_id":"3d8611c2e79d"},
3562
- {"key":"L0009","section":"page top","text":"pages tweaked","placement":"placed","file":"modules/hall-ui/public/studio.html","line":83,"string_id":"271de72308a4"},
3563
- {"key":"L0010","section":"page top","text":"this week","placement":"placed","file":"modules/hall-ui/public/studio.html","line":85,"string_id":"130c3731ad83"},
3564
- {"key":"L0011","section":"Good evening.","text":"Good evening.","placement":"placed","file":"modules/hall-ui/public/studio.html","line":95,"string_id":"80fd51db38d7"},
3561
+ {"key":"L0008","section":"page top","text":"{{worldName}} · studio","placement":"placed","file":"modules/hall-ui/public/studio.html","line":85,"string_id":"3d8611c2e79d"},
3562
+ {"key":"L0009","section":"page top","text":"pages tweaked","placement":"placed","file":"modules/hall-ui/public/studio.html","line":89,"string_id":"271de72308a4"},
3563
+ {"key":"L0010","section":"page top","text":"this week","placement":"placed","file":"modules/hall-ui/public/studio.html","line":91,"string_id":"130c3731ad83"},
3564
+ {"key":"L0011","section":"Good evening.","text":"Good evening.","placement":"placed","file":"modules/hall-ui/public/studio.html","line":101,"string_id":"80fd51db38d7"},
3565
3565
  {"key":"L0012","section":"Good evening.","text":"{…}, on the {…} page, is where you left it. {…} of its {…} lines are yours so far.","placement":"placed","file":"modules/hall-ui/public/studio.js","line":656,"string_id":"7763e6f28c67"},
3566
- {"key":"L0013","section":"Good evening.","text":"click any words here to rewrite them","placement":"placed","file":"modules/hall-ui/public/studio.html","line":97,"string_id":"8d46c902a9d5"},
3566
+ {"key":"L0013","section":"Good evening.","text":"click any words here to rewrite them","placement":"placed","file":"modules/hall-ui/public/studio.html","line":103,"string_id":"8d46c902a9d5"},
3567
3567
  {"key":"L0014","section":"Good evening.","text":"Resume","placement":"unplaced"},
3568
3568
  {"key":"L0015","section":"Good evening.","text":"{…} of {…}","placement":"placed","file":"modules/hall-ui/public/sky-panel.js","line":120,"string_id":"73c1372b43d9","occurrences":2},
3569
- {"key":"L0016","section":"Good evening.","text":"Tweak/CopyWrite Flow","placement":"placed","file":"modules/hall-ui/public/studio.html","line":117,"string_id":"18801fb6845f"},
3569
+ {"key":"L0016","section":"Good evening.","text":"Tweak/CopyWrite Flow","placement":"placed","file":"modules/hall-ui/public/studio.html","line":123,"string_id":"18801fb6845f"},
3570
3570
  {"key":"L0017","section":"Good evening.","text":"next up: {…} — {…}","placement":"unplaced"},
3571
- {"key":"L0018","section":"Good evening.","text":"Approval queue","placement":"placed","file":"modules/hall-ui/public/studio.html","line":121,"string_id":"20c98a4b630f"},
3571
+ {"key":"L0018","section":"Good evening.","text":"Approval queue","placement":"placed","file":"modules/hall-ui/public/studio.html","line":127,"string_id":"20c98a4b630f"},
3572
3572
  {"key":"L0019","section":"Good evening.","text":"2 pages applied, waiting for you","placement":"unplaced"},
3573
- {"key":"L0020","section":"Good evening.","text":"Artist Review Status","placement":"placed","file":"modules/hall-ui/public/studio.html","line":125,"string_id":"4d3b1bcae3eb"},
3574
- {"key":"L0021","section":"Good evening.","text":"From the live site","placement":"placed","file":"modules/hall-ui/public/studio.html","line":131,"string_id":"edced5d528c3"},
3573
+ {"key":"L0020","section":"Good evening.","text":"Artist Review Status","placement":"placed","file":"modules/hall-ui/public/studio.html","line":131,"string_id":"4d3b1bcae3eb"},
3574
+ {"key":"L0021","section":"Good evening.","text":"From the live site","placement":"placed","file":"modules/hall-ui/public/studio.html","line":137,"string_id":"edced5d528c3"},
3575
3575
  {"key":"L0022","section":"Good evening.","text":"2 reviews from the live site","placement":"unplaced"},
3576
3576
  {"key":"L0023","section":"Good evening.","text":"1 review from before Tweak Mode still waits","placement":"unplaced"},
3577
3577
  {"key":"L0024","section":"Good evening.","text":"Builders hall · this session","placement":"placed","file":"modules/hall-ui/public/craft-mode.js","line":481,"string_id":"fd1903586e8e"},
@@ -0,0 +1,140 @@
1
+ -- core_274 a task a PERSON parked in backlog is never auto-promoted out of it
2
+ -- Applied under task 1004592.
3
+ --
4
+ -- WHY. Two routes put a task into backlog on purpose:
5
+ --
6
+ -- POST /tasks/:id/promote on an ABANDONED task restoreTask (ADR 0152) -- the
7
+ -- task "comes back un-workable and needs a second, explicit promote"
8
+ -- POST /tasks/:id/demote a person took a ready task
9
+ -- back off the board
10
+ --
11
+ -- Neither left anything behind in the row. The promotion sweep
12
+ -- (modules/lifecycle/db-tasks.js PROMOTABLE_BACKLOG_WHERE) promotes every
13
+ -- backlog row with no unmet dependency and no open blocker, so both were undone
14
+ -- on the next reconciler tick. OBSERVED on task 1003397 (2026-10-06): restored,
15
+ -- promoted by the sweep at 19:58:34Z with nobody promoting it; demoted at about
16
+ -- 20:00Z, back at ready at 20:03:34Z, one tick later.
17
+ --
18
+ -- SHAPE. A durable marker, tasks.parked_at + tasks.parked_by, written by the
19
+ -- two routes and honoured by every promoter:
20
+ --
21
+ -- (1) the sweep: `AND t.parked_at IS NULL` in PROMOTABLE_BACKLOG_WHERE
22
+ -- (2) the three trigger functions below, for the same reason core_250 gives
23
+ -- for its cascade clause: a parked task that HAS dependencies would
24
+ -- otherwise be promoted the moment one of them ships. Fixing only the
25
+ -- sweep would leave that path open.
26
+ --
27
+ -- The marker is cleared by a BEFORE UPDATE trigger whenever status leaves
28
+ -- 'backlog'. So a person's promote needs no change at all, and a stale marker
29
+ -- can never strand a task that a person later sends back to backlog by some
30
+ -- other route: once it leaves backlog, it is no longer parked.
31
+ --
32
+ -- NOT task_is_fully_unblocked(). Same reason as core_250: that predicate is
33
+ -- shared with the claim gate and answers "are the dependencies done", not "has
34
+ -- a person said wait".
35
+ --
36
+ -- Forward-safe: two nullable columns with no default, CREATE OR REPLACE only.
37
+ -- An older release never writes parked_at, so on a rolled-back pin nothing is
38
+ -- parked and promotion behaves exactly as before. The three function bodies are
39
+ -- core_250's verbatim apart from the one added line each.
40
+
41
+ ALTER TABLE tasks ADD COLUMN IF NOT EXISTS parked_at timestamptz;
42
+ ALTER TABLE tasks ADD COLUMN IF NOT EXISTS parked_by bigint REFERENCES builders(id) ON DELETE SET NULL;
43
+
44
+ -- Leaving backlog un-parks. Runs only when status actually changes, so a
45
+ -- write that parks a task (status -> 'backlog' plus parked_at) keeps it.
46
+ CREATE OR REPLACE FUNCTION clear_parked_on_leave_backlog()
47
+ RETURNS TRIGGER AS $$
48
+ BEGIN
49
+ IF NEW.status IS DISTINCT FROM 'backlog' THEN
50
+ NEW.parked_at := NULL;
51
+ NEW.parked_by := NULL;
52
+ END IF;
53
+ RETURN NEW;
54
+ END;
55
+ $$ LANGUAGE plpgsql;
56
+
57
+ DROP TRIGGER IF EXISTS trg_clear_parked_on_leave_backlog ON tasks;
58
+ CREATE TRIGGER trg_clear_parked_on_leave_backlog
59
+ BEFORE UPDATE OF status ON tasks
60
+ FOR EACH ROW
61
+ WHEN (OLD.status IS DISTINCT FROM NEW.status)
62
+ EXECUTE FUNCTION clear_parked_on_leave_backlog();
63
+
64
+ -- (a) a task shipped
65
+ CREATE OR REPLACE FUNCTION promote_dependents_on_ship()
66
+ RETURNS TRIGGER AS $$
67
+ BEGIN
68
+ IF NEW.status = 'shipped' AND (OLD.status IS DISTINCT FROM 'shipped') THEN
69
+ UPDATE tasks t
70
+ SET status = 'ready', promoted_at = COALESCE(t.promoted_at, now()), updated_at = now()
71
+ WHERE t.status = 'backlog'
72
+ AND t.kind <> 'spike'
73
+ AND t.source IS DISTINCT FROM 'cascade'
74
+ AND t.parked_at IS NULL
75
+ AND EXISTS (
76
+ SELECT 1 FROM dependencies d
77
+ WHERE d.to_kind = 'task' AND d.to_id = NEW.id
78
+ AND ( (d.from_kind = 'task' AND d.from_id = t.id)
79
+ OR (d.from_kind = 'goal' AND d.from_id = t.goal_id)
80
+ OR (d.from_kind = 'criterion' AND d.from_id IN (
81
+ SELECT tc.criterion_id FROM task_criteria tc WHERE tc.task_id = t.id)) )
82
+ )
83
+ AND task_is_fully_unblocked(t.id);
84
+ END IF;
85
+ RETURN NEW;
86
+ END;
87
+ $$ LANGUAGE plpgsql;
88
+
89
+ -- (b) a criterion satisfied
90
+ CREATE OR REPLACE FUNCTION promote_dependents_on_criterion_satisfy()
91
+ RETURNS TRIGGER AS $$
92
+ BEGIN
93
+ IF NEW.satisfied = true AND (OLD.satisfied IS DISTINCT FROM true) THEN
94
+ UPDATE tasks t
95
+ SET status = 'ready', promoted_at = COALESCE(t.promoted_at, now()), updated_at = now()
96
+ WHERE t.status = 'backlog'
97
+ AND t.kind <> 'spike'
98
+ AND t.source IS DISTINCT FROM 'cascade'
99
+ AND t.parked_at IS NULL
100
+ AND EXISTS (
101
+ SELECT 1 FROM dependencies d
102
+ WHERE d.to_kind = 'criterion' AND d.to_id = NEW.id
103
+ AND ( (d.from_kind = 'task' AND d.from_id = t.id)
104
+ OR (d.from_kind = 'goal' AND d.from_id = t.goal_id)
105
+ OR (d.from_kind = 'criterion' AND d.from_id IN (
106
+ SELECT tc.criterion_id FROM task_criteria tc WHERE tc.task_id = t.id)) )
107
+ )
108
+ AND task_is_fully_unblocked(t.id);
109
+ END IF;
110
+ RETURN NEW;
111
+ END;
112
+ $$ LANGUAGE plpgsql;
113
+
114
+ -- (c) a goal achieved
115
+ CREATE OR REPLACE FUNCTION promote_dependents_on_goal_achieve()
116
+ RETURNS TRIGGER AS $$
117
+ BEGIN
118
+ IF NEW.status = 'achieved' AND (OLD.status IS DISTINCT FROM 'achieved') THEN
119
+ UPDATE tasks t
120
+ SET status = 'ready', promoted_at = COALESCE(t.promoted_at, now()), updated_at = now()
121
+ WHERE t.status = 'backlog'
122
+ AND t.kind <> 'spike'
123
+ AND t.source IS DISTINCT FROM 'cascade'
124
+ AND t.parked_at IS NULL
125
+ AND EXISTS (
126
+ SELECT 1 FROM dependencies d
127
+ WHERE d.to_kind = 'goal' AND d.to_id = NEW.id
128
+ AND ( (d.from_kind = 'task' AND d.from_id = t.id)
129
+ OR (d.from_kind = 'goal' AND d.from_id = t.goal_id)
130
+ OR (d.from_kind = 'criterion' AND d.from_id IN (
131
+ SELECT tc.criterion_id FROM task_criteria tc WHERE tc.task_id = t.id)) )
132
+ )
133
+ AND task_is_fully_unblocked(t.id);
134
+ END IF;
135
+ RETURN NEW;
136
+ END;
137
+ $$ LANGUAGE plpgsql;
138
+
139
+ INSERT INTO schema_migrations (version) VALUES ('core_274_parked_backlog_stays_parked')
140
+ ON CONFLICT (version) DO NOTHING;
@@ -19,6 +19,10 @@
19
19
  // matchLine(text, lines) which line of the studio's own reading a word on
20
20
  // the page is, so an in-place edit names its key
21
21
  // claimWords(code, detail) a refused claim, in words
22
+ // skyAt(date) 'day' 07:00-18:59 on the viewer's clock, else 'night'
23
+ // dayPart(date) 'morning' / 'afternoon' in the day room, 'evening' at night
24
+ // clockGreets(served) whether the served greeting is still the stock one,
25
+ // so the clock may choose (an artist's tweak wins)
22
26
  //
23
27
  // Node-require-safe (the tweak-editor-lib.js pattern): assignment is the only
24
28
  // eval-time side effect, and only when a window exists.
@@ -198,9 +202,27 @@
198
202
  return 'That page could not be taken just now. Nothing changed.';
199
203
  }
200
204
 
205
+ // The room's sky and the greeting's time of day (task 1004654; the mockup
206
+ // docs/design/mocks/day-night-rooms). Day from 07:00 to 18:59 on the viewer's
207
+ // own clock, night otherwise: the creation page's rule (projects.html skyAt),
208
+ // written again here because hall-ui does not import the landing's code. The
209
+ // greeting is "morning" before noon in the day room, "afternoon" after it,
210
+ // and "evening" whenever the room is at night.
211
+ function skyAt(d) { const h = d.getHours(); return h >= 7 && h < 19 ? 'day' : 'night'; }
212
+ function dayPart(d) {
213
+ if (skyAt(d) === 'night') return 'evening';
214
+ return d.getHours() < 12 ? 'morning' : 'afternoon';
215
+ }
216
+ // The greeting the page is served with. Only while the page still says
217
+ // exactly this does the clock choose the greeting: once an artist's tweak of
218
+ // the studio page has rewritten it, their words show at every hour.
219
+ const STOCK_GREETING = 'Good evening.';
220
+ function clockGreets(served) { return tidy(served) === STOCK_GREETING; }
221
+
201
222
  const api = {
202
223
  STUDIO_PAGE, PAGE_ID_RE, SURFACE_WORDS, surfaceWord, titleOf, numberWords, tallyParts, resumeDetail,
203
224
  subParts, flowDetail, statusDetail, apexHost, landingHost, surfaceRows, askedLine, pickLabel, matchLine, claimWords,
225
+ skyAt, dayPart, STOCK_GREETING, clockGreets,
204
226
  };
205
227
  if (typeof window !== 'undefined') window.OTBStudioLib = api;
206
228
  if (typeof module !== 'undefined' && module.exports) module.exports = api;