@bongos/core 1.17.1 → 1.17.3
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 +521 -281
- package/.claude/skills/blocker-review/SKILL.md +1 -1
- package/.claude/skills/builder-claim/SKILL.md +2 -0
- package/.claude/skills/builder-exit/SKILL.md +2 -2
- package/.claude/skills/builder-redteam/SKILL.md +3 -3
- package/.claude/skills/builder-setup/SKILL.md +2 -2
- package/.claude/skills/builder-start/SKILL.md +1 -1
- package/.claude/skills/dev/SKILL.md +1 -1
- package/.claude/skills/idea-triage/SKILL.md +2 -2
- package/.claude/skills/ideate/SKILL.md +1 -1
- package/.claude/skills/merge-mode/SKILL.md +1 -1
- package/.claude/skills/new-project/SKILL.md +3 -0
- package/.claude/skills/paint/SKILL.md +1 -1
- package/GOVERNANCE.md +1 -1
- package/README.md +1 -1
- 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 +4 -2
- package/clients/bongos-client/index.mjs +2 -0
- package/docs/adr/0001-stack-choice-single-vps.md +1 -1
- package/docs/adr/0008-google-chat-oauth-user-auth.md +1 -1
- package/docs/adr/0019-red-team-bounty-payout-table.md +3 -3
- package/docs/adr/0020-security-model-public-stub.md +1 -1
- package/docs/adr/0023-kind-multipliers-and-idea-bonus.md +1 -1
- package/docs/adr/0024-cloneable-repo-local-first-memory.md +1 -1
- package/docs/adr/0026-bfg-memory-hygiene-and-cross-builder-learning.md +4 -4
- package/docs/adr/0027-bfg-session-inefficiency-evaluator.md +3 -3
- package/docs/adr/0030-builders-hall-live-updates.md +1 -1
- package/docs/adr/0031-cloud-dev-environments-for-builders.md +4 -4
- package/docs/adr/0032-discord-mirror-of-gds.md +2 -2
- package/docs/adr/0034-thetes-graduated-newcomer-rank.md +1 -1
- package/docs/adr/0044-mediterranean-palette-replacement.md +1 -1
- package/docs/adr/0044-per-box-live-game-preview.md +1 -1
- package/docs/adr/0054-session-token-reward-cost-plus.md +10 -10
- package/docs/adr/0057-container-cost-ledger.md +3 -3
- package/docs/adr/0062-medusa-instance-model-decoupling.md +4 -4
- package/docs/adr/0065-agpl-nonprofit-ai-first-governance.md +2 -2
- package/docs/adr/0085-remove-default-per-builder-spend-cap.md +1 -1
- package/docs/adr/0086-goal-scoped-work-hierarchy.md +1 -1
- package/docs/adr/0096-require-reward-before-workable.md +9 -9
- package/docs/adr/0097-retroactive-reward-backfill.md +3 -3
- package/docs/adr/0100-two-repo-instance-model.md +1 -1
- package/docs/adr/0101-goal-hierarchy-phase-5-judge-membership-reward.md +3 -3
- package/docs/adr/0103-core-first-extraction-cloud-bongos-trunk.md +3 -3
- package/docs/adr/0107-module-upstreaming-contribution-to-core-catalog.md +1 -1
- package/docs/adr/0120-pay-on-land-and-builder-owned-rebase-gate.md +6 -6
- package/docs/adr/0136-update-channel-subscription-policy.md +51 -0
- package/docs/adr/0137-upstream-publish-policy-manual-owner-gated.md +40 -0
- package/docs/adr/0138-bundled-module-deps-declared-per-module.md +45 -0
- package/docs/adr/README.md +9 -6
- package/docs/api/openapi.json +65 -26
- package/docs/api-reference.md +3 -2
- package/docs/architecture.md +2 -2
- package/docs/branding-contract.md +5 -4
- package/docs/canonical-permissions.md +1 -1
- package/docs/design/vanilla-hall-ui-redesign-scope.md +1 -1
- package/docs/file-map.md +18 -17
- package/docs/handoff-template.md +2 -2
- package/docs/modules-contract.md +6 -1
- package/docs/onboarding/diagrams/README.md +7 -7
- package/docs/onboarding/drachmae-and-karma.md +18 -18
- package/docs/onboarding/primer.md +9 -9
- package/docs/recipes/audit-replay.md +2 -2
- package/docs/recipes/builder-box-lifecycle.md +2 -2
- package/docs/recipes/claude-design-loop.md +1 -1
- package/docs/recipes/ops-gotchas.md +1 -1
- package/docs/recipes/private-npm-distribution.md +17 -0
- package/docs/recipes/staging-environment.md +1 -1
- package/docs/recipes/upgrading-the-core.md +55 -0
- package/docs/research/cursor-competitive-analysis.md +1 -1
- package/docs/research/llm-model-agnostic-and-cheaper-grader.md +1 -1
- package/modules/discord/module.json +2 -1
- package/modules/economy/achievements.js +9 -1
- package/modules/economy/credits.js +10 -1
- package/modules/hall-ui/public/builders.js +137 -620
- package/modules/hall-ui/public/goal-inbox.js +232 -0
- package/modules/hall-ui/public/goals-page.js +4 -1
- package/modules/hall-ui/public/goals.html +8 -0
- package/modules/hall-ui/public/hall-kit.js +474 -0
- package/modules/hall-ui/public/hall-widgets.js +14 -5
- package/modules/hall-ui/public/index.html +3 -0
- package/modules/hall-ui/public/instances-panel.js +24 -3
- package/modules/hall-ui/public/new-project-wizard.js +7 -5
- package/modules/hall-ui/public/style.css +168 -0
- package/modules/hall-ui/public/work.css +194 -0
- package/modules/hall-ui/public/work.html +46 -374
- package/modules/hall-ui/public/work.js +137 -102
- package/modules/lifecycle/criterion-suggest.js +80 -0
- package/modules/lifecycle/db.js +42 -5
- package/modules/lifecycle/routes/goals.js +26 -0
- package/modules/lifecycle/routes/tasks.js +21 -0
- package/modules/provisioning/CLAUDE.md +15 -0
- package/modules/provisioning/migrations/provisioning_001_tables.sql +160 -0
- package/modules/provisioning/migrations/provisioning_002_standalone_shape.sql +11 -0
- package/modules/provisioning/migrations/provisioning_003_github_app_manifest.sql +95 -0
- package/modules/provisioning/module.json +17 -0
- package/modules/provisioning/onboard-plan.js +37 -0
- package/modules/provisioning/provisioning.js +539 -0
- package/modules/provisioning/rate-limit.js +35 -0
- package/modules/provisioning/routes/provisioning.js +607 -0
- package/modules/provisioning/tests/provisioning.mjs +232 -0
- package/modules/provisioning/ui/.gitkeep +0 -0
- package/modules/security/secret-scrub.js +10 -0
- package/package-lock.json +2 -2
- package/package.json +7 -2
- package/scripts/discord/README.md +1 -1
- package/scripts/gds/claim.js +98 -48
- package/scripts/gds/claude-materialize.js +30 -9
- package/scripts/gds/cutover-codemod.js +241 -0
- package/scripts/gds/fitness.js +54 -0
- package/scripts/gds/init.js +59 -3
- package/scripts/gds/lint-infra-exec.js +70 -0
- package/scripts/gds/lint-workflow-exec.js +63 -0
- package/scripts/gds/mirror-lineage-check.js +14 -5
- package/scripts/gds/mirror-redact.js +8 -0
- package/scripts/gds/onboard.js +4 -0
- package/scripts/gds/package-core.js +18 -3
- package/scripts/gds/publish-manifest.js +60 -2
- package/scripts/gds/run-routine.js +51 -13
- package/scripts/gds/run-unit-tests.js +4 -0
- package/scripts/gds/update-channel.js +186 -0
- package/scripts/gds/upgrade.js +116 -9
- package/scripts/hall-preview/README.md +103 -0
- package/scripts/hall-preview/fixtures/access-requests.json +1 -0
- package/scripts/hall-preview/fixtures/achievements.json +76 -0
- package/scripts/hall-preview/fixtures/analytics__builder.json +251 -0
- package/scripts/hall-preview/fixtures/audit-log.json +1 -0
- package/scripts/hall-preview/fixtures/boxes__cost-ledger.json +1 -0
- package/scripts/hall-preview/fixtures/builders__active-claims.json +1 -0
- package/scripts/hall-preview/fixtures/builders__directory.json +81 -0
- package/scripts/hall-preview/fixtures/builders__roster.json +1 -0
- package/scripts/hall-preview/fixtures/goals.json +502 -0
- package/scripts/hall-preview/fixtures/goals__25.json +96 -0
- package/scripts/hall-preview/fixtures/goals__26.json +67 -0
- package/scripts/hall-preview/fixtures/goals__3.json +103 -0
- package/scripts/hall-preview/fixtures/goals__35.json +49 -0
- package/scripts/hall-preview/fixtures/goals__conflicts.json +154 -0
- package/scripts/hall-preview/fixtures/goals__detail.json +96 -0
- package/scripts/hall-preview/fixtures/goals__inbox.json +5 -0
- package/scripts/hall-preview/fixtures/goals__requests.json +3 -0
- package/scripts/hall-preview/fixtures/grades__by-builder.json +1 -0
- package/scripts/hall-preview/fixtures/inbox.json +330 -0
- package/scripts/hall-preview/fixtures/instance.json +124 -0
- package/scripts/hall-preview/fixtures/leaderboard.json +184 -0
- package/scripts/hall-preview/fixtures/me.json +476 -0
- package/scripts/hall-preview/fixtures/me__recent-ships.json +304 -0
- package/scripts/hall-preview/fixtures/override-requests.json +1 -0
- package/scripts/hall-preview/fixtures/provisioning__fleet.json +1 -0
- package/scripts/hall-preview/fixtures/provisioning__fleet__cost-ledger.json +1 -0
- package/scripts/hall-preview/fixtures/provisioning__instances.json +1 -0
- package/scripts/hall-preview/fixtures/public__analytics__ecosystem.json +516 -0
- package/scripts/hall-preview/fixtures/public__bounty-table.json +37 -0
- package/scripts/hall-preview/fixtures/public__cost-summary.json +742 -0
- package/scripts/hall-preview/fixtures/public__estimation-drift.json +41 -0
- package/scripts/hall-preview/fixtures/public__grades.json +50 -0
- package/scripts/hall-preview/fixtures/public__progress.json +124 -0
- package/scripts/hall-preview/fixtures/public__recent-shipped.json +426 -0
- package/scripts/hall-preview/fixtures/public__repo-health.json +160 -0
- package/scripts/hall-preview/fixtures/public__repo-info.json +5 -0
- package/scripts/hall-preview/fixtures/security__docs.json +1 -0
- package/scripts/hall-preview/fixtures/security__reports.json +1 -0
- package/scripts/hall-preview/fixtures/sessions__search.json +1 -0
- package/scripts/hall-preview/fixtures/tasks.json +2420 -0
- package/scripts/hall-preview/fixtures/tasks__claimable.json +2555 -0
- package/scripts/hall-preview/fixtures/tasks__detail.json +111 -0
- package/scripts/hall-preview/fixtures/tasks__peer-votes__feed.json +330 -0
- package/scripts/hall-preview/fixtures/versions.json +89 -0
- package/scripts/hall-preview/refresh-fixtures.js +77 -0
- package/scripts/hall-preview/server.js +178 -0
- package/scripts/migrate.sh +29 -4
- package/src/bongos/auth.js +14 -1
- package/src/bongos/optimizer.js +37 -2
- package/src/bongos/serve-internal.js +10 -1
- package/src/branding.js +1 -0
- package/src/module-api.js +12 -1
- package/src/module-loader/loader.js +36 -4
- package/src/module-loader/manifest-schema.js +16 -1
- package/tests/branding.mjs +11 -0
- package/tests/claim_error_surface.mjs +107 -0
- package/tests/claude_materialize.mjs +20 -0
- package/tests/consumer_layout_boot.mjs +302 -0
- package/tests/criterion_suggest.mjs +106 -0
- package/tests/cutover_codemod.mjs +184 -0
- package/tests/device_flow_start.mjs +25 -2
- package/tests/hook_core_resolve.mjs +125 -0
- package/tests/infra_exec_paths.mjs +104 -0
- package/tests/init.mjs +47 -0
- package/tests/migrate_root_resolution.mjs +97 -0
- package/tests/mirror_lineage_proof.mjs +14 -0
- package/tests/module_loader.mjs +42 -0
- package/tests/module_manifest.mjs +19 -0
- package/tests/onboard.mjs +13 -0
- package/tests/package_core.mjs +8 -0
- package/tests/provisioning_github_app_routes.mjs +15 -0
- package/tests/publish_manifest.mjs +52 -1
- package/tests/run_routine.mjs +26 -1
- package/tests/run_routine_two_root.mjs +77 -0
- package/tests/scrubber_corpus.mjs +17 -0
- package/tests/update_channel.mjs +186 -0
- package/tests/upgrade.mjs +131 -0
- package/tests/workflow_exec_paths.mjs +98 -0
- package/docs/design/container-exterior-tiles.md +0 -49
- package/docs/design/container-exterior.md +0 -81
- package/docs/design/container-interior.md +0 -77
- package/docs/design/world-map-scroll.md +0 -41
- package/docs/recipes/claude-gemini-bongos-doors.md +0 -155
- package/docs/recipes/cloudbongos-staging-gate.md +0 -139
- package/docs/recipes/cloudbongos-standup.md +0 -111
- package/docs/recipes/parallel-load-results-2026-05-30.md +0 -63
- package/docs/recipes/parallel-load-test.md +0 -32
- package/docs/recipes/pixel-art-pipeline.md +0 -411
- package/docs/recipes/staging-data.md +0 -50
- package/migrations/instance/018_pms_v3_planning_seed.sql +0 -131
- package/migrations/instance/080_gds_v4_planning_seed.sql +0 -75
- package/migrations/instance/110_medusa_planning_seed.sql +0 -70
- package/migrations/instance/120_bongos_v1_planning_seed.sql +0 -69
- package/migrations/instance/144_bongos_v1_module_system_criterion.sql +0 -26
- package/migrations/instance/159_bongos_v1_goal_hierarchy_criterion.sql +0 -29
- package/migrations/instance/172_v2_world_planning_seed.sql +0 -163
- package/migrations/instance/173_bongos_v1_c7_core_modularized.sql +0 -33
- package/migrations/instance/182_gdsv4_bongos_consolidation.sql +0 -132
- package/migrations/instance/183_gdsv4_carryover_themed_goals.sql +0 -116
- package/migrations/instance/186_bongos_v1_governance_planning_seed.sql +0 -69
- package/scripts/gds/art-stage.js +0 -152
- package/server.js +0 -212
- package/tests/art_key.mjs +0 -121
- package/tests/day_cycle.mjs +0 -197
- package/tests/snapshot_picker.mjs +0 -233
- package/tests/sprite_facing.mjs +0 -35
- package/tests/terrain_picker.mjs +0 -298
- package/tests/turn_in_place.mjs +0 -280
- package/tests/walkability.mjs +0 -188
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
-- Migration 182 — Consolidate GDS-V4 into BONGOS-V1 + split out the Bongos desktop app
|
|
2
|
-
-- ============================================================================
|
|
3
|
-
-- Archon-directed project cleanup, 2026-07-02 (task 1709, ADR 0103; with Lars).
|
|
4
|
-
--
|
|
5
|
-
-- GDS-V4 and BONGOS-V1 were two parallel internal / Cloud-Bongos versions with
|
|
6
|
-
-- no clean divide. This migration makes BONGOS-V1 the single go-forward internal
|
|
7
|
-
-- (Cloud Bongos platform) version, carries GDS-V4's still-relevant open work
|
|
8
|
-
-- into it, splits the Bongos DESKTOP APP into its own goal, prunes superseded
|
|
9
|
-
-- work, and freezes GDS-V4.
|
|
10
|
-
--
|
|
11
|
-
-- REVERSIBLE by construction: no destructive drops — only status / version_id /
|
|
12
|
-
-- goal_id / one dependency-edge mutations. The exact before-state is snapshotted
|
|
13
|
-
-- in the task-1709 session notes. See ADR 0103 for the full rationale + the
|
|
14
|
-
-- ADR-0095 (grep-over-embeddings) decision that retires the C1 recall arm.
|
|
15
|
-
--
|
|
16
|
-
-- Idempotency: migrate.sh applies each numbered migration once; the goal INSERT
|
|
17
|
-
-- is additionally NOT-EXISTS-guarded so a manual re-run cannot double-create it.
|
|
18
|
-
-- ============================================================================
|
|
19
|
-
|
|
20
|
-
BEGIN;
|
|
21
|
-
|
|
22
|
-
-- 1. Create the "Bongos desktop app" goal under BONGOS-V1 and reparent the app
|
|
23
|
-
-- tasks (mascot/brand, branded download + auto-update, the cloudbongos.com
|
|
24
|
-
-- landing/download page, the feedback-capture app, the absorbed Dev Box
|
|
25
|
-
-- switch). scope_modules stays empty until the code carve (bongos-app/ ->
|
|
26
|
-
-- modules/bongos-app/) creates the module, at which point the goal is scoped
|
|
27
|
-
-- to it. See ADR 0087 (the app absorbs Dev Box).
|
|
28
|
-
DO $$
|
|
29
|
-
DECLARE app_goal_id bigint;
|
|
30
|
-
BEGIN
|
|
31
|
-
SELECT id INTO app_goal_id
|
|
32
|
-
FROM goals
|
|
33
|
-
WHERE version_id = 'BONGOS-V1' AND title = 'Bongos desktop app'
|
|
34
|
-
LIMIT 1;
|
|
35
|
-
|
|
36
|
-
IF app_goal_id IS NULL THEN
|
|
37
|
-
INSERT INTO goals (version_id, title, description, scope_modules, created_by, status)
|
|
38
|
-
VALUES (
|
|
39
|
-
'BONGOS-V1',
|
|
40
|
-
'Bongos desktop app',
|
|
41
|
-
'The Cloud Bongos DESKTOP APP (bongos-app/): a Zoom-style feedback-capture '
|
|
42
|
-
|| 'walkthrough tool that produces one model-agnostic prompt bundle for a coding '
|
|
43
|
-
|| 'agent, and the umbrella app that absorbs the Dev Box switch (ADR 0045/0072/0087). '
|
|
44
|
-
|| 'Distinct from the Cloud Bongos PLATFORM (the GDS engine, modules, grader, hosting). '
|
|
45
|
-
|| 'Covers: mascot/brand (Bongo Buddha), branded download + auto-update, the '
|
|
46
|
-
|| 'cloudbongos.com landing/download page, and the dev-box desktop client. The code '
|
|
47
|
-
|| 'carve bongos-app/ -> modules/bongos-app/ is tracked as a task under this goal.',
|
|
48
|
-
'{}',
|
|
49
|
-
1,
|
|
50
|
-
'open'
|
|
51
|
-
)
|
|
52
|
-
RETURNING id INTO app_goal_id;
|
|
53
|
-
END IF;
|
|
54
|
-
|
|
55
|
-
-- App tasks currently in GDS-V4: rebind version AND attach to the app goal.
|
|
56
|
-
-- 1523 interactive mascot · 1294 devbox-app go-live bump ·
|
|
57
|
-
-- 1463 devbox-app build workflow · 1484 dev-box host-key / app re-pin
|
|
58
|
-
UPDATE tasks
|
|
59
|
-
SET version_id = 'BONGOS-V1', goal_id = app_goal_id, updated_at = now()
|
|
60
|
-
WHERE id IN (1523, 1294, 1463, 1484)
|
|
61
|
-
AND version_id = 'GDS-V4';
|
|
62
|
-
|
|
63
|
-
-- App tasks already in BONGOS-V1: attach to the app goal.
|
|
64
|
-
-- 1311 branded download + auto-update · 1682/1700/1701 Bongo Buddha anim ·
|
|
65
|
-
-- 1702 cloudbongos.com landing/download page
|
|
66
|
-
UPDATE tasks
|
|
67
|
-
SET goal_id = app_goal_id, updated_at = now()
|
|
68
|
-
WHERE id IN (1311, 1682, 1700, 1701, 1702)
|
|
69
|
-
AND version_id = 'BONGOS-V1';
|
|
70
|
-
END $$;
|
|
71
|
-
|
|
72
|
-
-- 2. Abandon 19 superseded tasks:
|
|
73
|
-
-- C1 recall/embeddings arm (939,962,966-971,1221) — retired by ADR 0095's
|
|
74
|
-
-- grep-over-embeddings decision (Anthropic + Sourcegraph removed embedding
|
|
75
|
-
-- indexes; the endorsed path is meaning-in-source, tracked separately).
|
|
76
|
-
-- Old V3.R## grader tasks (201,202,242,292,388,490,492) — superseded by the
|
|
77
|
-
-- shipped 4-worker grader panel + ADR 0089.
|
|
78
|
-
-- T-NNN task-ref migration (753,754,755) — the current hall-link convention
|
|
79
|
-
-- already works and is enforced.
|
|
80
|
-
UPDATE tasks
|
|
81
|
-
SET status = 'abandoned', updated_at = now()
|
|
82
|
-
WHERE id IN (939,962,966,967,968,969,970,971,1221,
|
|
83
|
-
201,202,242,292,388,490,492,
|
|
84
|
-
753,754,755)
|
|
85
|
-
AND version_id = 'GDS-V4'
|
|
86
|
-
AND status IN ('backlog', 'ready');
|
|
87
|
-
|
|
88
|
-
-- 3. Sever the 758 -> 753 dependency edge. 753 (T-NNN ADR) is being abandoned;
|
|
89
|
-
-- 758 ("document the hall as the canonical doc surface") is kept and must not
|
|
90
|
-
-- be left permanently unclaimable (DEPS_NOT_SHIPPED) by a dead dependency.
|
|
91
|
-
-- Delete from both the polymorphic table (the gate read) and the legacy one.
|
|
92
|
-
DELETE FROM dependencies
|
|
93
|
-
WHERE from_kind = 'task' AND from_id = 758 AND to_kind = 'task' AND to_id = 753;
|
|
94
|
-
DELETE FROM task_dependencies
|
|
95
|
-
WHERE task_id = 758 AND depends_on_task_id = 753;
|
|
96
|
-
|
|
97
|
-
-- 4. Move two misfiled game-art tasks to product V2 (they are world art, not
|
|
98
|
-
-- internal-track work): 586 grass_on_sand variety, 587 player_walk family.
|
|
99
|
-
UPDATE tasks
|
|
100
|
-
SET version_id = 'V2', updated_at = now()
|
|
101
|
-
WHERE id IN (586, 587)
|
|
102
|
-
AND version_id = 'GDS-V4';
|
|
103
|
-
|
|
104
|
-
-- 5. Carry every remaining NON-TERMINAL GDS-V4 task (the platform work) forward
|
|
105
|
-
-- to BONGOS-V1. Non-terminal = backlog/ready/completed/blocked. This leaves
|
|
106
|
-
-- the in-flight tail (10 confirmed + 1 active) and terminal history
|
|
107
|
-
-- (shipped/abandoned) attributed to GDS-V4, exactly like a normal
|
|
108
|
-
-- version-close carry-over. Runs AFTER steps 1/2/4 so the app / abandoned /
|
|
109
|
-
-- product tasks are already out of scope; self-correcting for the remainder.
|
|
110
|
-
UPDATE tasks
|
|
111
|
-
SET version_id = 'BONGOS-V1', updated_at = now()
|
|
112
|
-
WHERE version_id = 'GDS-V4'
|
|
113
|
-
AND status IN ('backlog', 'ready', 'completed', 'blocked');
|
|
114
|
-
|
|
115
|
-
-- 6. BONGOS-V1 becomes the single go-forward internal version: rename it off the
|
|
116
|
-
-- misleading "Bongos App" title (the app is now a GOAL inside it, step 1) and
|
|
117
|
-
-- mark it 'building' (it is actively being built).
|
|
118
|
-
UPDATE versions
|
|
119
|
-
SET name = 'Cloud Bongos — platform (V1)', status = 'building'
|
|
120
|
-
WHERE id = 'BONGOS-V1';
|
|
121
|
-
|
|
122
|
-
-- 7. Freeze GDS-V4 — sealed to new planning. Its 11 in-flight tasks land as its
|
|
123
|
-
-- final shipped history; its 358 shipped + 51 abandoned rows stay as the
|
|
124
|
-
-- archive of what GDS-V4 delivered. ('frozen', not 'shipped': GDS-V4 did not
|
|
125
|
-
-- ship — it was absorbed — and 'shipped' would falsely read 100% + could gate
|
|
126
|
-
-- the in-flight tail.)
|
|
127
|
-
UPDATE versions
|
|
128
|
-
SET status = 'frozen'
|
|
129
|
-
WHERE id = 'GDS-V4'
|
|
130
|
-
AND status <> 'shipped';
|
|
131
|
-
|
|
132
|
-
COMMIT;
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
-- Migration 183 — Five themed goals for the GDS-V4 carryover (BONGOS-V1)
|
|
2
|
-
-- ============================================================================
|
|
3
|
-
-- Follow-up to ADR 0103 (migration 182): the ~72 still-relevant GDS-V4 tasks
|
|
4
|
-
-- carried into BONGOS-V1 were left goal-less. This gives the platform debt a
|
|
5
|
-
-- spine — five OUTCOME goals (ADR 0086 goal tier), each with done-when criteria,
|
|
6
|
-
-- and reparents the tasks under them. Evergreen chores + grader/economy/misc +
|
|
7
|
-
-- recent non-debt work are deliberately LEFT goal-less (they are not carryover
|
|
8
|
-
-- outcomes). Owner-directed 2026-07-02 (with Lars).
|
|
9
|
-
--
|
|
10
|
-
-- Goals are Archon-owned (created_by = 1), scope_modules empty (grouping goals,
|
|
11
|
-
-- not scope-walled; tasks attach here via this migration, not the API route).
|
|
12
|
-
-- Criteria start satisfied=false, so each goal stays 'open' until its work lands.
|
|
13
|
-
--
|
|
14
|
-
-- REVERSIBLE: only INSERTs (goals + criteria) and task goal_id UPDATEs. To undo,
|
|
15
|
-
-- NULL the goal_id on the affected tasks and DELETE the 5 goals + their criteria.
|
|
16
|
-
-- Idempotent: goal INSERTs are title-guarded, criteria use ON CONFLICT DO NOTHING,
|
|
17
|
-
-- task UPDATEs only touch still-goal-less rows.
|
|
18
|
-
-- ============================================================================
|
|
19
|
-
|
|
20
|
-
BEGIN;
|
|
21
|
-
|
|
22
|
-
DO $$
|
|
23
|
-
DECLARE gid bigint;
|
|
24
|
-
BEGIN
|
|
25
|
-
-- ---- G1: Build-pipeline integrity --------------------------------------
|
|
26
|
-
SELECT id INTO gid FROM goals WHERE version_id='BONGOS-V1' AND title='Build-pipeline integrity' LIMIT 1;
|
|
27
|
-
IF gid IS NULL THEN
|
|
28
|
-
INSERT INTO goals (version_id, title, description, scope_modules, created_by, status)
|
|
29
|
-
VALUES ('BONGOS-V1', 'Build-pipeline integrity',
|
|
30
|
-
'GDS-V4 carryover (ADR 0103): the system that builds Cloud Bongos never fails silently or carries known integrity holes — ship/merge/deploy, CI, the nightly backup, and the SEC-863 deploy-gate.',
|
|
31
|
-
'{}', 1, 'open')
|
|
32
|
-
RETURNING id INTO gid;
|
|
33
|
-
END IF;
|
|
34
|
-
INSERT INTO done_when_criteria (version_id, criterion_id, criterion_md, goal_id, sort_order) VALUES
|
|
35
|
-
('BONGOS-V1','gcarry-pipe-loud','Every stage of ship->merge->deploy and the nightly DB backup fails LOUDLY (surfaces in CI or journald), never silently.',gid,10),
|
|
36
|
-
('BONGOS-V1','gcarry-pipe-sec863','The SEC-863 deploy-gate has no known bypass: audit range anchored to last-successful-deploy, sub-Metic protected-path claims blocked at claim time, and each protected-path commit tied to a task in the main audit.',gid,20),
|
|
37
|
-
('BONGOS-V1','gcarry-pipe-smoke','A full-stack integration smoke (server + Postgres) runs as a required PR check, and the flaky unit harness is isolated so a green run is trustworthy.',gid,30)
|
|
38
|
-
ON CONFLICT (version_id, criterion_id) DO NOTHING;
|
|
39
|
-
UPDATE tasks SET goal_id=gid, updated_at=now()
|
|
40
|
-
WHERE version_id='BONGOS-V1' AND goal_id IS NULL
|
|
41
|
-
AND id IN (1426,1427,1429,1431,1432,1433,1435,1436,1462,1479,1641,1703,1219,861,862,1140,1437,1440,1461,1434,723);
|
|
42
|
-
|
|
43
|
-
-- ---- G2: Builder experience — hall, dev box, and skills ----------------
|
|
44
|
-
SELECT id INTO gid FROM goals WHERE version_id='BONGOS-V1' AND title='Builder experience — hall, dev box, and skills' LIMIT 1;
|
|
45
|
-
IF gid IS NULL THEN
|
|
46
|
-
INSERT INTO goals (version_id, title, description, scope_modules, created_by, status)
|
|
47
|
-
VALUES ('BONGOS-V1', 'Builder experience — hall, dev box, and skills',
|
|
48
|
-
'GDS-V4 carryover (ADR 0103): everything a builder directly touches — the builders hall UI, the dev box + sandbox, and the day-to-day skills — works without needing Claude for routine actions.',
|
|
49
|
-
'{}', 1, 'open')
|
|
50
|
-
RETURNING id INTO gid;
|
|
51
|
-
END IF;
|
|
52
|
-
INSERT INTO done_when_criteria (version_id, criterion_id, criterion_md, goal_id, sort_order) VALUES
|
|
53
|
-
('BONGOS-V1','gcarry-bx-hall','Core task actions (claim, release, ship-trigger, triage) and a task board work in the builders hall WITHOUT invoking the LLM.',gid,10),
|
|
54
|
-
('BONGOS-V1','gcarry-bx-identity','A builder can view and edit their own profile, see works-completed, and read an efficiency-aware leaderboard.',gid,20),
|
|
55
|
-
('BONGOS-V1','gcarry-bx-onramp','Newcomers never dead-end: auth/re-auth is browser-clickable and self-explanatory, and the dev box + sandbox are discoverable.',gid,30),
|
|
56
|
-
('BONGOS-V1','gcarry-bx-box','A builder dev box + sandbox is robust: uncommitted work is not lost on reclaim, host-keys survive rebuilds, and staging is cross-platform.',gid,40)
|
|
57
|
-
ON CONFLICT (version_id, criterion_id) DO NOTHING;
|
|
58
|
-
UPDATE tasks SET goal_id=gid, updated_at=now()
|
|
59
|
-
WHERE version_id='BONGOS-V1' AND goal_id IS NULL
|
|
60
|
-
AND id IN (758,751,759,424,1466,1467,1468,1469,1471,1473,1474,1475,1476,1481,1482,594,1472,1715,1696,1650,1470,1391,1165,837,843,885,1477,1493,1430,1665);
|
|
61
|
-
|
|
62
|
-
-- ---- G3: Cloud Bongos productization and self-host ---------------------
|
|
63
|
-
SELECT id INTO gid FROM goals WHERE version_id='BONGOS-V1' AND title='Cloud Bongos productization and self-host' LIMIT 1;
|
|
64
|
-
IF gid IS NULL THEN
|
|
65
|
-
INSERT INTO goals (version_id, title, description, scope_modules, created_by, status)
|
|
66
|
-
VALUES ('BONGOS-V1', 'Cloud Bongos productization and self-host',
|
|
67
|
-
'GDS-V4 carryover (ADR 0103): someone other than the owner can run Cloud Bongos — a second instance, a real update channel, a clean vanilla boot, and hosting as a module.',
|
|
68
|
-
'{}', 1, 'open')
|
|
69
|
-
RETURNING id INTO gid;
|
|
70
|
-
END IF;
|
|
71
|
-
INSERT INTO done_when_criteria (version_id, criterion_id, criterion_md, goal_id, sort_order) VALUES
|
|
72
|
-
('BONGOS-V1','gcarry-prod-customer2','A second instance (Mercury) runs live on a pinned Cloud Bongos core, with its own repo and GDS.',gid,10),
|
|
73
|
-
('BONGOS-V1','gcarry-prod-upgrade','bongos upgrade is a real update-consumption channel for a two-repo consumer (not a stub).',gid,20),
|
|
74
|
-
('BONGOS-V1','gcarry-prod-vanilla','A vanilla docker compose up boots clean: no instance/product seed data runs and no host-brand leaks, both gated in CI.',gid,30),
|
|
75
|
-
('BONGOS-V1','gcarry-prod-hosting','Instance hosting (provision, manage, cost read-out) is available as a Cloud Bongos module.',gid,40)
|
|
76
|
-
ON CONFLICT (version_id, criterion_id) DO NOTHING;
|
|
77
|
-
UPDATE tasks SET goal_id=gid, updated_at=now()
|
|
78
|
-
WHERE version_id='BONGOS-V1' AND goal_id IS NULL
|
|
79
|
-
AND id IN (1689,1690,1326,1704,1706,1485,1619,1620,1621,1388,1439);
|
|
80
|
-
|
|
81
|
-
-- ---- G4: Findability — the grep path (ADR 0095) ------------------------
|
|
82
|
-
SELECT id INTO gid FROM goals WHERE version_id='BONGOS-V1' AND title='Findability — the grep path (ADR 0095)' LIMIT 1;
|
|
83
|
-
IF gid IS NULL THEN
|
|
84
|
-
INSERT INTO goals (version_id, title, description, scope_modules, created_by, status)
|
|
85
|
-
VALUES ('BONGOS-V1', 'Findability — the grep path (ADR 0095)',
|
|
86
|
-
'GDS-V4 carryover (ADR 0103 / ADR 0095): a repo agents navigate by literal search, with meaning written into the source rather than an embedding index.',
|
|
87
|
-
'{}', 1, 'open')
|
|
88
|
-
RETURNING id INTO gid;
|
|
89
|
-
END IF;
|
|
90
|
-
INSERT INTO done_when_criteria (version_id, criterion_id, criterion_md, goal_id, sort_order) VALUES
|
|
91
|
-
('BONGOS-V1','gcarry-find-docstrings','The docstring / module-header convention is rolled out across the codebase and guarded by a fitness/density check so it cannot rot.',gid,10),
|
|
92
|
-
('BONGOS-V1','gcarry-find-why','Code rationale (the why) is surfaced forward-facing, and the AST/tree-sitter repo-map upgrade is decided.',gid,20)
|
|
93
|
-
ON CONFLICT (version_id, criterion_id) DO NOTHING;
|
|
94
|
-
UPDATE tasks SET goal_id=gid, updated_at=now()
|
|
95
|
-
WHERE version_id='BONGOS-V1' AND goal_id IS NULL
|
|
96
|
-
AND id IN (1654,1655,1656,1657,1659,848);
|
|
97
|
-
|
|
98
|
-
-- ---- G5: Autonomy groundwork -------------------------------------------
|
|
99
|
-
SELECT id INTO gid FROM goals WHERE version_id='BONGOS-V1' AND title='Autonomy groundwork' LIMIT 1;
|
|
100
|
-
IF gid IS NULL THEN
|
|
101
|
-
INSERT INTO goals (version_id, title, description, scope_modules, created_by, status)
|
|
102
|
-
VALUES ('BONGOS-V1', 'Autonomy groundwork',
|
|
103
|
-
'GDS-V4 carryover (ADR 0103): safe unattended routines — guardrails first, then arm the safe set.',
|
|
104
|
-
'{}', 1, 'open')
|
|
105
|
-
RETURNING id INTO gid;
|
|
106
|
-
END IF;
|
|
107
|
-
INSERT INTO done_when_criteria (version_id, criterion_id, criterion_md, goal_id, sort_order) VALUES
|
|
108
|
-
('BONGOS-V1','gcarry-auto-guardrails','An off-droplet spend ceiling, a scoped file-only automation token, and a hall kill-switch all exist.',gid,10),
|
|
109
|
-
('BONGOS-V1','gcarry-auto-armed','The cloud-routine execution environment is verified and the safe routine set is armed behind the autonomy flag.',gid,20)
|
|
110
|
-
ON CONFLICT (version_id, criterion_id) DO NOTHING;
|
|
111
|
-
UPDATE tasks SET goal_id=gid, updated_at=now()
|
|
112
|
-
WHERE version_id='BONGOS-V1' AND goal_id IS NULL
|
|
113
|
-
AND id IN (1393,1394,1395,1396);
|
|
114
|
-
END $$;
|
|
115
|
-
|
|
116
|
-
COMMIT;
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
-- 186_bongos_v1_governance_planning_seed.sql (migrations/instance/ — OTB scope-truth)
|
|
2
|
-
-- Planning session (2026-07-03): the BONGOS-V1 "Governance — configurable roles &
|
|
3
|
-
-- permissions" goal + its six done-when criteria.
|
|
4
|
-
--
|
|
5
|
-
-- WHY THIS LIVES IN migrations/instance/ (ADR 0105 / selfhost-boot gate):
|
|
6
|
-
-- versions/goals/done_when_criteria are OTB scope-truth, NOT platform-universal
|
|
7
|
-
-- schema. In migrations/ root they would seed a vanilla third-party self-host with
|
|
8
|
-
-- OTB's governance criteria (the selfhost-boot VANILLA assertion: a fresh DB seeds
|
|
9
|
-
-- ZERO scope-truth). Here, migrate.sh applies the file only when the OWNING instance
|
|
10
|
-
-- opts in (GDS_APPLY_INSTANCE_SEEDS=1); a vanilla self-host skips the whole dir.
|
|
11
|
-
--
|
|
12
|
-
-- DR-SAFE: the goal was first created via the API (a runtime row), so a from-scratch
|
|
13
|
-
-- owning-instance replay would have no goal to parent the criteria under. This
|
|
14
|
-
-- migration recreates the goal idempotently (title-guard) so replay stays whole and
|
|
15
|
-
-- so it is a no-op on prod (where goal 30 already exists). Mirrors migration 183.
|
|
16
|
-
--
|
|
17
|
-
-- The 25 tasks (BV1.R90-R114) + dependency graph are seeded by
|
|
18
|
-
-- scripts/gds/seed-governance-tasks.js after this deploys (so the slugs resolve).
|
|
19
|
-
|
|
20
|
-
BEGIN;
|
|
21
|
-
|
|
22
|
-
DO $do$
|
|
23
|
-
DECLARE gid bigint;
|
|
24
|
-
BEGIN
|
|
25
|
-
SELECT id INTO gid FROM goals
|
|
26
|
-
WHERE version_id = 'BONGOS-V1'
|
|
27
|
-
AND title = 'Governance — configurable roles & permissions'
|
|
28
|
-
LIMIT 1;
|
|
29
|
-
|
|
30
|
-
IF gid IS NULL THEN
|
|
31
|
-
INSERT INTO goals (version_id, title, description, scope_modules, created_by, status)
|
|
32
|
-
VALUES (
|
|
33
|
-
'BONGOS-V1',
|
|
34
|
-
'Governance — configurable roles & permissions',
|
|
35
|
-
$desc$A core, Discord-style roles-and-permissions system where PERMISSIONS are the atomic primitive and ranks become seeded roles. Adds first-class principals (machine identities), session-scopes (box tokens), ownership-scoped permissions, and a governance-owned protected-surface registry (policy owns / substrate enforces). Capability lives in core (modules/governance/, default:true); per-project settings split config/governance.json (over neutral) + governance_* DB tables. Ships an Archon-only Governance hall tab (assign + toggle; system permissions locked). Preserves the ADR 0016 trust boundary end-to-end. Protected-scope (kernel/lifecycle) -> Archon-mediated.$desc$,
|
|
36
|
-
'{kernel,lifecycle,hall-ui}',
|
|
37
|
-
1,
|
|
38
|
-
'open'
|
|
39
|
-
)
|
|
40
|
-
RETURNING id INTO gid;
|
|
41
|
-
END IF;
|
|
42
|
-
|
|
43
|
-
INSERT INTO done_when_criteria (version_id, criterion_id, criterion_md, goal_id, sort_order) VALUES
|
|
44
|
-
('BONGOS-V1', 'gov-perms-atom',
|
|
45
|
-
$md$**Permissions become the atom; ranks become seeded roles — with zero day-one behavior change.** Authority stops being a fixed rank threshold and becomes a resolved set of granular permissions. Done when: a code-defined permission catalog exists (each permission flagged `system` or not, since permissions map to real routes and cannot be UI-invented); a per-request, uncached resolver returns a builder's effective permission set as the union of their roles (preserving ADR 0016); four seeded roles (`xenos`/`thetes`/`metic`/`archon`) reproduce today's thresholds exactly; a `requirePermission()` gate exists alongside `requireRank`; and a parity test proves every builder resolves to exactly today's powers (behavior-identical at ship).$md$,
|
|
46
|
-
gid, 20),
|
|
47
|
-
('BONGOS-V1', 'gov-gates-permissioned',
|
|
48
|
-
$md$**Every DB-resolvable authority gate reads permissions, not rank.** Rank stops being special everywhere the server decides access. Done when: the ~60 HTTP route gates migrate `requireRank(...)` -> `requirePermission(...)`; claim eligibility (`xenosClaimAllowed`/`rankAllowsTask`/per-task floor), the page-level gates, and the wandering-prefs clamp are re-expressed as permissions; the ~6 duplicated numeric rank-tier maps collapse into the single resolver; and the `route-rank-check` fitness function is updated to assert permission gates so nothing silently regresses.$md$,
|
|
49
|
-
gid, 21),
|
|
50
|
-
('BONGOS-V1', 'gov-full-model',
|
|
51
|
-
$md$**The complete authority model is represented — not just role -> permission.** The 2026-07-03 authority sweep proved Cloud Bongos authority runs on ~7 mechanisms, not one. Done when: first-class **principals** (machine identities like the BFG memory-writer and the Discord bot, keyed on `system_role`, never UI-grantable) are modeled; **session-scopes** (box-scoped tokens, deny-by-default) are a first-class capability distinct from a builder's roles; **ownership-scoped** permissions ("act on *own* X" — own box/memory/credentials/claim) are expressible; and the **protected-surface registry** (today's `PROTECTED_GLOBS` / `EXPECTED_RANKS`) becomes governance-owned *data* while the out-of-band substrate (git hooks, CI, GitHub branch protection, SSH) stays the *enforcer* — policy owns, substrate enforces.$md$,
|
|
52
|
-
gid, 22),
|
|
53
|
-
('BONGOS-V1', 'gov-core-project-split',
|
|
54
|
-
$md$**Capability lives in core; settings live per project.** The governance engine is portable to any Cloud Bongos instance; each project keeps its own governance data. Done when: `modules/governance/` is a `default:true` core module with its own `governance_*` additive migrations and a resolver exposed through a kernel port; role *templates/defaults* ship as `config/governance.json` resolved over a `config/governance.neutral.json` (the branding pattern); live role/permission/assignment *data* lives in the DB; and a fresh vanilla instance boots with sane neutral defaults and no OTB identity.$md$,
|
|
55
|
-
gid, 23),
|
|
56
|
-
('BONGOS-V1', 'gov-archon-tab',
|
|
57
|
-
$md$**The Archon Governance tab — assign + toggle.** The owner can configure governance from the builders' hall, Discord-style. Done when: an Archon-only Governance tab lets you view/edit the ~12 operational permissions per role, create custom roles, and assign roles to builders; `system` permissions render **locked** (visible but not grantable); and the tab is gated in depth at the page layer (`serve-internal`), the API layer (`governance.manage`), and pinned in `route-rank-check`.$md$,
|
|
58
|
-
gid, 24),
|
|
59
|
-
('BONGOS-V1', 'gov-boundary-proof',
|
|
60
|
-
$md$**The trust boundary provably holds — with a live proof and the docs corrected.** This criterion de-risks the whole goal: no amount of governance configuration can weaken production safety. Done when: an abuse-matrix test proves no configurable role/permission can grant a low-trust builder deploy or protected-path access; a live demonstration creates a custom role granting an operational permission (it works) while a `system` permission stays enforced by substrate; an ADR records the "permissions-as-atom + principals + session-scopes + protected-surface registry, policy-owns/substrate-enforces" decision; and the stale ADR 0043 / canonical-permissions.md branch-protection claims are fixed (GitHub branch protection is now live).$md$,
|
|
61
|
-
gid, 25)
|
|
62
|
-
ON CONFLICT (version_id, criterion_id) DO UPDATE
|
|
63
|
-
SET criterion_md = EXCLUDED.criterion_md,
|
|
64
|
-
goal_id = EXCLUDED.goal_id,
|
|
65
|
-
sort_order = EXCLUDED.sort_order;
|
|
66
|
-
END
|
|
67
|
-
$do$;
|
|
68
|
-
|
|
69
|
-
COMMIT;
|
package/scripts/gds/art-stage.js
DELETED
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// scripts/gds/art-stage.js — after the art pipeline writes modules/art-pipeline/generated/tiles/,
|
|
3
|
-
// rebuild the atlas the game client loads and surface it on the builder's own
|
|
4
|
-
// sandbox live preview (ADR 0044/0052) in ONE command (#1067). Today the loop is
|
|
5
|
-
// generate -> manually rebuild the atlas -> manually restart -> manually refresh;
|
|
6
|
-
// this collapses the last three into one step (and #1065's auto-reload then
|
|
7
|
-
// refreshes the open tab on its own).
|
|
8
|
-
//
|
|
9
|
-
// Internal-track tooling. It does NOT regenerate art (generation costs $ and is a
|
|
10
|
-
// separate, reviewed step), does NOT touch prod, and does NOT commit anything.
|
|
11
|
-
//
|
|
12
|
-
// node scripts/gds/art-stage.js # rebuild atlas + surface on the sandbox
|
|
13
|
-
// node scripts/gds/art-stage.js --no-build # skip the atlas rebuild, just restart + print
|
|
14
|
-
// node scripts/gds/art-stage.js --tiles "a b c" # label the affected tiles explicitly
|
|
15
|
-
//
|
|
16
|
-
// On a BOX the preview serves /workspace (box-game-preview.service), but a Claude
|
|
17
|
-
// session edits a git worktree, so we copy the rebuilt public/assets/tiles into
|
|
18
|
-
// /workspace before restarting (self-contained; does not depend on the #1068 ship
|
|
19
|
-
// gate's worktree sync). It deliberately does NOT write the sandbox-stage REVIEW
|
|
20
|
-
// marker — surfacing art for a look is not the same as recording a ship sign-off.
|
|
21
|
-
|
|
22
|
-
const path = require('node:path');
|
|
23
|
-
const fs = require('node:fs');
|
|
24
|
-
const { execFileSync } = require('node:child_process');
|
|
25
|
-
const sandbox = require('./sandbox-stage');
|
|
26
|
-
|
|
27
|
-
const REPO_ROOT = path.resolve(__dirname, '..', '..');
|
|
28
|
-
const BOX_SERVED_ROOT = '/workspace';
|
|
29
|
-
const PY = process.env.PYTHON || 'python3';
|
|
30
|
-
const HEALTH_TIMEOUT_MS = 90_000;
|
|
31
|
-
const HEALTH_POLL_MS = 2_000;
|
|
32
|
-
|
|
33
|
-
// Rebuild public/assets/tiles + the content-hashed atlas from modules/art-pipeline/generated/tiles/.
|
|
34
|
-
// build_tilesheet.py copies the per-tile PNGs and calls build_atlas at its tail.
|
|
35
|
-
function rebuildAtlas(deps = {}) {
|
|
36
|
-
const run = deps.execFileSync || execFileSync;
|
|
37
|
-
run(PY, [path.join(REPO_ROOT, 'modules/art-pipeline/pipeline/build_tilesheet.py')], { cwd: REPO_ROOT, stdio: 'inherit' });
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// On a box, the preview serves /workspace/public, not the session worktree. Copy
|
|
41
|
-
// the rebuilt tiles tree across so the sandbox shows the new art. No-op when the
|
|
42
|
-
// session checkout IS the served root (running directly in /workspace, or a
|
|
43
|
-
// laptop where the local preview serves the worktree). Best-effort: returns
|
|
44
|
-
// { copied, reason? }.
|
|
45
|
-
function copyAtlasToServed(deps = {}) {
|
|
46
|
-
const f = deps.fs || fs;
|
|
47
|
-
const servedRoot = deps.servedRoot || BOX_SERVED_ROOT;
|
|
48
|
-
const repoRoot = deps.repoRoot || REPO_ROOT;
|
|
49
|
-
if (path.resolve(repoRoot) === path.resolve(servedRoot)) return { copied: false, reason: 'session checkout is the served checkout' };
|
|
50
|
-
const from = path.join(repoRoot, 'public/assets/tiles');
|
|
51
|
-
const to = path.join(servedRoot, 'public/assets/tiles');
|
|
52
|
-
if (!f.existsSync(from) || !f.existsSync(servedRoot)) return { copied: false, reason: 'no served checkout / no tiles to copy' };
|
|
53
|
-
try {
|
|
54
|
-
f.cpSync(from, to, { recursive: true });
|
|
55
|
-
return { copied: true, to };
|
|
56
|
-
} catch (e) {
|
|
57
|
-
return { copied: false, reason: e.message };
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// The tiles this run touched: an explicit --tiles list (the orchestrator knows
|
|
62
|
-
// the family members) or a git diff of public/assets/tiles (standalone runs).
|
|
63
|
-
function affectedTiles(explicit, deps = {}) {
|
|
64
|
-
if (explicit && explicit.trim()) return explicit.trim().split(/\s+/);
|
|
65
|
-
const run = deps.execFileSync || execFileSync;
|
|
66
|
-
try {
|
|
67
|
-
const out = run('git', ['status', '--porcelain', '--', 'public/assets/tiles'], { cwd: deps.repoRoot || REPO_ROOT, encoding: 'utf8' });
|
|
68
|
-
return out.split('\n').map((l) => l.slice(3).trim()).filter(Boolean);
|
|
69
|
-
} catch {
|
|
70
|
-
return [];
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
async function waitHealthy(healthUrl, deps = {}) {
|
|
75
|
-
const fetchImpl = deps.fetchImpl || fetch;
|
|
76
|
-
const deadline = Date.now() + (deps.timeoutMs || HEALTH_TIMEOUT_MS);
|
|
77
|
-
while (Date.now() < deadline) {
|
|
78
|
-
try {
|
|
79
|
-
const res = await fetchImpl(healthUrl, { signal: AbortSignal.timeout(5_000) });
|
|
80
|
-
if (res.status < 500) return true;
|
|
81
|
-
} catch { /* keep polling */ }
|
|
82
|
-
await new Promise((r) => setTimeout(r, deps.pollMs || HEALTH_POLL_MS));
|
|
83
|
-
}
|
|
84
|
-
return false;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
function printSurfacedBlock(url, tiles, log = console.log) {
|
|
88
|
-
const bar = '─'.repeat(64);
|
|
89
|
-
log('');
|
|
90
|
-
log(bar);
|
|
91
|
-
log(' 🎨 NEW ART IS LIVE ON YOUR SANDBOX');
|
|
92
|
-
log('');
|
|
93
|
-
log(` ${url}`);
|
|
94
|
-
log('');
|
|
95
|
-
if (tiles.length) log(` Affected: ${tiles.join(', ')}`);
|
|
96
|
-
log(' Open the link to see it in-game. (With the auto-reload from task 1065,');
|
|
97
|
-
log(' an already-open tab refreshes itself.)');
|
|
98
|
-
log(bar);
|
|
99
|
-
log('');
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
async function main(argv = process.argv.slice(2), deps = {}) {
|
|
103
|
-
const noBuild = argv.includes('--no-build');
|
|
104
|
-
const tilesArg = (() => { const i = argv.indexOf('--tiles'); return i >= 0 ? argv[i + 1] : ''; })();
|
|
105
|
-
const log = deps.log || console.log;
|
|
106
|
-
|
|
107
|
-
if (!noBuild) {
|
|
108
|
-
log('Rebuilding the atlas from modules/art-pipeline/generated/tiles/ ...');
|
|
109
|
-
rebuildAtlas(deps);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
const ctx = (deps.resolvePreviewContext || sandbox.resolvePreviewContext)(deps);
|
|
113
|
-
if (!ctx) {
|
|
114
|
-
log('Atlas rebuilt into public/assets/tiles/. No sandbox here to surface it on');
|
|
115
|
-
log('(not a dev box, and this clone has no local game preview).');
|
|
116
|
-
return { ok: true, surfaced: false, reason: 'no sandbox' };
|
|
117
|
-
}
|
|
118
|
-
if (!ctx.url) {
|
|
119
|
-
log('Atlas rebuilt. This box is on the quick tunnel (no preview hostname) — no sandbox URL to open (ADR 0044).');
|
|
120
|
-
return { ok: true, surfaced: false, reason: 'no preview URL' };
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
if (ctx.kind === 'box') {
|
|
124
|
-
const c = copyAtlasToServed(deps);
|
|
125
|
-
if (c.copied) log(` copied the rebuilt tiles into ${deps.servedRoot || BOX_SERVED_ROOT} so the sandbox serves them`);
|
|
126
|
-
else log(` (atlas copy skipped: ${c.reason})`);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
log(`Restarting the ${ctx.kind} preview to pick up the new atlas...`);
|
|
130
|
-
try {
|
|
131
|
-
ctx.restart(deps);
|
|
132
|
-
} catch (e) {
|
|
133
|
-
log(` could not restart the preview (${e.message}); the atlas is rebuilt — restart manually to see it.`);
|
|
134
|
-
return { ok: false, surfaced: false, reason: e.message };
|
|
135
|
-
}
|
|
136
|
-
const healthy = await waitHealthy(ctx.healthUrl, deps);
|
|
137
|
-
if (!healthy) {
|
|
138
|
-
log(' preview did not come back healthy in time — check its logs; the atlas is rebuilt.');
|
|
139
|
-
return { ok: false, surfaced: false, reason: 'preview unhealthy' };
|
|
140
|
-
}
|
|
141
|
-
printSurfacedBlock(ctx.url, affectedTiles(tilesArg, deps), log);
|
|
142
|
-
return { ok: true, surfaced: true, url: ctx.url };
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
module.exports = { rebuildAtlas, copyAtlasToServed, affectedTiles, waitHealthy, main };
|
|
146
|
-
|
|
147
|
-
if (require.main === module) {
|
|
148
|
-
main().then((r) => process.exit(r && r.ok === false ? 1 : 0)).catch((e) => {
|
|
149
|
-
console.error('art-stage error:', e.message);
|
|
150
|
-
process.exit(1);
|
|
151
|
-
});
|
|
152
|
-
}
|