@bongos/core 1.21.106 → 1.21.107
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 +47 -27
- package/clients/bongos-client/README.md +1 -1
- package/clients/bongos-client/bongos-client.global.js +4 -0
- package/clients/bongos-client/index.cjs +4 -0
- package/clients/bongos-client/index.d.ts +6 -1
- package/clients/bongos-client/index.mjs +4 -0
- package/docs/api/openapi.json +91 -2
- package/docs/api-reference.md +5 -3
- package/docs/module-api-changelog.md +2 -0
- package/migrations/core_275_claims_auto_pickup.sql +24 -0
- package/modules/government/decision-rules.js +1 -0
- package/modules/lifecycle/autopickup.js +94 -0
- package/modules/lifecycle/db-claims.js +18 -4
- package/modules/lifecycle/routes/claims.js +12 -1
- package/modules/lifecycle/routes/project-settings.js +59 -0
- package/package-lock.json +2 -2
- package/package.json +1 -1
- package/release-notes.json +6 -0
- package/scripts/gds/government-walk.js +1 -0
- package/scripts/gds/run-unit-tests.js +3 -0
- package/src/bongos/project-settings.js +79 -0
- package/src/module-api.js +8 -1
- package/tests/autopickup_cap.mjs +236 -0
- package/tests/autopickup_cap_db.mjs +115 -0
- package/tests/government_act_alone_buildings.mjs +1 -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.21.
|
|
6
|
-
"core_contract": "1.21.
|
|
7
|
-
"source_commit": "
|
|
5
|
+
"core_version": "1.21.107",
|
|
6
|
+
"core_contract": "1.21.107",
|
|
7
|
+
"source_commit": "66864d4729f78666ac0d3cc86772672dad49d007",
|
|
8
8
|
"source_ref": "HEAD",
|
|
9
|
-
"built_at": "2026-10-
|
|
9
|
+
"built_at": "2026-10-09T16:17:03.848Z",
|
|
10
10
|
"redaction": {
|
|
11
11
|
"model": "docs-redacted+functional-verbatim",
|
|
12
12
|
"docs_redacted": 592,
|
|
13
13
|
"agent_docs_stubbed": 28,
|
|
14
|
-
"functional_verbatim":
|
|
14
|
+
"functional_verbatim": 3027,
|
|
15
15
|
"rules": 3,
|
|
16
16
|
"gate_literals": 3,
|
|
17
17
|
"gate": "passed"
|
|
18
18
|
},
|
|
19
|
-
"file_count":
|
|
20
|
-
"tree_sha256": "
|
|
19
|
+
"file_count": 3648,
|
|
20
|
+
"tree_sha256": "7b88f76244577f7ff0ed046eef50822d8f34efad63453b8257040b942df1708a",
|
|
21
21
|
"files": [
|
|
22
22
|
{
|
|
23
23
|
"path": ".claude/skills/ask-for-help/SKILL.md",
|
|
@@ -317,12 +317,12 @@
|
|
|
317
317
|
{
|
|
318
318
|
"path": "clients/bongos-client/README.md",
|
|
319
319
|
"mode": "0000644",
|
|
320
|
-
"sha256": "
|
|
320
|
+
"sha256": "91c5efc7dccdd2f340a3614b34c2a2819abc13416e960b53d141f1813c1b99db"
|
|
321
321
|
},
|
|
322
322
|
{
|
|
323
323
|
"path": "clients/bongos-client/bongos-client.global.js",
|
|
324
324
|
"mode": "0000644",
|
|
325
|
-
"sha256": "
|
|
325
|
+
"sha256": "69e333da3eb4e9b56be940bcf96a8ea15c9b01743c7a1897a388ce9d12bb7808"
|
|
326
326
|
},
|
|
327
327
|
{
|
|
328
328
|
"path": "clients/bongos-client/examples/hello-world.mjs",
|
|
@@ -332,17 +332,17 @@
|
|
|
332
332
|
{
|
|
333
333
|
"path": "clients/bongos-client/index.cjs",
|
|
334
334
|
"mode": "0000644",
|
|
335
|
-
"sha256": "
|
|
335
|
+
"sha256": "cbcff06b2e51bc07dc9bb86267a163edd59ea3a90410a2a7cf32f54689d6dc11"
|
|
336
336
|
},
|
|
337
337
|
{
|
|
338
338
|
"path": "clients/bongos-client/index.d.ts",
|
|
339
339
|
"mode": "0000644",
|
|
340
|
-
"sha256": "
|
|
340
|
+
"sha256": "87a3e5f52908abab175b07d614fcfe59ffa2e45905bb48d4aee760412cd571d2"
|
|
341
341
|
},
|
|
342
342
|
{
|
|
343
343
|
"path": "clients/bongos-client/index.mjs",
|
|
344
344
|
"mode": "0000644",
|
|
345
|
-
"sha256": "
|
|
345
|
+
"sha256": "151e3d04622f5ea4ed18e8994a1e0054250d9cd47dea2d4cc6757fa3430ed7a0"
|
|
346
346
|
},
|
|
347
347
|
{
|
|
348
348
|
"path": "clients/bongos-client/package.json",
|
|
@@ -2327,12 +2327,12 @@
|
|
|
2327
2327
|
{
|
|
2328
2328
|
"path": "docs/api-reference.md",
|
|
2329
2329
|
"mode": "0000644",
|
|
2330
|
-
"sha256": "
|
|
2330
|
+
"sha256": "2664221c9a2b16fde834338979647972cb2ff8d65e223a08edccd90b2427186f"
|
|
2331
2331
|
},
|
|
2332
2332
|
{
|
|
2333
2333
|
"path": "docs/api/openapi.json",
|
|
2334
2334
|
"mode": "0000644",
|
|
2335
|
-
"sha256": "
|
|
2335
|
+
"sha256": "5458c8e5fe23d697de50e4fd6317cb8868208e2e6026f6fa74c0f1a291ab586e"
|
|
2336
2336
|
},
|
|
2337
2337
|
{
|
|
2338
2338
|
"path": "docs/architecture.md",
|
|
@@ -2872,7 +2872,7 @@
|
|
|
2872
2872
|
{
|
|
2873
2873
|
"path": "docs/module-api-changelog.md",
|
|
2874
2874
|
"mode": "0000644",
|
|
2875
|
-
"sha256": "
|
|
2875
|
+
"sha256": "e04eba1f8d62cb1ae1251c701aad1d4108cf1c48c2bd7a71eade2c29d419e80e"
|
|
2876
2876
|
},
|
|
2877
2877
|
{
|
|
2878
2878
|
"path": "docs/modules-contract.md",
|
|
@@ -4099,6 +4099,11 @@
|
|
|
4099
4099
|
"mode": "0000644",
|
|
4100
4100
|
"sha256": "48266ddb9168d1240029ecf6e69572010512dddc219d0f0cb4d6b373775752eb"
|
|
4101
4101
|
},
|
|
4102
|
+
{
|
|
4103
|
+
"path": "migrations/core_275_claims_auto_pickup.sql",
|
|
4104
|
+
"mode": "0000644",
|
|
4105
|
+
"sha256": "75381af0ac96645f2f8fe254f609c75d2fa83bc2fc1f13887c23165fc8eed58e"
|
|
4106
|
+
},
|
|
4102
4107
|
{
|
|
4103
4108
|
"path": "modules/agents/CLAUDE.md",
|
|
4104
4109
|
"mode": "0000644",
|
|
@@ -4947,7 +4952,7 @@
|
|
|
4947
4952
|
{
|
|
4948
4953
|
"path": "modules/government/decision-rules.js",
|
|
4949
4954
|
"mode": "0000644",
|
|
4950
|
-
"sha256": "
|
|
4955
|
+
"sha256": "7e0191b9b20cdbf2f74f6149235b53bb9f4fb9167507c742d8bedc477610c4f4"
|
|
4951
4956
|
},
|
|
4952
4957
|
{
|
|
4953
4958
|
"path": "modules/government/docket-floors.js",
|
|
@@ -6824,6 +6829,11 @@
|
|
|
6824
6829
|
"mode": "0000644",
|
|
6825
6830
|
"sha256": "e7c7db8a6faf50f3b75cb26ac33caa8357c462293e64318212ace69b0b654507"
|
|
6826
6831
|
},
|
|
6832
|
+
{
|
|
6833
|
+
"path": "modules/lifecycle/autopickup.js",
|
|
6834
|
+
"mode": "0000644",
|
|
6835
|
+
"sha256": "e1a135cd31cff98754c3d9eab3c1d8f5e77a18b19b0e6ba6687b58babab4ce49"
|
|
6836
|
+
},
|
|
6827
6837
|
{
|
|
6828
6838
|
"path": "modules/lifecycle/cascade.js",
|
|
6829
6839
|
"mode": "0000644",
|
|
@@ -6897,7 +6907,7 @@
|
|
|
6897
6907
|
{
|
|
6898
6908
|
"path": "modules/lifecycle/db-claims.js",
|
|
6899
6909
|
"mode": "0000644",
|
|
6900
|
-
"sha256": "
|
|
6910
|
+
"sha256": "bfdaf979059f10ff3d2f94d5d7f9d7fa377f1a2756967c84f7008fb1b68c83eb"
|
|
6901
6911
|
},
|
|
6902
6912
|
{
|
|
6903
6913
|
"path": "modules/lifecycle/db-deps-criteria.js",
|
|
@@ -7297,7 +7307,7 @@
|
|
|
7297
7307
|
{
|
|
7298
7308
|
"path": "modules/lifecycle/routes/claims.js",
|
|
7299
7309
|
"mode": "0000644",
|
|
7300
|
-
"sha256": "
|
|
7310
|
+
"sha256": "6b872458c5d872cc84f48b173cb4480da73223c8f3284df886dbf4acb0837467"
|
|
7301
7311
|
},
|
|
7302
7312
|
{
|
|
7303
7313
|
"path": "modules/lifecycle/routes/closeness.js",
|
|
@@ -7372,7 +7382,7 @@
|
|
|
7372
7382
|
{
|
|
7373
7383
|
"path": "modules/lifecycle/routes/project-settings.js",
|
|
7374
7384
|
"mode": "0000644",
|
|
7375
|
-
"sha256": "
|
|
7385
|
+
"sha256": "779b4865cb7792b1d03661d1b6212d9e99aa0691a79664f4bd923a6a5777d5e5"
|
|
7376
7386
|
},
|
|
7377
7387
|
{
|
|
7378
7388
|
"path": "modules/lifecycle/routes/recommendations.js",
|
|
@@ -10147,12 +10157,12 @@
|
|
|
10147
10157
|
{
|
|
10148
10158
|
"path": "package-lock.json",
|
|
10149
10159
|
"mode": "0000644",
|
|
10150
|
-
"sha256": "
|
|
10160
|
+
"sha256": "c16dedbb2b09e052499c6ab3e729d3b6398b070d283e5fcd459a722330a9bcd3"
|
|
10151
10161
|
},
|
|
10152
10162
|
{
|
|
10153
10163
|
"path": "package.json",
|
|
10154
10164
|
"mode": "0000644",
|
|
10155
|
-
"sha256": "
|
|
10165
|
+
"sha256": "e2deb79f00c230babbea2ba21005f4dcd2d6f2208638c44d2f6b38ba01416fcc"
|
|
10156
10166
|
},
|
|
10157
10167
|
{
|
|
10158
10168
|
"path": "public-docs/index.html",
|
|
@@ -10172,7 +10182,7 @@
|
|
|
10172
10182
|
{
|
|
10173
10183
|
"path": "release-notes.json",
|
|
10174
10184
|
"mode": "0000644",
|
|
10175
|
-
"sha256": "
|
|
10185
|
+
"sha256": "6182edd848be32362494da2bc94f8a4c33bca78bf2c6b9a253834d65531853b4"
|
|
10176
10186
|
},
|
|
10177
10187
|
{
|
|
10178
10188
|
"path": "scripts/cron/style_guide_audit.sh",
|
|
@@ -10857,7 +10867,7 @@
|
|
|
10857
10867
|
{
|
|
10858
10868
|
"path": "scripts/gds/government-walk.js",
|
|
10859
10869
|
"mode": "0000644",
|
|
10860
|
-
"sha256": "
|
|
10870
|
+
"sha256": "c456509abfc61709bb1613a63493312560014e236ca12a5f022c4cec9e6ad832"
|
|
10861
10871
|
},
|
|
10862
10872
|
{
|
|
10863
10873
|
"path": "scripts/gds/grade-correlation-audit.js",
|
|
@@ -11397,7 +11407,7 @@
|
|
|
11397
11407
|
{
|
|
11398
11408
|
"path": "scripts/gds/run-unit-tests.js",
|
|
11399
11409
|
"mode": "0000644",
|
|
11400
|
-
"sha256": "
|
|
11410
|
+
"sha256": "e9324b2fe5b23acb8b45723ba7d11d708cbdf92b63e70d0387246eb6fd1a5ac9"
|
|
11401
11411
|
},
|
|
11402
11412
|
{
|
|
11403
11413
|
"path": "scripts/gds/runner-drift.js",
|
|
@@ -12267,7 +12277,7 @@
|
|
|
12267
12277
|
{
|
|
12268
12278
|
"path": "src/bongos/project-settings.js",
|
|
12269
12279
|
"mode": "0000644",
|
|
12270
|
-
"sha256": "
|
|
12280
|
+
"sha256": "4a8235d9a6b6dbd4dd876bc8681074fa9dfad36c6ca2f620012b89c27083e910"
|
|
12271
12281
|
},
|
|
12272
12282
|
{
|
|
12273
12283
|
"path": "src/bongos/repo-info.js",
|
|
@@ -12447,7 +12457,7 @@
|
|
|
12447
12457
|
{
|
|
12448
12458
|
"path": "src/module-api.js",
|
|
12449
12459
|
"mode": "0000644",
|
|
12450
|
-
"sha256": "
|
|
12460
|
+
"sha256": "468b26045e9d63b3a8f75572e5bccb37517ad08719c7828048c80e4ec40e15dc"
|
|
12451
12461
|
},
|
|
12452
12462
|
{
|
|
12453
12463
|
"path": "src/module-loader/catalog.js",
|
|
@@ -12989,6 +12999,16 @@
|
|
|
12989
12999
|
"mode": "0000644",
|
|
12990
13000
|
"sha256": "1c1c7b862d134033ef8cdfef8288f989be6a25c25dade657c5b57e4f1bd2c46c"
|
|
12991
13001
|
},
|
|
13002
|
+
{
|
|
13003
|
+
"path": "tests/autopickup_cap.mjs",
|
|
13004
|
+
"mode": "0000644",
|
|
13005
|
+
"sha256": "c447ac65b59cd60ed0924cf95ce50d56d745fd42d5ad48e468387707ff01188a"
|
|
13006
|
+
},
|
|
13007
|
+
{
|
|
13008
|
+
"path": "tests/autopickup_cap_db.mjs",
|
|
13009
|
+
"mode": "0000644",
|
|
13010
|
+
"sha256": "23833e26b2424ad58e6af3b4bec8c67f938d413b232cde7f2e58b97cf6ec210d"
|
|
13011
|
+
},
|
|
12992
13012
|
{
|
|
12993
13013
|
"path": "tests/backfill_sessions.mjs",
|
|
12994
13014
|
"mode": "0000644",
|
|
@@ -14362,7 +14382,7 @@
|
|
|
14362
14382
|
{
|
|
14363
14383
|
"path": "tests/government_act_alone_buildings.mjs",
|
|
14364
14384
|
"mode": "0000644",
|
|
14365
|
-
"sha256": "
|
|
14385
|
+
"sha256": "c2760e6d0d830de8178bca5a3eead05a799290d241451b5d4a15afbbdc4a4de2"
|
|
14366
14386
|
},
|
|
14367
14387
|
{
|
|
14368
14388
|
"path": "tests/government_board_amendment.mjs",
|
|
@@ -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
|
-
-
|
|
8
|
+
- 541 operations across 76 resource groups
|
|
9
9
|
|
|
10
10
|
## Use it from your project
|
|
11
11
|
|
|
@@ -871,6 +871,10 @@ function createClient(opts = {}) {
|
|
|
871
871
|
getProjectSettingsShipMode: (args) => request("GET", "/project-settings/ship-mode", { hasBody: false }, args),
|
|
872
872
|
// PATCH /project-settings/ship-mode — rank: metic+archon — PATCH /project-settings/ship-mode
|
|
873
873
|
patchProjectSettingsShipMode: (args) => request("PATCH", "/project-settings/ship-mode", { hasBody: true }, args),
|
|
874
|
+
// GET /project-settings/tweak-autopickup — rank: any-builder — GET /project-settings/tweak-autopickup
|
|
875
|
+
getProjectSettingsTweakAutopickup: (args) => request("GET", "/project-settings/tweak-autopickup", { hasBody: false }, args),
|
|
876
|
+
// PATCH /project-settings/tweak-autopickup — rank: metic+archon — PATCH /project-settings/tweak-autopickup
|
|
877
|
+
patchProjectSettingsTweakAutopickup: (args) => request("PATCH", "/project-settings/tweak-autopickup", { hasBody: true }, args),
|
|
874
878
|
},
|
|
875
879
|
"projects": {
|
|
876
880
|
// GET /projects — rank: metic+archon — GET /projects
|
|
@@ -870,6 +870,10 @@ function createClient(opts = {}) {
|
|
|
870
870
|
getProjectSettingsShipMode: (args) => request("GET", "/project-settings/ship-mode", { hasBody: false }, args),
|
|
871
871
|
// PATCH /project-settings/ship-mode — rank: metic+archon — PATCH /project-settings/ship-mode
|
|
872
872
|
patchProjectSettingsShipMode: (args) => request("PATCH", "/project-settings/ship-mode", { hasBody: true }, args),
|
|
873
|
+
// GET /project-settings/tweak-autopickup — rank: any-builder — GET /project-settings/tweak-autopickup
|
|
874
|
+
getProjectSettingsTweakAutopickup: (args) => request("GET", "/project-settings/tweak-autopickup", { hasBody: false }, args),
|
|
875
|
+
// PATCH /project-settings/tweak-autopickup — rank: metic+archon — PATCH /project-settings/tweak-autopickup
|
|
876
|
+
patchProjectSettingsTweakAutopickup: (args) => request("PATCH", "/project-settings/tweak-autopickup", { hasBody: true }, args),
|
|
873
877
|
},
|
|
874
878
|
"projects": {
|
|
875
879
|
// GET /projects — rank: metic+archon — GET /projects
|
|
@@ -241,6 +241,7 @@ export interface PatchProjectSettingsRotDaysRequest { days: number }
|
|
|
241
241
|
export interface PatchProjectSettingsRotDaysResponse { ok: boolean; rot_days: unknown; source: unknown; describe: unknown }
|
|
242
242
|
export interface PatchProjectSettingsShipModeRequest { mode: string }
|
|
243
243
|
export interface PatchProjectSettingsShipModeResponse { ok: boolean; mode: unknown; chosen: unknown; source: unknown; sentence: unknown }
|
|
244
|
+
export interface PatchProjectSettingsTweakAutopickupRequest { mode?: string; cap?: number }
|
|
244
245
|
export interface PatchProjectsIdFeaturedRequest { featured: boolean }
|
|
245
246
|
export interface PatchProjectsIdFeaturedResponse { project: unknown }
|
|
246
247
|
export interface PatchProjectsIdStatusRequest { status: string }
|
|
@@ -297,7 +298,7 @@ export interface PostClaimsBatchResponse { claims: unknown }
|
|
|
297
298
|
export interface PostClaimsBatchValidateRequest { task_ids: unknown[] }
|
|
298
299
|
export interface PostClaimsIdReleaseOnBehalfRequest { reason: string }
|
|
299
300
|
export interface PostClaimsIdResolveRequest { outcome: "shipped" | "abandoned" | "partial"; notes_md?: string; value_summary?: string; verification?: Record<string, unknown>; force?: boolean; committed_files?: string[]; sandbox_review?: Record<string, unknown>; resolver_worktree?: string }
|
|
300
|
-
export interface PostClaimsRequest { task_id: StringifiableId; worktree_name?: string; head_sha?: string; bind_session?: boolean; enforce_touches?: boolean }
|
|
301
|
+
export interface PostClaimsRequest { task_id: StringifiableId; worktree_name?: string; head_sha?: string; bind_session?: boolean; enforce_touches?: boolean; auto_pickup?: boolean }
|
|
301
302
|
export interface PostClaimsResponse { claim: unknown; task: unknown; just_unlocked: unknown; overlap_warning: unknown; sibling_overlap_warning: unknown; reward: unknown }
|
|
302
303
|
export interface PostConnectionsIdAcceptResponse { status: unknown }
|
|
303
304
|
export interface PostConnectionsRequest { handle: string; note?: string }
|
|
@@ -1380,6 +1381,10 @@ export interface BongosClient {
|
|
|
1380
1381
|
getProjectSettingsShipMode(args?: RequestArgs): Promise<GetProjectSettingsShipModeResponse>;
|
|
1381
1382
|
/** PATCH /project-settings/ship-mode — rank: metic+archon */
|
|
1382
1383
|
patchProjectSettingsShipMode(args: RequestArgs & { body: PatchProjectSettingsShipModeRequest }): Promise<PatchProjectSettingsShipModeResponse>;
|
|
1384
|
+
/** GET /project-settings/tweak-autopickup — rank: any-builder */
|
|
1385
|
+
getProjectSettingsTweakAutopickup(args?: RequestArgs): Promise<ApiResponse>;
|
|
1386
|
+
/** PATCH /project-settings/tweak-autopickup — rank: metic+archon */
|
|
1387
|
+
patchProjectSettingsTweakAutopickup(args?: RequestArgs & { body?: PatchProjectSettingsTweakAutopickupRequest }): Promise<ApiResponse>;
|
|
1383
1388
|
};
|
|
1384
1389
|
"projects": {
|
|
1385
1390
|
/** GET /projects — rank: metic+archon */
|
|
@@ -867,6 +867,10 @@ export function createClient(opts = {}) {
|
|
|
867
867
|
getProjectSettingsShipMode: (args) => request("GET", "/project-settings/ship-mode", { hasBody: false }, args),
|
|
868
868
|
// PATCH /project-settings/ship-mode — rank: metic+archon — PATCH /project-settings/ship-mode
|
|
869
869
|
patchProjectSettingsShipMode: (args) => request("PATCH", "/project-settings/ship-mode", { hasBody: true }, args),
|
|
870
|
+
// GET /project-settings/tweak-autopickup — rank: any-builder — GET /project-settings/tweak-autopickup
|
|
871
|
+
getProjectSettingsTweakAutopickup: (args) => request("GET", "/project-settings/tweak-autopickup", { hasBody: false }, args),
|
|
872
|
+
// PATCH /project-settings/tweak-autopickup — rank: metic+archon — PATCH /project-settings/tweak-autopickup
|
|
873
|
+
patchProjectSettingsTweakAutopickup: (args) => request("PATCH", "/project-settings/tweak-autopickup", { hasBody: true }, args),
|
|
870
874
|
},
|
|
871
875
|
"projects": {
|
|
872
876
|
// GET /projects — rank: metic+archon — GET /projects
|
package/docs/api/openapi.json
CHANGED
|
@@ -15957,6 +15957,80 @@
|
|
|
15957
15957
|
]
|
|
15958
15958
|
}
|
|
15959
15959
|
},
|
|
15960
|
+
"/project-settings/tweak-autopickup": {
|
|
15961
|
+
"get": {
|
|
15962
|
+
"operationId": "get_project_settings_tweak_autopickup",
|
|
15963
|
+
"tags": [
|
|
15964
|
+
"project-settings"
|
|
15965
|
+
],
|
|
15966
|
+
"summary": "GET /project-settings/tweak-autopickup",
|
|
15967
|
+
"description": "**Rank:** `any-builder` — Any authenticated builder (row-level ownership enforced in-handler).",
|
|
15968
|
+
"x-rank": "any-builder",
|
|
15969
|
+
"x-source": "modules/lifecycle/routes/project-settings.js",
|
|
15970
|
+
"responses": {
|
|
15971
|
+
"200": {
|
|
15972
|
+
"description": "Success."
|
|
15973
|
+
},
|
|
15974
|
+
"400": {
|
|
15975
|
+
"$ref": "#/components/responses/BadRequest"
|
|
15976
|
+
},
|
|
15977
|
+
"401": {
|
|
15978
|
+
"$ref": "#/components/responses/Unauthorized"
|
|
15979
|
+
},
|
|
15980
|
+
"403": {
|
|
15981
|
+
"$ref": "#/components/responses/Forbidden"
|
|
15982
|
+
}
|
|
15983
|
+
},
|
|
15984
|
+
"security": [
|
|
15985
|
+
{
|
|
15986
|
+
"builderSession": []
|
|
15987
|
+
}
|
|
15988
|
+
]
|
|
15989
|
+
},
|
|
15990
|
+
"patch": {
|
|
15991
|
+
"operationId": "patch_project_settings_tweak_autopickup",
|
|
15992
|
+
"tags": [
|
|
15993
|
+
"project-settings"
|
|
15994
|
+
],
|
|
15995
|
+
"summary": "PATCH /project-settings/tweak-autopickup",
|
|
15996
|
+
"description": "PATCH /project-settings/tweak-autopickup — body { mode?: 'off' | 'on', cap?: n }. rank: project.settings.manage (metic+, government_010), the same atom as the other writes on this page. Each field is validated by the resolver's own parser, and both are checked before either is written, so a half-valid body writes nothing.\n\n**Rank:** `metic+archon` — Metic or Archon rank (review/triage powers).\n\n**Permissions:** `project.settings.manage` (all required).",
|
|
15997
|
+
"x-rank": "metic+archon",
|
|
15998
|
+
"x-source": "modules/lifecycle/routes/project-settings.js",
|
|
15999
|
+
"x-permissions": [
|
|
16000
|
+
"project.settings.manage"
|
|
16001
|
+
],
|
|
16002
|
+
"requestBody": {
|
|
16003
|
+
"required": false,
|
|
16004
|
+
"content": {
|
|
16005
|
+
"application/json": {
|
|
16006
|
+
"schema": {
|
|
16007
|
+
"$ref": "#/components/schemas/PatchProjectSettingsTweakAutopickupRequest"
|
|
16008
|
+
}
|
|
16009
|
+
}
|
|
16010
|
+
},
|
|
16011
|
+
"x-validated": true
|
|
16012
|
+
},
|
|
16013
|
+
"responses": {
|
|
16014
|
+
"200": {
|
|
16015
|
+
"description": "Success."
|
|
16016
|
+
},
|
|
16017
|
+
"400": {
|
|
16018
|
+
"$ref": "#/components/responses/ValidationFailed"
|
|
16019
|
+
},
|
|
16020
|
+
"401": {
|
|
16021
|
+
"$ref": "#/components/responses/Unauthorized"
|
|
16022
|
+
},
|
|
16023
|
+
"403": {
|
|
16024
|
+
"$ref": "#/components/responses/Forbidden"
|
|
16025
|
+
}
|
|
16026
|
+
},
|
|
16027
|
+
"security": [
|
|
16028
|
+
{
|
|
16029
|
+
"builderSession": []
|
|
16030
|
+
}
|
|
16031
|
+
]
|
|
16032
|
+
}
|
|
16033
|
+
},
|
|
15960
16034
|
"/project/manage-link": {
|
|
15961
16035
|
"get": {
|
|
15962
16036
|
"operationId": "get_project_manage_link",
|
|
@@ -28398,6 +28472,18 @@
|
|
|
28398
28472
|
"sentence"
|
|
28399
28473
|
]
|
|
28400
28474
|
},
|
|
28475
|
+
"PatchProjectSettingsTweakAutopickupRequest": {
|
|
28476
|
+
"type": "object",
|
|
28477
|
+
"properties": {
|
|
28478
|
+
"mode": {
|
|
28479
|
+
"type": "string"
|
|
28480
|
+
},
|
|
28481
|
+
"cap": {
|
|
28482
|
+
"type": "number"
|
|
28483
|
+
}
|
|
28484
|
+
},
|
|
28485
|
+
"additionalProperties": false
|
|
28486
|
+
},
|
|
28401
28487
|
"PatchProjectsIdFeaturedRequest": {
|
|
28402
28488
|
"type": "object",
|
|
28403
28489
|
"properties": {
|
|
@@ -29339,6 +29425,9 @@
|
|
|
29339
29425
|
},
|
|
29340
29426
|
"enforce_touches": {
|
|
29341
29427
|
"type": "boolean"
|
|
29428
|
+
},
|
|
29429
|
+
"auto_pickup": {
|
|
29430
|
+
"type": "boolean"
|
|
29342
29431
|
}
|
|
29343
29432
|
},
|
|
29344
29433
|
"required": [
|
|
@@ -34474,8 +34563,8 @@
|
|
|
34474
34563
|
"description": "A required dependency/feature is not configured or is temporarily down."
|
|
34475
34564
|
}
|
|
34476
34565
|
},
|
|
34477
|
-
"x-endpoint-count":
|
|
34478
|
-
"x-schema-count":
|
|
34566
|
+
"x-endpoint-count": 541,
|
|
34567
|
+
"x-schema-count": 577,
|
|
34479
34568
|
"x-undocumented-bodies": 12,
|
|
34480
34569
|
"x-response-schemas": 382,
|
|
34481
34570
|
"x-generated-by": "scripts/gds/gen-api-docs.js"
|
package/docs/api-reference.md
CHANGED
|
@@ -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.
|
|
5
|
+
> **Generated from the live route files** — the route file is authoritative. 541 endpoints across 95 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/0016-trust-boundary-server-enforced-permissions.md)): `public` < `any-builder` < `metic+archon` < `archon`.
|
|
@@ -143,7 +143,7 @@ Base path: `/api/bongos`. Ranks (enforced server-side, [ADR 0016](adr/0016-trust
|
|
|
143
143
|
|
|
144
144
|
| Method | Path | Rank | Body | Description |
|
|
145
145
|
|---|---|---|---|---|
|
|
146
|
-
| POST | `/api/bongos/claims` | `any-builder` | `task_id`, `worktree_name`, `head_sha`, `bind_session`, `enforce_touches` | own work (claim a ready task); Xenos additionally filtered to newcomer_friendly rows inside db.claimTask (returns rank_too_low_for_task 4… |
|
|
146
|
+
| POST | `/api/bongos/claims` | `any-builder` | `task_id`, `worktree_name`, `head_sha`, `bind_session`, `enforce_touches`, `auto_pickup` | own work (claim a ready task); Xenos additionally filtered to newcomer_friendly rows inside db.claimTask (returns rank_too_low_for_task 4… |
|
|
147
147
|
| POST | `/api/bongos/claims/:id/release-on-behalf` | `metic+archon` | `reason` | POST /claims/:id/release-on-behalf — V3.R14 (task 238). |
|
|
148
148
|
| POST | `/api/bongos/claims/:id/resolve` | `any-builder` | `outcome`, `notes_md`, `value_summary`, `verification`, `force`, `committed_files`, `sandbox_review`, `resolver_worktree` | resolve own claim (ship/abandon); ownership checked in db.resolveClaim (NOT_YOUR_CLAIM). |
|
|
149
149
|
| POST | `/api/bongos/claims/batch` | `any-builder` | `task_ids`, `worktree_name`, `bind_session` | Atomic multi-claim. |
|
|
@@ -616,7 +616,7 @@ Base path: `/api/bongos`. Ranks (enforced server-side, [ADR 0016](adr/0016-trust
|
|
|
616
616
|
|---|---|---|---|---|
|
|
617
617
|
| GET | `/api/bongos/project/manage-link` | `archon` | — | GET /project/manage-link — the hub's page for THIS project, where its owner takes it offline or disconnects it (task 1004570). |
|
|
618
618
|
|
|
619
|
-
## `project-settings` (
|
|
619
|
+
## `project-settings` (6)
|
|
620
620
|
|
|
621
621
|
| Method | Path | Rank | Body | Description |
|
|
622
622
|
|---|---|---|---|---|
|
|
@@ -624,6 +624,8 @@ Base path: `/api/bongos`. Ranks (enforced server-side, [ADR 0016](adr/0016-trust
|
|
|
624
624
|
| PATCH | `/api/bongos/project-settings/rot-days` | `metic+archon` | `days` | PATCH /project-settings/rot-days — body { days }. |
|
|
625
625
|
| GET | `/api/bongos/project-settings/ship-mode` | `any-builder` | — | GET /project-settings/ship-mode — the ship mode alone, for the CLI and the AI. |
|
|
626
626
|
| PATCH | `/api/bongos/project-settings/ship-mode` | `metic+archon` | `mode` | PATCH /project-settings/ship-mode — body { mode: 'auto' \| 'manual' }. |
|
|
627
|
+
| GET | `/api/bongos/project-settings/tweak-autopickup` | `any-builder` | — | |
|
|
628
|
+
| PATCH | `/api/bongos/project-settings/tweak-autopickup` | `metic+archon` | `mode`, `cap` | PATCH /project-settings/tweak-autopickup — body { mode?: 'off' \| 'on', cap?: n }. |
|
|
627
629
|
|
|
628
630
|
## `projects` (8)
|
|
629
631
|
|
|
@@ -3049,5 +3049,7 @@ is load-bearing: the script throws rather than guess if it is missing, and
|
|
|
3049
3049
|
landed since 1.21.104 with no explicit bump. run 37941330141. (task 1002620)
|
|
3050
3050
|
1.21.106 — CI auto-patch (publish-on-merge, ADR 0161): carrier for merges
|
|
3051
3051
|
landed since 1.21.105 with no explicit bump. run 37953632231. (task 1002620)
|
|
3052
|
+
1.21.107 — CI auto-patch (publish-on-merge, ADR 0161): carrier for merges
|
|
3053
|
+
landed since 1.21.106 with no explicit bump. run 37957919746. (task 1002620)
|
|
3052
3054
|
---------------------------------------------------------------------------
|
|
3053
3055
|
```
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
-- core_275 a claim can carry the auto_pickup mark
|
|
2
|
+
-- Applied under task 1004677 (BV2.TW19a, ADR 0371 D5/D6).
|
|
3
|
+
--
|
|
4
|
+
-- WHY. The Autobongos tweak lane picks up a submitted page round with nobody at a
|
|
5
|
+
-- terminal, and each pickup costs the project a grade nobody chose to spend. So the
|
|
6
|
+
-- lane claims with a mark, and the SERVER counts marked claims at claim time:
|
|
7
|
+
-- tweak.autopickup_monthly_cap per calendar month, and at most two per round. The
|
|
8
|
+
-- count is read from these rows (the ledger), never from a stored counter.
|
|
9
|
+
--
|
|
10
|
+
-- SHAPE. One nullable boolean. NULL and false both mean "an ordinary claim"; only
|
|
11
|
+
-- true is counted. Nullable with no default, so the column is additive and an
|
|
12
|
+
-- older release that never names it keeps inserting exactly as before.
|
|
13
|
+
--
|
|
14
|
+
-- The partial index serves the two counts (this month's marked claims, and one
|
|
15
|
+
-- round's marked claims), and stays tiny: only marked rows are in it.
|
|
16
|
+
|
|
17
|
+
ALTER TABLE claims ADD COLUMN IF NOT EXISTS auto_pickup boolean;
|
|
18
|
+
|
|
19
|
+
CREATE INDEX IF NOT EXISTS idx_claims_auto_pickup
|
|
20
|
+
ON claims (claimed_at, task_id)
|
|
21
|
+
WHERE auto_pickup IS TRUE;
|
|
22
|
+
|
|
23
|
+
INSERT INTO schema_migrations (version) VALUES ('core_275_claims_auto_pickup')
|
|
24
|
+
ON CONFLICT (version) DO NOTHING;
|
|
@@ -66,6 +66,7 @@ const AREAS = Object.freeze([
|
|
|
66
66
|
today: 'whoever may change the project settings', acts: Object.freeze([
|
|
67
67
|
'PATCH /project-settings/rot-days',
|
|
68
68
|
'PATCH /project-settings/ship-mode',
|
|
69
|
+
'PATCH /project-settings/tweak-autopickup',
|
|
69
70
|
'PATCH /work-categories/:id',
|
|
70
71
|
]) }),
|
|
71
72
|
Object.freeze({ key: 'disputes', name: 'Disputes', gate: 'security.report.adjudicate',
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// modules/lifecycle/autopickup.js — the server's half of tweak auto-pickup
|
|
4
|
+
// (task 1004677 / BV2.TW19a, ADR 0371 D3, D5, D6).
|
|
5
|
+
//
|
|
6
|
+
// The Autobongos tweak lane claims a submitted page round with an `auto_pickup`
|
|
7
|
+
// mark (claims.auto_pickup, migration core_275). The runner is a builder's own
|
|
8
|
+
// process, so the limits on it are NOT left to the runner: claimTask calls
|
|
9
|
+
// autoPickupRefusal inside its transaction and the claim is refused when
|
|
10
|
+
//
|
|
11
|
+
// - the claim is marked but the task is not a page-tweak round (AUTO_PICKUP_NOT_A_TWEAK)
|
|
12
|
+
// - the project has tweak.autopickup off (AUTO_PICKUP_OFF)
|
|
13
|
+
// - this calendar month already holds `cap` marked claims (AUTO_PICKUP_CAP_REACHED)
|
|
14
|
+
// - this round already has two marked claims (AUTO_PICKUP_ROUND_LIMIT)
|
|
15
|
+
//
|
|
16
|
+
// THE LOCK. The count and the claim insert must not interleave with another
|
|
17
|
+
// runner's, or two runners racing for the last slot both read cap-1 and both
|
|
18
|
+
// insert. So the count runs after pg_advisory_xact_lock('page-tweak/autopickup'),
|
|
19
|
+
// one project-wide key, held to the end of claimTask's transaction (the insert
|
|
20
|
+
// commits under it). Only marked claims take the lock; an ordinary claim never
|
|
21
|
+
// waits on it.
|
|
22
|
+
//
|
|
23
|
+
// COUNTED FROM THE LEDGER, never a counter: a stored number drifts the first time
|
|
24
|
+
// a write fails between the claim and the bump. A released claim still counts —
|
|
25
|
+
// the pickup happened and the grade may already have been spent.
|
|
26
|
+
//
|
|
27
|
+
// The mark is a cost brake on a runner the owner chose to run, not a security
|
|
28
|
+
// boundary: a claim without it is an ordinary claim its builder could make by hand.
|
|
29
|
+
|
|
30
|
+
const api = require('../../src/module-api');
|
|
31
|
+
|
|
32
|
+
const PAGE_TWEAK_SOURCE = 'page-tweak';
|
|
33
|
+
const LOCK_KEY = 'page-tweak/autopickup';
|
|
34
|
+
// D6.2: one apply plus one try at the artist's note; a round sent back twice is a
|
|
35
|
+
// disagreement a person should read.
|
|
36
|
+
const MAX_AUTO_APPLIES_PER_ROUND = 2;
|
|
37
|
+
|
|
38
|
+
// The two counts, on any executor (the claim transaction's client, or the pool).
|
|
39
|
+
// Month boundaries are the database's, so every runner and every reader agree.
|
|
40
|
+
const MONTH_COUNT_SQL = `
|
|
41
|
+
SELECT count(*)::int AS n
|
|
42
|
+
FROM claims c JOIN tasks t ON t.id = c.task_id
|
|
43
|
+
WHERE c.auto_pickup IS TRUE
|
|
44
|
+
AND t.source = '${PAGE_TWEAK_SOURCE}'
|
|
45
|
+
AND c.claimed_at >= date_trunc('month', now())`;
|
|
46
|
+
const ROUND_COUNT_SQL = `
|
|
47
|
+
SELECT count(*)::int AS n FROM claims WHERE task_id = $1 AND auto_pickup IS TRUE`;
|
|
48
|
+
|
|
49
|
+
async function countThisMonth(exec = api.pool) {
|
|
50
|
+
const { rows } = await exec.query(MONTH_COUNT_SQL);
|
|
51
|
+
return Number(rows[0] && rows[0].n) || 0;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
async function countForRound(exec, taskId) {
|
|
55
|
+
const { rows } = await exec.query(ROUND_COUNT_SQL, [taskId]);
|
|
56
|
+
return Number(rows[0] && rows[0].n) || 0;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// autoPickupRefusal(client, task, settings) — null when the marked claim may
|
|
60
|
+
// proceed, else the refusal object claimTask throws. `settings` is the resolved
|
|
61
|
+
// { mode, cap }, read BEFORE the transaction opens (the claimPermissionsFor
|
|
62
|
+
// precedent: a settings read is not part of the claim's consistency).
|
|
63
|
+
async function autoPickupRefusal(client, task, settings) {
|
|
64
|
+
if (!task || task.source !== PAGE_TWEAK_SOURCE) {
|
|
65
|
+
return { code: 'AUTO_PICKUP_NOT_A_TWEAK', message: 'Only a page tweak round can be claimed with the auto_pickup mark.' };
|
|
66
|
+
}
|
|
67
|
+
const s = settings || {};
|
|
68
|
+
if (s.mode !== 'on') {
|
|
69
|
+
return { code: 'AUTO_PICKUP_OFF', message: 'Tweak auto-pickup is off for this project, so a submitted page waits for a person.' };
|
|
70
|
+
}
|
|
71
|
+
await client.query('SELECT pg_advisory_xact_lock(hashtext($1))', [LOCK_KEY]);
|
|
72
|
+
const forRound = await countForRound(client, task.id);
|
|
73
|
+
if (forRound >= MAX_AUTO_APPLIES_PER_ROUND) {
|
|
74
|
+
return {
|
|
75
|
+
code: 'AUTO_PICKUP_ROUND_LIMIT', applied: forRound, limit: MAX_AUTO_APPLIES_PER_ROUND,
|
|
76
|
+
message: `This page round was already applied automatically ${forRound} times, so it waits for a person.`,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
const used = await countThisMonth(client);
|
|
80
|
+
if (used >= s.cap) {
|
|
81
|
+
return {
|
|
82
|
+
code: 'AUTO_PICKUP_CAP_REACHED', used, cap: s.cap,
|
|
83
|
+
message: `Auto-pickup has used this month's ${s.cap} rounds, so submitted pages wait for a person until next month.`,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
module.exports = {
|
|
90
|
+
LOCK_KEY,
|
|
91
|
+
MAX_AUTO_APPLIES_PER_ROUND,
|
|
92
|
+
countThisMonth,
|
|
93
|
+
autoPickupRefusal,
|
|
94
|
+
};
|