@bongos/core 1.19.803 → 1.19.805
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 +261 -236
- package/.claude/skills/ask-for-help/SKILL.md +6 -6
- package/.claude/skills/backlog-review/SKILL.md +1 -1
- package/.claude/skills/blocker-review/SKILL.md +7 -7
- package/.claude/skills/blocker-solve/SKILL.md +5 -5
- package/.claude/skills/bug-triage/SKILL.md +7 -7
- package/.claude/skills/builder-claim/SKILL.md +3 -3
- package/.claude/skills/builder-cost/SKILL.md +2 -2
- package/.claude/skills/builder-end/SKILL.md +2 -2
- package/.claude/skills/builder-exit/SKILL.md +7 -7
- package/.claude/skills/builder-key/SKILL.md +2 -2
- package/.claude/skills/builder-reauth/SKILL.md +2 -2
- package/.claude/skills/builder-redteam/SKILL.md +7 -7
- package/.claude/skills/builder-release/SKILL.md +2 -2
- package/.claude/skills/builder-sequence/SKILL.md +1 -1
- package/.claude/skills/builder-setup/SKILL.md +3 -3
- package/.claude/skills/builder-ship/SKILL.md +1 -1
- package/.claude/skills/builder-stage/SKILL.md +1 -1
- package/.claude/skills/builder-start/SKILL.md +1 -1
- package/.claude/skills/fix-task/SKILL.md +4 -4
- package/.claude/skills/goal-create/SKILL.md +18 -18
- package/.claude/skills/goal-review/SKILL.md +7 -7
- package/.claude/skills/grade-audit/SKILL.md +5 -5
- package/.claude/skills/grade-recover/SKILL.md +4 -4
- package/.claude/skills/grader-health/SKILL.md +6 -6
- package/.claude/skills/idea-triage/SKILL.md +14 -14
- package/.claude/skills/merge-mode/SKILL.md +3 -3
- package/.claude/skills/planning-session/SKILL.md +20 -20
- package/.claude/skills/priority-session/SKILL.md +10 -10
- package/.claude/skills/recall/SKILL.md +1 -1
- package/.claude/skills/scan-before-install/SKILL.md +3 -3
- package/.claude/skills/status/SKILL.md +2 -2
- package/.claude/skills/strand-fix/SKILL.md +2 -2
- package/clients/bongos-client/README.md +1 -1
- package/clients/bongos-client/bongos-client.global.js +2 -0
- package/clients/bongos-client/index.cjs +2 -0
- package/clients/bongos-client/index.d.ts +2 -0
- package/clients/bongos-client/index.mjs +2 -0
- package/docs/api/openapi.json +45 -11
- package/docs/api-reference.md +11 -10
- package/docs/module-api-changelog.md +4 -0
- package/modules/builder-settings/profile-nudge-prefs.js +1 -1
- package/modules/builder-settings/render-prefs.js +1 -1
- package/modules/dev-box/app/README.md +1 -1
- package/modules/dev-box/app/src/gds-client.js +11 -9
- package/modules/dev-box/app/src/vendor/bongos-client.cjs +2 -0
- package/modules/dev-box/app/test/unit.mjs +13 -13
- package/modules/dev-box/box-access.js +3 -3
- package/modules/dev-box/box-onboard.js +7 -7
- package/modules/discord/bug-attachments.js +1 -1
- package/modules/economy/cost-classify.js +6 -6
- package/modules/grading/grader-rubric.json +1 -1
- package/modules/grading/grader-score.js +1 -1
- package/modules/hall-ui/module.json +1 -1
- package/modules/hall-ui/public/drachmae.js +3 -3
- package/modules/hall-ui/public/idea.js +1 -1
- package/modules/hall-ui/public/md-reader.js +1 -1
- package/modules/hall-ui/public/people.html +5 -1
- package/modules/hall-ui/public/people.js +44 -5
- package/modules/hall-ui/public/primer.js +4 -4
- package/modules/hall-ui/public/roster.js +1 -1
- package/modules/hall-ui/public/shell.js +1 -1
- package/modules/hall-ui/public/task.js +1 -1
- package/modules/ideas/inbox.js +2 -2
- package/modules/lifecycle/db-analytics.js +1 -1
- package/modules/lifecycle/done-when.js +4 -4
- package/modules/lifecycle/version-close.js +1 -1
- package/modules/memory/learnings.js +2 -2
- package/modules/memory/memory.js +1 -1
- package/modules/onboarding/onboarding.js +1 -1
- package/modules/platform-identity/routes/my-projects.js +1 -1
- package/modules/platform-identity/routes/sso.js +2 -2
- package/modules/public-landing/public/index.html +2 -2
- package/modules/public-landing/public/projects-floor.states.json +1 -1
- package/modules/public-landing/public/projects.html +1 -1
- package/modules/public-landing/public/projects.states.json +1 -1
- package/modules/sessions/db.js +120 -0
- package/modules/sessions/module.json +2 -2
- package/modules/sessions/pollers/session-upload-health.js +111 -0
- package/modules/sessions/pulse.js +2 -2
- package/modules/sessions/routes/sessions.js +46 -0
- package/modules/sessions/upload-health.js +197 -0
- package/modules/status-ui/module.json +1 -1
- package/modules/status-ui/public/explore.js +1 -1
- package/package-lock.json +2 -2
- package/package.json +1 -1
- package/scripts/gds/agent-invoke.js +3 -3
- package/scripts/gds/api.js +4 -4
- package/scripts/gds/api.sh +1 -1
- package/scripts/gds/architect-audit.js +1 -1
- package/scripts/gds/artifact-audit.js +2 -2
- package/scripts/gds/audit-ships.js +2 -2
- package/scripts/gds/backfill-cost.js +1 -1
- package/scripts/gds/backfill-sessions.js +1 -1
- package/scripts/gds/backfill-subagent-rewards.js +1 -1
- package/scripts/gds/backfill-task-rewards.js +2 -2
- package/scripts/gds/box-auth-check.js +1 -1
- package/scripts/gds/box-sync.js +3 -3
- package/scripts/gds/box.js +10 -10
- package/scripts/gds/build-cli-package.js +3 -3
- package/scripts/gds/capture.js +2 -2
- package/scripts/gds/ci-grade.js +1 -1
- package/scripts/gds/claim-recall.js +2 -2
- package/scripts/gds/cli-lib.js +3 -3
- package/scripts/gds/context-pack.js +1 -1
- package/scripts/gds/copy-apply.js +2 -2
- package/scripts/gds/dev-lib.js +2 -2
- package/scripts/gds/fetch-art-key.js +2 -2
- package/scripts/gds/fetch-sound-prefs.js +3 -3
- package/scripts/gds/grade-smoke.js +1 -1
- package/scripts/gds/hooks/pre-push.js +1 -1
- package/scripts/gds/init.js +9 -9
- package/scripts/gds/key-card.js +1 -1
- package/scripts/gds/learning-capture.js +2 -2
- package/scripts/gds/linkify-refs.js +2 -2
- package/scripts/gds/local-preview-lib.js +1 -1
- package/scripts/gds/login.js +11 -10
- package/scripts/gds/main-audit.js +1 -1
- package/scripts/gds/newcomer-floor.config.json +1 -1
- package/scripts/gds/newcomer-floor.js +2 -2
- package/scripts/gds/newcomer-floor.templates.json +2 -2
- package/scripts/gds/onboarding-ship.js +1 -1
- package/scripts/gds/paste-token.js +3 -3
- package/scripts/gds/portability-smoke-memory.sh +5 -5
- package/scripts/gds/prove-strict-versioning.js +2 -2
- package/scripts/gds/provision-net.js +2 -2
- package/scripts/gds/provision-units.js +3 -3
- package/scripts/gds/pulse.js +2 -2
- package/scripts/gds/push-path-brief.js +2 -2
- package/scripts/gds/reauth.js +1 -1
- package/scripts/gds/recall.js +1 -1
- package/scripts/gds/redteam-patrol.js +3 -3
- package/scripts/gds/render-ideas.js +5 -5
- package/scripts/gds/repo-metrics.js +1 -1
- package/scripts/gds/sandbox-stage.js +3 -3
- package/scripts/gds/seed-adopt-tasks.js +3 -3
- package/scripts/gds/seed-board-room-tasks.js +1 -1
- package/scripts/gds/seed-bongos-app-tasks.js +2 -2
- package/scripts/gds/seed-bongos-coreB-tranche1-tasks.js +3 -3
- package/scripts/gds/seed-bongos-coreB-tranche2-tasks.js +4 -4
- package/scripts/gds/seed-bongos-tasks.js +5 -5
- package/scripts/gds/seed-bongos-v1-idea-routing-tasks.js +1 -1
- package/scripts/gds/seed-bongos-v1-seo-tasks.js +1 -1
- package/scripts/gds/seed-bv1-community-tasks.js +1 -1
- package/scripts/gds/seed-bv1-privacy-invites-tasks.js +1 -1
- package/scripts/gds/seed-bv1-profile-page-tasks.js +1 -1
- package/scripts/gds/seed-bv1-profiles-tasks.js +1 -1
- package/scripts/gds/seed-bv1-r01-delta-tasks.js +1 -1
- package/scripts/gds/seed-gds-v4-tasks.js +3 -3
- package/scripts/gds/seed-medusa-tasks.js +1 -1
- package/scripts/gds/seed-productization-tasks.js +1 -1
- package/scripts/gds/seed-project-admin-console-tasks.js +1 -1
- package/scripts/gds/seed-provisioning-tasks.js +2 -2
- package/scripts/gds/seed-strict-versioning-tasks.js +3 -3
- package/scripts/gds/seed-v2-world-tasks.js +2 -2
- package/scripts/gds/seed-verify-criteria.js +1 -1
- package/scripts/gds/session-digest.js +1 -1
- package/scripts/gds/session.js +2 -2
- package/scripts/gds/setup.js +7 -7
- package/scripts/gds/ship-flow.js +3 -3
- package/scripts/gds/ship-grade-steps.js +3 -3
- package/scripts/gds/ship-memory-sync.js +1 -1
- package/scripts/gds/ship-session-upload.js +3 -3
- package/scripts/gds/smoke-batch-claim.sh +10 -10
- package/scripts/gds/smoke-batch-release.sh +14 -14
- package/scripts/gds/smoke-claim-consistency.sh +19 -19
- package/scripts/gds/smoke-dependencies.sh +9 -9
- package/scripts/gds/smoke-write.sh +11 -11
- package/scripts/gds/start.js +1 -1
- package/scripts/gds/status.js +2 -2
- package/scripts/gds/strand-watch.js +1 -1
- package/scripts/gds/triage.js +4 -4
- package/scripts/gds/version-close.js +2 -2
- package/scripts/hall-preview/README.md +1 -1
- package/scripts/hall-preview/server.js +1 -1
- package/src/bongos/auth-admission.js +3 -3
- package/src/bongos/auth-idp.js +2 -2
- package/src/bongos/auth.js +3 -3
- package/src/bongos/db.js +2 -2
- package/src/bongos/llm-cache.js +2 -2
- package/src/bongos/metrics.js +1 -1
- package/src/bongos/middleware/audit.js +3 -3
- package/src/bongos/middleware/rate-limit.js +1 -1
- package/src/bongos/platform-visibility-gate.js +2 -2
- package/src/bongos/routes/_helpers.js +1 -1
- package/src/bongos/routes/audit-log.js +1 -1
- package/src/bongos/routes/auth.js +5 -5
- package/src/bongos/routes/backup.js +1 -1
- package/src/bongos/routes/builders.js +1 -1
- package/src/bongos/routes/instance.js +1 -1
- package/src/bongos/routes/live.js +1 -1
- package/src/bongos/routes/me.js +2 -2
- package/src/bongos/routes/modules.js +2 -2
- package/src/bongos/routes/public.js +1 -1
- package/src/bongos/routes/security.js +4 -4
- package/src/bongos/routes.js +1 -1
- package/src/bongos/serve-internal.js +6 -6
- package/src/branding.js +1 -1
- package/src/module-api.js +1 -1
- package/src/module-seams.js +2 -2
- package/src/platform-server.js +2 -2
- package/tests/api_alias_exceptions.mjs +67 -0
- package/tests/application_echo.mjs +12 -12
- package/tests/artifact_audit.mjs +1 -1
- package/tests/auth_page_gate.mjs +4 -4
- package/tests/auth_web_recovery.mjs +11 -11
- package/tests/bongos_login.mjs +7 -4
- package/tests/box_env.mjs +6 -6
- package/tests/bug_attachments.mjs +1 -1
- package/tests/cli_sessions.mjs +1 -1
- package/tests/dev_lib.mjs +1 -1
- package/tests/discord_bugs.mjs +2 -2
- package/tests/discord_inbound.mjs +2 -2
- package/tests/explore_visible_states.mjs +1 -1
- package/tests/government_page_gates.mjs +1 -1
- package/tests/hall_reference_world.mjs +1 -1
- package/tests/idea_ideate_full.mjs +1 -1
- package/tests/idp_federation.mjs +2 -2
- package/tests/llm-cache.mjs +1 -1
- package/tests/manage_manifest_shared_read.mjs +3 -3
- package/tests/people_directory_clip.mjs +219 -0
- package/tests/planning_session_skill.mjs +1 -1
- package/tests/platform_visibility_gate.mjs +15 -15
- package/tests/profile_route.mjs +37 -26
- package/tests/projects_hub.mjs +2 -2
- package/tests/provision.mjs +2 -2
- package/tests/provision_settings_apply.mjs +4 -4
- package/tests/sandbox_stage.mjs +8 -8
- package/tests/scouting_owner_access_and_reach.mjs +3 -3
- package/tests/session_upload_health.mjs +329 -0
- package/tests/setup_device_flow_fallback.mjs +1 -1
- package/tests/skill_ask_for_help.mjs +3 -3
- package/tests/skill_grade_audit.mjs +2 -2
- package/tests/skill_grader_health.mjs +3 -3
- package/tests/smoke_write_contract.mjs +1 -1
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
# 1. Create 2 disjoint __smoke__ tasks
|
|
10
10
|
# 2. Claim both as the same builder
|
|
11
11
|
# 3. Hit every consumer surface that currently exists:
|
|
12
|
-
# - GET /api/
|
|
13
|
-
# - GET /api/
|
|
12
|
+
# - GET /api/bongos/me (always present)
|
|
13
|
+
# - GET /api/bongos/builders/me (PMS-V2 P6) (capability-gated)
|
|
14
14
|
# The /builder-start and /builder-session CLIs render server data;
|
|
15
15
|
# they do not constitute independent surfaces in the sense of
|
|
16
|
-
# criterion 7 (they consume /api/
|
|
16
|
+
# criterion 7 (they consume /api/bongos/* responses). We assert at the
|
|
17
17
|
# API boundary, which is where the bug class lives.
|
|
18
18
|
# 4. Extract the ordered (task_id) sequence from each surface
|
|
19
19
|
# 5. Assert all surfaces return identical sequences
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
# which surfaces were checked vs skipped.
|
|
25
25
|
#
|
|
26
26
|
# TODO: once PMS-V2 P6 (#48 — /builders web profile) ships, the
|
|
27
|
-
# /api/
|
|
27
|
+
# /api/bongos/builders/me surface will start returning 200 and this smoke
|
|
28
28
|
# will automatically include it. No edits needed here.
|
|
29
29
|
#
|
|
30
30
|
# Usage:
|
|
@@ -101,7 +101,7 @@ print(json.dumps({
|
|
|
101
101
|
}))
|
|
102
102
|
")
|
|
103
103
|
local out
|
|
104
|
-
out=$(call POST /api/
|
|
104
|
+
out=$(call POST /api/bongos/tasks "${body}")
|
|
105
105
|
echo "${out}" | python3 -c "import json,sys; print(json.load(sys.stdin)['task']['id'])"
|
|
106
106
|
}
|
|
107
107
|
|
|
@@ -110,13 +110,13 @@ claim_task() {
|
|
|
110
110
|
local body
|
|
111
111
|
body=$(python3 -c "import json; print(json.dumps({'task_id': ${task_id}, 'worktree_name': '__smoke__'}))")
|
|
112
112
|
local out
|
|
113
|
-
out=$(call POST /api/
|
|
113
|
+
out=$(call POST /api/bongos/claims "${body}")
|
|
114
114
|
echo "${out}" | python3 -c "import json,sys; print(json.load(sys.stdin)['claim']['id'])"
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
release_claim() {
|
|
118
118
|
local claim_id="$1"
|
|
119
|
-
call POST "/api/
|
|
119
|
+
call POST "/api/bongos/claims/${claim_id}/resolve" '{"outcome":"abandoned","notes_md":"smoke cleanup"}' >/dev/null || true
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
echo "=== GDS claim-consistency smoke test ==="
|
|
@@ -168,8 +168,8 @@ checked=0
|
|
|
168
168
|
skipped=0
|
|
169
169
|
fail=0
|
|
170
170
|
|
|
171
|
-
# Surface 1: /api/
|
|
172
|
-
ME_PAYLOAD=$(call GET /api/
|
|
171
|
+
# Surface 1: /api/bongos/me — always present.
|
|
172
|
+
ME_PAYLOAD=$(call GET /api/bongos/me)
|
|
173
173
|
ME_IDS=$(extract_ids "${ME_PAYLOAD}" "[c['task_id'] for c in data.get('active_claims', [])]")
|
|
174
174
|
# Filter to just our 2 smoke task_ids in case the builder has other live claims.
|
|
175
175
|
ME_FILTERED=$(python3 -c "
|
|
@@ -177,19 +177,19 @@ ids = '${ME_IDS}'.split(',') if '${ME_IDS}' else []
|
|
|
177
177
|
keep = [x for x in ids if x in ('${TASK_A}', '${TASK_B}')]
|
|
178
178
|
print(','.join(keep))
|
|
179
179
|
")
|
|
180
|
-
echo "/api/
|
|
180
|
+
echo "/api/bongos/me -> ${ME_FILTERED}"
|
|
181
181
|
if [[ "${ME_FILTERED}" == "${EXPECTED}" ]]; then
|
|
182
|
-
echo " PASS /api/
|
|
182
|
+
echo " PASS /api/bongos/me ordering matches"
|
|
183
183
|
checked=$((checked+1))
|
|
184
184
|
else
|
|
185
|
-
echo " FAIL /api/
|
|
185
|
+
echo " FAIL /api/bongos/me ordering mismatch (expected ${EXPECTED}, got ${ME_FILTERED})"
|
|
186
186
|
fail=1
|
|
187
187
|
fi
|
|
188
188
|
|
|
189
|
-
# Surface 2: /api/
|
|
190
|
-
BUILDERS_ME_CODE=$(probe_status /api/
|
|
189
|
+
# Surface 2: /api/bongos/builders/me — PMS-V2 P6, capability-gated.
|
|
190
|
+
BUILDERS_ME_CODE=$(probe_status /api/bongos/builders/me)
|
|
191
191
|
if [[ "${BUILDERS_ME_CODE}" == "200" ]]; then
|
|
192
|
-
BME_PAYLOAD=$(call GET /api/
|
|
192
|
+
BME_PAYLOAD=$(call GET /api/bongos/builders/me)
|
|
193
193
|
# Try both common shapes: top-level active_claims, or nested under builder/profile.
|
|
194
194
|
BME_IDS=$(extract_ids "${BME_PAYLOAD}" "[c['task_id'] for c in (data.get('active_claims') or data.get('builder', {}).get('active_claims') or data.get('profile', {}).get('active_claims') or [])]")
|
|
195
195
|
BME_FILTERED=$(python3 -c "
|
|
@@ -197,16 +197,16 @@ ids = '${BME_IDS}'.split(',') if '${BME_IDS}' else []
|
|
|
197
197
|
keep = [x for x in ids if x in ('${TASK_A}', '${TASK_B}')]
|
|
198
198
|
print(','.join(keep))
|
|
199
199
|
")
|
|
200
|
-
echo "/api/
|
|
200
|
+
echo "/api/bongos/builders/me -> ${BME_FILTERED}"
|
|
201
201
|
if [[ "${BME_FILTERED}" == "${EXPECTED}" ]]; then
|
|
202
|
-
echo " PASS /api/
|
|
202
|
+
echo " PASS /api/bongos/builders/me ordering matches /api/bongos/me"
|
|
203
203
|
checked=$((checked+1))
|
|
204
204
|
else
|
|
205
|
-
echo " FAIL /api/
|
|
205
|
+
echo " FAIL /api/bongos/builders/me ordering mismatch (expected ${EXPECTED}, got ${BME_FILTERED})"
|
|
206
206
|
fail=1
|
|
207
207
|
fi
|
|
208
208
|
else
|
|
209
|
-
echo "/api/
|
|
209
|
+
echo "/api/bongos/builders/me -> HTTP ${BUILDERS_ME_CODE} (SKIP — PMS-V2 P6 not live yet)"
|
|
210
210
|
skipped=$((skipped+1))
|
|
211
211
|
fi
|
|
212
212
|
|
|
@@ -31,29 +31,29 @@ BASE="${GDS_BASE:-$(gds_api_base)}"
|
|
|
31
31
|
SUFFIX="$(date +%s)"
|
|
32
32
|
|
|
33
33
|
echo "=== 1. Create task B (depends-on target, status=ready) ==="
|
|
34
|
-
B=$(curl -sS -X POST "$BASE/api/
|
|
34
|
+
B=$(curl -sS -X POST "$BASE/api/bongos/tasks" \
|
|
35
35
|
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
|
|
36
36
|
--data "{\"version_id\":\"GDS-V3\",\"title\":\"__smoke__ dep-test B $SUFFIX\",\"description\":\"smoke\",\"status\":\"ready\",\"kind\":\"feature\",\"discipline\":\"engineering\",\"priority\":5,\"touches\":[\"smoke-dep-B-$SUFFIX/\"],\"source\":\"smoke\",\"source_ref\":\"smoke-dep-B-$SUFFIX\"}")
|
|
37
37
|
B_ID=$(echo "$B" | python3 -c "import json,sys; print(json.load(sys.stdin)['task']['id'])")
|
|
38
38
|
echo " B id=$B_ID"
|
|
39
39
|
|
|
40
40
|
echo "=== 2. Create task A (dependent, status=backlog) ==="
|
|
41
|
-
A=$(curl -sS -X POST "$BASE/api/
|
|
41
|
+
A=$(curl -sS -X POST "$BASE/api/bongos/tasks" \
|
|
42
42
|
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
|
|
43
43
|
--data "{\"version_id\":\"GDS-V3\",\"title\":\"__smoke__ dep-test A $SUFFIX\",\"description\":\"smoke\",\"status\":\"backlog\",\"kind\":\"feature\",\"discipline\":\"engineering\",\"priority\":5,\"touches\":[\"smoke-dep-A-$SUFFIX/\"],\"source\":\"smoke\",\"source_ref\":\"smoke-dep-A-$SUFFIX\"}")
|
|
44
44
|
A_ID=$(echo "$A" | python3 -c "import json,sys; print(json.load(sys.stdin)['task']['id'])")
|
|
45
45
|
echo " A id=$A_ID"
|
|
46
46
|
|
|
47
47
|
echo "=== 3. Wire A → depends_on B ==="
|
|
48
|
-
curl -sS -X POST "$BASE/api/
|
|
48
|
+
curl -sS -X POST "$BASE/api/bongos/tasks/$A_ID/dependencies" \
|
|
49
49
|
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
|
|
50
50
|
--data "{\"depends_on_task_id\": $B_ID}" | python3 -m json.tool
|
|
51
51
|
|
|
52
52
|
echo "=== 4. Manually promote A (testing claim-time gate, not auto-promote) ==="
|
|
53
|
-
curl -sS -X POST "$BASE/api/
|
|
53
|
+
curl -sS -X POST "$BASE/api/bongos/tasks/$A_ID/promote" -H "Authorization: Bearer $TOKEN" | python3 -m json.tool
|
|
54
54
|
|
|
55
55
|
echo "=== 5. Attempt claim A — MUST 409 DEPS_NOT_SHIPPED ==="
|
|
56
|
-
CLAIM_RESP=$(curl -sS -X POST "$BASE/api/
|
|
56
|
+
CLAIM_RESP=$(curl -sS -X POST "$BASE/api/bongos/claims" \
|
|
57
57
|
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
|
|
58
58
|
--data "{\"task_id\": $A_ID, \"worktree_name\": \"smoke-$SUFFIX\"}")
|
|
59
59
|
echo "$CLAIM_RESP" | python3 -m json.tool
|
|
@@ -63,14 +63,14 @@ echo "=== 6. Claim + ship B (the dep) ==="
|
|
|
63
63
|
node scripts/gds/claim.js "$B_ID" --worktree "smoke-$SUFFIX-B"
|
|
64
64
|
# Move through completed → confirmed → shipped using direct API calls (skip the
|
|
65
65
|
# scanner/grader by going straight at /resolve + /confirm + /ship)
|
|
66
|
-
curl -sS -X POST "$BASE/api/
|
|
66
|
+
curl -sS -X POST "$BASE/api/bongos/claims/by-task/$B_ID/resolve" \
|
|
67
67
|
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
|
|
68
68
|
--data '{"outcome":"completed","verification":{"passed":true,"smoke_ok":true}}' >/dev/null
|
|
69
|
-
curl -sS -X POST "$BASE/api/
|
|
70
|
-
curl -sS -X POST "$BASE/api/
|
|
69
|
+
curl -sS -X POST "$BASE/api/bongos/tasks/$B_ID/confirm" -H "Authorization: Bearer $TOKEN" >/dev/null
|
|
70
|
+
curl -sS -X POST "$BASE/api/bongos/tasks/$B_ID/ship" -H "Authorization: Bearer $TOKEN" >/dev/null
|
|
71
71
|
|
|
72
72
|
echo "=== 7. Verify A auto-promoted (status should still be 'ready' from manual step 4, or auto-flipped from backlog) ==="
|
|
73
|
-
A_STATUS=$(curl -sS -H "Authorization: Bearer $TOKEN" "$BASE/api/
|
|
73
|
+
A_STATUS=$(curl -sS -H "Authorization: Bearer $TOKEN" "$BASE/api/bongos/tasks/$A_ID" | python3 -c "import json,sys; print(json.load(sys.stdin)['task']['status'])")
|
|
74
74
|
echo " A status: $A_STATUS"
|
|
75
75
|
[ "$A_STATUS" = "ready" ] && echo " PASS" || (echo " FAIL: A not ready"; exit 1)
|
|
76
76
|
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
# Exercises the full claim → ship round-trip against the live API:
|
|
5
5
|
# 1. Read session token from ~/.config/otb/bongos-session.json (or the legacy
|
|
6
6
|
# gds-session.json / pms-session.json names, all still accepted on read)
|
|
7
|
-
# 2. POST /api/
|
|
8
|
-
# 3. POST /api/
|
|
9
|
-
# 4. POST /api/
|
|
7
|
+
# 2. POST /api/bongos/tasks → create a synthetic task titled '__smoke__ <ts>'
|
|
8
|
+
# 3. POST /api/bongos/claims → claim it
|
|
9
|
+
# 4. POST /api/bongos/claims/:id/resolve outcome=shipped
|
|
10
10
|
# 5. Validate: tasks.status flipped to 'shipped'
|
|
11
11
|
# session_logs row exists for this claim
|
|
12
12
|
# public/recent-shipped does NOT contain the smoke title
|
|
@@ -53,7 +53,7 @@ call() {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
snapshot_progress() {
|
|
56
|
-
curl -sS "${API}/api/
|
|
56
|
+
curl -sS "${API}/api/bongos/public/progress" \
|
|
57
57
|
| python3 -c "import json,sys; d=json.load(sys.stdin); print(','.join(f\"{r['version_id']}:{r['shipped_weight']}/{r['total_weight']}\" for r in d['progress']))"
|
|
58
58
|
}
|
|
59
59
|
|
|
@@ -83,7 +83,7 @@ echo "Version: ${VERSION_ID}"
|
|
|
83
83
|
# version-select.js, and node is the interpreter a Windows builder box actually
|
|
84
84
|
# has — the python3 the rest of this file depends on is frequently absent there
|
|
85
85
|
# (it is the Microsoft Store stub), so a python3 step cannot be verified locally.
|
|
86
|
-
GOAL_ID=$(call GET "/api/
|
|
86
|
+
GOAL_ID=$(call GET "/api/bongos/goals?version=${VERSION_ID}" | node -e '
|
|
87
87
|
let s = "";
|
|
88
88
|
process.stdin.on("data", (d) => { s += d; });
|
|
89
89
|
process.stdin.on("end", () => {
|
|
@@ -140,21 +140,21 @@ print(json.dumps({
|
|
|
140
140
|
'source_ref': '${ts}'
|
|
141
141
|
}))
|
|
142
142
|
")
|
|
143
|
-
TASK_JSON=$(call POST /api/
|
|
143
|
+
TASK_JSON=$(call POST /api/bongos/tasks "${CREATE_BODY}")
|
|
144
144
|
TASK_ID=$(echo "${TASK_JSON}" | python3 -c "import json,sys; print(json.load(sys.stdin)['task']['id'])")
|
|
145
145
|
echo "created task #${TASK_ID}"
|
|
146
146
|
|
|
147
147
|
echo
|
|
148
148
|
echo "--- 2. claim task ---"
|
|
149
149
|
CLAIM_BODY=$(python3 -c "import json; print(json.dumps({'task_id': ${TASK_ID}, 'worktree_name': '__smoke__'}))")
|
|
150
|
-
CLAIM_JSON=$(call POST /api/
|
|
150
|
+
CLAIM_JSON=$(call POST /api/bongos/claims "${CLAIM_BODY}")
|
|
151
151
|
CLAIM_ID=$(echo "${CLAIM_JSON}" | python3 -c "import json,sys; print(json.load(sys.stdin)['claim']['id'])")
|
|
152
152
|
echo "claim #${CLAIM_ID}"
|
|
153
153
|
|
|
154
154
|
echo
|
|
155
155
|
echo "--- 3. resolve claim shipped (verification.passed=true → lands at completed; grade gates confirm) ---"
|
|
156
156
|
RESOLVE_BODY='{"outcome":"shipped","notes_md":"smoke-test","value_summary":"smoke-test","verification":{"passed":true,"scanner_clean":true,"smoke_clean":true}}'
|
|
157
|
-
RESOLVE_JSON=$(call POST "/api/
|
|
157
|
+
RESOLVE_JSON=$(call POST "/api/bongos/claims/${CLAIM_ID}/resolve" "${RESOLVE_BODY}")
|
|
158
158
|
echo "${RESOLVE_JSON}"
|
|
159
159
|
|
|
160
160
|
echo
|
|
@@ -162,7 +162,7 @@ echo "--- 4. validate ---"
|
|
|
162
162
|
fail=0
|
|
163
163
|
|
|
164
164
|
# 4a. recent-shipped does NOT contain the smoke title
|
|
165
|
-
RECENT=$(curl -sS "${API}/api/
|
|
165
|
+
RECENT=$(curl -sS "${API}/api/bongos/public/recent-shipped")
|
|
166
166
|
if echo "${RECENT}" | python3 -c "
|
|
167
167
|
import json, sys
|
|
168
168
|
data = json.load(sys.stdin)
|
|
@@ -196,7 +196,7 @@ fi
|
|
|
196
196
|
# (Pre-#209 this asserted 'confirmed', which has been failing on every run
|
|
197
197
|
# since the grader gate landed — fixed in #468.) The task should never reach
|
|
198
198
|
# 'shipped' (that needs a merge). credits_reward=0, so no credit_log row.
|
|
199
|
-
TASK_AFTER=$(call GET "/api/
|
|
199
|
+
TASK_AFTER=$(call GET "/api/bongos/tasks/${TASK_ID}")
|
|
200
200
|
STATUS_AFTER=$(echo "${TASK_AFTER}" | python3 -c "import json,sys; print(json.load(sys.stdin)['task']['status'])")
|
|
201
201
|
if [[ "${STATUS_AFTER}" == "completed" ]]; then
|
|
202
202
|
echo "PASS task.status = completed (resolve landed it at completed; grade gates confirm — V3.R18 #209)"
|
|
@@ -249,7 +249,7 @@ cleanup_throwaway_task() {
|
|
|
249
249
|
out=$(curl -sS -X POST \
|
|
250
250
|
-H "Authorization: Bearer ${TOKEN}" -H "Content-Type: application/json" \
|
|
251
251
|
-d "${reason}" -w "\n%{http_code}" \
|
|
252
|
-
"${API}/api/
|
|
252
|
+
"${API}/api/bongos/tasks/${TASK_ID}/abandon") || true
|
|
253
253
|
code="${out##*$'\n'}"
|
|
254
254
|
case "${code}" in
|
|
255
255
|
2*) echo "PASS cleaned up throwaway task #${TASK_ID} (abandoned)" ;;
|
package/scripts/gds/start.js
CHANGED
|
@@ -732,7 +732,7 @@ async function main() {
|
|
|
732
732
|
const rawClaimable = r.data.claimable || [];
|
|
733
733
|
|
|
734
734
|
// Discipline routing (V3.R81 / #299). preferred_disciplines lives on the
|
|
735
|
-
// builder row (migration 027), surfaced via /api/
|
|
735
|
+
// builder row (migration 027), surfaced via /api/bongos/me.
|
|
736
736
|
const preferred = (me.ok && Array.isArray(me.data?.builder?.preferred_disciplines))
|
|
737
737
|
? me.data.builder.preferred_disciplines
|
|
738
738
|
: [];
|
package/scripts/gds/status.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// ~10-step prose archaeology (grep seed file → eyeball "Gates R55–R63" →
|
|
6
6
|
// re-query each task) that motivated the task. Reads the structured
|
|
7
7
|
// criterion↔task link (task_criteria, migration 055) via the public endpoint
|
|
8
|
-
// GET /api/
|
|
8
|
+
// GET /api/bongos/versions/:id/progress.
|
|
9
9
|
//
|
|
10
10
|
// Usage:
|
|
11
11
|
// node scripts/gds/status.js # all criteria, default version
|
|
@@ -59,7 +59,7 @@ function parseArgs(argv) {
|
|
|
59
59
|
async function fetchProgress(version) {
|
|
60
60
|
let res;
|
|
61
61
|
try {
|
|
62
|
-
res = await fetch(`${API_BASE}/api/
|
|
62
|
+
res = await fetch(`${API_BASE}/api/bongos/versions/${encodeURIComponent(version)}/progress`, {
|
|
63
63
|
headers: { 'User-Agent': require('../../src/branding').userAgent() },
|
|
64
64
|
});
|
|
65
65
|
} catch (err) {
|
|
@@ -145,7 +145,7 @@ async function check({ nowMs = Date.now(), timeoutMs = DEFAULT_TIMEOUT_MS, confi
|
|
|
145
145
|
let pages;
|
|
146
146
|
try {
|
|
147
147
|
pages = await Promise.all(WATCHED.map(async (status) => {
|
|
148
|
-
const res = await withTimeout(call('GET', `/api/
|
|
148
|
+
const res = await withTimeout(call('GET', `/api/bongos/tasks?status=${status}&limit=${PAGE_LIMIT}`), status);
|
|
149
149
|
const body = res && (res.data || res);
|
|
150
150
|
const tasks = body && Array.isArray(body.tasks) ? body.tasks : null;
|
|
151
151
|
if (!tasks) throw new Error(`unexpected shape from /tasks?status=${status}`);
|
package/scripts/gds/triage.js
CHANGED
|
@@ -158,7 +158,7 @@ async function listOpenIdeas() {
|
|
|
158
158
|
// GET /inbox in routes/inbox.js only returns open ideas regardless of
|
|
159
159
|
// query — but the explicit param is forward-safe.
|
|
160
160
|
if (!r.ok) {
|
|
161
|
-
throw new Error(`GET /api/
|
|
161
|
+
throw new Error(`GET /api/bongos/inbox failed: ${r.status} ${JSON.stringify(r.data)}`);
|
|
162
162
|
}
|
|
163
163
|
return r.data?.ideas ?? [];
|
|
164
164
|
}
|
|
@@ -167,7 +167,7 @@ async function patchIdea(id, patch) {
|
|
|
167
167
|
const api = await cliClient();
|
|
168
168
|
const r = await api.inbox.patchInboxId({ id, body: patch });
|
|
169
169
|
if (!r.ok) {
|
|
170
|
-
throw new Error(`PATCH /api/
|
|
170
|
+
throw new Error(`PATCH /api/bongos/inbox/${id} failed: ${r.status} ${JSON.stringify(r.data)}`);
|
|
171
171
|
}
|
|
172
172
|
return r.data?.idea;
|
|
173
173
|
}
|
|
@@ -254,7 +254,7 @@ function applyGoalAnswer(defaultGoalId, rawAnswer) {
|
|
|
254
254
|
}
|
|
255
255
|
|
|
256
256
|
async function createTask({ versionId, title, description, priority, sourceRef, goalId = null }) {
|
|
257
|
-
// (The old note here said POST /api/
|
|
257
|
+
// (The old note here said POST /api/bongos/tasks does not accept 'kind'. That is
|
|
258
258
|
// no longer true — routes/tasks.js takes it, and the hall promote path already
|
|
259
259
|
// sends it. Left un-sent from THIS path deliberately: changing what kind a
|
|
260
260
|
// triaged promotion lands with is a behaviour change task R13 was not asked to
|
|
@@ -284,7 +284,7 @@ async function createTask({ versionId, title, description, priority, sourceRef,
|
|
|
284
284
|
const api = await cliClient();
|
|
285
285
|
const r = await api.tasks.postTasks({ body });
|
|
286
286
|
if (!r.ok) {
|
|
287
|
-
throw new Error(`POST /api/
|
|
287
|
+
throw new Error(`POST /api/bongos/tasks failed: ${r.status} ${JSON.stringify(r.data)}`);
|
|
288
288
|
}
|
|
289
289
|
return r.data?.task;
|
|
290
290
|
}
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
//
|
|
6
6
|
// What it does:
|
|
7
7
|
// 1. Verifies the version is ready to close (calls
|
|
8
|
-
// GET /api/
|
|
9
|
-
// 2. Lists shipped tasks for the version (GET /api/
|
|
8
|
+
// GET /api/bongos/versions/close-suggestions and checks the gate).
|
|
9
|
+
// 2. Lists shipped tasks for the version (GET /api/bongos/tasks) and drafts a
|
|
10
10
|
// <scope>-shipped.md archive grouped by kind/bucket from value_summary.
|
|
11
11
|
// 3. Identifies carry-over candidates (backlog + ready) and drafts a
|
|
12
12
|
// next-version scope stub (e.g. limitations/pms-v3.md) with a
|
|
@@ -4,7 +4,7 @@ The dev-box sandbox previews the **game only** — `/builders` 404s there (idea
|
|
|
4
4
|
hall-ui changes are reviewed here: a DB-less fixture server that serves the **real**
|
|
5
5
|
`modules/hall-ui/public` files through the **real** serving seams (boot-time `?v=`
|
|
6
6
|
content-hash stamping, `{{token}}` replacement, `window.__BRANDING__`/`__MODULES__`
|
|
7
|
-
injection, theme markup), answering every `/api/
|
|
7
|
+
injection, theme markup), answering every `/api/bongos|bongos/*` read from checked-in
|
|
8
8
|
fixtures. Proven recipe from tasks 1723/1742, checked in by task 2167.
|
|
9
9
|
|
|
10
10
|
## Quickstart
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// so hall-ui changes are reviewed HERE: a tiny express app that serves the real
|
|
6
6
|
// modules/hall-ui/public files through the REAL serving seams (boot-time ?v=
|
|
7
7
|
// stamping, {{token}} replacement, __BRANDING__/__MODULES__ injection, theme
|
|
8
|
-
// markup) with the /api/
|
|
8
|
+
// markup) with the /api/bongos|bongos reads answered from checked-in fixtures.
|
|
9
9
|
// Boots DB-less (pg pools connect lazily). Proven recipe from tasks 1723/1742,
|
|
10
10
|
// finally checked in.
|
|
11
11
|
//
|
|
@@ -62,7 +62,7 @@ async function reportMembershipCheckIn({ githubId, githubLogin, displayName, ava
|
|
|
62
62
|
if (!idp) return;
|
|
63
63
|
const kind = membershipKind({ githubLogin });
|
|
64
64
|
try {
|
|
65
|
-
await fetch(`${idp.origin}/api/
|
|
65
|
+
await fetch(`${idp.origin}/api/bongos/sso/membership/check-in`, {
|
|
66
66
|
method: 'POST',
|
|
67
67
|
headers: { 'Content-Type': 'application/json', Accept: 'application/json', 'User-Agent': userAgent() },
|
|
68
68
|
body: JSON.stringify({
|
|
@@ -159,7 +159,7 @@ async function reportActivityRollup({ builderId, githubId = null }) {
|
|
|
159
159
|
if (!/^\d+$/.test(String(ghId ?? ''))) return;
|
|
160
160
|
const shipped = await pool.query('SELECT count(*)::int AS n FROM tasks WHERE shipped_by = $1', [builderId]);
|
|
161
161
|
const recentShips = await recentShipsForRollup(builderId);
|
|
162
|
-
await fetch(`${idp.origin}/api/
|
|
162
|
+
await fetch(`${idp.origin}/api/bongos/sso/activity/rollup`, {
|
|
163
163
|
method: 'POST',
|
|
164
164
|
headers: { 'Content-Type': 'application/json', Accept: 'application/json', 'User-Agent': userAgent() },
|
|
165
165
|
body: JSON.stringify({
|
|
@@ -434,7 +434,7 @@ async function readApplicantProfileFromHub(githubId) {
|
|
|
434
434
|
const idp = loadIdpConfig();
|
|
435
435
|
if (!idp || githubId == null) return null;
|
|
436
436
|
try {
|
|
437
|
-
const r = await fetch(`${idp.origin}/api/
|
|
437
|
+
const r = await fetch(`${idp.origin}/api/bongos/sso/applicant-profile`, {
|
|
438
438
|
method: 'POST',
|
|
439
439
|
headers: { 'Content-Type': 'application/json', Accept: 'application/json', 'User-Agent': userAgent() },
|
|
440
440
|
signal: AbortSignal.timeout(APPLICANT_PROFILE_TIMEOUT_MS),
|
package/src/bongos/auth-idp.js
CHANGED
|
@@ -31,7 +31,7 @@ const { loadIdpConfig } = require('./auth-config.js');
|
|
|
31
31
|
const { newSessionToken } = require('./auth-github.js');
|
|
32
32
|
|
|
33
33
|
function idpAuthorizeUrl(origin, clientId, state, redirectUri) {
|
|
34
|
-
const u = new URL(`${String(origin).replace(/\/+$/, '')}/api/
|
|
34
|
+
const u = new URL(`${String(origin).replace(/\/+$/, '')}/api/bongos/sso/authorize`);
|
|
35
35
|
u.searchParams.set('client_id', clientId);
|
|
36
36
|
u.searchParams.set('redirect_uri', redirectUri);
|
|
37
37
|
u.searchParams.set('state', state);
|
|
@@ -48,7 +48,7 @@ function buildIdpAuthorizeUrl(state, redirectUri) {
|
|
|
48
48
|
// with the instance's client_id + client_secret; the hub returns IDENTITY ONLY
|
|
49
49
|
// (github_id, github_login, display_name, avatar_url) — never a rank (ADR 0141 §2).
|
|
50
50
|
async function exchangeIdpCode({ code, redirectUri, idp }) {
|
|
51
|
-
const res = await fetch(`${idp.origin}/api/
|
|
51
|
+
const res = await fetch(`${idp.origin}/api/bongos/sso/token`, {
|
|
52
52
|
method: 'POST',
|
|
53
53
|
headers: {
|
|
54
54
|
'Content-Type': 'application/json',
|
package/src/bongos/auth.js
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
// Two flows that produce the same `builder_sessions` row:
|
|
4
4
|
//
|
|
5
5
|
// - Device Flow (CLI):
|
|
6
|
-
// 1. POST /api/
|
|
6
|
+
// 1. POST /api/bongos/auth/device/start
|
|
7
7
|
// → { user_code, verification_uri, device_code, interval, expires_in }
|
|
8
8
|
// The CLI shows user_code to the user and asks them to open
|
|
9
9
|
// verification_uri in a browser.
|
|
10
|
-
// 2. CLI polls POST /api/
|
|
10
|
+
// 2. CLI polls POST /api/bongos/auth/device/poll { device_code }
|
|
11
11
|
// → 'pending' | 'slow_down' | 'expired' | 'denied' |
|
|
12
12
|
// { token, builder: {...} }
|
|
13
13
|
//
|
|
@@ -364,7 +364,7 @@ async function requireBuilder(req, res, next) {
|
|
|
364
364
|
// and also falls back to Referer, so this is belt-and-braces for navigations
|
|
365
365
|
// where Referer may be stripped. Returns '' if the host can't be determined.
|
|
366
366
|
function signInWithReturn(req) {
|
|
367
|
-
const base = '/api/
|
|
367
|
+
const base = '/api/bongos/auth/web/start';
|
|
368
368
|
const proto = req.headers['x-forwarded-proto'] || (req.secure ? 'https' : 'http');
|
|
369
369
|
const host = req.headers['x-forwarded-host'] || req.headers['host'];
|
|
370
370
|
if (!host) return base;
|
package/src/bongos/db.js
CHANGED
|
@@ -737,7 +737,7 @@ async function revokeSession(token) {
|
|
|
737
737
|
|
|
738
738
|
// revokeSessionById — V3.R38 / #259. Kill ONE session by primary key. Returns
|
|
739
739
|
// the number of rows revoked (0 if id didn't exist or was already revoked, 1
|
|
740
|
-
// otherwise). Used by POST /api/
|
|
740
|
+
// otherwise). Used by POST /api/bongos/auth/revoke (Archon-only).
|
|
741
741
|
|
|
742
742
|
async function revokeSessionById(sessionId) {
|
|
743
743
|
const { rowCount } = await pool.query(
|
|
@@ -751,7 +751,7 @@ async function revokeSessionById(sessionId) {
|
|
|
751
751
|
|
|
752
752
|
// revokeAllSessionsForBuilder — V3.R38 / #259. Kill EVERY non-revoked session
|
|
753
753
|
// for a single builder. Returns the count of sessions revoked. Used by:
|
|
754
|
-
// * POST /api/
|
|
754
|
+
// * POST /api/bongos/auth/revoke-all (Archon-only direct call)
|
|
755
755
|
// * setBuilderRank when newRank < oldRank (rank-change-near-instant per C7)
|
|
756
756
|
|
|
757
757
|
async function revokeAllSessionsForBuilder(builderId) {
|
package/src/bongos/llm-cache.js
CHANGED
|
@@ -151,7 +151,7 @@ async function lookup(cacheKey, { tokensSavedEst = 0 } = {}) {
|
|
|
151
151
|
// must never take down the thing it accelerates.
|
|
152
152
|
if (_apiCall) {
|
|
153
153
|
try {
|
|
154
|
-
const r = await _apiCall('POST', '/api/
|
|
154
|
+
const r = await _apiCall('POST', '/api/bongos/llm-cache/lookup',
|
|
155
155
|
{ cache_key: cacheKey, tokens_saved_est: est }, { allowUnauthenticated: true });
|
|
156
156
|
if (r && r.ok && r.data && r.data.hit) return r.data.result || null;
|
|
157
157
|
} catch (_) { /* network/auth error → miss */ }
|
|
@@ -185,7 +185,7 @@ async function store(spec, { resultStdout, resultCostUsd = 0 } = {}) {
|
|
|
185
185
|
// cost server-side; best-effort: any error → no-store (never throws).
|
|
186
186
|
if (_apiCall) {
|
|
187
187
|
try {
|
|
188
|
-
const r = await _apiCall('POST', '/api/
|
|
188
|
+
const r = await _apiCall('POST', '/api/bongos/llm-cache/store',
|
|
189
189
|
{ spec, result_stdout: resultStdout, result_cost_usd: Number(resultCostUsd) || 0 },
|
|
190
190
|
{ allowUnauthenticated: true });
|
|
191
191
|
return !!(r && r.ok && r.data && r.data.stored);
|
package/src/bongos/metrics.js
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
// - process/runtime: uptime, RSS, heap, CPU (counter), event-loop lag, build_info
|
|
15
15
|
// - HTTP (from httpMiddleware): gds_http_requests_total{method,route,status} +
|
|
16
16
|
// gds_http_request_duration_seconds histogram — route normalized to a
|
|
17
|
-
// low-cardinality template so /api/
|
|
17
|
+
// low-cardinality template so /api/bongos/tasks/1380 and /…/1381 share a series.
|
|
18
18
|
// Gives error-rate + 4xx/5xx per route. 401/403 also bump gds_auth_failures_total.
|
|
19
19
|
// - DB gauges (collected at scrape, read-only — never instruments the gate-floor
|
|
20
20
|
// ship pipeline): tasks-by-status, claims (all-time + active), builders-by-rank,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// src/bongos/middleware/audit.js — append-only audit log for authenticated writes
|
|
2
2
|
// (V3.R35 / #256).
|
|
3
3
|
//
|
|
4
|
-
// Wire-up: mounted INSIDE the /api/
|
|
4
|
+
// Wire-up: mounted INSIDE the /api/bongos sub-router by routes.js, AFTER the JSON
|
|
5
5
|
// body parser and AFTER each route's auth middleware has run (the middleware
|
|
6
6
|
// fires on res 'finish', so by then auth either populated req.builder or sent
|
|
7
7
|
// a 401 — both cases are handled below).
|
|
8
8
|
//
|
|
9
9
|
// What it captures:
|
|
10
|
-
// - Every authenticated POST/PATCH/PUT/DELETE that the /api/
|
|
10
|
+
// - Every authenticated POST/PATCH/PUT/DELETE that the /api/bongos router
|
|
11
11
|
// served. Reads (GET) are explicitly skipped — they're high-volume and
|
|
12
12
|
// low-signal for forensics.
|
|
13
13
|
// - The redacted request body, the response status the client actually saw,
|
|
@@ -161,7 +161,7 @@ function clientIp(req) {
|
|
|
161
161
|
// (e.g. 404 from the router), fall back to req.path.
|
|
162
162
|
function routePattern(req) {
|
|
163
163
|
if (req.route && req.route.path) {
|
|
164
|
-
// baseUrl carries '/api/
|
|
164
|
+
// baseUrl carries '/api/bongos' plus any sub-router prefix; combining them
|
|
165
165
|
// yields the full pattern. trim trailing slash for tidiness.
|
|
166
166
|
const base = (req.baseUrl || '').replace(/\/+$/, '');
|
|
167
167
|
const tail = req.route.path === '/' ? '' : req.route.path;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/bongos/middleware/rate-limit.js — V3.R34 (#255).
|
|
2
2
|
//
|
|
3
3
|
// Five sliding-window in-memory limiters. The first two are the GLOBAL pair and
|
|
4
|
-
// protect write methods on /api/
|
|
4
|
+
// protect write methods on /api/bongos/* only — read methods (GET, HEAD, OPTIONS)
|
|
5
5
|
// bypass them entirely; #3, #4 and #5 are mounted per-surface to close exactly that
|
|
6
6
|
// gap where an unauthenticated READ is itself the abuse.
|
|
7
7
|
//
|
|
@@ -127,7 +127,7 @@ function isGated() { return mode() === GATED; }
|
|
|
127
127
|
|
|
128
128
|
// Express routes case-insensitively and tolerates one trailing slash, so the
|
|
129
129
|
// exempt test must see the path the way the router will — otherwise a probe
|
|
130
|
-
// spelled `/HEALTHZ` or `/api/
|
|
130
|
+
// spelled `/HEALTHZ` or `/api/bongos/instance/` is refused while the router would
|
|
131
131
|
// have served it. Mismatches still fail CLOSED; this only keeps the list honest.
|
|
132
132
|
function normalizePath(p) {
|
|
133
133
|
let s = String(p || '').toLowerCase();
|
|
@@ -160,7 +160,7 @@ function productName() {
|
|
|
160
160
|
// subdomain, a dev port, or plain http would otherwise be dropped at the default
|
|
161
161
|
// page. Only a GET/HEAD path is safe to come back to; anything else returns to '/'.
|
|
162
162
|
function signInHref(req) {
|
|
163
|
-
const base = '/api/
|
|
163
|
+
const base = '/api/bongos/auth/web/start';
|
|
164
164
|
const back = (req.method === 'GET' || req.method === 'HEAD') ? relativeReturn(req.originalUrl) : null;
|
|
165
165
|
return back ? `${base}?return=${encodeURIComponent(back)}` : base;
|
|
166
166
|
}
|
|
@@ -409,7 +409,7 @@ function hardenRouterStack(router, seen = new Set()) {
|
|
|
409
409
|
// Read-only, no-auth, no-secret routes, so a static '*' is safe; the caller
|
|
410
410
|
// mounts it scoped to a `/public…` prefix (passed as `scope` for documentation
|
|
411
411
|
// + signature parity) so it can't leak onto the authenticated routes on the same
|
|
412
|
-
// /api/
|
|
412
|
+
// /api/bongos base. Behavior is BYTE-IDENTICAL to the two copy-pasted blocks it
|
|
413
413
|
// replaces (routes/analytics.js + routes/public.js): sets
|
|
414
414
|
// Access-Control-Allow-Origin:*, and answers an OPTIONS preflight with
|
|
415
415
|
// Allow-Methods 'GET, OPTIONS' + Allow-Headers 'Content-Type' and a 204.
|
|
@@ -14,7 +14,7 @@ const VALID_METHODS = new Set(['POST', 'PATCH', 'PUT', 'DELETE']);
|
|
|
14
14
|
module.exports = function buildAuditLogRouter() {
|
|
15
15
|
const router = express.Router();
|
|
16
16
|
|
|
17
|
-
// GET /api/
|
|
17
|
+
// GET /api/bongos/audit-log?limit=&offset=&builder_id=&method=
|
|
18
18
|
//
|
|
19
19
|
// Paginated, newest-first. Clamps:
|
|
20
20
|
// limit → 1..500, default 100
|
|
@@ -92,7 +92,7 @@ function renderAuthErrorPage(heading, detail, opts = {}) {
|
|
|
92
92
|
catch { return AUTH_ERROR_FALLBACK; }
|
|
93
93
|
})();
|
|
94
94
|
const subtitle = opts.subtitle || copy.subtitle;
|
|
95
|
-
const cta = opts.cta || { href: opts.startHref || '/api/
|
|
95
|
+
const cta = opts.cta || { href: opts.startHref || '/api/bongos/auth/web/start', label: copy.ctaLabel };
|
|
96
96
|
const note = opts.note || "If this keeps happening, the GitHub OAuth app's authorized callback URL may be misconfigured. See docs/recipes/ops-gotchas.md (GitHub OAuth section).";
|
|
97
97
|
// The instance name in the tab title comes from the branding pack, never a
|
|
98
98
|
// hardcoded host brand — a non-OTB instance sees its own name (ADR 0062 §3).
|
|
@@ -165,7 +165,7 @@ function renderAccessPendingPage(login, startHref) {
|
|
|
165
165
|
</header>
|
|
166
166
|
<main>
|
|
167
167
|
<section class="scroll">
|
|
168
|
-
<div class="landing" id="pending" data-login="${safeLogin}" data-start="${escapeHtml(startHref || '/api/
|
|
168
|
+
<div class="landing" id="pending" data-login="${safeLogin}" data-start="${escapeHtml(startHref || '/api/bongos/auth/web/start')}">
|
|
169
169
|
<p>We're checking your access now. You'll be signed in automatically as soon as it clears — no need to refresh.</p>
|
|
170
170
|
<p class="landing__note" id="pending-note">Checking…</p>
|
|
171
171
|
</div>
|
|
@@ -178,7 +178,7 @@ function renderAccessPendingPage(login, startHref) {
|
|
|
178
178
|
var login = el ? el.getAttribute('data-login') : '';
|
|
179
179
|
/* server-built from the still-valid handshake cookies (task 1003234): the
|
|
180
180
|
fresh sign-in keeps the wizard return + repo scope a founder started with */
|
|
181
|
-
var start = (el && el.getAttribute('data-start')) || '/api/
|
|
181
|
+
var start = (el && el.getAttribute('data-start')) || '/api/bongos/auth/web/start';
|
|
182
182
|
var EVERY_MS = 3000;
|
|
183
183
|
var GIVE_UP_MS = 5 * 60 * 1000;
|
|
184
184
|
var started = Date.now();
|
|
@@ -190,7 +190,7 @@ function renderAccessPendingPage(login, startHref) {
|
|
|
190
190
|
note.textContent = 'Still waiting on approval. You can leave this page open, or try signing in again later.';
|
|
191
191
|
return;
|
|
192
192
|
}
|
|
193
|
-
fetch('/api/
|
|
193
|
+
fetch('/api/bongos/auth/web/admission-status?login=' + encodeURIComponent(login), { credentials: 'omit' })
|
|
194
194
|
.then(function (r) { return r.ok ? r.json() : null; })
|
|
195
195
|
.then(function (j) {
|
|
196
196
|
if (j && j.admitted) { land(); return; }
|
|
@@ -350,7 +350,7 @@ function recoveryStartHref(req) {
|
|
|
350
350
|
if (returnTo) params.set('return', returnTo);
|
|
351
351
|
if (parseCookie(req, REPOS_COOKIE) === '1') params.set('repos', '1');
|
|
352
352
|
const q = params.toString();
|
|
353
|
-
return '/api/
|
|
353
|
+
return '/api/bongos/auth/web/start' + (q ? '?' + q : '');
|
|
354
354
|
}
|
|
355
355
|
|
|
356
356
|
// The canonical sign-in origin, read from the instance branding pack (oauthOrigin,
|
|
@@ -153,7 +153,7 @@ module.exports = function buildBackupRouter() {
|
|
|
153
153
|
|
|
154
154
|
res.status(202).json({
|
|
155
155
|
ok: true,
|
|
156
|
-
message: 'Backup started — poll GET /api/
|
|
156
|
+
message: 'Backup started — poll GET /api/bongos/backup/status to see the new dump land (usually < 30 s).',
|
|
157
157
|
started_at: startedAt,
|
|
158
158
|
});
|
|
159
159
|
}));
|
|
@@ -456,7 +456,7 @@ module.exports = function buildBuildersRouter() {
|
|
|
456
456
|
// Public read (no auth). Spec says the hall renders other builders'
|
|
457
457
|
// checklists read-only — a builder's onboarding progress is roster-visible
|
|
458
458
|
// signal, same posture as rank or drachmae shown on the leaderboard. The
|
|
459
|
-
// builder's own row is also surfaced inside /api/
|
|
459
|
+
// builder's own row is also surfaced inside /api/bongos/me; this endpoint is
|
|
460
460
|
// what the hall hits for the CURRENT viewer AND for any other builder
|
|
461
461
|
// whose card is rendered.
|
|
462
462
|
//
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// src/bongos/routes/instance.js — GET /api/
|
|
1
|
+
// src/bongos/routes/instance.js — GET /api/bongos/instance (V4.R82, task 1249, ADR 0062 / Cloud Bongos C8).
|
|
2
2
|
//
|
|
3
3
|
// The instance manifest: one public, pre-auth, read-only descriptor that a CLI
|
|
4
4
|
// (`bongos login <url>`) fetches to configure ITSELF — the conda
|