You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit feec46c
Browse filesBrowse the repository at this point in the historyBrowse files
Migration S creates the seven collections ADR 0019 defines, and nothing
else. The runbook JSON stays unloaded (task 110) and no UI is built
(tasks 120-140). Committed schema goes 24 -> 31 application collections.
Open question 1 is settled in favour of the ADR's own recommendation:
shutdown_contingencies stays its OWN collection rather than folding into
shutdown_template_steps behind a discriminator. A contingency has no seq
position, no offset, no duration and no hold point, so folding would
leave half the columns null for half the rows, and the two are read at
different moments -- a step list is walked, a contingency is consulted
when something has already gone wrong.
Shape of the split:
- Template side is project-agnostic, so responsible_role_key and
tag_ref_hint are TEXT. The instance side resolves them to real
shutdown_roles and tags relations at planning time.
- shutdown_step_events is append-only and PUBLIC to create: planning is
an office act, but logging what happened is a gloved hand at 2 AM in
the rain (hard constraint #1). A login wall there is the one thing
guaranteed to get the ledger written afterwards from memory.
- Because the ledger is append-only a malformed record is permanent, so
the createRule is the gate, not the UI: contingency_invoked must name
a contingency, not_performed must carry a reason from ADR 0018 §4's
vocabulary. There is no `skipped` kind.
- No status or current_step column anywhere (constraint #4).
client_token is deliberately NOT `hidden`, which is where it differs
from calibrations.client_token: a hidden field is stripped from client
input, so a required hidden field can never be satisfied by a client
POST at all. Calibrations only gets away with it because a privileged
pb_hooks route writes those records; these events are posted directly by
the accountless field client.
Verified: applies to a fresh DB, `migrate down` removes all seven
cleanly and re-applies; smoke test 94 -> 112 assertions, green; browser
field-path suite still 7/7.
Docs: ARCHITECTURE.md §2 (tree, mutability table, two new rejected-list
entries for go/no-go authority and stored status), collection count and
v1/delta split updated across CLAUDE.md, ROADMAP, current-state,
architecture-status and open-questions. Task 100 DONE; M2 migrations
checkbox ticked.
|`service_visits`| Manufacturer-representative visits against a tag XOR system, with report evidence. |**append-only**|
89
98
|`turnover_packages`| A frozen, sealed snapshot of a scope's checkout — the signed turnover deliverable (built server-side). |**append-only**|
90
99
|`signatures`| A recorded attestation (name/role/statement) bound to a package or check by content hash. |**append-only**|
100
+
|`shutdown_templates`| A named shutdown runbook in the library (seeded from `seed/`). | editable |
101
+
|`shutdown_template_steps`| Ordered library steps: group, offsets, hold point, role/tag as project-agnostic **text**. | editable |
102
+
|`shutdown_contingencies`| Library trigger/action pairs. Not steps — no seq position, offset, or hold point. | editable |
103
+
|`shutdown_roles`| Per-project role registry: `role_key`, title, contact, `notify_on` (**stored, never acted on**). | editable |
104
+
|`shutdowns`| One planned outage. `planned_window_start` is T-0. A planning record, deliberately **not** append-only. | editable |
105
+
|`shutdown_steps`| The instantiated step list; role and tag are real **relations** here. Editable while planning. | editable |
106
+
|`shutdown_step_events`| What actually happened: started/completed/held/released/aborted/resumed/not_performed/contingency_invoked, with frozen step text. |**append-only**|
91
107
92
108
### Field notes worth knowing
93
109
@@ -544,9 +560,24 @@ re-imports are safe.
544
560
hook serves the file in place instead.
545
561
-**Global tag-number uniqueness.** Rejected — real programs run multiple plants
546
562
that reuse tag numbers. Uniqueness is per project.
547
-
-**Building shutdown/compliance collections now.** Rejected as building ahead.
548
-
The domain content lives in `seed/` so it is not lost; the collections and
549
-
UIs come in Phases 4–5.
563
+
-**Building shutdown/compliance collections now.** Rejected as building ahead
564
+
*while Phases 1–3 were the work*. The domain content lived in `seed/` so it
565
+
was not lost. **Superseded for the shutdown half on 2026-09-07**: Phase 4 / M2
566
+
arrived, ADR 0019 was accepted, and migration S created the seven shutdown
567
+
collections (task `100`). The compliance half still stands — the Phase 5
568
+
templates remain data with no execution UI.
569
+
-**Anything that makes the shutdown module part of the go/no-go decision.**
570
+
Rejected permanently (ADR 0019, the LOTO doctrine of ADR 0007 applied to the
571
+
second module that could plausibly claim authority): no interlocks, no
572
+
permission-to-proceed, no "safe to cut" indicator, no green all-clear, and no
573
+
rule that blocks logging past an unsatisfied hold point. A hold point warns
574
+
and enters the derived standing; it never stands in the doorway at 2 AM when
575
+
the authorizer is unreachable. The app records; the written energy-control
576
+
procedure and the people on site authorize. The app must never be usable as
577
+
evidence that it is safe to cut a live main.
578
+
-**A `status` or `current_step` column on `shutdowns`.** Rejected — hard
579
+
constraint #4. A step's state is its latest event, a shutdown's standing is a
580
+
fold over its events, and schedule variance is computed at render.
550
581
-**Seeding the shutdown runbook as flat checklist templates.** Rejected — a
551
582
flattened copy loses the offsets, hold points, and roles, and would diverge
552
583
from the real runbook in `seed/`. One representation, loaded when Phase 4
Copy file name to clipboardExpand all lines: docs/architecture-status.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ implementation and decision state differ.
18
18
| Record locking/supersession |`CURRENT` for immutable checks; `PROPOSED` for packages | Check records are born immutable; warranty claims freeze on close. | Frozen packages supersede rather than update; signatures do not carry forward. | Historical signoff can be misread as current. | Define current-package derivation, voids, and supersession UX. |
19
19
| Evidence hashing |`PROPOSED`, `UNKNOWN` active work | No committed hash contract; staged canonicalization/hook files exist. | Versioned canonical bytes, file inclusion policy, SHA-256 identifier, golden vectors. | A non-reproducible hash creates misleading assurance. | Review allowlists, Unicode/time/number rules, file hashing, and test vectors. |
20
20
| PDF generation |`CURRENT` browser print; `DECIDED` paid boundary | Free print-friendly HTML; no committed PDF renderer. | Basic record/index remains free; advanced compiled binder may run in paid sidecar. | Paywalling evidence would violate constraints; server PDF may burden Pi. | Define minimum free turnover artifact and whether deterministic core PDF is required. |
21
-
| API versioning |`DECIDED`, `CURRENT` drift |`docs/API.md` calls 16 collections v1; committed schema has **24** (16 v1 + 8 delta) and selective auth. Auth/PII semantics are settled (ADR 0011); the collection-set version bump is not. | Reconcile contract, define additive vs breaking policy, publish compatibility fixtures. | Existing clients/sidecar may silently mis-handle rules or fields. | Decide the version bump for the 8 delta collections — sequenced to M3 (D12). |
21
+
| API versioning |`DECIDED`, `CURRENT` drift |`docs/API.md` calls 16 collections v1; committed schema has **31** (16 v1 + 15 delta) and selective auth. Auth/PII semantics are settled (ADR 0011); the collection-set version bump is not. | Reconcile contract, define additive vs breaking policy, publish compatibility fixtures. | Existing clients/sidecar may silently mis-handle rules or fields. | Decide the version bump for the 8 delta collections — sequenced to M3 (D12). |
22
22
| Cross-product handoffs |`PROPOSED`| No implemented manifest/event exchange found. | Versioned exports/events with provenance; no direct DB coupling. | Premature shapes create permanent identifiers and duplicate masters. | Approve bounded contexts, stable ids, first concrete handoff, and ownership. |
23
23
| Paid/core boundary |`DECIDED`, `CURRENT` sidecar | ADR 0003; LoopCheck-Lookahead has separate DB and read-only HTTP consumption. | Core owns field facts/basic export; paid owns optional aggregation and compilation. | High legal/product risk if premium gains private access or required field features. | Clarify whether sidecar service-account role needs mechanical read-only enforcement. |
24
24
| Service-cutover ownership |`RESOLVED` — stays in LoopCheck (2026-07-18) | Complete LoopCheck workflow from notice through restoration. |**Settled:** service cutover is LoopCheck's permanently; it does not move to a sibling. | — |**Resolved** — [DECISIONS.md D9](DECISIONS.md#d9--service-cutover-stays-in-loopcheck-semantics-frozen); no migration planned. |
Copy file name to clipboardExpand all lines: docs/tasks/100-shutdown-collections-migration.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# 100 — Shutdown collections migration (schema only, no UI)
2
2
3
-
Status: TODO
3
+
Status: DONE (2026-09-07 — migration `1789000034_migration_s_shutdowns.js`; open question 1 settled as the ADR recommended, contingencies stay a separate collection; smoke test 94 → 112 assertions, green)
4
4
Milestone: M2 Shutdown Runbooks + Punch List (v0.10.0)
0 commit comments