@bongos/core 1.19.1073 → 1.19.1075
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 +404 -549
- package/.claude/skills/feedback/SKILL.md +2 -2
- package/bin/bongos.js +1 -3
- package/clients/bongos-client/README.md +1 -1
- package/clients/bongos-client/bongos-client.global.js +4 -60
- package/clients/bongos-client/index.cjs +4 -60
- package/clients/bongos-client/index.d.ts +5 -90
- package/clients/bongos-client/index.mjs +4 -60
- package/config/branding.neutral.json +1 -5
- package/config/modules.neutral.json +2 -3
- package/config/scheduled-routines.json +0 -2
- package/docs/adr/0145-free-hosted-project-tier-isolation-and-domain-separation.md +1 -0
- package/docs/adr/0285-a-shared-box-holds-about-twelve-projects-per-gb-and-memory-is-the-wall.md +1 -0
- package/docs/adr/0323-hosting-is-three-shapes-and-we-are-not-the-landlord.md +1 -1
- package/docs/adr/0327-a-cloud-host-runs-on-the-owners-account-and-the-key-is-borrowed.md +1 -1
- package/docs/adr/0341-the-page-is-the-unit-of-tweak-mode.md +2 -0
- package/docs/adr/0345-we-host-every-projects-hall-and-its-app-deploys-where-the-owner-chooses.md +94 -0
- package/docs/adr/README.md +1 -0
- package/docs/api/openapi.json +175 -1665
- package/docs/api-reference.md +9 -41
- package/docs/architecture.md +16 -1
- package/docs/branding-contract.md +0 -3
- package/docs/copy-inventory.md +454 -479
- package/docs/copy-registry.json +746 -978
- package/docs/file-map.md +5 -34
- package/docs/module-api-changelog.md +4 -0
- package/docs/modules-contract.md +13 -1
- package/docs/onboarding/diagrams/04-architecture.mmd +11 -22
- package/docs/onboarding/diagrams/README.md +3 -3
- package/docs/onboarding/diagrams/assertions.json +2 -22
- package/docs/onboarding/primer.md +9 -28
- package/docs/page-inventory.json +4 -1
- package/docs/page-readings.json +1032 -1077
- package/docs/recipes/render-pilot.md +29 -10
- package/migrations/core_257_module_store_registry.sql +87 -0
- package/migrations/core_258_drop_dev_box_tables.sql +55 -0
- package/modules/agents/module.json +1 -0
- package/modules/autonomy/module.json +1 -0
- package/modules/builder-settings/module.json +1 -0
- package/modules/builder-settings/render-prefs.js +4 -5
- package/modules/copy-desk/docx.js +78 -5
- package/modules/copy-desk/module.json +1 -0
- package/modules/copy-desk/routes/copy-desk.js +10 -10
- package/modules/copy-desk/tests/copy_docx.mjs +107 -1
- package/modules/copy-desk/tests/fixtures/word-docx.mjs +30 -0
- package/modules/discord/module.json +1 -0
- package/modules/discord/ship-broadcast.js +3 -3
- package/modules/economy/credits.js +2 -2
- package/modules/economy/module.json +1 -0
- package/modules/economy/routes/credits.js +1 -2
- package/modules/government/catalog.js +13 -17
- package/modules/government/migrations/government_019_retire_box_permissions.sql +33 -0
- package/modules/government/module.json +1 -0
- package/modules/government/protected-surfaces.json +3 -11
- package/modules/government/resolver.js +3 -46
- package/modules/government/routes/government.js +0 -2
- package/modules/government/session-scopes.js +43 -83
- package/modules/government/session-scopes.json +8 -18
- package/modules/grading/module.json +1 -0
- package/modules/hall-ui/module.json +1 -0
- package/modules/hall-ui/public/board-lib.js +2 -2
- package/modules/hall-ui/public/builders.js +29 -40
- package/modules/hall-ui/public/collab.html +1 -1
- package/modules/hall-ui/public/collab.js +1 -1
- package/modules/hall-ui/public/diagrams.html +3 -3
- package/modules/hall-ui/public/dom-utils.js +1 -1
- package/modules/hall-ui/public/gate.js +2 -2
- package/modules/hall-ui/public/gate.states.json +1 -1
- package/modules/hall-ui/public/hall-render.js +43 -79
- package/modules/hall-ui/public/index.html +5 -1
- package/modules/hall-ui/public/modules.js +1 -0
- package/modules/hall-ui/public/oversight.css +5 -5
- package/modules/hall-ui/public/palette.js +0 -11
- package/modules/hall-ui/public/primer.js +1 -1
- package/modules/hall-ui/public/sessions.html +1 -1
- package/modules/hall-ui/public/settings-sessions.js +1 -1
- package/modules/hall-ui/public/settings.css +0 -1
- package/modules/hall-ui/public/settings.html +4 -33
- package/modules/hall-ui/public/settings.js +3 -33
- package/modules/hall-ui/public/settings.states.json +2 -2
- package/modules/hall-ui/public/studio.html +1 -1
- package/modules/hall-ui/public/style.css +10 -13
- package/modules/hall-ui/public/task.html +4 -1
- package/modules/hall-ui/public/task.js +36 -1
- package/modules/hall-ui/public/tweak-editor-lib.js +18 -1
- package/modules/hall-ui/public/tweak-editor.css +16 -0
- package/modules/hall-ui/public/tweak-editor.html +26 -3
- package/modules/hall-ui/public/tweak-editor.js +32 -1
- package/modules/hall-ui/public/work.js +1 -1
- package/modules/hall-ui/records/tweak-editor.md +1 -0
- package/modules/ideas/module.json +1 -0
- package/modules/ideas/projection.js +1 -1
- package/modules/lifecycle/db-claim-reads.js +1 -58
- package/modules/lifecycle/db-ship.js +4 -9
- package/modules/lifecycle/db.js +0 -4
- package/modules/lifecycle/github-push.js +12 -14
- package/modules/lifecycle/kickoff-checklist.js +0 -4
- package/modules/lifecycle/lifecycle.js +0 -8
- package/modules/lifecycle/module.json +1 -0
- package/modules/lifecycle/publish-reconciler.js +10 -10
- package/modules/lifecycle/routes/tasks.js +13 -15
- package/modules/lifecycle/ship-card.js +1 -1
- package/modules/lifecycle/task-visuals.js +2 -2
- package/modules/memory/module.json +1 -0
- package/modules/memory/routes/memory.js +2 -2
- package/modules/npm-release/module.json +1 -0
- package/modules/onboarding/module.json +1 -0
- package/modules/onboarding/onboarding-state.js +17 -36
- package/modules/onboarding/routes/access-requests.js +3 -3
- package/modules/platform-identity/module.json +1 -0
- package/modules/platform-identity/platform-identity.js +13 -5
- package/modules/platform-identity/routes/sso.js +5 -4
- package/modules/platform-identity/tests/platform-identity.mjs +17 -3
- package/modules/provisioning/capacity.js +1 -1
- package/modules/provisioning/module.json +1 -0
- package/modules/provisioning/provisioning.js +6 -5
- package/modules/provisioning/routes/provisioning.js +4 -4
- package/modules/provisioning/starter-bundles.js +5 -25
- package/modules/public-landing/module.json +1 -0
- package/modules/public-landing/public/assets/cosmos.css +1 -1
- package/modules/public-landing/public/contact.html +1 -1
- package/modules/public-landing/public/privacy.html +1 -1
- package/modules/public-landing/public/projects.html +101 -32
- package/modules/public-landing/public/projects.probes.json +2 -2
- package/modules/public-landing/public/projects.states.json +4 -3
- package/modules/public-landing/public/terms.html +1 -1
- package/modules/security/module.json +1 -0
- package/modules/sessions/db.js +1 -1
- package/modules/sessions/module.json +1 -0
- package/modules/specialities/module.json +1 -0
- package/modules/status-ui/module.json +1 -0
- package/modules/ui-design/module.json +1 -0
- package/package-lock.json +2 -2
- package/package.json +1 -1
- package/release-notes.json +84 -0
- package/scripts/gds/artifact-format.js +203 -0
- package/scripts/gds/artifact-staleness.js +2 -2
- package/scripts/gds/audit-authorship.sh +1 -13
- package/scripts/gds/backfill-task-rewards.js +5 -5
- package/scripts/gds/claim.js +0 -15
- package/scripts/gds/claude-materialize.js +2 -2
- package/scripts/gds/cli-lib.js +15 -15
- package/scripts/gds/codemod-rename-src-gds.js +1 -1
- package/scripts/gds/context-pack.js +5 -7
- package/scripts/gds/diagram-facts.js +12 -23
- package/scripts/gds/do-api.js +13 -80
- package/scripts/gds/doc-cli-guard.js +2 -0
- package/scripts/gds/doctor.js +4 -4
- package/scripts/gds/feedback-latest.js +139 -9
- package/scripts/gds/fitness-checks-identity.js +2 -7
- package/scripts/gds/fitness-checks-packaging.js +4 -4
- package/scripts/gds/fitness-checks-write-validation.js +4 -0
- package/scripts/gds/fitness-ratchets.js +5 -5
- package/scripts/gds/fitness.js +10 -10
- package/scripts/gds/gen-api-client.js +4 -4
- package/scripts/gds/gen-api-docs.js +1 -1
- package/scripts/gds/gen-diagrams.js +49 -71
- package/scripts/gds/gen-repo-map.js +13 -14
- package/scripts/gds/gen-session-index.js +8 -8
- package/scripts/gds/http-api-client.js +12 -19
- package/scripts/gds/init.js +1 -1
- package/scripts/gds/leak-scan-allowlist.js +1 -1
- package/scripts/gds/lint-infra-exec.js +1 -1
- package/scripts/gds/local-preview-lib.js +8 -39
- package/scripts/gds/local-preview.js +2 -15
- package/scripts/gds/migration-namespace.js +3 -3
- package/scripts/gds/module-artifact.js +212 -0
- package/scripts/gds/module.js +95 -6
- package/scripts/gds/package-core.js +5 -116
- package/scripts/gds/plain-cards.js +1 -1
- package/scripts/gds/provision-config.js +2 -2
- package/scripts/gds/provision-net.js +2 -3
- package/scripts/gds/provision.js +9 -9
- package/scripts/gds/publish-manifest.js +1 -2
- package/scripts/gds/push-path-brief.js +10 -10
- package/scripts/gds/regen-instance-docs.js +1 -1
- package/scripts/gds/rename-history-check.js +1 -1
- package/scripts/gds/run-unit-tests.js +2 -16
- package/scripts/gds/sandbox-stage.js +39 -341
- package/scripts/gds/session-digest-build.js +2 -2
- package/scripts/gds/ship-deploy-target.js +13 -13
- package/scripts/gds/ship-flow.js +7 -7
- package/scripts/gds/ship-land.js +9 -10
- package/scripts/gds/ship-merge.js +4 -4
- package/scripts/gds/ship-preflight-steps.js +4 -4
- package/scripts/gds/ship-regen.js +15 -49
- package/scripts/gds/ship.js +13 -33
- package/scripts/gds/skill-preflight.js +9 -8
- package/scripts/gds/start.js +0 -15
- package/scripts/hall-preview/README.md +5 -5
- package/scripts/hall-preview/server.js +6 -6
- package/scripts/render-diagrams.sh +1 -1
- package/src/bongos/api-errors.js +1 -1
- package/src/bongos/api-prefix.js +4 -4
- package/src/bongos/auth-github.js +2 -3
- package/src/bongos/auth.js +51 -126
- package/src/bongos/db-kernel.js +2 -3
- package/src/bongos/db.js +5 -28
- package/src/bongos/module-scope-map.js +14 -29
- package/src/bongos/module-store.js +141 -0
- package/src/bongos/platform-visibility-gate.js +1 -1
- package/src/bongos/route-rank-check.js +3 -16
- package/src/bongos/routes/auth.js +0 -116
- package/src/bongos/routes/builders.js +5 -15
- package/src/bongos/routes/instance.js +8 -14
- package/src/bongos/routes/me.js +7 -23
- package/src/bongos/routes/modules.js +83 -0
- package/src/bongos/routes/security.js +3 -3
- package/src/bongos/routes.js +7 -2
- package/src/bongos/serve-internal.js +5 -6
- package/src/bongos-downloads.js +1 -6
- package/src/branding.js +2 -2
- package/src/build-info.js +4 -6
- package/src/instance-config.js +2 -2
- package/src/module-api.js +13 -6
- package/src/module-loader/catalog.js +3 -0
- package/src/module-loader/loader.js +4 -4
- package/src/module-loader/manifest-schema.js +16 -8
- package/src/module-seams.js +2 -3
- package/src/modules.js +42 -14
- package/tests/agents_spend_guard.mjs +1 -1
- package/tests/api_alias_caller_ratchet.mjs +1 -1
- package/tests/api_alias_exceptions.mjs +1 -1
- package/tests/api_client.mjs +1 -16
- package/tests/api_path_404.mjs +1 -1
- package/tests/auth_page_gate.mjs +10 -10
- package/tests/backfill_task_rewards.mjs +1 -1
- package/tests/canonical_profile_url.mjs +1 -3
- package/tests/claim_action.mjs +4 -1
- package/tests/claim_from_task_and_home.mjs +127 -0
- package/tests/{box_ship_permissions.mjs → cli_allowlist_permissions.mjs} +5 -5
- package/tests/cli_sessions.mjs +1 -1
- package/tests/consumer_layout_boot.mjs +2 -0
- package/tests/context_pack.mjs +13 -13
- package/tests/copy_desk_page_docx.mjs +33 -2
- package/tests/copy_inventory.mjs +7 -7
- package/tests/core_upgrade_runner.mjs +6 -6
- package/tests/credit_grant.mjs +2 -2
- package/tests/criterion_suggest.mjs +1 -1
- package/tests/deploy_divergence_line.mjs +11 -11
- package/tests/design_tokens_sync.mjs +3 -2
- package/tests/diagram_facts_offset.mjs +1 -1
- package/tests/do_api.mjs +106 -0
- package/tests/feedback_latest.mjs +122 -0
- package/tests/fitness.mjs +44 -42
- package/tests/fitness_ratchets.mjs +2 -2
- package/tests/gate_approvals.mjs +0 -1
- package/tests/github_push_land_proof.mjs +1 -1
- package/tests/go_live.mjs +3 -3
- package/tests/goal_advisory.mjs +3 -3
- package/tests/goal_suggest.mjs +3 -3
- package/tests/government_abuse_matrix.mjs +21 -19
- package/tests/government_ownership_scope.mjs +33 -35
- package/tests/government_parity.mjs +2 -2
- package/tests/government_protected_surfaces.mjs +56 -37
- package/tests/government_require_permission.mjs +3 -3
- package/tests/government_seed.mjs +37 -4
- package/tests/government_session_scope.mjs +92 -366
- package/tests/hall_audit.mjs +1 -1
- package/tests/hall_error_envelope.mjs +4 -0
- package/tests/hall_landing_boot.mjs +4 -1
- package/tests/hall_palette.mjs +1 -16
- package/tests/hall_record_world.mjs +6 -0
- package/tests/hall_tweak_editor.mjs +52 -1
- package/tests/helpers.mjs +1 -1
- package/tests/host_topology_skips.mjs +3 -4
- package/tests/html_comment_nesting.mjs +137 -0
- package/tests/infra_exec_paths.mjs +9 -10
- package/tests/init.mjs +4 -5
- package/tests/instance_manifest.mjs +18 -25
- package/tests/kickoff_checklist.mjs +1 -1
- package/tests/lib_sh_resolution.mjs +0 -221
- package/tests/local_preview.mjs +0 -12
- package/tests/migration_namespace.mjs +6 -6
- package/tests/module-scope-map.mjs +9 -9
- package/tests/module_api.mjs +2 -2
- package/tests/module_catalog.mjs +1 -1
- package/tests/module_cli.mjs +20 -20
- package/tests/module_contributions.mjs +6 -6
- package/tests/module_loader.mjs +6 -6
- package/tests/module_manifest.mjs +26 -17
- package/tests/module_route_rank.mjs +2 -2
- package/tests/module_store_publish.mjs +307 -0
- package/tests/module_store_publish_route.mjs +121 -0
- package/tests/module_store_registry_migration.mjs +70 -0
- package/tests/modules.mjs +56 -26
- package/tests/modules_route_wiring.mjs +1 -1
- package/tests/onboarding_route_signals.mjs +21 -31
- package/tests/onboarding_state.mjs +35 -49
- package/tests/paste_token_session_store.mjs +1 -1
- package/tests/permission_path.mjs +0 -3
- package/tests/platform_boot.mjs +1 -2
- package/tests/platform_visibility_gate.mjs +1 -1
- package/tests/profile_route.mjs +1 -6
- package/tests/project_modules_ui.mjs +17 -17
- package/tests/projects_hub.mjs +5 -5
- package/tests/projects_hub_app_step.mjs +138 -0
- package/tests/projects_hub_module_picker.mjs +77 -76
- package/tests/projects_hub_pre_uat.mjs +4 -5
- package/tests/provision.mjs +7 -7
- package/tests/provisioning_capacity.mjs +1 -1
- package/tests/provisioning_recommendations.mjs +2 -1
- package/tests/provisioning_starter_bundles.mjs +0 -22
- package/tests/publish_branch_route.mjs +11 -19
- package/tests/publish_manifest.mjs +2 -3
- package/tests/publish_reconciler.mjs +8 -8
- package/tests/push_path_brief.mjs +10 -9
- package/tests/rank_tier_single_source.mjs +1 -13
- package/tests/regrade_eligibility.mjs +1 -1
- package/tests/rename_history_restraint.mjs +1 -1
- package/tests/repo_map.mjs +12 -13
- package/tests/runner_drift.mjs +3 -21
- package/tests/sandbox_stage.mjs +57 -390
- package/tests/seam_wiring_guard.mjs +11 -11
- package/tests/search_isolation.mjs +3 -3
- package/tests/session_records.mjs +1 -1
- package/tests/session_rename_fallback.mjs +1 -22
- package/tests/session_start_freshness.mjs +3 -3
- package/tests/session_token_hash_db.mjs +1 -1
- package/tests/ship_card.mjs +1 -1
- package/tests/ship_ci_deploy.mjs +17 -17
- package/tests/ship_error_shape.mjs +1 -1
- package/tests/ship_premerge.mjs +1 -1
- package/tests/ship_resume.mjs +1 -1
- package/tests/skill_preflight.mjs +2 -2
- package/tests/skip_is_not_pass.mjs +1 -1
- package/tests/task_visual_slots.mjs +31 -0
- package/tests/terms_acceptance.mjs +2 -2
- package/tests/upgrade.mjs +4 -4
- package/tests/watch_sealed_floor.mjs +0 -1
- package/tests/wizard_draft_resume.mjs +2 -2
- package/tests/wizard_intent_resume.mjs +21 -10
- package/tests/wizard_preselect_why.mjs +18 -18
- package/docs/onboarding/browser-terminal-guide.md +0 -73
- package/docs/recipes/managed-settings-remote-control.md +0 -416
- package/modules/dev-box/CLAUDE.md +0 -15
- package/modules/dev-box/box-access.js +0 -623
- package/modules/dev-box/box-credential.js +0 -94
- package/modules/dev-box/box-onboard.js +0 -486
- package/modules/dev-box/boxes.js +0 -1038
- package/modules/dev-box/db.js +0 -39
- package/modules/dev-box/module.json +0 -19
- package/modules/dev-box/routes/box.js +0 -1223
- package/scripts/gds/box-auth-check.js +0 -160
- package/scripts/gds/box-infra.js +0 -321
- package/scripts/gds/box-sync.js +0 -216
- package/scripts/gds/box.js +0 -1332
- package/scripts/gds/cf-tunnel.js +0 -558
- package/scripts/gds/smoke-box.sh +0 -150
- package/scripts/gds/tree-preflight.js +0 -241
- package/src/bongos/app-pair.js +0 -172
- package/tests/app_pair.mjs +0 -168
- package/tests/box_access.mjs +0 -578
- package/tests/box_auth_check.mjs +0 -114
- package/tests/box_code_staleness.mjs +0 -129
- package/tests/box_connect_e2e.mjs +0 -196
- package/tests/box_cost.mjs +0 -70
- package/tests/box_credential.mjs +0 -125
- package/tests/box_dns_repoint.mjs +0 -153
- package/tests/box_env.mjs +0 -64
- package/tests/box_host_keys.mjs +0 -126
- package/tests/box_infra_resolve.mjs +0 -246
- package/tests/box_onboard.mjs +0 -317
- package/tests/box_scope_session.mjs +0 -119
- package/tests/box_sweep_docs.mjs +0 -119
- package/tests/box_sync.mjs +0 -55
- package/tests/box_sync_scope_report.mjs +0 -126
- package/tests/box_task_scope.mjs +0 -169
- package/tests/box_task_scope_pause.mjs +0 -66
- package/tests/box_terminal_ssrf.mjs +0 -96
- package/tests/boxes.mjs +0 -1585
- package/tests/cf_ruleset_preflight.mjs +0 -142
- package/tests/cf_tunnel.mjs +0 -496
- package/tests/docs_scrubber_damage.mjs +0 -111
- package/tests/module_scope_active_claims.mjs +0 -94
- package/tests/ship_api_client_pathspec.mjs +0 -100
- package/tests/tree_preflight.mjs +0 -243
|
@@ -155,7 +155,7 @@ function buildSessionDigest(entries, opts = {}) {
|
|
|
155
155
|
mu.input += tin; mu.output += tout; mu.cache_read += tcr; mu.cache_creation += tcc;
|
|
156
156
|
} else {
|
|
157
157
|
// task 1676: a token-bearing turn with NO model id. Previously dropped
|
|
158
|
-
// from model_usage (→ total_tokens>0 but priced $0 on the
|
|
158
|
+
// from model_usage (→ total_tokens>0 but priced $0 on the CI
|
|
159
159
|
// path; ADR 0097). Accumulate the unlabeled tokens so the digest can
|
|
160
160
|
// attribute them to a real, priceable family bucket after the loop.
|
|
161
161
|
m._unlabeled.input += tin; m._unlabeled.output += tout;
|
|
@@ -233,7 +233,7 @@ function buildSessionDigest(entries, opts = {}) {
|
|
|
233
233
|
m.total_tokens = m.tokens.input + m.tokens.output + m.tokens.cache_read + m.tokens.cache_creation;
|
|
234
234
|
// task 1676 — cost-plus reward zero-out fix. The cost-plus session reward
|
|
235
235
|
// (ADR 0054) prices `model_usage` server-side. model_usage is keyed on msg.model
|
|
236
|
-
// and SKIPS any token-bearing turn whose model id is missing. On the
|
|
236
|
+
// and SKIPS any token-bearing turn whose model id is missing. On the CI
|
|
237
237
|
// agent path that gap was the difference between total_tokens>0 (so the digest
|
|
238
238
|
// passes the route's empty-session guard + gets stored) and model_usage={} (so
|
|
239
239
|
// priceModelUsage returns $0 → 0 drachmae) — ADR 0097's "upload no priced model
|
|
@@ -32,7 +32,7 @@ const { REPO_ROOT } = require('./ship-state.js');
|
|
|
32
32
|
// `bongos upgrade` (pin-bump), NOT an SSH deploy (ADR 0108). When a target IS
|
|
33
33
|
// set it requires that host's SSH key, so only the operator can land.
|
|
34
34
|
//
|
|
35
|
-
// 'ci' — NO builder
|
|
35
|
+
// 'ci' — NO builder machine holds the prod key. ship pushes the branch, opens a
|
|
36
36
|
// PR, and enables GitHub auto-merge; once required checks pass, GitHub
|
|
37
37
|
// merges to main and .github/workflows/deploy-prod.yml deploys from
|
|
38
38
|
// Actions. ship then CONFIRMS the deploy landed (PR merged + the
|
|
@@ -62,8 +62,8 @@ function parseDeployMode(envVal, configRaw) {
|
|
|
62
62
|
// effectiveDeployMode — credential- and protection-aware adjustment of the parsed
|
|
63
63
|
// mode (pure; exported for the regression test). The 'laptop' land path pushes
|
|
64
64
|
// main + SSHes the droplet FROM THIS MACHINE, so it requires a local GitHub push
|
|
65
|
-
// credential. A machine without one — a
|
|
66
|
-
//
|
|
65
|
+
// credential. A machine without one — a fresh/stale local clone that can't
|
|
66
|
+
// even `git pull` (token-less origin, ADR 0053) — physically cannot run it;
|
|
67
67
|
// it must ship via the 'ci' server-mediated publish path instead
|
|
68
68
|
// (pushVia()==='server', ADR 0055), which lets the GDS server push with its own
|
|
69
69
|
// credential. So when the parsed mode is 'laptop' but the machine can't push
|
|
@@ -314,10 +314,10 @@ function fetchDeployedVersion(url = deployedVersionUrl()) {
|
|
|
314
314
|
// pushVia — which publish path ship uses in 'ci' mode (ADR 0055 / task 1025):
|
|
315
315
|
// 'local' — this machine pushes the branch + opens the PR with git + gh
|
|
316
316
|
// (laptop: gh present + authenticated). Today's behaviour.
|
|
317
|
-
// 'server' — this machine has NO GitHub push credential (
|
|
317
|
+
// 'server' — this machine has NO GitHub push credential (no gh, a
|
|
318
318
|
// credential-less origin). ship uploads a thin branch bundle to the
|
|
319
319
|
// GDS, which pushes + opens the PR + auto-merges with the SERVER's
|
|
320
|
-
// credential.
|
|
320
|
+
// credential. This machine holds nothing (#919 model preserved).
|
|
321
321
|
// Override with <PREFIX>_PUSH_VIA_SERVER=1 (force server) / =0 (force local) for tests.
|
|
322
322
|
function ghAvailableAndAuthed() {
|
|
323
323
|
try {
|
|
@@ -338,15 +338,15 @@ function pushVia() {
|
|
|
338
338
|
if (o === '1') return 'server';
|
|
339
339
|
if (o === '0') return 'local';
|
|
340
340
|
// No explicit override: a machine that can run an authenticated gh (laptop)
|
|
341
|
-
// takes the local path; everything else
|
|
341
|
+
// takes the local path; everything else goes server-mediated.
|
|
342
342
|
return ghAvailableAndAuthed() ? 'local' : 'server';
|
|
343
343
|
}
|
|
344
344
|
|
|
345
345
|
// broadcastHandledByServer — task 1045: on the server-mediated publish path the
|
|
346
346
|
// SERVER posts the Discord ship-broadcast after it confirms the deploy (it holds
|
|
347
|
-
// the webhook secrets; the
|
|
348
|
-
// locally there, or
|
|
349
|
-
// as before, fail silently. True only when the publish actually goes server-side:
|
|
347
|
+
// the webhook secrets; the local machine does NOT — ADR 0053). So ship.js must NOT
|
|
348
|
+
// also post locally there, or this machine would either double-post (impossible — no
|
|
349
|
+
// secret) or, as before, fail silently. True only when the publish actually goes server-side:
|
|
350
350
|
// ci deploy mode AND this machine has no GitHub push credential (pushVia 'server').
|
|
351
351
|
// The laptop path (pushVia 'local') keeps posting locally, exactly as today. Pure
|
|
352
352
|
// w.r.t. its inputs (env + committed deploy.json) + exported so the gate is tested.
|
|
@@ -355,12 +355,12 @@ function broadcastHandledByServer() {
|
|
|
355
355
|
}
|
|
356
356
|
|
|
357
357
|
// shouldBailOnFetchFailure — autoMerge's decision when `git fetch origin main`
|
|
358
|
-
// fails. A credential-less
|
|
358
|
+
// fails. A credential-less checkout (private origin, no creds —
|
|
359
359
|
// ADR 0053) CANNOT fetch origin, and that is FINE for the server-mediated
|
|
360
|
-
// publish path (ADR 0055): ciLandServer bundles against
|
|
360
|
+
// publish path (ADR 0055): ciLandServer bundles against this machine's LOCAL
|
|
361
361
|
// origin/main and the SERVER tops up main with its own credential. So a fetch
|
|
362
|
-
// failure is fatal ONLY when we are NOT taking that path — otherwise
|
|
363
|
-
// never reach ciLand and strands every ship at confirmed (the bug task 1027
|
|
362
|
+
// failure is fatal ONLY when we are NOT taking that path — otherwise such a
|
|
363
|
+
// machine can never reach ciLand and strands every ship at confirmed (the bug task 1027
|
|
364
364
|
// surfaced: ADR 0055 shipped the server path but left this fetch guard in front
|
|
365
365
|
// of it). Pure + exported for the regression test (no git, no network).
|
|
366
366
|
// NOTE: callers must still guard the pushVia() gh-probe behind `!fetchedMain` so
|
package/scripts/gds/ship-flow.js
CHANGED
|
@@ -318,7 +318,7 @@ async function shipMain() {
|
|
|
318
318
|
|
|
319
319
|
// ---- Module drift check (BV1.R53, task 1422) ----
|
|
320
320
|
// If the task carries a module_key, verify the committed diff doesn't stray
|
|
321
|
-
// into a DIFFERENT module's territory. "You said game, you touched
|
|
321
|
+
// into a DIFFERENT module's territory. "You said game, you touched provisioning" is
|
|
322
322
|
// the semantic violation this catches. Files no module owns are allowed —
|
|
323
323
|
// they're cross-cutting — as is the territory of a CROSS-CUTTING module, which
|
|
324
324
|
// every craft legitimately writes into. Only contact with a different OWNING
|
|
@@ -365,11 +365,11 @@ async function shipMain() {
|
|
|
365
365
|
}
|
|
366
366
|
|
|
367
367
|
// ---- Sandbox-first review gate (#927, ADR 0046) ----
|
|
368
|
-
// On a
|
|
369
|
-
// builder's own
|
|
368
|
+
// On a clone that carries the game preview, a diff that touches game
|
|
369
|
+
// surfaces must be STAGED on the builder's own local preview (ADR 0044)
|
|
370
370
|
// and reviewed in a browser before the claim resolves — see it running,
|
|
371
|
-
// get the chance to iterate, THEN decide to ship to the main game.
|
|
372
|
-
//
|
|
371
|
+
// get the chance to iterate, THEN decide to ship to the main game. A
|
|
372
|
+
// checkout with no game preview, non-game diffs, and --skip-stage all pass
|
|
373
373
|
// through untouched. Interactive: stage + ask; declining aborts with the
|
|
374
374
|
// claim intact. Non-TTY (agent-driven sessions): stage, then abort with the
|
|
375
375
|
// review URL — the re-run after the human reviews passes on the fresh
|
|
@@ -425,8 +425,8 @@ async function shipMain() {
|
|
|
425
425
|
}
|
|
426
426
|
// #1048: the recorded sandbox self-approval (when the builder approved a
|
|
427
427
|
// staged game change), threaded into the resolve call below so the server
|
|
428
|
-
// persists it on the task. null on
|
|
429
|
-
//
|
|
428
|
+
// persists it on the task. null on a checkout with no game preview, non-game
|
|
429
|
+
// diffs, --skip-stage, and bare fresh-marker re-runs without --approved.
|
|
430
430
|
const sandboxReview = sandboxGate.sandboxReview || null;
|
|
431
431
|
|
|
432
432
|
// ---- Step 1+2: verify locally (smoke) — runs AFTER the review gate (#1061) ----
|
package/scripts/gds/ship-land.js
CHANGED
|
@@ -172,10 +172,9 @@ function formatPublishFailure(data, status, branch, opts = {}) {
|
|
|
172
172
|
return out;
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
-
// ciLandServer — the
|
|
176
|
-
// hand the branch to the GDS, which pushes it + opens the PR +
|
|
177
|
-
// the server-side credential.
|
|
178
|
-
// box-scoped session is 403'd by the endpoint (it must `/builder-reauth` first).
|
|
175
|
+
// ciLandServer — the server-mediated path: no GitHub push credential on this
|
|
176
|
+
// machine, so hand the branch to the GDS, which pushes it + opens the PR +
|
|
177
|
+
// auto-merges with the server-side credential. Needs an ordinary cli session.
|
|
179
178
|
async function ciLandServer(taskId, branch, valueSummary, { hold = false } = {}) {
|
|
180
179
|
console.log(' ci-land: server-mediated publish (this machine has no GitHub push credential)');
|
|
181
180
|
const headSha = gitOk('git rev-parse HEAD');
|
|
@@ -275,11 +274,11 @@ function reconciledCardStatus(liveStatus, preMergeStatus) {
|
|
|
275
274
|
return liveStatus === 'shipped' ? 'shipped' : preMergeStatus;
|
|
276
275
|
}
|
|
277
276
|
|
|
278
|
-
// task 1052 (E): the
|
|
279
|
-
// 'confirmed' without finishing. A
|
|
280
|
-
// CANNOT run /merge-mode (it needs gh + a main checkout), so the old
|
|
281
|
-
// /merge-mode" advice was a dead end
|
|
282
|
-
// had to reverse-engineer recovery from source). Point a
|
|
277
|
+
// task 1052 (E): the machine-appropriate next step when a ship lands the task at
|
|
278
|
+
// 'confirmed' without finishing. A machine with no push credential (pushVia 'server' —
|
|
279
|
+
// no authed gh) CANNOT run /merge-mode (it needs gh + a main checkout), so the old
|
|
280
|
+
// "for /merge-mode" advice was a dead end there (the #1027 retrospective: the agent
|
|
281
|
+
// had to reverse-engineer recovery from source). Point such a machine at the resume
|
|
283
282
|
// instead (task 941); a laptop keeps /merge-mode (with resume as the alternative).
|
|
284
283
|
// Pure + exported for unit tests.
|
|
285
284
|
function strandNextStep(taskId, via) {
|
|
@@ -372,7 +371,7 @@ function prAssigneeLine(login) {
|
|
|
372
371
|
}
|
|
373
372
|
|
|
374
373
|
// task 1003988 — what to tell a builder while their PR sits RED. The poll used to
|
|
375
|
-
// wait out its nine minutes in silence, so a credential-less
|
|
374
|
+
// wait out its nine minutes in silence, so a credential-less checkout learned only that
|
|
376
375
|
// the land was "pending" and pushed the same commit again (PR 922: nine red runs).
|
|
377
376
|
// `md` is publish-status's merge_driver; null means nothing red to report. Pure +
|
|
378
377
|
// exported so the wording is pinned by tests/unit_report_status.mjs.
|
|
@@ -103,7 +103,7 @@ function regenerateShipArtifacts() {
|
|
|
103
103
|
regenerateCopyInventory();
|
|
104
104
|
// Refresh the generated OpenAPI spec + API reference from the shipped route tree (task 1918).
|
|
105
105
|
regenerateApiDocs();
|
|
106
|
-
// ...then the typed client FROM that spec
|
|
106
|
+
// ...then the typed client FROM that spec on the same beat (task 2051).
|
|
107
107
|
regenerateApiClient();
|
|
108
108
|
}
|
|
109
109
|
|
|
@@ -168,10 +168,10 @@ async function mergeLocally(taskId, valueSummary, { dbOnly = false } = {}) {
|
|
|
168
168
|
// nothing to push, merge, or deploy. Short-circuit so the caller's POST
|
|
169
169
|
// /tasks/:id/ship still flips status to shipped instead of stranding the
|
|
170
170
|
// task at confirmed forever.
|
|
171
|
-
// A credential-less
|
|
171
|
+
// A credential-less checkout can't `git fetch origin main` (private origin, no
|
|
172
172
|
// creds — ADR 0053), but that's only fatal OFF the server-publish path: the
|
|
173
|
-
//
|
|
174
|
-
// up main. Without this,
|
|
173
|
+
// ADR-0055 path bundles against its LOCAL origin/main and the server tops
|
|
174
|
+
// up main. Without this, such a checkout dead-ends here and strands every ship at
|
|
175
175
|
// confirmed (task 1027). The `!fetchedMain &&` short-circuit keeps the gh-probe
|
|
176
176
|
// (pushVia) off the happy laptop path, so laptop behavior is byte-for-byte.
|
|
177
177
|
const fetchedMain = shellOk('git fetch origin main');
|
|
@@ -238,22 +238,22 @@ function decidePreMerge({ branch, behind, via }) {
|
|
|
238
238
|
if (!branch || branch === 'main' || branch === 'HEAD') {
|
|
239
239
|
return { action: 'skip', reason: `not on a feature branch (${branch})` };
|
|
240
240
|
}
|
|
241
|
-
// Server-mediated publish (ADR 0055): a credential-less partial-clone
|
|
241
|
+
// Server-mediated publish (ADR 0055): a credential-less partial-clone checkout
|
|
242
242
|
// (blob:none, HTTPS origin, no gh/credential-helper — ADR 0053) CANNOT run a
|
|
243
243
|
// local `git merge origin/main` — the ort merge lazily fetches main's blobs
|
|
244
244
|
// from the promisor remote and there are no credentials to authenticate that
|
|
245
|
-
// fetch, so
|
|
245
|
+
// fetch, so such a checkout strands here and can never ship while behind main, i.e.
|
|
246
246
|
// ≈always (idea #364). It also does not NEED to: ciLandServer bundles
|
|
247
247
|
// `origin/main..HEAD` and the SERVER reconciles the branch with the real main
|
|
248
248
|
// when it pushes + opens + auto-merges the PR; a genuine conflict surfaces
|
|
249
249
|
// server-side as merge_conflict (publish-reconciler / conflict-resolve,
|
|
250
250
|
// ADR 0082). The local pre-merge (#1068) is a LAPTOP-path optimization (so the
|
|
251
251
|
// sandbox-reviewed tree == the shipped tree); it stays exactly as-is there
|
|
252
|
-
// (via 'local'/undefined) and is simply skipped on the
|
|
252
|
+
// (via 'local'/undefined) and is simply skipped on the server path.
|
|
253
253
|
if (via === 'server') {
|
|
254
254
|
return {
|
|
255
255
|
action: 'skip',
|
|
256
|
-
reason: 'server-mediated publish reconciles with origin/main server-side (credential-less partial-clone
|
|
256
|
+
reason: 'server-mediated publish reconciles with origin/main server-side (credential-less partial-clone checkout cannot fetch main blobs locally — idea #364)',
|
|
257
257
|
};
|
|
258
258
|
}
|
|
259
259
|
if (!Number.isFinite(behind) || behind === 0) {
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
|
|
9
9
|
'use strict';
|
|
10
10
|
|
|
11
|
-
const fs = require('node:fs');
|
|
12
11
|
const path = require('node:path');
|
|
13
12
|
const { gitOk, shellOk } = require('./ship-git.js');
|
|
14
13
|
const { pushVia } = require('./ship-deploy-target.js');
|
|
@@ -27,21 +26,21 @@ function currentBranch() {
|
|
|
27
26
|
//
|
|
28
27
|
// Returns a status string ('skipped-server' | 'regen-failed' | 'current' |
|
|
29
28
|
// 'committed' | 'committed-nofatal') so the regression test (task 1046) can
|
|
30
|
-
// prove the
|
|
29
|
+
// prove the server-publish skip without git or a headless browser.
|
|
31
30
|
function regenerateDiagrams() {
|
|
32
|
-
// task 1046: on the server-mediated-publish path (
|
|
31
|
+
// task 1046: on the server-mediated-publish path (pushVia 'server'),
|
|
33
32
|
// there is no headless browser, so render-diagrams.sh fails and gen-diagrams.js
|
|
34
33
|
// exits non-zero AFTER writing the regenerated .mmd + assertions.json — which
|
|
35
34
|
// shellOk() then treats as a failed regen and returns BEFORE the commit below,
|
|
36
35
|
// leaving those files UNCOMMITTED in the builder's tree (had to be reverted by
|
|
37
|
-
// hand).
|
|
36
|
+
// hand). That path must not attempt the regen at all: skip here and let a
|
|
38
37
|
// render-capable ship (the laptop path, which CAN render the PNGs) refresh them
|
|
39
38
|
// as a matched .mmd+.png+assertions set; the diagram-drift routine backstops any
|
|
40
39
|
// staleness in the meantime. Skipping entirely (vs --no-render) avoids committing
|
|
41
40
|
// a .mmd/.png mismatch to main. Mirrors gen-diagrams.js's own non-fatal skip when
|
|
42
41
|
// bash itself is absent (ENOENT).
|
|
43
42
|
if (pushVia() === 'server') {
|
|
44
|
-
console.log(' diagram regen skipped on the
|
|
43
|
+
console.log(' diagram regen skipped on the server-publish ship path (no GDS session for the conceptual diagrams) — a full-clone ship refreshes the .mmd; drift checker backstops staleness');
|
|
45
44
|
return 'skipped-server';
|
|
46
45
|
}
|
|
47
46
|
// ADR 0110 pt.3 (task 2027): the .svg/.png RENDERS are now gitignored and
|
|
@@ -75,7 +74,7 @@ function regenerateDiagrams() {
|
|
|
75
74
|
|
|
76
75
|
// task 1224 (Path B / ADR 0063): refresh the generated symbol skeleton from the shipped tree so the
|
|
77
76
|
// altitude map can't drift. Pure JS (no headless browser, no render) — unlike the diagrams it is safe
|
|
78
|
-
// on EVERY ship path, including the
|
|
77
|
+
// on EVERY ship path, including the server-publish path. Non-fatal: a hiccup must never block
|
|
79
78
|
// a ship. ADR 0110 (task 1926): docs/repo-map.md is now GITIGNORED + regenerated at deploy — the
|
|
80
79
|
// generator still WRITES it (untracked, harmless), but ship commits ONLY the tracked nested-doc
|
|
81
80
|
// blocks. It is deliberately absent from the git add/status lists below: `git add <ignored path>`
|
|
@@ -102,12 +101,12 @@ function regenerateRepoMap() {
|
|
|
102
101
|
|
|
103
102
|
// Refresh the generated session-log index (docs/session-log-index.md) + the bounded CLAUDE.md §13
|
|
104
103
|
// "recent sessions" snippet from the shipped tree's docs/session-logs/*.md (ADR 0062 §8, task 1226).
|
|
105
|
-
// Pure JS (reads files, no DB, no headless browser) — safe on EVERY ship path including the
|
|
104
|
+
// Pure JS (reads files, no DB, no headless browser) — safe on EVERY ship path including the
|
|
106
105
|
// server-publish path. Non-fatal: a hiccup must never block a ship; the Path-C CI gate
|
|
107
106
|
// (`gen-session-index --check`) backstops staleness on main.
|
|
108
107
|
// Refresh the generated API docs (docs/api/openapi.json + docs/api-reference.md +
|
|
109
108
|
// docs/routes-permissions.md) from the shipped route tree (task 1918). Pure JS (reads
|
|
110
|
-
// route files, no DB, no headless browser) — safe on EVERY ship path incl. the
|
|
109
|
+
// route files, no DB, no headless browser) — safe on EVERY ship path incl. the
|
|
111
110
|
// server-publish path. Non-fatal: a hiccup must never block a ship; the fitness
|
|
112
111
|
// `gen-api-docs --check` gate backstops staleness on main.
|
|
113
112
|
function regenerateApiDocs() {
|
|
@@ -130,27 +129,14 @@ function regenerateApiDocs() {
|
|
|
130
129
|
}
|
|
131
130
|
|
|
132
131
|
// Refresh the generated typed client (clients/bongos-client) FROM the just-regenerated
|
|
133
|
-
// spec
|
|
134
|
-
//
|
|
132
|
+
// spec (task 2051). Runs right after regenerateApiDocs so the client reflects the
|
|
133
|
+
// same route tree. Automatic here
|
|
135
134
|
// (not fail-if-forgotten): before this, ship regenerated the spec but not the client,
|
|
136
135
|
// so a route change left the client stale until the api_client test caught it in CI.
|
|
137
136
|
// Non-fatal + safe on every ship path; the api_client freshness test backstops main.
|
|
138
137
|
|
|
139
|
-
//
|
|
140
|
-
|
|
141
|
-
const VENDORED_CLIENT_REL = 'modules/dev-box/app/src/vendor/bongos-client.cjs';
|
|
142
|
-
|
|
143
|
-
// The git pathspec for the regenerated client. Pure + exported so the rule is unit-tested
|
|
144
|
-
// with no git/fs (task 1002417). `git status` tolerates an unmatched pathspec (exit 0) but
|
|
145
|
-
// `git add` aborts the ENTIRE staging step (exit 128), which leaves the regenerated client
|
|
146
|
-
// unstaged and the worktree dirty — and a dirty worktree makes the ship's auto-merge bail,
|
|
147
|
-
// stranding the task at `confirmed` with no PR. So the vendored copy is named ONLY when it
|
|
148
|
-
// is actually on disk.
|
|
149
|
-
function apiClientPathspec({ worktreeRoot, existsSync = fs.existsSync } = {}) {
|
|
150
|
-
const paths = ['clients/bongos-client'];
|
|
151
|
-
if (existsSync(path.join(worktreeRoot, VENDORED_CLIENT_REL))) paths.push(VENDORED_CLIENT_REL);
|
|
152
|
-
return paths;
|
|
153
|
-
}
|
|
138
|
+
// The regenerated client's git pathspec: the one directory the generator writes.
|
|
139
|
+
const API_CLIENT_PATHSPEC = 'clients/bongos-client';
|
|
154
140
|
|
|
155
141
|
function regenerateApiClient() {
|
|
156
142
|
console.log(' regenerating typed API client (clients/bongos-client) from the OpenAPI spec...');
|
|
@@ -158,31 +144,13 @@ function regenerateApiClient() {
|
|
|
158
144
|
console.log(' api-client regen failed (non-fatal) — CI api_client freshness test backstops staleness');
|
|
159
145
|
return 'regen-failed';
|
|
160
146
|
}
|
|
161
|
-
|
|
162
|
-
// build (ADR 0045); keep the copy byte-identical (the api_client test asserts it).
|
|
163
|
-
// Present only where the dev-box module ships — an instance without it has no vendored
|
|
164
|
-
// copy, so both the vendor step and the git pathspec below drop out (task 1002417: the
|
|
165
|
-
// app moved from top-level devbox-app/ to modules/dev-box/app/ per ADR 0145, and these
|
|
166
|
-
// paths were not updated, so the guard below silently never fired).
|
|
167
|
-
// Resolve it WORKTREE-LOCALLY (like the generator above, __dirname=scripts/gds), NOT
|
|
168
|
-
// via REPO_ROOT: on a ship from a linked worktree REPO_ROOT is the MAIN checkout, so a
|
|
169
|
-
// REPO_ROOT path would vendor the main tree while gen-api-client just wrote THIS tree,
|
|
170
|
-
// leaving this worktree's vendored copy stale → the api_client byte-identity test reds
|
|
171
|
-
// the PR (task 2060 fix). __dirname keeps the generator, the vendored file, and the
|
|
172
|
-
// git add all on the same tree.
|
|
173
|
-
const worktreeRoot = path.join(__dirname, '..', '..');
|
|
174
|
-
const vendorScript = path.join(worktreeRoot, 'modules', 'dev-box', 'app', 'scripts', 'vendor-client.js');
|
|
175
|
-
if (fs.existsSync(vendorScript)) {
|
|
176
|
-
shellOk(`"${process.execPath}" ${JSON.stringify(vendorScript)}`);
|
|
177
|
-
}
|
|
178
|
-
const clientPathspec = apiClientPathspec({ worktreeRoot }).join(' ');
|
|
179
|
-
const dirty = gitOk(`git status --porcelain ${clientPathspec}`);
|
|
147
|
+
const dirty = gitOk(`git status --porcelain ${API_CLIENT_PATHSPEC}`);
|
|
180
148
|
if (!dirty) {
|
|
181
149
|
console.log(' API client already current — nothing to commit');
|
|
182
150
|
return 'current';
|
|
183
151
|
}
|
|
184
|
-
shellOk(`git add ${
|
|
185
|
-
if (shellOk('git commit -m "chore(api-client): auto-regenerate typed client
|
|
152
|
+
shellOk(`git add ${API_CLIENT_PATHSPEC}`);
|
|
153
|
+
if (shellOk('git commit -m "chore(api-client): auto-regenerate typed client (task 2051)"')) {
|
|
186
154
|
console.log(' committed auto-regenerated API client');
|
|
187
155
|
return 'committed';
|
|
188
156
|
}
|
|
@@ -215,7 +183,7 @@ function regenerateSessionIndex() {
|
|
|
215
183
|
// Refresh the generated file-map sections (.claude/skills/ + .claude/scheduled-tasks/ trees in
|
|
216
184
|
// docs/file-map.md) from what is on disk (ADR 0066, task 1276). Pure JS (reads dirs + the
|
|
217
185
|
// docs/file-map.notes.json sidecar, no DB, no headless browser) — safe on EVERY ship path including
|
|
218
|
-
// the
|
|
186
|
+
// the server-publish path. Non-fatal: a hiccup must never block a ship; the Path-C CI gate
|
|
219
187
|
// (`gen-file-map --check`, in fitness.js) backstops staleness on main. NB gen-file-map exits 2 when
|
|
220
188
|
// a skill/routine has no note, so shellOk may report "failed" on a legit note-gap ship — that is
|
|
221
189
|
// fine, we still commit whatever it wrote and CI surfaces the missing note.
|
|
@@ -333,8 +301,6 @@ function mainWorktreeBusy() {
|
|
|
333
301
|
// (uncommitted work / wrong branch / empty touches[]); refuse.
|
|
334
302
|
|
|
335
303
|
module.exports = {
|
|
336
|
-
VENDORED_CLIENT_REL,
|
|
337
|
-
apiClientPathspec,
|
|
338
304
|
currentBranch,
|
|
339
305
|
describeMainWorktreeBusy,
|
|
340
306
|
mainWorktreeBusy,
|
package/scripts/gds/ship.js
CHANGED
|
@@ -46,10 +46,10 @@
|
|
|
46
46
|
// # Archon). The cheap default after fixing grader
|
|
47
47
|
// # findings — closes the task-595-regrade-gap (#678).
|
|
48
48
|
// node scripts/gds/ship.js <task-id> --skip-stage # skip the sandbox-first review gate (#927,
|
|
49
|
-
// # ADR 0046). On a
|
|
50
|
-
// # otherwise staged to
|
|
51
|
-
// # preview (
|
|
52
|
-
// # browser review BEFORE the claim resolves.
|
|
49
|
+
// # ADR 0046). On a clone with the game preview,
|
|
50
|
+
// # game-surface diffs are otherwise staged to
|
|
51
|
+
// # the builder's own local preview (ADR 0044) for
|
|
52
|
+
// # a browser review BEFORE the claim resolves.
|
|
53
53
|
// node scripts/gds/ship.js <task-id> --approved # record your sandbox sign-off (#1048): re-run with
|
|
54
54
|
// # this AFTER reviewing the staged change at the
|
|
55
55
|
// # sandbox URL. Persists a sandbox_review row on the
|
|
@@ -77,21 +77,6 @@
|
|
|
77
77
|
|
|
78
78
|
'use strict';
|
|
79
79
|
|
|
80
|
-
// TREE PREFLIGHT (task 1003098). A task-scoped dev box carries scripts/ and
|
|
81
|
-
// src/bongos/ but not every modules/ directory, so the requires below can fail —
|
|
82
|
-
// and Node's loader names only the FIRST missing one, which turned recovery into
|
|
83
|
-
// guess-read-fix-repeat. This enumerates every missing requirement in one message
|
|
84
|
-
// and exits before the first such require runs. It must stay ABOVE them.
|
|
85
|
-
//
|
|
86
|
-
// A PRE-REQUEST hard exit, like the usage banner and worktree guard: nothing has
|
|
87
|
-
// been sent yet, so there is no in-flight request for cliExit to drain.
|
|
88
|
-
const { action: _surfaceAction } = require('./surface.js');
|
|
89
|
-
const { checkTree: _checkTree } = require('./tree-preflight.js');
|
|
90
|
-
{
|
|
91
|
-
const _fault = _checkTree(__filename, { command: _surfaceAction("ship") });
|
|
92
|
-
if (_fault) { console.error(_fault); process.exit(1); }
|
|
93
|
-
}
|
|
94
|
-
|
|
95
80
|
const { buildMergeArgv, gitArgvOk, sanitizeGitHubRefs } = require('./ship-git.js');
|
|
96
81
|
const { apiErrorLine, normalizeApiError, postLandShipOutcome } = require('./ship-io.js');
|
|
97
82
|
const { deriveTagsFromPaths } = require('./ship-surprise.js');
|
|
@@ -137,8 +122,6 @@ const {
|
|
|
137
122
|
strandNextStep,
|
|
138
123
|
} = require('./ship-land.js');
|
|
139
124
|
const {
|
|
140
|
-
VENDORED_CLIENT_REL,
|
|
141
|
-
apiClientPathspec,
|
|
142
125
|
regenerateDiagrams,
|
|
143
126
|
regenerateFileMap,
|
|
144
127
|
regenerateRepoMap,
|
|
@@ -192,9 +175,6 @@ module.exports = {
|
|
|
192
175
|
// resolveTranscriptPath itself runs path.resolve, which can't carry a Windows
|
|
193
176
|
// path through a Linux CI run.
|
|
194
177
|
encodeProjectPath,
|
|
195
|
-
// task 1002417: the regenerated-client pathspec rule, exported pure so the
|
|
196
|
-
// "never name a path git add cannot match" invariant is tested without git/fs.
|
|
197
|
-
apiClientPathspec, VENDORED_CLIENT_REL,
|
|
198
178
|
// task 1003: transcript-grade scrubber internals, exported pure so the planted-
|
|
199
179
|
// secret corpus test (tests/scrubber_corpus.mjs) can exercise each layer + tune.
|
|
200
180
|
shannonEntropy, looksHighEntropySecret, redactHighEntropy, collectEnvSecrets,
|
|
@@ -293,8 +273,8 @@ module.exports = {
|
|
|
293
273
|
// preflight's upstream-deletion warning — exported so it's unit-tested
|
|
294
274
|
// without a live git repo.
|
|
295
275
|
parseDeletedUpstreamPaths,
|
|
296
|
-
// task 1052 (E):
|
|
297
|
-
// (via 'server') is pointed at the resume, never at gh-only /merge-mode.
|
|
276
|
+
// task 1052 (E): path-aware "what to do next" for a confirmed-strand — a machine
|
|
277
|
+
// on the server path (via 'server') is pointed at the resume, never at gh-only /merge-mode.
|
|
298
278
|
strandNextStep,
|
|
299
279
|
// task 1002606: the success-pending banner lines, pure — pinned so the strand
|
|
300
280
|
// detection story ("NOT a failure" + how you WILL find out if it fails) can't drift.
|
|
@@ -313,20 +293,20 @@ module.exports = {
|
|
|
313
293
|
// #858: commit-pinned deploy confirmation via the /version endpoint.
|
|
314
294
|
deployedCommitStatus,
|
|
315
295
|
// ADR 0055 / task 1025: which ci-mode publish path this machine uses
|
|
316
|
-
// ('local' = git+gh here; 'server' = server-mediated,
|
|
296
|
+
// ('local' = git+gh here; 'server' = server-mediated, no local push credential) — so
|
|
317
297
|
// doctor.js reports the same path ship will take instead of failing on
|
|
318
298
|
// missing gh where gh isn't needed.
|
|
319
299
|
pushVia,
|
|
320
|
-
// task 1046: diagram regen returns a status string and SKIPS on the
|
|
321
|
-
//
|
|
322
|
-
//
|
|
300
|
+
// task 1046: diagram regen returns a status string and SKIPS on the server-publish
|
|
301
|
+
// path so such a checkout never leaves uncommitted .mmd/assertions in its tree —
|
|
302
|
+
// exported so the regression test proves the skip without git.
|
|
323
303
|
regenerateDiagrams,
|
|
324
304
|
regenerateRepoMap,
|
|
325
305
|
regenerateSessionIndex,
|
|
326
306
|
// ADR 0066 / task 1276: regenerate docs/file-map.md's skills + scheduled-tasks sections from disk.
|
|
327
307
|
regenerateFileMap,
|
|
328
308
|
// task 1037: autoMerge's fetch-failure decision — fatal only OFF the server-
|
|
329
|
-
// publish path (a credential-less
|
|
309
|
+
// publish path (a credential-less checkout can't fetch but ships via ADR 0055).
|
|
330
310
|
// Exported pure so the regression test proves the truth table without git.
|
|
331
311
|
shouldBailOnFetchFailure,
|
|
332
312
|
// task 391 (idea #37): autoMerge's zero-commit verdict — refuse a zero-commit
|
|
@@ -362,8 +342,8 @@ module.exports = {
|
|
|
362
342
|
if (require.main === module) {
|
|
363
343
|
// --print-deploy-mode (task 1003221): the EFFECTIVE mode, one word, no session or
|
|
364
344
|
// network. The /merge-mode skill used to probe parseDeployMode directly, which
|
|
365
|
-
// defaults to 'laptop' when config/deploy.json is absent —
|
|
366
|
-
//
|
|
345
|
+
// defaults to 'laptop' when config/deploy.json is absent — sending the
|
|
346
|
+
// builder down a push path they had no credential for.
|
|
367
347
|
if (process.argv.slice(2).includes('--print-deploy-mode')) {
|
|
368
348
|
console.log(require('./ship-deploy-target.js').resolveDeployMode());
|
|
369
349
|
process.exit(0);
|
|
@@ -4,12 +4,13 @@
|
|
|
4
4
|
// 1000077; criterion guards-skill-declares-machine).
|
|
5
5
|
//
|
|
6
6
|
// THE INCIDENT. /merge-mode states in its own prose that it assumes the Archon's
|
|
7
|
-
// Mac or the droplet. It was run on a
|
|
8
|
-
// strandNextStep() tells a
|
|
9
|
-
// a main checkout this machine doesn't have." So the
|
|
10
|
-
// places and neither stopped the run, because prose cannot
|
|
11
|
-
// executable copy was on a different code path. A capability a
|
|
12
|
-
// must be a declaration the machine can CHECK, not a sentence a
|
|
7
|
+
// Mac or the droplet. It was run on a machine with no push credential anyway. Worse,
|
|
8
|
+
// ship.js ALREADY knew: strandNextStep() tells such a machine "/merge-mode is NOT
|
|
9
|
+
// available here — it needs gh + a main checkout this machine doesn't have." So the
|
|
10
|
+
// knowledge existed in two places and neither stopped the run, because prose cannot
|
|
11
|
+
// refuse and the one executable copy was on a different code path. A capability a
|
|
12
|
+
// procedure needs must be a declaration the machine can CHECK, not a sentence a
|
|
13
|
+
// reader can skim.
|
|
13
14
|
//
|
|
14
15
|
// THREE PARTS, matching that diagnosis:
|
|
15
16
|
// 1. `requires:` in the skill's own YAML frontmatter — the declaration.
|
|
@@ -74,7 +75,7 @@ const CAPABILITIES = {
|
|
|
74
75
|
what: 'an authenticated GitHub CLI',
|
|
75
76
|
probe: () => ghAuthed(),
|
|
76
77
|
missing: 'no authenticated `gh` on this machine. Run `gh auth login`, or use a machine that has it — '
|
|
77
|
-
+ 'a
|
|
78
|
+
+ 'a machine with no push credential normally does not, by design (it publishes through the server instead, ADR 0055).',
|
|
78
79
|
},
|
|
79
80
|
'main-checkout': {
|
|
80
81
|
what: 'the main checkout, not a linked worktree',
|
|
@@ -318,7 +319,7 @@ function checkOpsSkillsDeclareMachine({ dir = SKILLS_DIR, read = null, names: in
|
|
|
318
319
|
violations.push(
|
|
319
320
|
`${n} fences commands needing [${undeclared.join(', ')}] but does not declare them. `
|
|
320
321
|
+ 'Add them to `requires:` in the frontmatter so the preflight can refuse early — '
|
|
321
|
-
+ 'prose cannot refuse, which is how /merge-mode came to be run on a
|
|
322
|
+
+ 'prose cannot refuse, which is how /merge-mode came to be run on a machine that could not run it (task 1003167).'
|
|
322
323
|
);
|
|
323
324
|
}
|
|
324
325
|
}
|
package/scripts/gds/start.js
CHANGED
|
@@ -52,21 +52,6 @@
|
|
|
52
52
|
//
|
|
53
53
|
// Returns JSON if --json is passed (for the slash command to parse cleanly).
|
|
54
54
|
|
|
55
|
-
// TREE PREFLIGHT (task 1003098). A task-scoped dev box carries scripts/ and
|
|
56
|
-
// src/bongos/ but not every modules/ directory, so the requires below can fail —
|
|
57
|
-
// and Node's loader names only the FIRST missing one, which turned recovery into
|
|
58
|
-
// guess-read-fix-repeat. This enumerates every missing requirement in one message
|
|
59
|
-
// and exits before the first such require runs. It must stay ABOVE them.
|
|
60
|
-
//
|
|
61
|
-
// A PRE-REQUEST hard exit, like the usage banner and worktree guard: nothing has
|
|
62
|
-
// been sent yet, so there is no in-flight request for cliExit to drain.
|
|
63
|
-
const { action: _surfaceAction } = require('./surface.js');
|
|
64
|
-
const { checkTree: _checkTree } = require('./tree-preflight.js');
|
|
65
|
-
{
|
|
66
|
-
const _fault = _checkTree(__filename, { command: _surfaceAction("start") });
|
|
67
|
-
if (_fault) { console.error(_fault); process.exit(1); }
|
|
68
|
-
}
|
|
69
|
-
|
|
70
55
|
const { cliClient, errCode, errDetails, requireSession, fmtUsd, printOnboardingNudge, printCostWarning, printNeedsNudge, hallBase, API_BASE, rewardPolicy, costPlusOnlyNote, isDispatcherIncompatError, cardFlagsFromMe } = require('./cli-lib');
|
|
71
56
|
const { plainCardLines } = require('./plain-cards');
|
|
72
57
|
const { contextPack, formatContextPackCompact } = require('./context-pack');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Hall preview harness
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`/builder-stage` previews the **game only** — `/builders` 404s there (idea 490) — so
|
|
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__`
|
|
@@ -19,7 +19,7 @@ node scripts/hall-preview/server.js # neutral pack, port 4600
|
|
|
19
19
|
|---|---|
|
|
20
20
|
| `--port 4600` | listen port |
|
|
21
21
|
| `--brand config/branding.json` | serve the instance pack (default: `config/branding.neutral.json`, the vanilla skin) |
|
|
22
|
-
| `--modules-off
|
|
22
|
+
| `--modules-off discord,provisioning` | report those modules disabled in `window.__MODULES__` — verifies `moduleOn()` gating (the Discord links, Instances/Start-a-project widgets must vanish) |
|
|
23
23
|
| `--empty` | drain every array in every fixture — the empty-state screenshot pass |
|
|
24
24
|
| `--fixture-me` | don't read your own account live — serve the checked-in `me.json` snapshot (see below) |
|
|
25
25
|
|
|
@@ -32,7 +32,7 @@ A GET with no fixture answers 404 and logs
|
|
|
32
32
|
The fixtures are one particular builder's snapshot, so the harness used to greet
|
|
33
33
|
everyone as that builder — their name, credits, achievements, goals and **rank**.
|
|
34
34
|
A metic snapshot also sealed the Archon-gated pages, so a UI change to Watch /
|
|
35
|
-
|
|
35
|
+
Gate / Permissions could not be reviewed at all.
|
|
36
36
|
|
|
37
37
|
So at boot the harness reads **your** account: if this machine holds a GDS CLI
|
|
38
38
|
session, the me-scoped endpoints (`/me`, `/me/*`, `/builders/<you>/…`,
|
|
@@ -136,8 +136,8 @@ The hard seams every redesign must keep. Run on each changed page:
|
|
|
136
136
|
// after connect): watch the network panel, or count via a fixture hit log line.
|
|
137
137
|
```
|
|
138
138
|
|
|
139
|
-
Module gating: rerun the page with `--modules-off
|
|
140
|
-
|
|
139
|
+
Module gating: rerun the page with `--modules-off discord,provisioning` — the
|
|
140
|
+
Discord links and the Instances/Start-a-project widgets must be absent, with
|
|
141
141
|
zero console errors.
|
|
142
142
|
|
|
143
143
|
## Gotchas
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// scripts/hall-preview/server.js — the hall preview harness (task 2167).
|
|
3
3
|
//
|
|
4
|
-
//
|
|
4
|
+
// /builder-stage previews the GAME only (/builders 404s there, idea 490),
|
|
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
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// finally checked in.
|
|
11
11
|
//
|
|
12
12
|
// node scripts/hall-preview/server.js [--port 4600] [--brand <file>]
|
|
13
|
-
// [--modules-off
|
|
13
|
+
// [--modules-off discord,provisioning] [--empty]
|
|
14
14
|
//
|
|
15
15
|
// --port listen port (default 4600)
|
|
16
16
|
// --brand branding pack file — default config/branding.neutral.json
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
// --empty serve every fixture with its arrays emptied — the
|
|
21
21
|
// empty-state screenshot pass
|
|
22
22
|
// --rank archon override the served /me builder.rank (live or fixture) so the
|
|
23
|
-
// Archon-gated pages (watch,
|
|
23
|
+
// Archon-gated pages (watch, gate) render in preview
|
|
24
24
|
// --fixture-me do NOT read your own account live; serve the checked-in
|
|
25
25
|
// fixtures/me.json snapshot (deterministic screenshot passes,
|
|
26
26
|
// and the offline/signed-out path) — task 1003315
|
|
@@ -50,15 +50,15 @@ function arg(name) {
|
|
|
50
50
|
const PORT = Number(arg('--port')) || 4600;
|
|
51
51
|
const EMPTY = process.argv.includes('--empty');
|
|
52
52
|
// --rank: view the hall as a different rank — the served /me builder.rank is
|
|
53
|
-
// overridden in the response, so the Archon-gated pages (watch,
|
|
53
|
+
// overridden in the response, so the Archon-gated pages (watch, gate)
|
|
54
54
|
// render their real content instead of the sealed notice. Since task 1003315 the
|
|
55
55
|
// served /me is normally your OWN account, so this is now only needed to view
|
|
56
56
|
// the hall as a rank you are not. Preview-only theatre:
|
|
57
57
|
// the real pages are server-gated (requireGovernmentPage / ADR 0016).
|
|
58
58
|
const RANK_OVERRIDE = arg('--rank');
|
|
59
59
|
const MODULES_OFF = String(arg('--modules-off') || '').split(',').map((s) => s.trim()).filter(Boolean);
|
|
60
|
-
// --modules-on: force-report modules as enabled — a
|
|
61
|
-
// often lacks prod's instance modules (provisioning,
|
|
60
|
+
// --modules-on: force-report modules as enabled — a local checkout's config
|
|
61
|
+
// often lacks prod's instance modules (provisioning, discord), and their
|
|
62
62
|
// widgets can't be reviewed without it (task 2169).
|
|
63
63
|
const MODULES_ON = String(arg('--modules-on') || '').split(',').map((s) => s.trim()).filter(Boolean);
|
|
64
64
|
// --fixture-me: pin the checked-in /me snapshot instead of reading the caller's
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
# already-installed browser and forbids the download when it finds one; it only
|
|
20
20
|
# falls back to puppeteer's own download where nothing is installed (a dev
|
|
21
21
|
# laptop, where that fetch works fine). This is what makes render-at-deploy
|
|
22
|
-
# viable (deploy-prod.sh
|
|
22
|
+
# viable (deploy-prod.sh calls this).
|
|
23
23
|
set -euo pipefail
|
|
24
24
|
|
|
25
25
|
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|