@bongos/core 1.19.916 → 1.19.917
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/.bongos-core.json +46 -21
- package/docs/adr/0317-a-plane-that-cannot-give-an-instance-its-own-account-is-refused.md +148 -0
- package/docs/adr/README.md +1 -0
- package/docs/module-api-changelog.md +2 -0
- package/docs/recipes/self-host.md +1 -1
- package/migrations/core_252_claims_published_head_sha_idx.sql +33 -0
- package/modules/lifecycle/cascade.js +92 -4
- package/modules/lifecycle/db-ship.js +43 -0
- package/modules/lifecycle/db.js +2 -0
- package/modules/lifecycle/removal-derivation.js +332 -0
- package/modules/lifecycle/routes/lifecycle.js +24 -0
- package/modules/lifecycle/tests/cascade.mjs +21 -4
- package/package-lock.json +2 -2
- package/package.json +1 -1
- package/scripts/gds/provision-repo.js +52 -0
- package/scripts/gds/provision.js +7 -1
- package/src/module-api.js +1 -1
- package/tests/provision_account_identity.mjs +135 -0
- package/tests/removal_proposal.mjs +583 -0
package/.bongos-core.json
CHANGED
|
@@ -2,22 +2,22 @@
|
|
|
2
2
|
"artifact": "bongos-core",
|
|
3
3
|
"manifest_schema": 1,
|
|
4
4
|
"generator": "scripts/gds/package-core.js",
|
|
5
|
-
"core_version": "1.19.
|
|
6
|
-
"core_contract": "1.19.
|
|
7
|
-
"source_commit": "
|
|
5
|
+
"core_version": "1.19.917",
|
|
6
|
+
"core_contract": "1.19.917",
|
|
7
|
+
"source_commit": "5e828ad0df8cbaa5a638c0365e6a9f993756b6f9",
|
|
8
8
|
"source_ref": "HEAD",
|
|
9
|
-
"built_at": "2026-09-20T17:
|
|
9
|
+
"built_at": "2026-09-20T17:33:13.906Z",
|
|
10
10
|
"redaction": {
|
|
11
11
|
"model": "docs-redacted+functional-verbatim",
|
|
12
|
-
"docs_redacted":
|
|
12
|
+
"docs_redacted": 506,
|
|
13
13
|
"agent_docs_stubbed": 26,
|
|
14
|
-
"functional_verbatim":
|
|
14
|
+
"functional_verbatim": 2298,
|
|
15
15
|
"rules": 3,
|
|
16
16
|
"gate_literals": 3,
|
|
17
17
|
"gate": "passed"
|
|
18
18
|
},
|
|
19
|
-
"file_count":
|
|
20
|
-
"tree_sha256": "
|
|
19
|
+
"file_count": 2830,
|
|
20
|
+
"tree_sha256": "5d48e907f305164b84433d1bad09d324336c2fb2924f148081143ff761c39f58",
|
|
21
21
|
"files": [
|
|
22
22
|
{
|
|
23
23
|
"path": ".claude/skills/ask-for-help/SKILL.md",
|
|
@@ -2074,10 +2074,15 @@
|
|
|
2074
2074
|
"mode": "0000644",
|
|
2075
2075
|
"sha256": "d0597a50d8f9a23c8d6c81a595fe6af73640cf574ae32f64730078ac7e19c7a5"
|
|
2076
2076
|
},
|
|
2077
|
+
{
|
|
2078
|
+
"path": "docs/adr/0317-a-plane-that-cannot-give-an-instance-its-own-account-is-refused.md",
|
|
2079
|
+
"mode": "0000644",
|
|
2080
|
+
"sha256": "4dd5bbb9c14e4ba19568646ceea2d29b66c46b99555d6c236a25b7b40097756c"
|
|
2081
|
+
},
|
|
2077
2082
|
{
|
|
2078
2083
|
"path": "docs/adr/README.md",
|
|
2079
2084
|
"mode": "0000644",
|
|
2080
|
-
"sha256": "
|
|
2085
|
+
"sha256": "05a90e437ed0c53a9bcc4f310f9cb056c4f8aa333ab8953f2f56a20d4381f7f9"
|
|
2081
2086
|
},
|
|
2082
2087
|
{
|
|
2083
2088
|
"path": "docs/api-reference.md",
|
|
@@ -2647,7 +2652,7 @@
|
|
|
2647
2652
|
{
|
|
2648
2653
|
"path": "docs/module-api-changelog.md",
|
|
2649
2654
|
"mode": "0000644",
|
|
2650
|
-
"sha256": "
|
|
2655
|
+
"sha256": "7459f942b736ed35b74c50c3f95279e64f3c80dc7e06d686aef147bf6c3bb62c"
|
|
2651
2656
|
},
|
|
2652
2657
|
{
|
|
2653
2658
|
"path": "docs/modules-contract.md",
|
|
@@ -2867,7 +2872,7 @@
|
|
|
2867
2872
|
{
|
|
2868
2873
|
"path": "docs/recipes/self-host.md",
|
|
2869
2874
|
"mode": "0000644",
|
|
2870
|
-
"sha256": "
|
|
2875
|
+
"sha256": "a5c98b8ee01461669a5f4ee5fa361e85e11915eb8326e060c4cf20841c35c07e"
|
|
2871
2876
|
},
|
|
2872
2877
|
{
|
|
2873
2878
|
"path": "docs/recipes/server-bring-up.md",
|
|
@@ -3754,6 +3759,11 @@
|
|
|
3754
3759
|
"mode": "0000644",
|
|
3755
3760
|
"sha256": "75bb644b32a70b52ac544edb901abff91aad07701848a470cc52103dc7e74234"
|
|
3756
3761
|
},
|
|
3762
|
+
{
|
|
3763
|
+
"path": "migrations/core_252_claims_published_head_sha_idx.sql",
|
|
3764
|
+
"mode": "0000644",
|
|
3765
|
+
"sha256": "4c7a47e03192ee2ed1e885d14a06854af40acb6472f52af40bcb36ad3e3ddb17"
|
|
3766
|
+
},
|
|
3757
3767
|
{
|
|
3758
3768
|
"path": "modules/agents/CLAUDE.md",
|
|
3759
3769
|
"mode": "0000644",
|
|
@@ -5492,7 +5502,7 @@
|
|
|
5492
5502
|
{
|
|
5493
5503
|
"path": "modules/lifecycle/cascade.js",
|
|
5494
5504
|
"mode": "0000644",
|
|
5495
|
-
"sha256": "
|
|
5505
|
+
"sha256": "52e63c329e4546f0a8ce2ca75157b9974b23eeaabf155f7ea02ead4d8f9bb8a8"
|
|
5496
5506
|
},
|
|
5497
5507
|
{
|
|
5498
5508
|
"path": "modules/lifecycle/check-rollup.js",
|
|
@@ -5587,7 +5597,7 @@
|
|
|
5587
5597
|
{
|
|
5588
5598
|
"path": "modules/lifecycle/db-ship.js",
|
|
5589
5599
|
"mode": "0000644",
|
|
5590
|
-
"sha256": "
|
|
5600
|
+
"sha256": "d280c54d35721d0a24090ab9cc3ac35d311d253d59d4ea57fb542e1232f5c744"
|
|
5591
5601
|
},
|
|
5592
5602
|
{
|
|
5593
5603
|
"path": "modules/lifecycle/db-tasks.js",
|
|
@@ -5602,7 +5612,7 @@
|
|
|
5602
5612
|
{
|
|
5603
5613
|
"path": "modules/lifecycle/db.js",
|
|
5604
5614
|
"mode": "0000644",
|
|
5605
|
-
"sha256": "
|
|
5615
|
+
"sha256": "2dea49342bf4a9be1279e662240075e57c31855804c8407a212ea9c33934f95e"
|
|
5606
5616
|
},
|
|
5607
5617
|
{
|
|
5608
5618
|
"path": "modules/lifecycle/dead-deps.js",
|
|
@@ -5759,6 +5769,11 @@
|
|
|
5759
5769
|
"mode": "0000644",
|
|
5760
5770
|
"sha256": "6176e109575f02c681240b809b85b272c438c7284a7fdd290cd87b46abdb9e7c"
|
|
5761
5771
|
},
|
|
5772
|
+
{
|
|
5773
|
+
"path": "modules/lifecycle/removal-derivation.js",
|
|
5774
|
+
"mode": "0000644",
|
|
5775
|
+
"sha256": "ef63843d5d00230a90063c454a5ad7a9dc170ce26cedc99377807ae1ced3f7c0"
|
|
5776
|
+
},
|
|
5762
5777
|
{
|
|
5763
5778
|
"path": "modules/lifecycle/rot.js",
|
|
5764
5779
|
"mode": "0000644",
|
|
@@ -5827,7 +5842,7 @@
|
|
|
5827
5842
|
{
|
|
5828
5843
|
"path": "modules/lifecycle/routes/lifecycle.js",
|
|
5829
5844
|
"mode": "0000644",
|
|
5830
|
-
"sha256": "
|
|
5845
|
+
"sha256": "f4b080286870b6cd52cd59c5cb7c5a5127c3b0a90df50b7d87495d684767203b"
|
|
5831
5846
|
},
|
|
5832
5847
|
{
|
|
5833
5848
|
"path": "modules/lifecycle/routes/mingle.js",
|
|
@@ -5927,7 +5942,7 @@
|
|
|
5927
5942
|
{
|
|
5928
5943
|
"path": "modules/lifecycle/tests/cascade.mjs",
|
|
5929
5944
|
"mode": "0000644",
|
|
5930
|
-
"sha256": "
|
|
5945
|
+
"sha256": "fc8c5cf14265515faf8dc63b17b80de1acbb7558a08d26808960244aec6e4377"
|
|
5931
5946
|
},
|
|
5932
5947
|
{
|
|
5933
5948
|
"path": "modules/lifecycle/version-autoclose.js",
|
|
@@ -7832,12 +7847,12 @@
|
|
|
7832
7847
|
{
|
|
7833
7848
|
"path": "package-lock.json",
|
|
7834
7849
|
"mode": "0000644",
|
|
7835
|
-
"sha256": "
|
|
7850
|
+
"sha256": "fd2d387fbc65cce2c412625937abd7fd2c7760083fd0768aa8ae45c2e8bd4992"
|
|
7836
7851
|
},
|
|
7837
7852
|
{
|
|
7838
7853
|
"path": "package.json",
|
|
7839
7854
|
"mode": "0000644",
|
|
7840
|
-
"sha256": "
|
|
7855
|
+
"sha256": "bfee39b9a538046973186020153d4058238ccd25e55c8874316fd5ebab0c42c2"
|
|
7841
7856
|
},
|
|
7842
7857
|
{
|
|
7843
7858
|
"path": "public-docs/index.html",
|
|
@@ -8807,7 +8822,7 @@
|
|
|
8807
8822
|
{
|
|
8808
8823
|
"path": "scripts/gds/provision-repo.js",
|
|
8809
8824
|
"mode": "0000644",
|
|
8810
|
-
"sha256": "
|
|
8825
|
+
"sha256": "dd912cf4446f572257b0a9cc7380a331b8ae7e3d834ccff828fddc13ae5bcb19"
|
|
8811
8826
|
},
|
|
8812
8827
|
{
|
|
8813
8828
|
"path": "scripts/gds/provision-teardown.js",
|
|
@@ -8822,7 +8837,7 @@
|
|
|
8822
8837
|
{
|
|
8823
8838
|
"path": "scripts/gds/provision.js",
|
|
8824
8839
|
"mode": "0000644",
|
|
8825
|
-
"sha256": "
|
|
8840
|
+
"sha256": "784400e0a2912fb4c9bd14107dca7d50cc4a10d77b4a849cd73fe853a6cf3966"
|
|
8826
8841
|
},
|
|
8827
8842
|
{
|
|
8828
8843
|
"path": "scripts/gds/publish-credential-check.js",
|
|
@@ -9837,7 +9852,7 @@
|
|
|
9837
9852
|
{
|
|
9838
9853
|
"path": "src/module-api.js",
|
|
9839
9854
|
"mode": "0000644",
|
|
9840
|
-
"sha256": "
|
|
9855
|
+
"sha256": "d0494683c02dfc17a402568d4ed72ccc574b73b4813d06de8eda9ccfcafe09d9"
|
|
9841
9856
|
},
|
|
9842
9857
|
{
|
|
9843
9858
|
"path": "src/module-loader/catalog.js",
|
|
@@ -12824,6 +12839,11 @@
|
|
|
12824
12839
|
"mode": "0000644",
|
|
12825
12840
|
"sha256": "642ba54a20f08df1514f94114d39cdb70427f93542f4c060c83251ad1f46c80a"
|
|
12826
12841
|
},
|
|
12842
|
+
{
|
|
12843
|
+
"path": "tests/provision_account_identity.mjs",
|
|
12844
|
+
"mode": "0000644",
|
|
12845
|
+
"sha256": "d56cf2553c0b5efa6a17df3d578b7b5766ff62504af6c226688f73ac417df3c6"
|
|
12846
|
+
},
|
|
12827
12847
|
{
|
|
12828
12848
|
"path": "tests/provision_caddy_wiring.mjs",
|
|
12829
12849
|
"mode": "0000644",
|
|
@@ -13099,6 +13119,11 @@
|
|
|
13099
13119
|
"mode": "0000644",
|
|
13100
13120
|
"sha256": "a7a0a61260a4ee78f5452b76ee6d8ef732104cf9c32a3c05bfa25517bf883aeb"
|
|
13101
13121
|
},
|
|
13122
|
+
{
|
|
13123
|
+
"path": "tests/removal_proposal.mjs",
|
|
13124
|
+
"mode": "0000644",
|
|
13125
|
+
"sha256": "b447287dca1ffe65a926715e0a5f07c0a05e3503066febf85b7f6d317b805c8f"
|
|
13126
|
+
},
|
|
13102
13127
|
{
|
|
13103
13128
|
"path": "tests/rename_history_restraint.mjs",
|
|
13104
13129
|
"mode": "0000644",
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# ADR 0317 — A plane that cannot give an instance its own account is refused, not given a shared uid
|
|
2
|
+
|
|
3
|
+
**Status:** accepted · **Date:** 2026-09-20 · **Task:** [task 1004018](https://cloudbongos.com/builders#/task/1004018) (goal 1000106 — BONGOS-V2)
|
|
4
|
+
|
|
5
|
+
**Related:** [ADR 0281](0281-an-instance-identity-is-its-own-unix-account-and-pg-role.md) (the per-instance account this one guards) · [ADR 0315](0315-a-plane-with-no-proxy-is-refused-not-given-a-no-op-ingress.md) (the sibling refusal, and the ordering this one extends) · [ADR 0306](0306-instance-supervision-is-a-seam-with-systemd-as-the-default.md) (the supervision seam that deferred this question here) · [ADR 0128](0128-provisioning-runner-privilege-and-db-auth-model.md) (the `PROVISION_SUDO` escalation the probe tests)
|
|
6
|
+
|
|
7
|
+
## Context
|
|
8
|
+
|
|
9
|
+
ADR 0281 made an instance's identity its own unix account: provisioning step 1c runs
|
|
10
|
+
`ensureInstanceUserCmd` → `useradd --system`, and the unit's `User=`/`Group=` is what
|
|
11
|
+
stops one co-tenant instance reading a sibling's `/proc/<pid>/environ` — where every
|
|
12
|
+
instance's `EnvironmentFile` carries its GitHub App private key and its OAuth client
|
|
13
|
+
secret. That was audit finding B3, and closing it is the whole point of the account.
|
|
14
|
+
|
|
15
|
+
`useradd` needs uid 0. The self-host image is `node:22-bookworm-slim`, runs `USER node`,
|
|
16
|
+
and installs `postgresql-client bash tini curl ca-certificates git` — **no sudo**. On that
|
|
17
|
+
plane the account cannot be created at all, and ADR 0306 named this as the piece its seam
|
|
18
|
+
does not cover: *"`useradd` cannot run under `USER node` — that is task 1004018."*
|
|
19
|
+
|
|
20
|
+
**Two failure shapes, neither of them honest.**
|
|
21
|
+
|
|
22
|
+
- **Today it crashes, late.** `boxExec(ensureInstanceUserCmd(...))` is not `allowFail`, so
|
|
23
|
+
step 1c throws — *after* the capacity, ingress and wiring preflights have passed, after
|
|
24
|
+
the status flip to `provisioning`, and after the standalone shape has already pulled its
|
|
25
|
+
repo and run `npm ci`. The runner records a crash where the honest answer is a refusal,
|
|
26
|
+
and it records it with the box half-changed.
|
|
27
|
+
- **Tomorrow it goes quiet.** ADR 0315 refuses a proxyless plane, so a compose self-host
|
|
28
|
+
currently stops at the ingress question and never reaches step 1c. That is coincidence,
|
|
29
|
+
not protection: 0315 says in its own consequences that *"a future ADR that adds [a front
|
|
30
|
+
door] replaces this refusal rather than extending it."* The moment someone gives the
|
|
31
|
+
container a published port, the identity gap is live again — and `provision-process.js`'s
|
|
32
|
+
supervisord program block writes `user=<instanceUser>` for an account that was never
|
|
33
|
+
created, which supervisord reports as a program that will not start rather than as a
|
|
34
|
+
security regression.
|
|
35
|
+
|
|
36
|
+
The task asked for a posture, and it is worth naming the one that was rejected: *accept
|
|
37
|
+
that a self-host container is single-tenant and document that instances there are not
|
|
38
|
+
isolated.* It buys a working container standup by re-opening B3, and an operator has no
|
|
39
|
+
way to see which posture their box is running.
|
|
40
|
+
|
|
41
|
+
## Decision
|
|
42
|
+
|
|
43
|
+
**A plane where the runner cannot become root is refused before anything is attempted, and
|
|
44
|
+
the refusal names what a shared uid would cost.**
|
|
45
|
+
|
|
46
|
+
`accountPlaneGap(exec, { privileged })` in `scripts/gds/provision-repo.js` — beside the
|
|
47
|
+
account it guards — probes with `${sudo}sh -c 'test "$(id -u)" = 0'`. It returns `null`
|
|
48
|
+
when the runner reaches root, or a string naming the missing privilege.
|
|
49
|
+
`accountPreflight({ exec, apply, log, shape, privileged })` wraps it with the narration
|
|
50
|
+
its sibling preflights carry, and `provisionInstance` returns `{ok:false, error: 'Account
|
|
51
|
+
preflight failed: …'}`.
|
|
52
|
+
|
|
53
|
+
**The probe runs the same escalation the mutation will,** so a pass is evidence rather than
|
|
54
|
+
inference: `privileged` (i.e. `PROVISION_SUDO=1`) renders `sudo sh -c …`, exactly the
|
|
55
|
+
prefix `ensureInstanceUserCmd` will use a few steps later.
|
|
56
|
+
|
|
57
|
+
**`sh -c`, not a bare `test`, and that is load-bearing.** Under sudo the *outer*,
|
|
58
|
+
unprivileged shell would expand `$(id -u)` before sudo ever ran, and the probe would
|
|
59
|
+
cheerfully answer about the wrong user — passing on precisely the plane this refuses. The
|
|
60
|
+
command substitution has to happen inside the escalation. For the same reason there is no
|
|
61
|
+
pipeline: a pipeline's exit status is its last stage's, which would erase the distinction
|
|
62
|
+
below.
|
|
63
|
+
|
|
64
|
+
**A shell that ran and answered is the only failure that proves the plane cannot.** Under
|
|
65
|
+
remote exec `boxExec` is `ssh <host> bash -s`, so a briefly-unreachable co-hosting box
|
|
66
|
+
throws here too — and answering that with "this plane cannot create accounts, provision
|
|
67
|
+
elsewhere" would be a confident wrong diagnosis burning the intent's retry budget on a
|
|
68
|
+
network blip. Exit 1 (`test` said no) and 127 (`sudo` is not installed) are read as proof;
|
|
69
|
+
ssh reports its own failures as 255, so both still mean what they say across the hop.
|
|
70
|
+
Anything else returns *"could not confirm the runner can create a per-instance unix
|
|
71
|
+
account on this plane"* with the real cause leading. This is ADR 0315's rule, applied to a
|
|
72
|
+
different question.
|
|
73
|
+
|
|
74
|
+
**The refusal is ordered third, after capacity and ingress and before ADR 0303's wiring
|
|
75
|
+
check.** Those first three are questions about the *plane* — has it room, has it a proxy,
|
|
76
|
+
can it hand out an identity — and 0303's is the one question about *this instance's*
|
|
77
|
+
domain. ADR 0315's capacity → ingress → wiring order is extended, not rearranged: all four
|
|
78
|
+
still return before anything on the box changes.
|
|
79
|
+
|
|
80
|
+
**No container-shaped identity model, and no "single-tenant" acceptance.** The symmetry
|
|
81
|
+
with ADR 0306 would be a seam with a container implementation. There is nothing to put in
|
|
82
|
+
it: a per-instance account inside the container needs the image to run privileged, a
|
|
83
|
+
container-per-instance needs a docker socket and an orchestrator that does not exist here,
|
|
84
|
+
and unprivileged user namespaces are not reliably available. The honest encoding of "this
|
|
85
|
+
plane cannot give a child its own identity" is a refusal — the same reasoning ADR 0315
|
|
86
|
+
used to reject a no-op ingress backend.
|
|
87
|
+
|
|
88
|
+
## Consequences
|
|
89
|
+
|
|
90
|
+
- **A compose self-host still cannot provision a child instance — and now it says so for
|
|
91
|
+
its own reason, not by accident.** This refusal does not depend on ADR 0315's firing
|
|
92
|
+
first, so giving the container a front door later cannot silently re-open B3. Whoever
|
|
93
|
+
builds that front door has to answer this question too, and the error text is where they
|
|
94
|
+
will find it.
|
|
95
|
+
|
|
96
|
+
- **The failure moved from step 1c to the preflight.** A plane without root used to hard-
|
|
97
|
+
error after the status flip and, for a standalone, after a repo pull and an `npm ci`.
|
|
98
|
+
It now returns `{ok:false}` before any mutation, which is the pending-retry path an
|
|
99
|
+
environment problem earns rather than the crash it was getting.
|
|
100
|
+
|
|
101
|
+
- **One extra `sh -c` per applied standup.** Read-only, no mutation, and it runs after the
|
|
102
|
+
capacity measurement, so a full box still refuses without it. A dry run never probes, and
|
|
103
|
+
a dedicated droplet is skipped — cloud-init runs as root there, and ADR 0281's account
|
|
104
|
+
steps are baked into its user-data unchanged.
|
|
105
|
+
|
|
106
|
+
- **The live box is untouched.** The control-plane runner unit sets `PROVISION_SUDO=1`, so
|
|
107
|
+
the probe renders `sudo sh -c …`, passes, and every command after it is byte-identical.
|
|
108
|
+
The regression is pinned by a test that provisions a root-reaching plane and asserts
|
|
109
|
+
`useradd --system` still runs, after the probe.
|
|
110
|
+
|
|
111
|
+
- **Root, but no `useradd`, is deliberately not covered.** An Alpine-style plane with
|
|
112
|
+
`adduser` instead would pass the probe and fail at step 1c as it does today. The gap this
|
|
113
|
+
ADR closes is privilege, which is the one the planes we actually run exhibit; inventing a
|
|
114
|
+
second probe for a plane nobody has would be speculation, and it would fail loudly rather
|
|
115
|
+
than quietly in any case.
|
|
116
|
+
|
|
117
|
+
- **Teardown is not covered,** for ADR 0315's reason: a refusal on the teardown path would
|
|
118
|
+
strand a row instead of cleaning it.
|
|
119
|
+
|
|
120
|
+
- **This is a capability question, not a configuration knob.** There is no
|
|
121
|
+
`PROVISION_ALLOW_SHARED_UID`. A runner either reaches root on this plane or it does not,
|
|
122
|
+
and an operator who wants provisioning to proceed needs privilege, not a flag that says
|
|
123
|
+
to pretend.
|
|
124
|
+
|
|
125
|
+
## Alternatives considered
|
|
126
|
+
|
|
127
|
+
- **Accept it: document a self-host container as single-tenant with instances sharing one
|
|
128
|
+
uid.** Rejected. It is a silent downgrade of the exact vector ADR 0281 closed, visible
|
|
129
|
+
nowhere on the running box, and "single-tenant" is not what a container hosting several
|
|
130
|
+
child projects is. A posture an operator cannot observe is not a posture.
|
|
131
|
+
|
|
132
|
+
- **An identity seam with a container implementation** (mirroring ADR 0306). Rejected: no
|
|
133
|
+
implementation exists to put behind it. A seam whose second backend is "do nothing" is
|
|
134
|
+
the no-op backend ADR 0315 already rejected, wearing a seam's clothes.
|
|
135
|
+
|
|
136
|
+
- **Probe `useradd --help`, or `command -v useradd`.** Rejected on the mechanism: both
|
|
137
|
+
succeed as an unprivileged user on the very image this refuses. They test the binary; the
|
|
138
|
+
missing thing is the privilege to run it.
|
|
139
|
+
|
|
140
|
+
- **`${sudo}id -u` and compare the output to `0`.** Rejected: it decides on captured stdout
|
|
141
|
+
rather than on exit status, which every sibling preflight and every provisioning test
|
|
142
|
+
fake treats as the contract — the fakes answer commands with an empty `stdout`, so the
|
|
143
|
+
probe would have failed on hermetic planes that are fine, and the fix would have been to
|
|
144
|
+
teach a dozen harnesses about one probe.
|
|
145
|
+
|
|
146
|
+
- **Run the probe inside `ensureInstanceUserCmd` and let step 1c refuse itself.** Rejected:
|
|
147
|
+
it keeps the refusal after the status flip and after the standalone repo sync, which is
|
|
148
|
+
most of what makes the current failure a bad one.
|
package/docs/adr/README.md
CHANGED
|
@@ -408,3 +408,4 @@ This keeps the decision history honest and traceable.
|
|
|
408
408
|
| 0314 | [**A module owns a protected path without the whole module becoming protected** ([task 1004070](https://cloudbongos.com/builders#/task/1004070), goal 1000095 — BONGOS-V2). Three modules derive `protected` — and so are Archon-only to scope a goal to — because of ONE file that is not their domain: `onboarding` on `scripts/gds/setup.js`, `autonomy` on `scripts/gds/conductor-dispatch.js`, `copy-desk` on `scripts/gds/copy-inventory.js`. The owner chose *narrow what counts as protected*; the task set the fork and required the choice be justified before any glob moved. **Deleting the glob is out**: `MODULE_GLOBS` is also the territory deciding who may AUTHOR a task on a path, and the shared floor is only `tests/`, so an unowned path is authorable by no goal at all. That left reassigning each CLI to an already-protected module — **measured, not reasoned about**, by applying the edit to the source and re-requiring in a fresh process (`MODULE_SCOPE_MAP` is frozen and built from a COPY of `MODULE_GLOBS` at load, so an in-process mutation proves nothing and passes green). The measurement kills it: `copy-desk` and `autonomy` lose the ability to author on their own generator and their own conductor, and — the row that decides it — `devsecops` as the new owner **cannot author the generator together with the two artifacts it writes**, because `docs/copy-registry.json` and `docs/copy-inventory.md` stay `copy-desk`'s. So *change a UI string, regenerate the registry* becomes authorable by no single goal, and that is the ship-check freshness gate every UI task hits. Decision: **protection becomes per-path at the goal-scope wall, as it already is at the other three** — `matchProtected` decides task-authoring, the grader and gate decide ship, the post-push audit decides the dishonest case; only goal-creation asked about the MODULE, and that inconsistency is the whole defect. The derivation stays computed from `PROTECTED_GLOBS` and no flag is hand-set ([ADR 0086](0086-goal-scoped-work-hierarchy.md) §7 / SEC #863), and the Metic floor on those paths does not move. **Corrects the task's own numbers**: 12 of 26 modules derive protected, not 11, and `agents` (protected by `modules/agents/`, itself a protected glob) is absent from its list of seven — which is why the one thing this ADR SHIPS is a test pinning the full protected key set **by name**, a count assertion passing on the wrong twelve being exactly how that drifted. Implementation is deferred to task 1004109, per the task's own instruction to stop after the ADR. Also filed: `builder-settings` (task 1004110), whose overlap rides the blanket `src/bongos/routes/` prefix and so needs either the `me.js` strangler move or its own security ADR; and **nine protected paths owned by no module at all** (task 1004111) — the freshness generators, the merge-driver pair and `cli-lib.js` among them — found while checking whether deletion was viable, a pre-existing hole rather than one this opens. Does not decide: the floor a protected path carries, whether `scripts/gds/` deserves a shared-floor entry the way `tests/` has one, or how the nine unowned paths get a home.](0314-module-protection-is-per-path-not-per-module.md) | modules / permissions |
|
|
409
409
|
| 0316 | [**The ignite floor is a scheduling dial, not the trusted tier** ([task 1004084](https://cloudbongos.com/builders#/task/1004084), goal 1000095 — BONGOS-V2). BV2 decision 3 makes the ignite floor — who may turn a quick idea straight into claimable work — a per-instance setting, and decision 16 adds the descent decay rate beside it, the two to share one home. Both the spec and the seeded task described the mechanism the same way: the floor IS the `METIC_PLUS` constant in `modules/ideas/routing.js`, so this is "a setting, not a refactor". Tracing the code before building refuted that: `METIC_PLUS` is spelled once but READ for four semantically different gates — the two `decideLanding` bug branches (land at `ready` or at `backlog`), `mayProposeCriterion` (who may file a `kind='criterion-proposal'`, a planning-scope write), and the protected-scope wall in `authorizeRoutedLanding` (who may route work into the permission / ship-grade / deploy / migration core). Only the first two are the ignite floor, so making the CONSTANT configurable would mean an instance setting its floor to `xenos` — exactly the "project of one wants every thought claimable" case the owner asked for — ALSO gaining the right to file criterion-proposals and to breach the protected core. The codebase already said so in three places nobody had read into the spec: the constant's own header ("It grants nothing — the server-side rank floor and the goal's scope wall are separate, load-bearing gates"), the protected-scope branch ("the two are layers, not alternatives"), and `tests/filing_abuse_matrix.mjs`, which models the widening as an ATTACK and pins the literal. Decision: a separate dial. `modules/ideas/config.js` + `config/ideas.neutral.json` carry both knobs on the `modules/government/config.js` precedence (env -> instance root `config/ideas.json` -> core root neutral; the ADR 0268 dual-root split matters, since one root reads the host pack out of `node_modules` where `npm ci` erases it). `igniteFloor` defaults to `metic`, resolving to exactly the `METIC_PLUS` set, and is threaded into `decideLanding` as a ready-made `trustedRanks` **Set** by the callers — `routing.js` is TOLD the floor and never reads config, staying pure and DB-free — while `METIC_PLUS` stays a FIXED constant for the other two gates, neither of which takes a floor argument (pinned structurally). `descentDecayRate` defaults to 0.5 and ships with no production caller, because R11 is its intended reader and depends on the unbuilt R08 — the same deliberate slice boundary `modules/government/config.js` documents for itself, and what decision 16 asked for. Everything fails to VANILLA rather than dead: a malformed pack, an unknown rank or an out-of-band rate falls back, and an unrecognised floor yields the DEFAULT set, never an empty one (failing closed would stop every ignition on a typo). Rejected: configuring `METIC_PLUS` as written (a security widening in a config file's clothes); splitting it into four named constants (the other three want the same fixed tier, and naming them invites configuring them); having `routing.js` read the config itself (makes the landing matrix impure and untestable at a different floor). Spec decision 3's "spelled in one place" describes the intent, not the mechanism; the spec was not edited and the task description was amended in flight.](0316-the-ignite-floor-is-not-the-trusted-tier.md) | ideas / permissions |
|
|
410
410
|
| 0315 | [**A plane with no proxy is refused, not given a no-op ingress** ([task 1004017](https://cloudbongos.com/builders#/task/1004017), goal 1000106 — BONGOS-V2). The piece [ADR 0306](0306-instance-supervision-is-a-seam-with-systemd-as-the-default.md) explicitly deferred: the self-host image ships no proxy, so provisioning step 6's `<slug>.caddy` snippet write and `systemctl reload caddy` cannot work there and a child instance gets no front door. **Two failure shapes, only one visible**: a DOMAINED child already half-refused, because `caddy adapt` fails with no binary and [ADR 0303](0303-provisioning-verifies-the-base-caddyfile-and-never-edits-it.md)'s own catch turns that into a gap — but the message told the operator to add a directive to `/etc/caddy/Caddyfile`, a file the container does not have and that ADR 0303 §1 forbids provisioning from creating; a DOMAINLESS child skipped that preflight entirely (it is gated on `inst.domain`), reached step 6 and died on the `sudo` write, an uncaught throw that bypasses the `{ok:false}` pending-retry path and hard-errors the instance on attempt one — a crash recorded where a refusal was the honest answer. Decision: `ingressPlaneGap(exec)` probes the plane with `caddy version` — one cheap unprivileged read, the same posture as `checkCaddyWiring` — and both standup legs refuse with `Ingress preflight failed: …`, deliberately NOT domain-gated, because the domainless child is the one 0303 could not see. **Only a missing binary proves there is no proxy**: under remote exec `boxExec` is `ssh <host> bash -s`, so an unreachable co-hosting box throws here too, and diagnosing a network blip as 'this plane has no proxy, provision elsewhere' would be a confident wrong answer that burns the intent's retry budget — exit 127 is read as proof, anything else answers 'could not confirm a reverse proxy on this plane' with the real cause leading. The three refusals are ordered **capacity → ingress → wiring**, cheapest and most fundamental first and all before any mutation, which moves 0303's preflight behind the ADR 0285 capacity measurement; both still refuse before anything changes, so only the precedence between two refusals moves. **No ingress seam and no no-op backend**, despite the obvious symmetry with 0306: a `none` implementation whose `writeSite`/`reload` are no-ops lets the standup SUCCEED while leaving the child unreachable — neither half of the task's done-when, and exactly the silently-broken instance it exists to prevent. Does not decide: what a child's front door IS on a container plane (a published port, a bundled proxy, an explicit localhost-only shape) — a future ADR that adds one replaces this refusal rather than extending it. Teardown is left alone on purpose: it already reloads `allowFail`, and refusing there would strand a row instead of cleaning it.](0315-a-plane-with-no-proxy-is-refused-not-given-a-no-op-ingress.md) | provisioning / ingress |
|
|
411
|
+
| 0317 | [**A plane that cannot give an instance its own account is refused, not given a shared uid** ([task 1004018](https://cloudbongos.com/builders#/task/1004018), goal 1000106 — BONGOS-V2). The last of the three container gaps [ADR 0306](0306-instance-supervision-is-a-seam-with-systemd-as-the-default.md) deferred, and the sibling of [ADR 0315](0315-a-plane-with-no-proxy-is-refused-not-given-a-no-op-ingress.md). [ADR 0281](0281-an-instance-identity-is-its-own-unix-account-and-pg-role.md) makes an instance's identity its own unix account, and the unit's `User=`/`Group=` is what stops one co-tenant reading a sibling's `/proc/<pid>/environ` — where every instance's `EnvironmentFile` carries its GitHub App private key and OAuth client secret (audit B3). `useradd` needs uid 0; the self-host image is `node:22-bookworm-slim` running `USER node` with **no sudo**, so there the account cannot be created at all. **Two failure shapes, neither honest**: today step 1c's `boxExec(ensureInstanceUserCmd(...))` is not `allowFail`, so it throws AFTER every preflight passed, AFTER the status flip to `provisioning`, and — for a standalone — after a repo pull and an `npm ci`, recording a crash with the box half-changed; and tomorrow it goes quiet, because a compose self-host only stops short of step 1c by ADR 0315's coincidence, and 0315 says in its own consequences that a future front door **replaces** that refusal. Decision: `accountPlaneGap(exec, { privileged })` in `provision-repo.js` probes with `${sudo}sh -c 'test "$(id -u)" = 0'` and `provisionInstance` refuses with `Account preflight failed: …` before any mutation. **The probe runs the SAME escalation the mutation will** (`PROVISION_SUDO=1` renders the same `sudo ` prefix `ensureInstanceUserCmd` uses), so a pass is evidence rather than inference. **`sh -c`, not a bare `test`, is load-bearing**: under sudo the outer unprivileged shell would expand `$(id -u)` first and answer about the wrong user, passing on exactly the plane this refuses — and for the same reason there is no pipeline, whose exit status is its last stage's. **Only a shell that ran and answered proves it**: `boxExec` is `ssh <host> bash -s` under remote exec, so exit 1 (`test` said no) and 127 (no sudo binary) are read as proof while ssh's own 255 answers "could not confirm" with the real cause leading — ADR 0315's rule applied to a different question. Ordered **third**, after capacity and ingress and before 0303's wiring check: the first three ask about the PLANE, 0303 asks about this instance's DOMAIN, and 0315's order is extended rather than rearranged. **Rejected: accepting it** — documenting a self-host container as single-tenant with a shared uid is a silent downgrade of the vector 0281 closed, observable nowhere on the running box, and "single-tenant" is not what a container hosting several child projects is; **an identity seam with a container implementation**, because nothing exists to put behind it and a seam whose second backend does nothing is 0315's no-op wearing a seam's clothes; **probing `useradd --help` / `command -v useradd`**, which succeed unprivileged on the very image this refuses; **`${sudo}id -u` compared against `0`**, which decides on captured stdout where every sibling preflight and every test fake treats exit status as the contract; and **refusing inside step 1c**, which keeps the refusal after the status flip. Not covered, deliberately: root-but-no-`useradd` (an Alpine-style plane fails loudly at step 1c as today), and teardown (0315's reason — a refusal there strands a row instead of cleaning it). No `PROVISION_ALLOW_SHARED_UID`: a runner either reaches root on this plane or it does not.](0317-a-plane-that-cannot-give-an-instance-its-own-account-is-refused.md) | provisioning / identity |
|
|
@@ -2306,5 +2306,7 @@ is load-bearing: the script throws rather than guess if it is missing, and
|
|
|
2306
2306
|
landed since 1.19.914 with no explicit bump. run 35524223153. (task 1002620)
|
|
2307
2307
|
1.19.916 — CI auto-patch (publish-on-merge, ADR 0161): carrier for merges
|
|
2308
2308
|
landed since 1.19.915 with no explicit bump. run 35525694524. (task 1002620)
|
|
2309
|
+
1.19.917 — CI auto-patch (publish-on-merge, ADR 0161): carrier for merges
|
|
2310
|
+
landed since 1.19.916 with no explicit bump. run 35526196428. (task 1002620)
|
|
2309
2311
|
---------------------------------------------------------------------------
|
|
2310
2312
|
```
|
|
@@ -39,7 +39,7 @@ Author `config/branding.json` from the neutral starter — see [the branding con
|
|
|
39
39
|
|
|
40
40
|
**Or scaffold it with `bongos init`** ([task #1204](https://example.com/builders#/task/1204)): a short interview (or `bongos init --from spec.json` for a hands-free / CI run) that writes both config files, **seeds your first version + its done-when goal**, and **files the human-only kickoff steps** (register a GitHub OAuth app, first owner sign-in, repo binding, admission) as real tracked tasks — so a fresh instance has a claimable queue on day one instead of an empty hall. It never invents your branding (it points you at the fill prompt for that). Preview the whole plan with `bongos init --dry-run`.
|
|
41
41
|
|
|
42
|
-
**Production hosting, optional (the `provisioning` module — [ADR 0111](../adr/0111-instance-hosting-provisioning-module.md) §3).** If you enable the `provisioning` module and answer the interview's hosting questions (shape — co-tenant `$0` or a dedicated droplet — bring-your-own domain, credential ref, tier), init turns those answers into a real **provisioning request** (a queued `provision` intent the control-plane runner drains) instead of only filing a manual "production topology" task. **A queued request does nothing until a runner drains it:** on the control plane that is a systemd timer running `node scripts/gds/provision.js run-intents --apply`. This Docker image now carries the tools the scaffold needs — git, and a core it can package out of its own `.git`-less checkout (task 1003995) — and supervision is no longer systemd-only: the runner picks a process manager, falling back to supervisord where systemd is not running (task 1003997, [ADR 0306](../adr/0306-instance-supervision-is-a-seam-with-systemd-as-the-default.md)). Three standup legs still assume a systemd box, so on a compose self-host a new project cannot stand up: the container has no reverse proxy for a child instance's front door, cannot create the per-instance unix account that isolates one instance from another
|
|
42
|
+
**Production hosting, optional (the `provisioning` module — [ADR 0111](../adr/0111-instance-hosting-provisioning-module.md) §3).** If you enable the `provisioning` module and answer the interview's hosting questions (shape — co-tenant `$0` or a dedicated droplet — bring-your-own domain, credential ref, tier), init turns those answers into a real **provisioning request** (a queued `provision` intent the control-plane runner drains) instead of only filing a manual "production topology" task. **A queued request does nothing until a runner drains it:** on the control plane that is a systemd timer running `node scripts/gds/provision.js run-intents --apply`. This Docker image now carries the tools the scaffold needs — git, and a core it can package out of its own `.git`-less checkout (task 1003995) — and supervision is no longer systemd-only: the runner picks a process manager, falling back to supervisord where systemd is not running (task 1003997, [ADR 0306](../adr/0306-instance-supervision-is-a-seam-with-systemd-as-the-default.md)). Three standup legs still assume a systemd box, so on a compose self-host a new project cannot stand up: the container has no reverse proxy for a child instance's front door, cannot create the per-instance unix account that isolates one instance from another, and installs its backup dir as a hardcoded founder user (task 1002719). **Two of the three now refuse instead of failing opaquely, each for its own reason** — so fixing one cannot silently re-open the other. **The ingress leg now refuses instead of failing opaquely** (task 1004017, [ADR 0315](../adr/0315-a-plane-with-no-proxy-is-refused-not-given-a-no-op-ingress.md)): provisioning probes the plane with `caddy version` and returns `Ingress preflight failed: …` naming the missing proxy, before it writes a Caddy snippet or reloads anything. Previously a domained child was told to edit an `/etc/caddy/Caddyfile` the container does not have, and a domainless one crashed on the snippet write. Giving the container a real front door is still unbuilt — the refusal closes the failure mode, not the capability. **The identity leg refuses too** (task 1004018, [ADR 0317](../adr/0317-a-plane-that-cannot-give-an-instance-its-own-account-is-refused.md)): provisioning probes whether the runner can reach root on this plane and returns `Account preflight failed: …` before any mutation, because `useradd` cannot run under `USER node` and every child there would otherwise share one uid — the sibling-secret vector [ADR 0281](../adr/0281-an-instance-identity-is-its-own-unix-account-and-pg-role.md) exists to close. It is a capability question, not a knob: there is no setting that accepts a shared uid. Note supervisord has no timer concept either, so a container-hosted instance gets no automatic DB backup — the standup log prints the `crontab` line to add instead. The two irreducibly-human legs — the GitHub OAuth app and the first owner sign-in — stay guided/manual. If the module isn't enabled on the target instance, init falls back to the manual production-topology task, so nothing is silently skipped.
|
|
43
43
|
|
|
44
44
|
## Configuration surface
|
|
45
45
|
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
-- core_252 — index claims.published_head_sha for REVERSE lookup (task 1004090 / BV2.R15)
|
|
2
|
+
--
|
|
3
|
+
-- migrations/171 added the column and every reader since has gone FORWARD:
|
|
4
|
+
-- getClaimPublishedSha(taskId) reads one row by task_id, which the existing
|
|
5
|
+
-- task_id index serves. BV2.R15 introduced the first reader that goes BACKWARD —
|
|
6
|
+
-- shippedTasksByPublishedSha(shas) asks "which shipped tasks published these
|
|
7
|
+
-- commits", i.e. `WHERE published_head_sha = ANY($1::text[])` — and nothing
|
|
8
|
+
-- indexed that direction, so it planned a full scan of `claims` on every ship
|
|
9
|
+
-- that deleted a previously shipped file.
|
|
10
|
+
--
|
|
11
|
+
-- That is on the ship path, which is exactly where a seq scan must not be: the
|
|
12
|
+
-- table grows one row per claim forever, and the cost would arrive quietly as
|
|
13
|
+
-- ships gradually slowing rather than as anything failing.
|
|
14
|
+
--
|
|
15
|
+
-- PARTIAL, on NOT NULL. The column is nullable and most historical rows are null
|
|
16
|
+
-- (rows predating 171, and publishes that rode another branch), so a partial
|
|
17
|
+
-- index is both smaller and a better match for the query — `= ANY(...)` never
|
|
18
|
+
-- matches NULL, so the excluded rows could not have been returned anyway.
|
|
19
|
+
--
|
|
20
|
+
-- Additive and idempotent: adds an index, touches no data, no column and no
|
|
21
|
+
-- constraint. Safe to run forward against a live database, and safe for an older
|
|
22
|
+
-- release to run against — an unused index changes no behaviour.
|
|
23
|
+
--
|
|
24
|
+
-- NOT a lifecycle_* module migration: `claims` is a CORE table, and a module
|
|
25
|
+
-- migration may only touch its own namespaced tables (fitness.js
|
|
26
|
+
-- checkModuleMigrationsAdditive, ADR 0083 Decision #5).
|
|
27
|
+
|
|
28
|
+
CREATE INDEX IF NOT EXISTS claims_published_head_sha_idx
|
|
29
|
+
ON claims (published_head_sha)
|
|
30
|
+
WHERE published_head_sha IS NOT NULL;
|
|
31
|
+
|
|
32
|
+
COMMENT ON INDEX claims_published_head_sha_idx IS
|
|
33
|
+
'Reverse lookup sha -> claim for BV2.R15 removal attribution (db-ship.shippedTasksByPublishedSha). Partial: = ANY() never matches NULL.';
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
// shipped task looks like THIS, file THAT task, for THAT discipline. There is no
|
|
18
18
|
// condition language, no stored rules, no per-project configuration and no UI —
|
|
19
19
|
// every one of those is a thing to add when a second and third cascade exist and
|
|
20
|
-
// have shown what they have in common.
|
|
20
|
+
// have shown what they have in common. `CASCADES` no longer ships empty: the
|
|
21
21
|
// mechanism, its idempotency and its non-blocking property are proved by the
|
|
22
22
|
// tests' own declarations, and R04 (task 1003115) writes the first production
|
|
23
23
|
// entry. A mechanism whose first real rule is written by the task that needs it
|
|
@@ -169,6 +169,50 @@ function artistReviewBody(task) {
|
|
|
169
169
|
].join('\n');
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
+
// The removal proposal's body (task 1004090 / BV2.R15, ADR 0313).
|
|
173
|
+
//
|
|
174
|
+
// IT ASKS, IT DOES NOT TELL. Every line here is written so a reader confirms or
|
|
175
|
+
// dismisses on the evidence rather than rubber-stamping a verdict — because the
|
|
176
|
+
// owner chose propose-then-confirm precisely for the cases this derivation cannot
|
|
177
|
+
// tell apart from a real removal. The three it CAN tell apart (a rename, a move,
|
|
178
|
+
// a rewrite in place) are already excluded upstream in removal-derivation.js.
|
|
179
|
+
//
|
|
180
|
+
// The affected tasks and paths are named as PROSE, deliberately. A cascade files
|
|
181
|
+
// one task per rule per ship keyed on (rule, ship), with no field for a target,
|
|
182
|
+
// and R05's runner may not be widened to fan out (ADR 0242). Owner decision
|
|
183
|
+
// 2026-09-20: the body carries them and R20 designs its own storage when it needs
|
|
184
|
+
// one. So this text IS the record until then — keep it readable and keep it exact.
|
|
185
|
+
function removalProposalBody(task, ctx) {
|
|
186
|
+
const found = ((ctx || {}).removals) || [];
|
|
187
|
+
const lines = [];
|
|
188
|
+
lines.push(`Shipping task ${task.id} deleted files that earlier SHIPPED work put there.`);
|
|
189
|
+
lines.push('');
|
|
190
|
+
lines.push('**This is a question, not a verdict.** Nothing has been marked removed, no');
|
|
191
|
+
lines.push('status changed and no credit moved — and none of that happens unless a person');
|
|
192
|
+
lines.push('confirms below. `shipped` is terminal and stays terminal.');
|
|
193
|
+
lines.push('');
|
|
194
|
+
lines.push('**Removed work attributed to:**');
|
|
195
|
+
for (const r of found) {
|
|
196
|
+
lines.push(` - task ${r.taskId}${r.title ? ` — ${r.title}` : ''}`);
|
|
197
|
+
for (const path of r.paths) lines.push(` ${path}`);
|
|
198
|
+
}
|
|
199
|
+
lines.push('');
|
|
200
|
+
if ((ctx || {}).removalTruncated) {
|
|
201
|
+
lines.push(`Note: this ship deleted ${(ctx || {}).removalDeletedCount} paths, more than the`);
|
|
202
|
+
lines.push('attribution cap, so the list above is PARTIAL. A ship that large is usually a');
|
|
203
|
+
lines.push('move or a sweep — weigh that before confirming.');
|
|
204
|
+
lines.push('');
|
|
205
|
+
}
|
|
206
|
+
lines.push('**Confirm** if that work is genuinely gone: the ideas whose descent it belongs');
|
|
207
|
+
lines.push('to will dim accordingly. **Dismiss** if this was a refactor, a move the rename');
|
|
208
|
+
lines.push('detection missed, or a deletion of something already superseded — dismissing is');
|
|
209
|
+
lines.push('what stops the sky being dimmed for a reason that is not real.');
|
|
210
|
+
lines.push('');
|
|
211
|
+
lines.push('Attribution runs through `claims.published_head_sha`, so a deletion whose origin');
|
|
212
|
+
lines.push('predates that record is silently absent rather than guessed at.');
|
|
213
|
+
return lines.join('\n');
|
|
214
|
+
}
|
|
215
|
+
|
|
172
216
|
// Production rules. The artist review is the first (R04); add another by
|
|
173
217
|
// appending an entry, never by touching the runner (ADR 0242).
|
|
174
218
|
const CASCADES = Object.freeze([
|
|
@@ -189,6 +233,25 @@ const CASCADES = Object.freeze([
|
|
|
189
233
|
title: (t) => `Artist review: the copy and visuals that shipped in task ${t.id}`,
|
|
190
234
|
body: artistReviewBody,
|
|
191
235
|
}),
|
|
236
|
+
Object.freeze({
|
|
237
|
+
key: 'removal-proposed-on-ship',
|
|
238
|
+
// ENGINEER, not artist: confirming asks whether deleted code is genuinely
|
|
239
|
+
// gone or was moved, which is a question about the diff.
|
|
240
|
+
discipline: 'engineer',
|
|
241
|
+
kind: 'unclassified',
|
|
242
|
+
// The anti-recursion guard FIRST, the same order and for the same reason as
|
|
243
|
+
// the rule above — a cascade-generated task must never cascade.
|
|
244
|
+
//
|
|
245
|
+
// The candidates are resolved ONCE into ctx by runCascadesForShip, never
|
|
246
|
+
// here: a `when` is pure and synchronous by contract, and this derivation is
|
|
247
|
+
// a network read. An absent ctx therefore means "nothing was derived" and
|
|
248
|
+
// files nothing — the opposite default to the artist gate above, and
|
|
249
|
+
// deliberately so: silence about a removal must never be read as a removal.
|
|
250
|
+
when: (t, ctx) => t.source !== CASCADE_SOURCE
|
|
251
|
+
&& Array.isArray((ctx || {}).removals) && (ctx || {}).removals.length > 0,
|
|
252
|
+
title: (t) => `Was this removed? Task ${t.id} deleted earlier shipped work`,
|
|
253
|
+
body: removalProposalBody,
|
|
254
|
+
}),
|
|
192
255
|
]);
|
|
193
256
|
|
|
194
257
|
// THE TRIGGERS. A cascade reacts to a state transition; there are two, and this
|
|
@@ -319,7 +382,7 @@ function cascadesFor(task, rules = CASCADES, ctx = {}, trigger = TRIGGERS.ship)
|
|
|
319
382
|
}
|
|
320
383
|
if (!hit) continue;
|
|
321
384
|
try {
|
|
322
|
-
matched.push({ rule, spec: cascadeTaskSpec(rule, task, trigger) });
|
|
385
|
+
matched.push({ rule, spec: cascadeTaskSpec(rule, task, trigger, ctx) });
|
|
323
386
|
} catch (e) {
|
|
324
387
|
errors.push(`cascade "${rule.key}": title/body threw (${e && e.message})`);
|
|
325
388
|
}
|
|
@@ -329,8 +392,11 @@ function cascadesFor(task, rules = CASCADES, ctx = {}, trigger = TRIGGERS.ship)
|
|
|
329
392
|
|
|
330
393
|
// The createTask payload for one matched rule. The attribution preamble is
|
|
331
394
|
// prepended here rather than left to each rule, so no rule can forget it.
|
|
332
|
-
|
|
333
|
-
|
|
395
|
+
// `ctx` reaches body() as a second argument, mirroring when(). The artist rule
|
|
396
|
+
// ignores it; the removal rule needs it, because what a ship deleted is derived
|
|
397
|
+
// per run and is not a property of the task row.
|
|
398
|
+
function cascadeTaskSpec(rule, task, trigger = TRIGGERS.ship, ctx = {}) {
|
|
399
|
+
const body = String(rule.body(task, ctx) || '').trim();
|
|
334
400
|
const preamble =
|
|
335
401
|
`Filed automatically when ${trigger.happened(task)} — the "${rule.key}" cascade `
|
|
336
402
|
+ `(modules/lifecycle/cascade.js). Nobody typed this; it is a REQUEST, filed at backlog, `
|
|
@@ -466,6 +532,27 @@ async function runCascadesForShip(shipped, deps = {}) {
|
|
|
466
532
|
try { ctx.artistGate = deps.artistGateMode(); }
|
|
467
533
|
catch (e) { report.errors.push(`cascade: artistGateMode() threw (${e && e.message}) — policy unread`); }
|
|
468
534
|
}
|
|
535
|
+
// WHAT THIS SHIP DELETED (task 1004090 / BV2.R15, ADR 0313). Resolved here
|
|
536
|
+
// rather than in the rule for the reason the rule's own comment gives: a
|
|
537
|
+
// `when` is pure and synchronous, and this is a network read.
|
|
538
|
+
//
|
|
539
|
+
// Same posture as the policy read above — a resolver that throws is REPORTED
|
|
540
|
+
// and leaves the keys unset, so a derivation outage files no proposal and
|
|
541
|
+
// costs the ship nothing. `removalCandidates` already swallows its own
|
|
542
|
+
// failures (removal-derivation.js returns a report rather than rejecting);
|
|
543
|
+
// this try/catch is the belt to that braces, because a non-blocking promise
|
|
544
|
+
// is only non-blocking until someone edits it.
|
|
545
|
+
if (typeof deps.removalCandidates === 'function') {
|
|
546
|
+
try {
|
|
547
|
+
const derived = await deps.removalCandidates(task);
|
|
548
|
+
ctx.removals = (derived && derived.removals) || [];
|
|
549
|
+
ctx.removalTruncated = Boolean(derived && derived.truncated);
|
|
550
|
+
ctx.removalDeletedCount = (derived && derived.deletedCount) || 0;
|
|
551
|
+
for (const e of (derived && derived.errors) || []) report.errors.push(e);
|
|
552
|
+
} catch (e) {
|
|
553
|
+
report.errors.push(`cascade: removalCandidates() threw (${e && e.message}) — no removal derived`);
|
|
554
|
+
}
|
|
555
|
+
}
|
|
469
556
|
|
|
470
557
|
const { matched, errors } = cascadesFor(task, deps.rules || CASCADES, ctx);
|
|
471
558
|
report.errors.push(...errors);
|
|
@@ -480,6 +567,7 @@ async function runCascadesForShip(shipped, deps = {}) {
|
|
|
480
567
|
|
|
481
568
|
module.exports = {
|
|
482
569
|
CASCADES,
|
|
570
|
+
removalProposalBody,
|
|
483
571
|
IDEA_CASCADES,
|
|
484
572
|
TRIGGERS,
|
|
485
573
|
fullIdeaScopingBody,
|
|
@@ -761,6 +761,48 @@ async function getClaimPublishedSha(taskId) {
|
|
|
761
761
|
return rows[0]?.published_head_sha ?? null;
|
|
762
762
|
}
|
|
763
763
|
|
|
764
|
+
// shippedTasksByPublishedSha — the reverse of getClaimPublishedSha: given commit
|
|
765
|
+
// shas, which SHIPPED tasks published them (BV2.R15, ADR 0313).
|
|
766
|
+
//
|
|
767
|
+
// This is how removal attribution answers "whose work was deleted". ADR 0313
|
|
768
|
+
// rejected the obvious alternative — parsing `(task NNNN)` out of commit messages —
|
|
769
|
+
// because only 7 of the last 15 commits on main carry a task id: merge commits and
|
|
770
|
+
// release carriers do not, and a convention that holds most of the time is not a
|
|
771
|
+
// basis for something that moves credits. `published_head_sha` is written by the
|
|
772
|
+
// SERVER at publish time and cannot be forgotten by an author.
|
|
773
|
+
//
|
|
774
|
+
// Only `shipped` rows come back, deliberately. Work that never landed cannot have
|
|
775
|
+
// been removed, and a proposal naming an abandoned task would be noise a person
|
|
776
|
+
// has to read and dismiss.
|
|
777
|
+
//
|
|
778
|
+
// INDEXED by core_252 (claims_published_head_sha_idx, partial on NOT NULL). This
|
|
779
|
+
// is the first reader to go BACKWARD along that column — every prior one reads
|
|
780
|
+
// forward by task_id — so before that index it planned a full scan of the
|
|
781
|
+
// claims table on the ship path, on a table that grows one row per claim
|
|
782
|
+
// forever.
|
|
783
|
+
//
|
|
784
|
+
// Returns a Map of sha -> { taskId, title }. Shas with no claim are simply absent:
|
|
785
|
+
// `published_head_sha` is nullable (rows predating migrations/171, or a publish
|
|
786
|
+
// that rode another branch), and ADR 0313 is explicit that an unattributable
|
|
787
|
+
// deletion files NOTHING. Silence is the correct output — a wrong removal proposal
|
|
788
|
+
// costs a person attention and dims a real star.
|
|
789
|
+
async function shippedTasksByPublishedSha(shas) {
|
|
790
|
+
const list = [...new Set((Array.isArray(shas) ? shas : [])
|
|
791
|
+
.filter((s) => typeof s === 'string' && /^[0-9a-f]{7,40}$/i.test(s)))];
|
|
792
|
+
if (!list.length) return new Map();
|
|
793
|
+
const { rows } = await pool.query(
|
|
794
|
+
`SELECT c.published_head_sha AS sha, t.id AS task_id, t.title
|
|
795
|
+
FROM claims c
|
|
796
|
+
JOIN tasks t ON t.id = c.task_id
|
|
797
|
+
WHERE c.published_head_sha = ANY($1::text[])
|
|
798
|
+
AND t.status = 'shipped'`,
|
|
799
|
+
[list]
|
|
800
|
+
);
|
|
801
|
+
const out = new Map();
|
|
802
|
+
for (const r of rows) out.set(r.sha, { taskId: String(r.task_id), title: r.title });
|
|
803
|
+
return out;
|
|
804
|
+
}
|
|
805
|
+
|
|
764
806
|
// V3.R14 (#238) — onboarding observability roster.
|
|
765
807
|
//
|
|
766
808
|
// One row per builder, joined with the live "what are they doing right
|
|
@@ -1408,6 +1450,7 @@ module.exports = {
|
|
|
1408
1450
|
getActiveClaimsForBuilderWithStale,
|
|
1409
1451
|
getBuildersRoster,
|
|
1410
1452
|
getClaimPublishedSha,
|
|
1453
|
+
shippedTasksByPublishedSha,
|
|
1411
1454
|
listConfirmedTasksForReconcile,
|
|
1412
1455
|
needsRebaseTasksForBuilder,
|
|
1413
1456
|
gatingRebaseTasksForBuilder,
|