@bongos/core 1.19.287 → 1.19.289

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 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.287",
6
- "core_contract": "1.19.287",
7
- "source_commit": "0e9c40ea9f9cbd3b8d38d4b84d2cbca469e939e2",
5
+ "core_version": "1.19.289",
6
+ "core_contract": "1.19.289",
7
+ "source_commit": "7fcb844542a0043f5c5beff9a14978d08dba62a9",
8
8
  "source_ref": "HEAD",
9
- "built_at": "2026-08-22T00:14:41.365Z",
9
+ "built_at": "2026-08-22T03:47:31.708Z",
10
10
  "redaction": {
11
11
  "model": "docs-redacted+functional-verbatim",
12
- "docs_redacted": 319,
12
+ "docs_redacted": 320,
13
13
  "agent_docs_stubbed": 22,
14
- "functional_verbatim": 1385,
14
+ "functional_verbatim": 1388,
15
15
  "rules": 3,
16
16
  "gate_literals": 3,
17
17
  "gate": "passed"
18
18
  },
19
- "file_count": 1726,
20
- "tree_sha256": "fc0bf7930e91aebc3ad1c590e667763ca5008d9a2d5edbc91957ae352762443d",
19
+ "file_count": 1730,
20
+ "tree_sha256": "08c303ce54af46b2a131d468064b1ec877f3120d3d6df123a8a5e4c88be18af6",
21
21
  "files": [
22
22
  {
23
23
  "path": ".claude/skills/blocker-review/SKILL.md",
@@ -152,7 +152,7 @@
152
152
  {
153
153
  "path": ".claude/skills/goal-review/SKILL.md",
154
154
  "mode": "0000644",
155
- "sha256": "66b744096d83b3b478f7973ac0c123402475257c67b16c7589b1b88a6effb2e3"
155
+ "sha256": "71bc5b89e2b2793a8f30c0510f4c30249436a9dd26c0eda6d1bd0634620c26ce"
156
156
  },
157
157
  {
158
158
  "path": ".claude/skills/grade-audit/SKILL.md",
@@ -347,12 +347,12 @@
347
347
  {
348
348
  "path": "clients/bongos-client/README.md",
349
349
  "mode": "0000644",
350
- "sha256": "75389c8fbcfeb39ce0320d182ea25cc97d2292814743521f834bd98de0ff83da"
350
+ "sha256": "aaf0bb7dae10d271e9999093935fef5ae8d85c3a2e3d5b4c52e0c11fed8c581e"
351
351
  },
352
352
  {
353
353
  "path": "clients/bongos-client/bongos-client.global.js",
354
354
  "mode": "0000644",
355
- "sha256": "f008fd2b92e818e1734bbbd4388af483730050780d14822daf16ca5e05110401"
355
+ "sha256": "372a5584ddad52fb524815fc7b50d1aab9163e974aac6f2c64f479e4034914a1"
356
356
  },
357
357
  {
358
358
  "path": "clients/bongos-client/examples/hello-world.mjs",
@@ -362,17 +362,17 @@
362
362
  {
363
363
  "path": "clients/bongos-client/index.cjs",
364
364
  "mode": "0000644",
365
- "sha256": "ac7eba0af25322341547f46f9daa385bd557e52c1f580d4873a5d4b35a633ca7"
365
+ "sha256": "7faac7fc48e714c76c2b19feaaf9c730b2c9b10ab71ddc5697c21497d02f10ef"
366
366
  },
367
367
  {
368
368
  "path": "clients/bongos-client/index.d.ts",
369
369
  "mode": "0000644",
370
- "sha256": "6d151ca60431e5346007c1939f10f711111c7b7a38f9914be7c8a6ff12d6a75d"
370
+ "sha256": "7aba0fe1d782cb6308f57dc2e5f6fe0d5ffe0f537d4ffe846bdc7a03e0f8064d"
371
371
  },
372
372
  {
373
373
  "path": "clients/bongos-client/index.mjs",
374
374
  "mode": "0000644",
375
- "sha256": "60a6ec5d2b7a41e8727769953bd5b38a6746e2373cd8a271ee7b0ba750b84f34"
375
+ "sha256": "5f1d221bfbf8d329f883a5dc3e84414728c67201d66faceff04d48732e44b13c"
376
376
  },
377
377
  {
378
378
  "path": "clients/bongos-client/package.json",
@@ -1394,20 +1394,25 @@
1394
1394
  "mode": "0000644",
1395
1395
  "sha256": "119637165d2d6b89f8c00afccd07d9f073629f1502f4b2f2cdc673001b2f8d2a"
1396
1396
  },
1397
+ {
1398
+ "path": "docs/adr/0183-criteria-close-themselves.md",
1399
+ "mode": "0000644",
1400
+ "sha256": "e7d0245b21406ddcd118dce29ffb1df5a4797e33d66231aa6bc734316c19530f"
1401
+ },
1397
1402
  {
1398
1403
  "path": "docs/adr/README.md",
1399
1404
  "mode": "0000644",
1400
- "sha256": "56d478e1b5285c1c133225240c65ec23c6b3b4f280cdda853c50b33564cc2910"
1405
+ "sha256": "5e8bcc7eff0a9940760952e4dffe3855474e506439d677625f411164ae226a35"
1401
1406
  },
1402
1407
  {
1403
1408
  "path": "docs/api-reference.md",
1404
1409
  "mode": "0000644",
1405
- "sha256": "ae992fbebcc171bbc4e669a45f01d3a5dd840bcaad334262136a2060fc362a43"
1410
+ "sha256": "2c4a9b56aea5a8e1a42c70ad5c2646c0d6db6d713c13b8d2068bd3a2fa6ac27e"
1406
1411
  },
1407
1412
  {
1408
1413
  "path": "docs/api/openapi.json",
1409
1414
  "mode": "0000644",
1410
- "sha256": "55c2cbd3c8473ed041d0df0c6d9eebe16ed3d333afae9f7dbe3b0ef1a211b4c6"
1415
+ "sha256": "fcb40a7d655517e6dd24b2d4e0e00a9fcace75b2eb0aa89348d2546abf8df422"
1411
1416
  },
1412
1417
  {
1413
1418
  "path": "docs/architecture.md",
@@ -3767,7 +3772,7 @@
3767
3772
  {
3768
3773
  "path": "modules/lifecycle/db.js",
3769
3774
  "mode": "0000644",
3770
- "sha256": "74eedb9ee1c423c9ecdea6f09d8555fa3200ac9e3a86a194182774cb72f0cd0b"
3775
+ "sha256": "18b2053d9195936be86d98e00812ab69980986f91cf83bc9db054441036192fd"
3771
3776
  },
3772
3777
  {
3773
3778
  "path": "modules/lifecycle/dead-deps.js",
@@ -3777,7 +3782,7 @@
3777
3782
  {
3778
3783
  "path": "modules/lifecycle/done-when.js",
3779
3784
  "mode": "0000644",
3780
- "sha256": "4e6f6af1cdaf026466155c1b0656a0e89872aa2bb264f36c50997ec4f069e808"
3785
+ "sha256": "fab91acf54bea4fca254bfd420a9a934e6eae434101ff57ae2a1bed48d2342d5"
3781
3786
  },
3782
3787
  {
3783
3788
  "path": "modules/lifecycle/est-advisory.js",
@@ -3809,6 +3814,11 @@
3809
3814
  "mode": "0000644",
3810
3815
  "sha256": "0367f88aefa890d8d7f2472dd847467d632150a93db8a96b85717b5fb1cc8c9e"
3811
3816
  },
3817
+ {
3818
+ "path": "modules/lifecycle/goal-suggest.js",
3819
+ "mode": "0000644",
3820
+ "sha256": "5fac15e501d6e5639b9e14d08ab34723b60e3569af913f4d15bb703a4e126a77"
3821
+ },
3812
3822
  {
3813
3823
  "path": "modules/lifecycle/hierarchy.js",
3814
3824
  "mode": "0000644",
@@ -3847,7 +3857,7 @@
3847
3857
  {
3848
3858
  "path": "modules/lifecycle/publish-reconciler.js",
3849
3859
  "mode": "0000644",
3850
- "sha256": "1cca02e8eff2b0a7fdc1fa06ad6be2f633e25a29bdd10dddf6147610fdae087a"
3860
+ "sha256": "900fc9ecfe91a0c1e9cd62b619f609c1416196d502c007d0bbb87c41387b6163"
3851
3861
  },
3852
3862
  {
3853
3863
  "path": "modules/lifecycle/routes/analytics.js",
@@ -3877,7 +3887,7 @@
3877
3887
  {
3878
3888
  "path": "modules/lifecycle/routes/goals.js",
3879
3889
  "mode": "0000644",
3880
- "sha256": "a94284db44e4108b21ff3a5f60ac25c0b16ff4330839f9d37045e90e763d430e"
3890
+ "sha256": "3fcc0339927bcc7f426e93c7a5762b45496ecf4e9b841f905fb5f1c468b5f8c0"
3881
3891
  },
3882
3892
  {
3883
3893
  "path": "modules/lifecycle/routes/lifecycle.js",
@@ -4512,12 +4522,12 @@
4512
4522
  {
4513
4523
  "path": "package-lock.json",
4514
4524
  "mode": "0000644",
4515
- "sha256": "ceaff2d7728751d980cf1e01c3342de37baa727b682bb70a75792f9825752851"
4525
+ "sha256": "4a910e78786de976213abedacfe08553775d9651b46579e1388941d416be82db"
4516
4526
  },
4517
4527
  {
4518
4528
  "path": "package.json",
4519
4529
  "mode": "0000644",
4520
- "sha256": "d2d685a112ab41f0698b9fc2436ff0e534bbc3441de3a0ef9c3e1821a92ba37d"
4530
+ "sha256": "9919d125bfcfaccf90bc06727eeec3f410882a6e1c83481e63f79f7a5d2d7a0b"
4521
4531
  },
4522
4532
  {
4523
4533
  "path": "public-docs/index.html",
@@ -6027,7 +6037,7 @@
6027
6037
  {
6028
6038
  "path": "src/bongos/route-rank-check.js",
6029
6039
  "mode": "0000644",
6030
- "sha256": "be8bc6ecd3ab1dbec4d3224d684b64d100920ad2cf7d08c51898160fefdaf534"
6040
+ "sha256": "97b8345a1d891151c3bc134926124a0ac929db661e0cfb26c6760c8c6030bafc"
6031
6041
  },
6032
6042
  {
6033
6043
  "path": "src/bongos/routes.js",
@@ -6162,7 +6172,7 @@
6162
6172
  {
6163
6173
  "path": "src/module-api.js",
6164
6174
  "mode": "0000644",
6165
- "sha256": "4d7fa01bf03ea2b91130272d141e16ac4f11aca831b7e6df8fb54eea7ccc8c1f"
6175
+ "sha256": "fbb190fb4b0b50ef8374412a009f1a4799ecbdb15b37caabac3c8a138ca29622"
6166
6176
  },
6167
6177
  {
6168
6178
  "path": "src/module-loader/catalog.js",
@@ -6384,6 +6394,11 @@
6384
6394
  "mode": "0000644",
6385
6395
  "sha256": "4697e7e264023c148d1f18cac9695157de56b5dd3db4b60f2ab94d73a8d7af65"
6386
6396
  },
6397
+ {
6398
+ "path": "tests/auto_satisfy_criteria.mjs",
6399
+ "mode": "0000644",
6400
+ "sha256": "1a5524b0e63631a0ebdc5e3e87c04eb862a9be7021b3b1caf5a44afb2dcb455b"
6401
+ },
6387
6402
  {
6388
6403
  "path": "tests/autonomous_fit_protected_paths.mjs",
6389
6404
  "mode": "0000644",
@@ -7119,6 +7134,11 @@
7119
7134
  "mode": "0000644",
7120
7135
  "sha256": "447e6376ae5f5e2bedf1a80b3355604544a5e349da87d110fc0135cc3cd98fac"
7121
7136
  },
7137
+ {
7138
+ "path": "tests/goal_suggest.mjs",
7139
+ "mode": "0000644",
7140
+ "sha256": "7fc1d81afc49311a3c8525b644319e4831bff295bef8be244220fea5ebfbbbd1"
7141
+ },
7122
7142
  {
7123
7143
  "path": "tests/goal_tier.mjs",
7124
7144
  "mode": "0000644",
@@ -1,13 +1,26 @@
1
1
  ---
2
2
  name: goal-review
3
- description: Walk the Bongos criterion review queue — for each criterion auto-flagged "met — pending review" (all its tasks shipped, not yet confirmed), prompt to confirm (→ satisfied), reject (not actually met), or note/defer. Confirming a goal's LAST criterion auto-flips the goal open→achieved. Triggers when the user says "/goal-review", "review goals", "review flagged criteria", "what criteria are ready to confirm", "confirm criteria", "walk the goal review queue", or runs as a scheduled daily task. Metic+ rank only (Metic and Archon; not Xenos).
3
+ description: Walk the Bongos criterion review queue. As of task 1002069 (ADR 0183) this is NO LONGER A GATE — a criterion whose gating tasks have all shipped satisfies ITSELF, and a goal whose criteria are all satisfied achieves itself. What remains here is the residue automation deliberately refuses: chiefly a criterion whose linked tasks were ALL ABANDONED (nothing delivered), plus rejecting a criterion that is not actually met. Prompt to confirm (→ satisfied), reject, or note/defer. Triggers when the user says "/goal-review", "review goals", "review flagged criteria", "what criteria are ready to confirm", "confirm criteria", "walk the goal review queue", or runs as a scheduled daily task. Metic+ rank only (Metic and Archon; not Xenos).
4
4
  ---
5
5
 
6
6
  You are running the **goal-review** session for this Cloud Bongos instance. It mirrors `/idea-triage`, but for the *closing* end of the work hierarchy (ADR 0086 §6): criteria that have **auto-flagged "met — pending review"** get walked one-at-a-time and dispositioned, so finished work actually closes out instead of sitting in limbo.
7
7
 
8
8
  > **The other end of this lifecycle is [`/goal-create`](../goal-create/SKILL.md)** — it opens a goal (scope wall, criteria, seed tasks); this one closes it out.
9
9
 
10
- **The auto-flag is derived, not stored.** When every task linked to a criterion has shipped — and the criterion has not yet been confirmed — the server flags it `pending_review` (deterministic from `task_criteria` + ship status; no manual propose step). This skill surfaces that queue and lets a trusted builder confirm or reject each one. Confirming sets the criterion `satisfied=true`; confirming a goal's **last** unsatisfied criterion auto-flips the goal `open → achieved`.
10
+ **The auto-flag is derived, not stored.** When every task linked to a criterion has shipped — and the criterion has not yet been confirmed — the server flags it `pending_review` (deterministic from `task_criteria` + ship status; no manual propose step). Confirming sets the criterion `satisfied=true`; confirming a goal's **last** unsatisfied criterion auto-flips the goal `open → achieved`.
11
+
12
+ ## ⚠ This skill is no longer a GATE (task 1002069 / [ADR 0183](../../../docs/adr/<redacted>.md))
13
+
14
+ **A criterion now closes itself.** `doneWhen.autoSatisfyShippedCriteria` runs inside `shipTask`'s transaction (immediately, for the ship that completed it) and unscoped on every `publish-reconciler` tick (draining the backlog and self-healing). A goal whose criteria are all satisfied achieves itself the same way. Nobody has to run this skill for finished work to close — that dependence was producing a **lying board** (goal 1000072 measured `6/9 shipped, 0/5 criteria`).
15
+
16
+ So expect the queue to be **mostly empty**, and read what IS in it as a signal rather than a chore. Automation refuses exactly two shapes, and they are what you are here for:
17
+
18
+ 1. **A criterion whose linked tasks were ALL ABANDONED.** Auto-close requires ≥1 task actually `shipped`, so cut work can never complete anything — but the review flag deliberately still surfaces it, because *somebody must decide whether the criterion still means anything now that its work is gone*. Options: confirm (it was satisfied another way), reject, or re-link it to the work that will actually deliver it. **This is the main reason the skill still exists.**
19
+ 2. **A criterion with NO linked tasks.** Automation requires ≥1 linked task, so it never auto-closes. If a criterion is genuinely met by work that was never linked, link the tasks (better — it makes the board true) or confirm manually.
20
+
21
+ A criterion sitting here with shipped tasks and no explanation means the sweep has not run or errored — check the `publish-reconciler` logs rather than confirming by hand, or you will paper over a broken sweep.
22
+
23
+ **Rejecting is now the more valuable verdict.** Confirming mostly duplicates what automation already did; rejecting is information only a human has.
11
24
 
12
25
  ## Rank gate — Metic+ only
13
26
 
@@ -5,7 +5,7 @@ A **generated**, zero-dependency typed client for the Bongos API — produced fr
5
5
  by hand; it regenerates when the spec changes, so it can never drift from the routes.
6
6
 
7
7
  - API version: **v1** (served at `/api/bongos/v1`)
8
- - 293 operations across 47 resource groups
8
+ - 294 operations across 47 resource groups
9
9
 
10
10
  ## Install
11
11
 
@@ -355,6 +355,8 @@ function createClient(opts = {}) {
355
355
  getGoalsInbox: (args) => request("GET", "/goals/inbox", { hasBody: false }, args),
356
356
  // POST /goals/reorder — rank: metic+archon — POST /goals/reorder
357
357
  postGoalsReorder: (args) => request("POST", "/goals/reorder", { hasBody: true }, args),
358
+ // GET /goals/suggestions — rank: any-builder — GET /goals/suggestions
359
+ getGoalsSuggestions: (args) => request("GET", "/goals/suggestions", { hasBody: false }, args),
358
360
  },
359
361
  "government": {
360
362
  // GET /government/assignments — rank: archon — GET /government/assignments
@@ -354,6 +354,8 @@ function createClient(opts = {}) {
354
354
  getGoalsInbox: (args) => request("GET", "/goals/inbox", { hasBody: false }, args),
355
355
  // POST /goals/reorder — rank: metic+archon — POST /goals/reorder
356
356
  postGoalsReorder: (args) => request("POST", "/goals/reorder", { hasBody: true }, args),
357
+ // GET /goals/suggestions — rank: any-builder — GET /goals/suggestions
358
+ getGoalsSuggestions: (args) => request("GET", "/goals/suggestions", { hasBody: false }, args),
357
359
  },
358
360
  "government": {
359
361
  // GET /government/assignments — rank: archon — GET /government/assignments
@@ -40,7 +40,6 @@ export interface GetGithubReposResponse { repos: unknown }
40
40
  export interface GetGoalsIdConflictsResponse { ok: boolean; goal_id: unknown; conflicts: unknown; cross_goals_considered: unknown }
41
41
  export interface GetGoalsIdRequestsResponse { requests: unknown }
42
42
  export interface GetGoalsIdResponse { goal: unknown; members: unknown; criteria: unknown; dependencies: unknown }
43
- export interface GetGoalsIdSuggestCriteriaResponse { goal_id: unknown; suggestions: unknown }
44
43
  export interface GetGoalsResponse { goals: unknown }
45
44
  export interface GetGovernmentAssignmentsResponse { assignments: unknown }
46
45
  export interface GetGovernmentPermissionsResponse { permissions: unknown; principals: unknown }
@@ -605,7 +604,7 @@ export interface BongosClient {
605
604
  /** POST /goals/{id}/scope — rank: metic+archon */
606
605
  postGoalsIdScope(args: RequestArgs & { body: PostGoalsIdScopeRequest }): Promise<PostGoalsIdScopeResponse>;
607
606
  /** GET /goals/{id}/suggest-criteria — rank: any-builder */
608
- getGoalsIdSuggestCriteria(args?: RequestArgs): Promise<GetGoalsIdSuggestCriteriaResponse>;
607
+ getGoalsIdSuggestCriteria(args?: RequestArgs): Promise<ApiResponse>;
609
608
  /** POST /goals/{id}/tasks — rank: any-builder */
610
609
  postGoalsIdTasks(args: RequestArgs & { body: PostGoalsIdTasksRequest }): Promise<PostGoalsIdTasksResponse>;
611
610
  /** POST /goals/{id}/transfer — rank: any-builder */
@@ -616,6 +615,8 @@ export interface BongosClient {
616
615
  getGoalsInbox(args?: RequestArgs): Promise<ApiResponse>;
617
616
  /** POST /goals/reorder — rank: metic+archon */
618
617
  postGoalsReorder(args: RequestArgs & { body: PostGoalsReorderRequest }): Promise<PostGoalsReorderResponse>;
618
+ /** GET /goals/suggestions — rank: any-builder */
619
+ getGoalsSuggestions(args?: RequestArgs): Promise<ApiResponse>;
619
620
  };
620
621
  "government": {
621
622
  /** GET /government/assignments — rank: archon */
@@ -351,6 +351,8 @@ export function createClient(opts = {}) {
351
351
  getGoalsInbox: (args) => request("GET", "/goals/inbox", { hasBody: false }, args),
352
352
  // POST /goals/reorder — rank: metic+archon — POST /goals/reorder
353
353
  postGoalsReorder: (args) => request("POST", "/goals/reorder", { hasBody: true }, args),
354
+ // GET /goals/suggestions — rank: any-builder — GET /goals/suggestions
355
+ getGoalsSuggestions: (args) => request("GET", "/goals/suggestions", { hasBody: false }, args),
354
356
  },
355
357
  "government": {
356
358
  // GET /government/assignments — rank: archon — GET /government/assignments
@@ -0,0 +1,58 @@
1
+ # ADR 0183 — A done-when criterion closes itself; the review queue becomes a place to look
2
+
3
+ - **Status:** accepted
4
+ - **Date:** 2026-08-21
5
+ - **Task:** 1002069 (owner request 2026-07-05, scope owner-confirmed)
6
+ - **Supersedes part of:** [ADR 0086](<redacted>.md) §6 / BV1.R63 — the criterion auto-flag stays, but confirming it is no longer the only way a criterion closes.
7
+
8
+ ## Context
9
+
10
+ Under ADR 0086 §6 a criterion became `satisfied` in exactly one way: a Metic+ called `POST /done-when/:id/satisfy`, and if it was the goal's last criterion the goal flipped `open→achieved`. The "met — pending review" flag was **derived** — every gating task shipped, nothing stored — and `/goal-review` walked that queue so a human could confirm each one.
11
+
12
+ That gate cost more than it bought. The signal it gated on is already unambiguous: *every task under this criterion has shipped.* A human confirming that adds no information, and when nobody runs `/goal-review` the consequence is not "a careful pause" but a **lying board** — criteria sitting unsatisfied and goals sitting `open` long after the work landed. The owner asked for the flip to be automatic (2026-07-05).
13
+
14
+ This session supplied the evidence for how bad the drift gets: goal 1000072 read `6/9 shipped, 0/5 criteria` — six tasks landed, not one criterion moved.
15
+
16
+ ## Decision
17
+
18
+ **A criterion satisfies itself once its gating set is fully delivered, and a goal achieves itself once all its criteria are satisfied.** One helper, `doneWhen.autoSatisfyShippedCriteria(exec, { taskId })`, run from two places:
19
+
20
+ | Where | Scope | Why both |
21
+ |---|---|---|
22
+ | `shipTask`, inside its transaction | `{ taskId }` — only what this ship gates | Immediate. A builder shipping a goal's last task sees the goal close *now*. On the txn client, so a rolled-back ship cannot leave a goal achieved. |
23
+ | `publish-reconciler` tick, every ~5 min | `{}` — every unsatisfied criterion | **Backlog drain** (criteria whose tasks shipped before this existed — nothing will ship against them again) and **self-heal** (a criterion linked after its tasks shipped, a hand-edited status, a ship whose best-effort in-txn close was skipped). |
24
+
25
+ `exec` is caller-supplied on purpose; the helper never reaches for a module pool. It is idempotent — it only reads `satisfied = false` rows — which is what makes an every-tick sweep safe.
26
+
27
+ `/goal-review` is **not** deleted. It stops being a gate and becomes a place to look: what closed, and the ambiguous cases automation deliberately refuses (below).
28
+
29
+ ### The delivery guard, and a deliberate asymmetry
30
+
31
+ Auto-close requires **both**:
32
+
33
+ 1. no linked task outside `{shipped, abandoned}` — nothing is still pending; and
34
+ 2. **at least one linked task actually `shipped`** — something was delivered.
35
+
36
+ The second is not redundant, and it is the whole reason this ADR exists rather than a one-line commit. Since [task 1002651](https://cloudbongos.com/builders#/task/1002651) made `abandoned` terminal-not-pending, a criterion whose linked tasks were **all cut** satisfies condition 1 *vacuously* — every task is accounted for, none is pending. Automating on condition 1 alone would satisfy criteria on **zero delivered work** and cascade their goals to `achieved`. Measured, not hypothetical: `buildCriterionProgress` returns `pending_review: true` for exactly that shape today.
37
+
38
+ **But `pending_review` keeps that wider meaning.** It answers "should a human look at this?", and task 1002651 chose on purpose that an all-abandoned criterion surfaces there — its work was cut, so someone must decide whether the criterion still means anything. Auto-close answers the narrower "may this close itself, unattended?"
39
+
40
+ > Everything that auto-closes was flagged for review. Not everything flagged for review auto-closes.
41
+
42
+ An earlier draft of this task "aligned" the two predicates and broke 1002651's intent; `tests/criterion_progress.mjs` caught it. **Do not re-align them.** The gap is the design.
43
+
44
+ ## Consequences
45
+
46
+ - **Criteria and goals stop lying by default.** No cadence discipline required.
47
+ - **`/goal-review` keeps a real job** — the all-abandoned case, and any criterion a human wants to reject.
48
+ - **The manual `POST /satisfy` route is untouched**, still Metic+. It remains the way to close a criterion that automation cannot judge (e.g. one with no linked tasks at all — automation requires ≥1, so a task-less criterion never auto-closes).
49
+ - **A close is only as good as its task links.** Auto-satisfy cannot help a criterion nothing is linked to; goal 1000072's five criteria have zero linked tasks and will stay `0/5` until they are linked. Automating the flip makes that gap *more* visible, not less — which is the point.
50
+ - **`achieveGoalIfComplete` (db.js) now has a sibling** that re-implements its rules in SQL on a caller's `exec`, because it reads through the module pool and could not see an uncommitted in-txn flip. The duplication is deliberate and noted at both sites; collapsing it would mean either a require cycle (`done-when` ↔ `db`) or moving goal reads out of `db.js`.
51
+ - **Observability:** the in-txn close logs from `closeCompletedWorkForShip`, which means it prints *before* commit — the one wart, accepted and documented there, because threading the summary back out through `withTx` would have cost ~5 lines in the over-threshold `db.js` (shrink-only ratchet policy).
52
+
53
+ ## Alternatives rejected
54
+
55
+ - **Sweep only, no ship hook.** Simpler, but a builder who ships a goal's last task would wait up to 5 minutes to see it close — losing the moment that makes the board feel alive.
56
+ - **Ship hook only, no sweep.** Leaves every pre-existing completed criterion unsatisfied forever, since nothing will ship against them again.
57
+ - **A stored `pending_review` column.** ADR 0086 §6 deliberately derives the flag; storing it adds a second source of truth to keep in sync.
58
+ - **Deleting `/goal-review`.** It still has the all-abandoned case and rejection to handle.
@@ -256,5 +256,6 @@ This keeps the decision history honest and traceable.
256
256
  | 0180 | [**Dependency intake & drift policy: baseline-ratchet audit gate, install scripts off, cooldown via patrol, OIDC publish** ([task 1003127](https://cloudbongos.com/builders#/task/1003127), goal 1000076). The red-team baseline audit found 18 advisories (2 high) sitting unwatched in 9 production deps, the `undici ^6.27.0` override pinned INSIDE a vulnerable range while also breaking Node 26 CLIs, and nothing gated what an agent may install — against a 2025 npm threat wave (chalk/debug, Shai-Hulud, Nx) that ran on postinstall scripts and long-lived publish tokens. Four decisions. (1) `scripts/gds/audit-gate.js` runs in the required `unit` check: a high/critical advisory NOT in the committed `config/audit-baseline.json` fails the merge gate; the baseline is **shrink-only pre-gate debt** (10 findings at adoption) — adding an entry to silence a NEW advisory is out of policy. Fail-OPEN on registry/infra errors, fail-CLOSED on findings: the gate catches new advisories, it does not prove registry uptime. Notably a blanket `npm audit fix` cannot even run here (`workspace:` protocol, EUNSUPPORTEDPROTOCOL) — fixes are explicit tasks. (2) `.npmrc ignore-scripts=true`: the tree needs no install-lifecycle scripts — sharp installs prebuilds via optionalDependencies, proven by a script-less `npm ci` + full 430-test suite; a future dep needing one is an ADR-level exception. (3) Update cooldown is PATROL-enforced (task 1003128 flags versions younger than 7 days + stale overrides + action-pin drift) rather than `.npmrc`-enforced, because CI's npm 10 warns on the npm-11 `minimum-release-age` key for every builder; move it into `.npmrc` when the toolchain floor reaches npm ≥ 11.10. (4) Publish auth moves to npm **trusted publishing (OIDC)** — needs a one-time owner registration on npmjs.com (blocker filed); until then the granular 90-day `NPM_TOKEN` is a documented exception.](<redacted>.md) | devsecops / supply chain |
257
257
  | 0181 | [**Teardown accepts every state but `torn_down`, and deliberately keeps the address** ([task 1003042](https://cloudbongos.com/builders#/task/1003042), goal 1000058). Walk finding N5: an instance at `status='error'` could never be removed — the owner's teardown answered 409 `not_teardownable` and the archon `force-teardown`, which exists as the escape hatch, answered the SAME refusal, because both read one hand-kept whitelist `['provisioning','active','tearing_down']` that omitted `requested` and `error`. No role had a path out, so errored rows accumulated permanently (instance 15 `swag` from 2026-08-07). The whitelist justified itself as "nothing running to tear down", which is FALSE for `error`: a provision failing mid-run lands there AFTER it may have created the database, taken a port, and written the systemd unit, Caddy block and DNS record — a partial standup is the thing most in need of reclaiming. `TEARDOWN_FROM` is now DERIVED from `INSTANCE_STATES` minus `torn_down`, so a future state is teardownable by DEFAULT — the bug was an allow-list that silently omitted states, and for a failure mode whose signature is "a row with no exit", the safe default is that an exit exists. The runner needed no change (its steps are each `allowFail`); only the web guard refused. The one surviving refusal is now ONE shared helper: the copies had drifted, and force-teardown's positional `res.fail` form put the bare code `not_teardownable` on the wire as the human text. **The `port` and `domain` are deliberately NOT released** — releasing the port alone would be WORSE than the status quo, because the `<slug>.caddy` block survives teardown and proxies the hostname to a PORT NUMBER, so a later instance given that port would answer at the torn-down project's still-live address (verified live: two projects torn down 2026-08-13 still resolved on 2026-08-19). Holding the port is what keeps the address inert at a harmless 502; releasing both is [task 1002897](https://cloudbongos.com/builders#/task/1002897). Retention is also correct for revive, which re-uses the same hostname. Copy was corrected to match: it had promised "the address stops answering", which was never true.](0181-teardown-state-gate-and-address-retention.md) | provisioning / lifecycle |
258
258
  | 0182 | [**Project visibility is TWO axes: a derived publish gate and a stored join door** ([task 1002320](https://cloudbongos.com/builders#/task/1002320), goal 1000046). Goal 1000046 seeded 31 tasks each citing "per R01" — this ADR — so nothing in the goal could start until it landed: it gated **29 open tasks**, the largest single chokepoint in the repo, while itself parked at `backlog` with no dependencies. The spec its planning task cites was never written, so this is the design of record. The goal's criterion says **four** states (Public/Private/Stealth/Unlisted) and R04 says **three** stored plus a derived dark-matter; both are right and conflating them is the trap. There are two INDEPENDENT axes: **publishability** (DERIVED from the identity gate — name + description, per the owner interview) decides whether a project is on the map at all, and **the join door** (STORED `visibility ∈ public|private|stealth`, owner-set) decides how it renders and who gets in. Four user-facing states = 3 × publishable + one derived state that collapses all three. The column name `visibility` is a mild lie kept for consistency with `goals.visibility` (ADR 0112) — it does NOT decide visibility, publishability does — and the ADR is the mitigation. All three stored states are VISIBLE; only the derived state is invisible, which is what makes the 3+1 split honest rather than a workaround. `private` inherits ADR 0112's exact meaning (visible-but-closed); `stealth` exposes EXISTENCE but not IDENTITY, and its redaction is **server-side in the feed** — the naive client-side version leaks to anyone opening the network tab, and the orbs page is a static site OUTSIDE this repo (R09) so it could never be enforced there. Three mechanisms touch "does this appear" and are separated: `status` (operational), `visibility` (owner), `featured` (Archon editorial) — on the map iff `status='active' AND publishable`, with `featured` only ranking among those. That is a real behaviour change: today's predicate is `featured=true AND status='active'`, so **featuring is currently load-bearing for visibility at all** and the goal's owner-control premise silently does not work without it. Visibility is owned by the INSTANCE and the hub row is a CACHE (ADR 0141 §3 + the admin-console spike's D1) — so `owner_github_id` being "advisory, not an authority" is CORRECT rather than a gap, R05 moves to an instance surface, and R08's absent-report default is fail-closed (unreported ⇒ dark matter, off the map rather than exposed by omission). Per-state join rules compose with the separate `open|closed` join policy ([task 1002817](https://cloudbongos.com/builders#/task/1002817)) by one rule: **visibility sets the ceiling, join policy may only narrow** — otherwise the two settings are a coin-flip decided by evaluation order. Finally, `stealth` COLLIDES with the existing instance-wide pre-launch password gate (`STEALTH_PASSWORD`, `src/bongos/stealth-gate.js`), which means nearly the opposite (a whole instance made unreadable vs a project publicly on the map, anonymously); per ADR 0174 the product meaning keeps the word and the infra rename is filed separately rather than decided by an ADR about visibility. Rejected: a stored 4-valued enum (makes `unlisted` compete with `private`, and lets publishable+unlisted disagree), a separate `published` boolean (can drift from the identity it summarises; derived cannot), and keeping `featured` as the visibility gate (an owner who sets public and appears nowhere has not been given control).](<redacted>.md) | platform-identity / project visibility |
259
+ | 0183 | [**A done-when criterion closes itself; the review queue becomes a place to look** ([task 1002069](https://cloudbongos.com/builders#/task/1002069), goal 1000072, owner request 2026-07-05). ADR 0086 §6 made `satisfied` reachable exactly one way — a Metic+ calling `POST /done-when/:id/satisfy` — even though the signal it gated on is unambiguous (**every** gating task shipped) and a human confirming it adds no information. When nobody runs `/goal-review` the result is not a careful pause but a **lying board**: this session measured goal 1000072 at `6/9 shipped, 0/5 criteria`. Now one helper, `doneWhen.autoSatisfyShippedCriteria(exec, {taskId})`, runs from **two** places for two different reasons — inside `shipTask`'s txn (scoped, **immediate**, on the txn client so a rolled-back ship cannot leave a goal achieved) and unscoped on every `publish-reconciler` tick (**backlog drain** for criteria whose tasks shipped before this existed, since nothing will ship against them again, plus **self-heal**). Idempotent by construction — it reads only `satisfied=false` rows — which is what makes an every-tick sweep safe. **The load-bearing subtlety is the delivery guard.** Auto-close needs BOTH "nothing still pending" AND **≥ 1 task actually `shipped`**; the second is not redundant, because since [task 1002651](https://cloudbongos.com/builders#/task/1002651) made `abandoned` terminal-not-pending, a criterion whose tasks were **all cut** satisfies the first clause *vacuously* and would auto-close on ZERO delivered work, cascading its goal to `achieved` (measured: `buildCriterionProgress` returns `pending_review:true` for exactly that shape). Yet `pending_review` **keeps** that wider meaning on purpose — it asks "should a human LOOK at this", and 1002651 chose that an all-abandoned criterion surfaces so someone decides whether it still means anything. So: everything that auto-closes was flagged; not everything flagged auto-closes. An earlier draft "aligned" the two predicates and broke that intent — `tests/criterion_progress.mjs` caught it; **do not re-align them**, the gap is the design. `/goal-review` is kept, demoted from gate to viewing surface; manual `POST /satisfy` stays for what automation cannot judge (a criterion with no linked tasks never auto-closes). Honest limits recorded: auto-satisfy cannot help a criterion nothing is LINKED to, and the in-txn close logs before commit (accepted — threading the summary out through `withTx` would cost ~5 lines in the over-threshold `db.js` under shrink-only ratchet policy). Rejected: sweep-only (up to 5 min to see your own goal close), hook-only (never drains the backlog), a stored `pending_review` column (second source of truth), deleting `/goal-review`.](<redacted>.md) | lifecycle / goal tier |
259
260
 
260
261
  > ⚠️ **Numbering collision (known):** two ADRs share `0008`. The numbers were assigned in parallel sessions before the lock could be enforced. The files are kept under their existing filenames to preserve git history, but the table disambiguates them as `0008-a` / `0008-b`. New ADRs should resume at `0040` to avoid further collisions. (`0024` is also a real on-disk duplicate: the cloneable-repo/local-first-memory ADR and the multi-agent-system-architecture ADR were both numbered `0024` in parallel; both keep their filenames, disambiguated as `0024-a` / `0024-b` like `0008`. Likewise `0025` ended up with two on-disk files — the offsite-backup ADR and the structured-criterion↔task-link ADR — both kept under their existing filenames and disambiguated as `0025-a` / `0025-b`; separately, the BFG ADR had also claimed `0025` on 2026-05-30 and yielded to `0026`. A third happened 2026-06-06: `0036` was claimed in parallel by the builders-subdomain ADR ([#726](https://example.com/builders#/task/726)) and this Discord-channels ADR ([#727](https://example.com/builders#/task/727)); the Discord-channels ADR yielded to `0037`. A fourth landed 2026-06-10: `0044` was claimed in parallel by the palette-replacement ADR and the per-box game-preview ADR ([#897](https://example.com/builders#/task/897)); both keep their filenames, disambiguated as `0044-a` / `0044-b` like `0008`. A fifth was caught pre-land 2026-06-13: `0050` was claimed in parallel by the device-flow-admission ADR ([#1000](https://example.com/builders#/task/1000)) and the sandbox-for-everyone ADR ([#1001](https://example.com/builders#/task/1001)); the latter yielded to `0052` before merging, so there is no `0050` duplicate. A sixth was caught pre-land 2026-06-21: the tool-agnostic-design-layer ADR ([#1375](https://example.com/builders#/task/1375)) first collided at `0079` with the value-gated-autonomous-engagement ADR, then at `0080` with the llm-cache-api-transport ADR (both part of the 0075–0080 LLM-cost-reduction series, landed on `main` in parallel); it yielded to `0081` before merging, so there is no `0079`/`0080` design-layer duplicate. A seventh landed 2026-06-23: `0084` was claimed in parallel by the auto-derived-per-task-rank-floor ADR and the remove-default-spend-cap ADR (task 1499); the rank-floor ADR landed on `main` first, so the spend-cap ADR yielded to `0085`, leaving no `0084` duplicate. An eighth landed 2026-06-27: `0095` was claimed in parallel by the borrowed-memory-and-retrieval-concepts ADR (PR #459, landed first) and the cross-agent-context-management ADR ([#1651](https://example.com/builders#/task/1651), PR #460); both keep their filenames, disambiguated as `0095-a` / `0095-b` like `0008`. These two are companions — `0095-a` adopts the memory/retrieval concepts and explicitly defers the grep-vs-semantic question to `0095-b`.)
@@ -4228,6 +4228,37 @@
4228
4228
  ]
4229
4229
  }
4230
4230
  },
4231
+ "/goals/suggestions": {
4232
+ "get": {
4233
+ "operationId": "get_goals_suggestions",
4234
+ "tags": [
4235
+ "goals"
4236
+ ],
4237
+ "summary": "GET /goals/suggestions",
4238
+ "description": "GET /goals/suggestions — \"which goal should this draft live in?\", answered before anything is created (task 1003062 / R07). Handler + the ranking and visibility rationale: ../goal-suggest.js. Mounted BEFORE GET /goals/:id so 'suggestions' is never captured as an id. rank: any-builder — a read of open goal titles, same surface as GET /goals.\n\n**Rank:** `any-builder` — Any authenticated builder (row-level ownership enforced in-handler).",
4239
+ "x-rank": "any-builder",
4240
+ "x-source": "modules/lifecycle/routes/goals.js",
4241
+ "responses": {
4242
+ "200": {
4243
+ "description": "Success."
4244
+ },
4245
+ "400": {
4246
+ "$ref": "#/components/responses/BadRequest"
4247
+ },
4248
+ "401": {
4249
+ "$ref": "#/components/responses/Unauthorized"
4250
+ },
4251
+ "403": {
4252
+ "$ref": "#/components/responses/Forbidden"
4253
+ }
4254
+ },
4255
+ "security": [
4256
+ {
4257
+ "builderSession": []
4258
+ }
4259
+ ]
4260
+ }
4261
+ },
4231
4262
  "/goals/{id}": {
4232
4263
  "get": {
4233
4264
  "operationId": "get_goals_id",
@@ -5257,14 +5288,7 @@
5257
5288
  ],
5258
5289
  "responses": {
5259
5290
  "200": {
5260
- "description": "Success.",
5261
- "content": {
5262
- "application/json": {
5263
- "schema": {
5264
- "$ref": "#/components/schemas/GetGoalsIdSuggestCriteriaResponse"
5265
- }
5266
- }
5267
- }
5291
+ "description": "Success."
5268
5292
  },
5269
5293
  "400": {
5270
5294
  "$ref": "#/components/responses/BadRequest"
@@ -13780,17 +13804,6 @@
13780
13804
  "dependencies"
13781
13805
  ]
13782
13806
  },
13783
- "GetGoalsIdSuggestCriteriaResponse": {
13784
- "type": "object",
13785
- "properties": {
13786
- "goal_id": {},
13787
- "suggestions": {}
13788
- },
13789
- "required": [
13790
- "goal_id",
13791
- "suggestions"
13792
- ]
13793
- },
13794
13807
  "GetGoalsResponse": {
13795
13808
  "type": "object",
13796
13809
  "properties": {
@@ -18546,9 +18559,9 @@
18546
18559
  "description": "A required dependency/feature is not configured or is temporarily down."
18547
18560
  }
18548
18561
  },
18549
- "x-endpoint-count": 293,
18550
- "x-schema-count": 328,
18562
+ "x-endpoint-count": 294,
18563
+ "x-schema-count": 327,
18551
18564
  "x-undocumented-bodies": 8,
18552
- "x-response-schemas": 219,
18565
+ "x-response-schemas": 218,
18553
18566
  "x-generated-by": "scripts/gds/gen-api-docs.js"
18554
18567
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Bongos API reference
4
4
 
5
- > **Generated from the live route files** — the route file is authoritative. 293 endpoints across 47 route files.
5
+ > **Generated from the live route files** — the route file is authoritative. 294 endpoints across 47 route files.
6
6
  > Machine-readable spec: [`docs/api/openapi.json`](api/openapi.json) (OpenAPI 3.1). Rendered docs site: **`/docs`** (e.g. `cloudbongos.com/docs`).
7
7
 
8
8
  Base path: `/api/bongos`. Ranks (enforced server-side, [ADR 0016](adr/<redacted>.md)): `public` < `any-builder` < `metic+archon` < `archon`.
@@ -197,7 +197,7 @@ Base path: `/api/bongos`. Ranks (enforced server-side, [ADR 0016](adr/<redacted>
197
197
  | GET | `/api/bongos/github/repos` | `any-builder` | — | acts only on the caller's OWN GitHub identity (the token they granted). |
198
198
  | POST | `/api/bongos/github/repos` | `any-builder` | `name` | creates a repo in the caller's OWN account. |
199
199
 
200
- ## `goals` (25)
200
+ ## `goals` (26)
201
201
 
202
202
  | Method | Path | Rank | Body | Description |
203
203
  |---|---|---|---|---|
@@ -226,6 +226,7 @@ Base path: `/api/bongos`. Ranks (enforced server-side, [ADR 0016](adr/<redacted>
226
226
  | PATCH | `/api/bongos/goals/:id/visibility` | `any-builder` | — | PATCH /goals/:id/visibility — make a goal public\|private (task 1952 / ADR 0112). |
227
227
  | GET | `/api/bongos/goals/inbox` | `any-builder` | — | GET /goals/inbox — the caller's private-goals inbox (task 1952 / ADR 0112): { invitations: invites addressed to me (accept/decline); join… |
228
228
  | POST | `/api/bongos/goals/reorder` | `metic+archon` | `version_id`, `ordered_ids` | POST /goals/reorder — Archon drag-to-reorder: set the priority order of every goal WITHIN one version (task 1760). |
229
+ | GET | `/api/bongos/goals/suggestions` | `any-builder` | — | GET /goals/suggestions — "which goal should this draft live in?", answered before anything is created (task 1003062 / R07). |
229
230
 
230
231
  ## `government` (13)
231
232
 
@@ -3863,7 +3863,7 @@ async function shipTask({ taskId, builderId }, deps = {}) {
3863
3863
  justUnlocked = [];
3864
3864
  }
3865
3865
  }
3866
-
3866
+ await doneWhen.closeCompletedWorkForShip(client, taskId); // task 1002069/ADR 0183 — in-txn criterion+goal close
3867
3867
  return {
3868
3868
  shipRow: rows[0], graduationBuilder, rankGraduation, actualShipperId,
3869
3869
  closedClaimCount: closedClaims.length,