@bongos/core 1.17.0
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 +5727 -0
- package/.claude/skills/blocker-review/SKILL.md +91 -0
- package/.claude/skills/blocker-solve/SKILL.md +96 -0
- package/.claude/skills/builder-backup/SKILL.md +54 -0
- package/.claude/skills/builder-box/SKILL.md +45 -0
- package/.claude/skills/builder-claim/SKILL.md +76 -0
- package/.claude/skills/builder-connect/SKILL.md +59 -0
- package/.claude/skills/builder-cost/SKILL.md +47 -0
- package/.claude/skills/builder-end/SKILL.md +81 -0
- package/.claude/skills/builder-exit/SKILL.md +88 -0
- package/.claude/skills/builder-key/SKILL.md +40 -0
- package/.claude/skills/builder-reauth/SKILL.md +50 -0
- package/.claude/skills/builder-redteam/SKILL.md +109 -0
- package/.claude/skills/builder-release/SKILL.md +41 -0
- package/.claude/skills/builder-setup/SKILL.md +62 -0
- package/.claude/skills/builder-ship/SKILL.md +79 -0
- package/.claude/skills/builder-stage/SKILL.md +51 -0
- package/.claude/skills/builder-start/SKILL.md +46 -0
- package/.claude/skills/close-box/SKILL.md +43 -0
- package/.claude/skills/design-sync/SKILL.md +69 -0
- package/.claude/skills/dev/SKILL.md +49 -0
- package/.claude/skills/feedback/SKILL.md +32 -0
- package/.claude/skills/figma-design-sync/SKILL.md +74 -0
- package/.claude/skills/goal-review/SKILL.md +89 -0
- package/.claude/skills/idea-triage/SKILL.md +144 -0
- package/.claude/skills/ideate/SKILL.md +82 -0
- package/.claude/skills/merge-mode/SKILL.md +169 -0
- package/.claude/skills/new-project/SKILL.md +108 -0
- package/.claude/skills/otb-character-review/SKILL.md +71 -0
- package/.claude/skills/otb-design-review/SKILL.md +47 -0
- package/.claude/skills/otb-feedback-capture/SKILL.md +45 -0
- package/.claude/skills/otb-figma-sync/SKILL.md +54 -0
- package/.claude/skills/otb-tile-generate/SKILL.md +45 -0
- package/.claude/skills/paint/SKILL.md +70 -0
- package/.claude/skills/planning-session/SKILL.md +299 -0
- package/.claude/skills/priority-session/SKILL.md +134 -0
- package/.claude/skills/read-session-export/SKILL.md +58 -0
- package/.claude/skills/recall/SKILL.md +52 -0
- package/.claude/skills/session-handoff/SKILL.md +46 -0
- package/.claude/skills/status/SKILL.md +33 -0
- package/.devcontainer/Dockerfile +69 -0
- package/.devcontainer/README.md +73 -0
- package/.devcontainer/devcontainer-lock.json +19 -0
- package/.devcontainer/devcontainer.json +93 -0
- package/.devcontainer/healthcheck.sh +84 -0
- package/.devcontainer/init-firewall.sh +198 -0
- package/.devcontainer/post-create.sh +153 -0
- package/.dockerignore +36 -0
- package/.env.local.example +32 -0
- package/.gitattributes +83 -0
- package/.gitignore +91 -0
- package/CLAUDE.md +242 -0
- package/CODE_OF_CONDUCT.md +46 -0
- package/CONTRIBUTING.md +51 -0
- package/Dockerfile +46 -0
- package/GOVERNANCE.md +44 -0
- package/LICENSE +661 -0
- package/README.md +88 -0
- package/bin/bongos.js +222 -0
- package/clients/bongos-client/README.md +48 -0
- package/clients/bongos-client/bongos-client.global.js +617 -0
- package/clients/bongos-client/examples/hello-world.mjs +62 -0
- package/clients/bongos-client/index.cjs +619 -0
- package/clients/bongos-client/index.d.ts +793 -0
- package/clients/bongos-client/index.mjs +614 -0
- package/clients/bongos-client/package.json +32 -0
- package/config/branding.neutral.json +60 -0
- package/config/design-tokens.neutral.json +51 -0
- package/config/design-tokens.schema.json +96 -0
- package/config/modules.neutral.json +9 -0
- package/docker-compose.yml +52 -0
- package/docker-entrypoint.sh +30 -0
- package/docs/adr/0001-stack-choice-single-vps.md +45 -0
- package/docs/adr/0002-digitalocean-over-hetzner.md +27 -0
- package/docs/adr/0003-cloudflare-origin-cert-over-letsencrypt.md +35 -0
- package/docs/adr/0004-amazonprimea-name-and-trademark-acceptance.md +45 -0
- package/docs/adr/0005-invisible-other-players-in-v1.md +37 -0
- package/docs/adr/0006-singleton-worldroom-plus-queueroom.md +30 -0
- package/docs/adr/0007-persistent-identity-via-localstorage-uuid.md +31 -0
- package/docs/adr/0008-family-based-tile-generation.md +86 -0
- package/docs/adr/0008-google-chat-oauth-user-auth.md +37 -0
- package/docs/adr/0009-autotile-architecture.md +181 -0
- package/docs/adr/0010-pms-architecture.md +70 -0
- package/docs/adr/0011-terrain-id-rendering-model.md +174 -0
- package/docs/adr/0012-ground-object-cell-split.md +208 -0
- package/docs/adr/0013-paths-as-object-overlays-with-autotile-dispatch.md +158 -0
- package/docs/adr/0014-families-canonical-over-vocabulary.md +103 -0
- package/docs/adr/0015-task-dependencies-and-auto-promotion.md +125 -0
- package/docs/adr/0016-trust-boundary-server-enforced-permissions.md +132 -0
- package/docs/adr/0017-code-simplification-and-repo-cleanliness.md +74 -0
- package/docs/adr/0018-three-rank-model-goes-live.md +97 -0
- package/docs/adr/0019-red-team-bounty-payout-table.md +52 -0
- package/docs/adr/0020-security-model-public-stub.md +70 -0
- package/docs/adr/0021-per-builder-skill-model-preferences.md +99 -0
- package/docs/adr/0022-secrets-policy.md +124 -0
- package/docs/adr/0023-kind-multipliers-and-idea-bonus.md +118 -0
- package/docs/adr/0024-cloneable-repo-local-first-memory.md +277 -0
- package/docs/adr/0024-multi-agent-system-architecture.md +125 -0
- package/docs/adr/0025-offsite-backup-vendor-digitalocean-spaces.md +59 -0
- package/docs/adr/0025-structured-criterion-task-link.md +44 -0
- package/docs/adr/0026-bfg-memory-hygiene-and-cross-builder-learning.md +117 -0
- package/docs/adr/0027-bfg-session-inefficiency-evaluator.md +170 -0
- package/docs/adr/0028-honest-llm-spend-accounting.md +109 -0
- package/docs/adr/0029-status-page-outage-resilience.md +59 -0
- package/docs/adr/0030-builders-hall-live-updates.md +59 -0
- package/docs/adr/0031-cloud-dev-environments-for-builders.md +222 -0
- package/docs/adr/0032-discord-mirror-of-gds.md +50 -0
- package/docs/adr/0033-discord-bot-service-principal.md +82 -0
- package/docs/adr/0034-thetes-graduated-newcomer-rank.md +53 -0
- package/docs/adr/0035-builder-onboarding-three-paths.md +128 -0
- package/docs/adr/0036-builders-subdomain-and-ui-reorg.md +40 -0
- package/docs/adr/0037-discord-channel-management.md +51 -0
- package/docs/adr/0038-chromebook-ttyd-cloudflare-tunnel.md +111 -0
- package/docs/adr/0039-setup-first-onboarding-ux.md +49 -0
- package/docs/adr/0040-remote-control-default-browser-onramp.md +47 -0
- package/docs/adr/0041-temporary-grader-bypass-killswitch.md +40 -0
- package/docs/adr/0042-builder-self-deploy-ci-auto-merge.md +82 -0
- package/docs/adr/0043-git-ssh-trust-boundary-and-rank-floor-on-permission-paths.md +74 -0
- package/docs/adr/0044-mediterranean-palette-replacement.md +73 -0
- package/docs/adr/0044-per-box-live-game-preview.md +57 -0
- package/docs/adr/0045-devbox-desktop-app.md +133 -0
- package/docs/adr/0046-sandbox-first-review-gate.md +72 -0
- package/docs/adr/0047-discord-bugs-intake-anti-abuse.md +36 -0
- package/docs/adr/0048-works-in-progress-ia-split.md +32 -0
- package/docs/adr/0049-split-parallel-safety-contract.md +46 -0
- package/docs/adr/0050-device-flow-admission-invite-gated-by-default.md +43 -0
- package/docs/adr/0051-full-session-transcript-corpus.md +57 -0
- package/docs/adr/0052-sandbox-for-everyone-game-only-preview.md +70 -0
- package/docs/adr/0053-scoped-dev-box-session.md +55 -0
- package/docs/adr/0054-session-token-reward-cost-plus.md +63 -0
- package/docs/adr/0055-server-mediated-branch-publish.md +47 -0
- package/docs/adr/0056-prod-deploy-script-mirror-and-healthcheck-retry.md +62 -0
- package/docs/adr/0057-container-cost-ledger.md +28 -0
- package/docs/adr/0057-discord-archon-approval-channels.md +64 -0
- package/docs/adr/0058-automatic-gate-surface-gatekeeper.md +64 -0
- package/docs/adr/0059-single-approval-remove-devbox-approval-gate.md +37 -0
- package/docs/adr/0060-gds-retrieval-layer.md +97 -0
- package/docs/adr/0061-context-layer-decomposition.md +61 -0
- package/docs/adr/0062-medusa-instance-model-decoupling.md +107 -0
- package/docs/adr/0063-generated-repo-map-symbol-skeleton.md +44 -0
- package/docs/adr/0064-rename-medusa-to-cloud-bongos.md +49 -0
- package/docs/adr/0065-agpl-nonprofit-ai-first-governance.md +69 -0
- package/docs/adr/0066-generated-file-map-sections.md +51 -0
- package/docs/adr/0067-session-start-fast-forward-pull.md +43 -0
- package/docs/adr/0068-shared-art-key-for-newcomers.md +38 -0
- package/docs/adr/0069-hall-live-channel-sse-decouple.md +35 -0
- package/docs/adr/0070-deterministic-session-card-delivery.md +44 -0
- package/docs/adr/0071-box-confirm-before-destroyed-and-drift-reconcile.md +59 -0
- package/docs/adr/0072-bongos-app-mac-signed-first-windows-deferred.md +35 -0
- package/docs/adr/0072-dev-box-code-staleness-visibility.md +39 -0
- package/docs/adr/0073-builder-needs-signal-and-byok-gemini-key.md +64 -0
- package/docs/adr/0073-secrets-scan-exclude-uri-detector.md +37 -0
- package/docs/adr/0074-memory-map-stays-light.md +32 -0
- package/docs/adr/0075-per-system-cost-attribution.md +37 -0
- package/docs/adr/0076-in-session-deterministic-compaction.md +58 -0
- package/docs/adr/0077-content-addressed-llm-cache.md +32 -0
- package/docs/adr/0078-deterministic-first-cron.md +48 -0
- package/docs/adr/0079-value-gated-autonomous-engagement.md +39 -0
- package/docs/adr/0080-llm-cache-api-transport-and-trust-model.md +46 -0
- package/docs/adr/0081-tool-agnostic-design-layer.md +62 -0
- package/docs/adr/0082-productized-key-storage-provisioning.md +32 -0
- package/docs/adr/0082-server-side-merge-conflict-auto-resolution.md +55 -0
- package/docs/adr/0083-modular-architecture-strangler-build-plan.md +143 -0
- package/docs/adr/0084-auto-derived-per-task-rank-floor.md +86 -0
- package/docs/adr/0085-remove-default-per-builder-spend-cap.md +39 -0
- package/docs/adr/0086-goal-scoped-work-hierarchy.md +123 -0
- package/docs/adr/0087-bongos-app-architecture-and-handoff-contract.md +49 -0
- package/docs/adr/0087-compete-on-governance-not-tooling-cursor.md +65 -0
- package/docs/adr/0088-consistent-character-generative-animation.md +169 -0
- package/docs/adr/0089-modular-multi-model-adversarial-grader.md +179 -0
- package/docs/adr/0090-metic-task-authoring.md +73 -0
- package/docs/adr/0091-bounding-the-kernel-and-db-carve.md +106 -0
- package/docs/adr/0092-hosting-module-and-on-prem-target.md +117 -0
- package/docs/adr/0093-tranche-2-core-carve-sequence.md +72 -0
- package/docs/adr/0094-repo-atlas-self-drawing-codebase-map.md +49 -0
- package/docs/adr/0095-borrowed-memory-and-retrieval-concepts.md +65 -0
- package/docs/adr/0095-cross-agent-context-management.md +58 -0
- package/docs/adr/0096-require-reward-before-workable.md +209 -0
- package/docs/adr/0097-one-active-claim-per-session-and-worktree-binding.md +46 -0
- package/docs/adr/0097-retroactive-reward-backfill.md +124 -0
- package/docs/adr/0098-public-mirror-publish-manifest.md +92 -0
- package/docs/adr/0099-delayed-redacted-mirror-export.md +55 -0
- package/docs/adr/0100-two-repo-instance-model.md +60 -0
- package/docs/adr/0101-goal-hierarchy-phase-5-judge-membership-reward.md +90 -0
- package/docs/adr/0102-finish-bounding-the-kernel.md +36 -0
- package/docs/adr/0103-core-first-extraction-cloud-bongos-trunk.md +70 -0
- package/docs/adr/0103-gdsv4-bongos-consolidation.md +28 -0
- package/docs/adr/0104-trust-gds-api-channel-in-auto-mode.md +42 -0
- package/docs/adr/0105-instance-seed-migrations-out-of-core.md +47 -0
- package/docs/adr/0106-goal-owner-manager-authority.md +84 -0
- package/docs/adr/0107-module-upstreaming-contribution-to-core-catalog.md +83 -0
- package/docs/adr/0108-instance-composition-configurable-root.md +87 -0
- package/docs/adr/0109-self-describing-openapi-and-hosted-docs.md +44 -0
- package/docs/adr/0110-untrack-whole-file-generated-nav-docs.md +49 -0
- package/docs/adr/0111-instance-hosting-provisioning-module.md +135 -0
- package/docs/adr/0112-private-goals-invitations-join-requests.md +72 -0
- package/docs/adr/0113-sandbox-studio-descope-superseded-by-0044-0052.md +41 -0
- package/docs/adr/0114-instance-docs-discovery-contract.md +32 -0
- package/docs/adr/0115-scheduled-routines-portability.md +31 -0
- package/docs/adr/0116-api-error-envelope-and-code-taxonomy.md +62 -0
- package/docs/adr/0117-api-versioning-and-deprecation-policy.md +50 -0
- package/docs/adr/0118-api-contract-source-of-truth-code-first.md +47 -0
- package/docs/adr/0119-api-pagination-contract.md +34 -0
- package/docs/adr/0120-pay-on-land-and-builder-owned-rebase-gate.md +108 -0
- package/docs/adr/0121-greenfield-vs-brownfield-onboarding-adopt-existing-repo.md +97 -0
- package/docs/adr/0122-onboarding-diagram-renders-deploy-rendered-off-git.md +43 -0
- package/docs/adr/0123-box-idle-sweep-autosave-before-destroy.md +36 -0
- package/docs/adr/0124-typed-api-response-bodies.md +37 -0
- package/docs/adr/0125-control-plane-scaffolds-standalone-instance-repo.md +36 -0
- package/docs/adr/0126-dedicated-cloudbongos-control-plane-droplet.md +30 -0
- package/docs/adr/0127-cross-box-fleet-observability.md +64 -0
- package/docs/adr/0128-provisioning-runner-privilege-and-db-auth-model.md +46 -0
- package/docs/adr/0129-cloudbongos-control-plane-pull-deploy.md +34 -0
- package/docs/adr/0130-provision-remote-exec-over-ssh.md +61 -0
- package/docs/adr/0131-rank-scoped-skill-visibility.md +47 -0
- package/docs/adr/0132-cohost-fleet-control-plane-migration.md +54 -0
- package/docs/adr/0133-github-app-manifest-onboarding-signin.md +42 -0
- package/docs/adr/0134-private-first-npm-distribution.md +38 -0
- package/docs/adr/README.md +208 -0
- package/docs/api/openapi.json +13720 -0
- package/docs/api-reference.md +437 -0
- package/docs/architecture.md +244 -0
- package/docs/branding-contract.md +66 -0
- package/docs/branding-fill-prompt.md +25 -0
- package/docs/canonical-permissions.md +241 -0
- package/docs/design/container-exterior-tiles.md +49 -0
- package/docs/design/container-exterior.md +81 -0
- package/docs/design/container-interior.md +77 -0
- package/docs/design/modular-architecture/00-research-report.md +107 -0
- package/docs/design/modular-architecture/01-architecture.md +125 -0
- package/docs/design/modular-architecture/02-module-map.md +116 -0
- package/docs/design/modular-architecture/03-builder-flows.md +104 -0
- package/docs/design/modular-architecture/04-module-lifecycle.md +62 -0
- package/docs/design/modular-architecture/README.md +27 -0
- package/docs/design/vanilla-hall-ui-redesign-scope.md +284 -0
- package/docs/design/world-map-scroll.md +41 -0
- package/docs/design-contract.md +320 -0
- package/docs/file-map.md +418 -0
- package/docs/handoff-template.md +92 -0
- package/docs/modules-contract.md +293 -0
- package/docs/onboarding/browser-terminal-guide.md +73 -0
- package/docs/onboarding/diagrams/01-task-lifecycle.mmd +28 -0
- package/docs/onboarding/diagrams/02-rank-ladder.mmd +54 -0
- package/docs/onboarding/diagrams/03-drachmae-karma.mmd +37 -0
- package/docs/onboarding/diagrams/04-architecture.mmd +51 -0
- package/docs/onboarding/diagrams/05-versioning.mmd +29 -0
- package/docs/onboarding/diagrams/README.md +94 -0
- package/docs/onboarding/diagrams/assertions.json +170 -0
- package/docs/onboarding/diagrams/puppeteer-config.json +1 -0
- package/docs/onboarding/diagrams/render-config.json +9 -0
- package/docs/onboarding/drachmae-and-karma.md +178 -0
- package/docs/onboarding/primer.md +202 -0
- package/docs/project-context.template.md +67 -0
- package/docs/recipes/README.md +35 -0
- package/docs/recipes/audit-replay.md +100 -0
- package/docs/recipes/bongos-cli-release.md +66 -0
- package/docs/recipes/builder-box-lifecycle.md +152 -0
- package/docs/recipes/claude-design-loop.md +143 -0
- package/docs/recipes/claude-gemini-bongos-doors.md +155 -0
- package/docs/recipes/cloudbongos-staging-gate.md +139 -0
- package/docs/recipes/cloudbongos-standup.md +111 -0
- package/docs/recipes/devbox-app-release.md +93 -0
- package/docs/recipes/devbox-app-windows-test.md +128 -0
- package/docs/recipes/failed-ship-recovery-proof.md +102 -0
- package/docs/recipes/figma-design-loop.md +129 -0
- package/docs/recipes/gds-db-backup.md +255 -0
- package/docs/recipes/instance-deploy.md +37 -0
- package/docs/recipes/managed-settings-remote-control.md +416 -0
- package/docs/recipes/memory-backup.md +71 -0
- package/docs/recipes/memory-sync-conflicts.md +98 -0
- package/docs/recipes/multi-builder-merge.md +78 -0
- package/docs/recipes/ops-gotchas.md +212 -0
- package/docs/recipes/overnight-builder.md +53 -0
- package/docs/recipes/packaging-the-core.md +49 -0
- package/docs/recipes/parallel-load-results-2026-05-30.md +63 -0
- package/docs/recipes/parallel-load-test.md +32 -0
- package/docs/recipes/pixel-art-pipeline.md +411 -0
- package/docs/recipes/private-npm-distribution.md +79 -0
- package/docs/recipes/search-index-ingestion.md +67 -0
- package/docs/recipes/self-host.md +60 -0
- package/docs/recipes/ship-and-regrade.md +72 -0
- package/docs/recipes/staging-data.md +50 -0
- package/docs/recipes/staging-environment.md +215 -0
- package/docs/recipes/upgrading-the-core.md +58 -0
- package/docs/research/cursor-competitive-analysis.md +255 -0
- package/docs/research/llm-model-agnostic-and-cheaper-grader.md +227 -0
- package/migrations/003_pms.sql +284 -0
- package/migrations/004_pms_cost_idempotency.sql +13 -0
- package/migrations/005_pms_smoke_filter.sql +44 -0
- package/migrations/006_pms_v2.sql +378 -0
- package/migrations/007_pms_v2_hierarchy_trigger.sql +59 -0
- package/migrations/008_pms_v2_migration_allocator.sql +27 -0
- package/migrations/009_pms_v2_blockers_table.sql +68 -0
- package/migrations/010_uptime.sql +29 -0
- package/migrations/011_backfill_v2_v3_done_when.sql +20 -0
- package/migrations/012_pms_v2_task_lifecycle_states.sql +82 -0
- package/migrations/013_claim_locking.sql +22 -0
- package/migrations/014_pms_task_discipline.sql +86 -0
- package/migrations/015_pms_estimation_calibration.sql +140 -0
- package/migrations/016_pms_task_grades.sql +60 -0
- package/migrations/017_version_progress_exclude_abandoned.sql +49 -0
- package/migrations/019_rename_pms_v3_to_gds_v3.sql +65 -0
- package/migrations/020_task_dependencies.sql +99 -0
- package/migrations/021_v3_renumber_and_deps.sql +224 -0
- package/migrations/022_v3_reconcile_dep_gated_status.sql +41 -0
- package/migrations/023_pms_rank.sql +30 -0
- package/migrations/025_builder_exit_status.sql +15 -0
- package/migrations/027_builders_preferred_disciplines.sql +46 -0
- package/migrations/028_tasks_parallel_safe.sql +71 -0
- package/migrations/029_rank_three_live.sql +32 -0
- package/migrations/030_vulnerability_reports.sql +61 -0
- package/migrations/031_reward_simplification.sql +57 -0
- package/migrations/032_repo_health_snapshots.sql +56 -0
- package/migrations/033_audit_log.sql +64 -0
- package/migrations/034_lifecycle_breakdown_leaf_only.sql +62 -0
- package/migrations/035_auth_token_hygiene.sql +66 -0
- package/migrations/037_builder_skill_model_prefs.sql +44 -0
- package/migrations/038_task_override_requests.sql +51 -0
- package/migrations/039_newcomer_friendly_column.sql +124 -0
- package/migrations/040_builder_karma.sql +58 -0
- package/migrations/041_kind_multipliers_and_idea_bonus.sql +42 -0
- package/migrations/042_criterion_proposal_workflow.sql +78 -0
- package/migrations/043_builder_onboarding_observability.sql +66 -0
- package/migrations/044_tasks_requires_rank.sql +97 -0
- package/migrations/045_builder_onboarding_state.sql +147 -0
- package/migrations/046_cost_log_builder_attribution.sql +42 -0
- package/migrations/054_builder_memory.sql +108 -0
- package/migrations/055_task_criteria.sql +90 -0
- package/migrations/058_peer_votes.sql +41 -0
- package/migrations/059_onboarding_pick_disciplines.sql +59 -0
- package/migrations/060_access_requests.sql +46 -0
- package/migrations/061_backfill_override_ship_attribution.sql +29 -0
- package/migrations/062_session_records.sql +34 -0
- package/migrations/063_session_records_tool_errors_idx.sql +11 -0
- package/migrations/064_grade_attempts.sql +18 -0
- package/migrations/065_bfg_principal.sql +58 -0
- package/migrations/066_live_notify_triggers.sql +69 -0
- package/migrations/067_builder_boxes.sql +117 -0
- package/migrations/067_discord_bot_foundation.sql +69 -0
- package/migrations/068_thetes_requires_rank.sql +27 -0
- package/migrations/069_builder_ssh_keys.sql +66 -0
- package/migrations/070_box_intents.sql +101 -0
- package/migrations/071_box_first_provision_approval.sql +46 -0
- package/migrations/072_onboarding_ship_three_remove_primer.sql +80 -0
- package/migrations/073_box_terminal_access.sql +46 -0
- package/migrations/075_builder_sound_prefs.sql +28 -0
- package/migrations/078_box_claude_active.sql +22 -0
- package/migrations/079_box_first_connected_at.sql +20 -0
- package/migrations/081_tasks_needs_migration.sql +34 -0
- package/migrations/084_tasks_security_sensitive.sql +24 -0
- package/migrations/085_security_engagement_docs.sql +34 -0
- package/migrations/086_rename_disciplines.sql +125 -0
- package/migrations/088_builders_anthropic_link.sql +28 -0
- package/migrations/089_builders_monthly_budget.sql +19 -0
- package/migrations/090_box_scoped_sessions.sql +38 -0
- package/migrations/091_session_token_reward.sql +44 -0
- package/migrations/093_tasks_sandbox_review.sql +22 -0
- package/migrations/102_remove_box_first_provision_approval.sql +58 -0
- package/migrations/103_search_chunks.sql +90 -0
- package/migrations/104_builder_box_blocked.sql +34 -0
- package/migrations/105_box_host_keys.sql +35 -0
- package/migrations/111_medusa_customer0_framing.sql +35 -0
- package/migrations/112_drop_track_check.sql +25 -0
- package/migrations/113_merge_lease.sql +16 -0
- package/migrations/114_cloudbongos_rename_live_strings.sql +32 -0
- package/migrations/118_currency_label_decoupling.sql +23 -0
- package/migrations/119_builder_behavior_prefs.sql +31 -0
- package/migrations/121_box_code_version.sql +37 -0
- package/migrations/122_builder_gemini_key.sql +30 -0
- package/migrations/123_cost_log_tiers.sql +33 -0
- package/migrations/124_cost_baseline.sql +45 -0
- package/migrations/125_llm_cache.sql +54 -0
- package/migrations/126_autonomy_runs.sql +33 -0
- package/migrations/143_cost_calibration.sql +63 -0
- package/migrations/145_backfill_task_requires_rank.sql +84 -0
- package/migrations/160_goal_tier.sql +88 -0
- package/migrations/163_polymorphic_dependencies.sql +187 -0
- package/migrations/164_event_sound_prefs.sql +20 -0
- package/migrations/165_task_module_key.sql +15 -0
- package/migrations/171_claims_published_head_sha.sql +24 -0
- package/migrations/174_close_orphaned_claims_on_terminal_tasks.sql +30 -0
- package/migrations/175_task_grades_diff_hash.sql +9 -0
- package/migrations/176_promotion_respects_open_blockers.sql +58 -0
- package/migrations/176_ui_discipline.sql +40 -0
- package/migrations/177_require_reward_before_workable.sql +76 -0
- package/migrations/178_reward_gate_auto_assign_revert_autopromote.sql +61 -0
- package/migrations/179_search_chunk_usefulness.sql +33 -0
- package/migrations/180_one_active_claim_per_session.sql +54 -0
- package/migrations/181_cost_log_skill_name.sql +33 -0
- package/migrations/184_claim_release_requested.sql +25 -0
- package/migrations/185_module_upstreaming_goal_wiring.sql +59 -0
- package/migrations/187_goal_sort_order.sql +30 -0
- package/migrations/187_tasks_kind_check_add_verify.sql +21 -0
- package/migrations/README.md +88 -0
- package/migrations/core_188_goal_visibility_and_membership_requests.sql +71 -0
- package/migrations/core_189_core_upgrades_ledger.sql +37 -0
- package/migrations/core_189_credit_log_task_id_index.sql +19 -0
- package/migrations/core_190_rebuild_claimable_task_views.sql +71 -0
- package/migrations/instance/018_pms_v3_planning_seed.sql +131 -0
- package/migrations/instance/080_gds_v4_planning_seed.sql +75 -0
- package/migrations/instance/110_medusa_planning_seed.sql +70 -0
- package/migrations/instance/120_bongos_v1_planning_seed.sql +69 -0
- package/migrations/instance/144_bongos_v1_module_system_criterion.sql +26 -0
- package/migrations/instance/159_bongos_v1_goal_hierarchy_criterion.sql +29 -0
- package/migrations/instance/172_v2_world_planning_seed.sql +163 -0
- package/migrations/instance/173_bongos_v1_c7_core_modularized.sql +33 -0
- package/migrations/instance/182_gdsv4_bongos_consolidation.sql +132 -0
- package/migrations/instance/183_gdsv4_carryover_themed_goals.sql +116 -0
- package/migrations/instance/186_bongos_v1_governance_planning_seed.sql +69 -0
- package/modules/autonomy/CLAUDE.md +49 -0
- package/modules/autonomy/db.js +50 -0
- package/modules/autonomy/module.json +13 -0
- package/modules/autonomy/pollers/routine-timers.js +146 -0
- package/modules/autonomy/routes/autonomy.js +37 -0
- package/modules/builder-settings/CLAUDE.md +58 -0
- package/modules/builder-settings/builder-needs.js +115 -0
- package/modules/builder-settings/db.js +168 -0
- package/modules/builder-settings/display-name.js +84 -0
- package/modules/builder-settings/event-sound-prefs.js +169 -0
- package/modules/builder-settings/interaction-prefs.js +201 -0
- package/modules/builder-settings/model-alloc-prefs.js +147 -0
- package/modules/builder-settings/module.json +10 -0
- package/modules/builder-settings/render-prefs.js +103 -0
- package/modules/builder-settings/routes/settings.js +417 -0
- package/modules/builder-settings/settings.js +52 -0
- package/modules/builder-settings/skill-prefs.js +196 -0
- package/modules/builder-settings/sound-prefs.js +178 -0
- package/modules/builder-settings/wandering-prefs.js +282 -0
- package/modules/dev-box/CLAUDE.md +38 -0
- package/modules/dev-box/box-access.js +275 -0
- package/modules/dev-box/box-credential.js +94 -0
- package/modules/dev-box/box-onboard.js +486 -0
- package/modules/dev-box/boxes.js +842 -0
- package/modules/dev-box/db.js +39 -0
- package/modules/dev-box/module.json +14 -0
- package/modules/dev-box/routes/box.js +977 -0
- package/modules/discord/CLAUDE.md +50 -0
- package/modules/discord/auth.js +54 -0
- package/modules/discord/bug-attachments.js +210 -0
- package/modules/discord/db.js +96 -0
- package/modules/discord/discord-approvals.js +145 -0
- package/modules/discord/discord-audit.js +29 -0
- package/modules/discord/discord-bot.js +545 -0
- package/modules/discord/discord-bugs.js +257 -0
- package/modules/discord/discord-channels.js +412 -0
- package/modules/discord/discord-inbound.js +147 -0
- package/modules/discord/discord-message-buffer.js +54 -0
- package/modules/discord/discord-reaction.js +186 -0
- package/modules/discord/discord-role-sync.js +318 -0
- package/modules/discord/module.json +14 -0
- package/modules/discord/pollers/discord-bot.js +19 -0
- package/modules/discord/routes/bug-attachments.js +44 -0
- package/modules/discord/routes/discord.js +102 -0
- package/modules/discord/ship-broadcast.js +78 -0
- package/modules/discord/webhook.js +74 -0
- package/modules/economy/CLAUDE.md +48 -0
- package/modules/economy/achievements.js +594 -0
- package/modules/economy/cost-classify.js +331 -0
- package/modules/economy/cost-summary-shape.js +90 -0
- package/modules/economy/cost.js +438 -0
- package/modules/economy/credits.js +430 -0
- package/modules/economy/migrations/economy_001_fix_gds_shipper_description.sql +91 -0
- package/modules/economy/module.json +10 -0
- package/modules/economy/reward.js +61 -0
- package/modules/economy/routes/cost.js +97 -0
- package/modules/economy/routes/leaderboard.js +26 -0
- package/modules/economy/routes/reward.js +42 -0
- package/modules/economy/streak.js +285 -0
- package/modules/grading/CLAUDE.md +42 -0
- package/modules/grading/db.js +39 -0
- package/modules/grading/grader-rubric.json +151 -0
- package/modules/grading/grader-workers/efficiency.js +213 -0
- package/modules/grading/grader-workers/extract-json.js +80 -0
- package/modules/grading/grader-workers/fence.js +100 -0
- package/modules/grading/grader-workers/hacker.js +239 -0
- package/modules/grading/grader-workers/index.js +183 -0
- package/modules/grading/grader-workers/narc.js +207 -0
- package/modules/grading/grader-workers/quality.js +198 -0
- package/modules/grading/grader-workers/rubric.js +20 -0
- package/modules/grading/grader-workers/worker-prompt.js +89 -0
- package/modules/grading/grader-workers/worker-verdict.js +50 -0
- package/modules/grading/grader.js +1790 -0
- package/modules/grading/module.json +12 -0
- package/modules/grading/routes/grade.js +51 -0
- package/modules/hall-ui/CLAUDE.md +61 -0
- package/modules/hall-ui/module.json +14 -0
- package/modules/hall-ui/public/atlas.html +180 -0
- package/modules/hall-ui/public/atlas.js +336 -0
- package/modules/hall-ui/public/box-panel.js +423 -0
- package/modules/hall-ui/public/brand-apply.js +117 -0
- package/modules/hall-ui/public/builders.js +3028 -0
- package/modules/hall-ui/public/chime.wav +0 -0
- package/modules/hall-ui/public/copy-on-click.js +174 -0
- package/modules/hall-ui/public/cursors/arrow.png +0 -0
- package/modules/hall-ui/public/cursors/hand-pointer.png +0 -0
- package/modules/hall-ui/public/cursors/magnifier-out.png +0 -0
- package/modules/hall-ui/public/cursors/magnifier.png +0 -0
- package/modules/hall-ui/public/diagram-viewer.css +125 -0
- package/modules/hall-ui/public/diagram-viewer.js +330 -0
- package/modules/hall-ui/public/diagrams.html +113 -0
- package/modules/hall-ui/public/dom-utils.js +212 -0
- package/modules/hall-ui/public/drachmae.html +68 -0
- package/modules/hall-ui/public/drachmae.js +136 -0
- package/modules/hall-ui/public/gate.html +143 -0
- package/modules/hall-ui/public/gate.js +228 -0
- package/modules/hall-ui/public/goals-page.js +1297 -0
- package/modules/hall-ui/public/goals.html +376 -0
- package/modules/hall-ui/public/goals.js +119 -0
- package/modules/hall-ui/public/hall-widgets.js +189 -0
- package/modules/hall-ui/public/harbor.html +167 -0
- package/modules/hall-ui/public/harbor.js +335 -0
- package/modules/hall-ui/public/index.html +116 -0
- package/modules/hall-ui/public/instances-panel.js +172 -0
- package/modules/hall-ui/public/md-reader.js +234 -0
- package/modules/hall-ui/public/modules.html +119 -0
- package/modules/hall-ui/public/modules.js +154 -0
- package/modules/hall-ui/public/new-project-wizard.js +186 -0
- package/modules/hall-ui/public/not-ready.html +48 -0
- package/modules/hall-ui/public/pair.html +119 -0
- package/modules/hall-ui/public/pair.js +132 -0
- package/modules/hall-ui/public/primer.css +404 -0
- package/modules/hall-ui/public/primer.html +85 -0
- package/modules/hall-ui/public/primer.js +641 -0
- package/modules/hall-ui/public/profile.html +85 -0
- package/modules/hall-ui/public/profile.js +236 -0
- package/modules/hall-ui/public/ranks.html +69 -0
- package/modules/hall-ui/public/ranks.js +206 -0
- package/modules/hall-ui/public/roadmap.html +209 -0
- package/modules/hall-ui/public/roadmap.js +375 -0
- package/modules/hall-ui/public/sessions.html +92 -0
- package/modules/hall-ui/public/sessions.js +222 -0
- package/modules/hall-ui/public/settings.html +640 -0
- package/modules/hall-ui/public/settings.js +1219 -0
- package/modules/hall-ui/public/shell.js +495 -0
- package/modules/hall-ui/public/style.css +1748 -0
- package/modules/hall-ui/public/task-detail.js +253 -0
- package/modules/hall-ui/public/task.html +83 -0
- package/modules/hall-ui/public/task.js +326 -0
- package/modules/hall-ui/public/watch.html +333 -0
- package/modules/hall-ui/public/watch.js +859 -0
- package/modules/hall-ui/public/work.html +469 -0
- package/modules/hall-ui/public/work.js +1292 -0
- package/modules/ideas/CLAUDE.md +37 -0
- package/modules/ideas/blockers.js +100 -0
- package/modules/ideas/inbox.js +459 -0
- package/modules/ideas/module.json +10 -0
- package/modules/ideas/routes/blockers.js +120 -0
- package/modules/ideas/routes/inbox.js +230 -0
- package/modules/lifecycle/CLAUDE.md +63 -0
- package/modules/lifecycle/conflict-resolve.js +436 -0
- package/modules/lifecycle/db.js +4970 -0
- package/modules/lifecycle/done-when.js +355 -0
- package/modules/lifecycle/github-push.js +969 -0
- package/modules/lifecycle/goal-conflicts.js +133 -0
- package/modules/lifecycle/hierarchy.js +104 -0
- package/modules/lifecycle/lifecycle.js +58 -0
- package/modules/lifecycle/merge-lock.js +261 -0
- package/modules/lifecycle/migrations/lifecycle_001_goal_first_leads.sql +28 -0
- package/modules/lifecycle/migrations/lifecycle_002_backfill_orphan_task_goals.sql +36 -0
- package/modules/lifecycle/module.json +13 -0
- package/modules/lifecycle/pollers/publish-reconciler.js +20 -0
- package/modules/lifecycle/publish-reconciler.js +418 -0
- package/modules/lifecycle/routes/analytics.js +63 -0
- package/modules/lifecycle/routes/claims.js +506 -0
- package/modules/lifecycle/routes/dependencies.js +82 -0
- package/modules/lifecycle/routes/done-when.js +136 -0
- package/modules/lifecycle/routes/gate-approvals.js +197 -0
- package/modules/lifecycle/routes/goals.js +1419 -0
- package/modules/lifecycle/routes/lifecycle.js +43 -0
- package/modules/lifecycle/routes/tasks.js +1703 -0
- package/modules/lifecycle/routes/versions.js +128 -0
- package/modules/lifecycle/ship-card.js +505 -0
- package/modules/lifecycle/ship-preflight.js +225 -0
- package/modules/lifecycle/task-classifier.js +512 -0
- package/modules/lifecycle/version-close.js +106 -0
- package/modules/memory/CLAUDE.md +40 -0
- package/modules/memory/learnings.js +275 -0
- package/modules/memory/memory.js +572 -0
- package/modules/memory/module.json +12 -0
- package/modules/memory/routes/learnings.js +90 -0
- package/modules/memory/routes/memory.js +916 -0
- package/modules/memory/routes/search.js +188 -0
- package/modules/memory/search-chunker.js +252 -0
- package/modules/memory/search.js +320 -0
- package/modules/onboarding/CLAUDE.md +55 -0
- package/modules/onboarding/approval-broadcast.js +59 -0
- package/modules/onboarding/db.js +54 -0
- package/modules/onboarding/module.json +10 -0
- package/modules/onboarding/newcomer-restock.js +212 -0
- package/modules/onboarding/onboarding-state.js +532 -0
- package/modules/onboarding/onboarding.js +508 -0
- package/modules/onboarding/port.js +63 -0
- package/modules/onboarding/routes/access-requests.js +208 -0
- package/modules/onboarding/routes/onboarding.js +54 -0
- package/modules/security/CLAUDE.md +44 -0
- package/modules/security/module.json +10 -0
- package/modules/security/routes/reports.js +251 -0
- package/modules/security/secret-scrub.js +201 -0
- package/modules/security/security.js +294 -0
- package/modules/sessions/CLAUDE.md +39 -0
- package/modules/sessions/bfg.js +357 -0
- package/modules/sessions/db.js +326 -0
- package/modules/sessions/module.json +10 -0
- package/modules/sessions/pulse.js +149 -0
- package/modules/sessions/routes/sessions.js +331 -0
- package/modules/status-ui/CLAUDE.md +47 -0
- package/modules/status-ui/module.json +14 -0
- package/modules/status-ui/public/README.md +29 -0
- package/modules/status-ui/public/cursors/arrow.png +0 -0
- package/modules/status-ui/public/cursors/hand-pointer.png +0 -0
- package/modules/status-ui/public/index.html +363 -0
- package/modules/status-ui/public/snapshots/.gitkeep +0 -0
- package/modules/status-ui/public/status.js +1375 -0
- package/modules/status-ui/public/style.css +1342 -0
- package/package-lock.json +975 -0
- package/package.json +28 -0
- package/public-docs/index.html +35 -0
- package/public-docs/redoc.standalone.js +1838 -0
- package/public-docs/redoc.standalone.js.LICENSE.txt +102 -0
- package/public-landing/buddha.png +0 -0
- package/public-landing/create.html +868 -0
- package/public-landing/index.html +168 -0
- package/scripts/bongos-mcp.js +28 -0
- package/scripts/cron/style_guide_audit.sh +134 -0
- package/scripts/discord/README.md +52 -0
- package/scripts/discord/lib.js +80 -0
- package/scripts/discord/post.js +51 -0
- package/scripts/gds/CLAUDE.md +144 -0
- package/scripts/gds/abandon.js +58 -0
- package/scripts/gds/adopt-detect.js +123 -0
- package/scripts/gds/adopt-import.js +111 -0
- package/scripts/gds/adopt-preflight.js +121 -0
- package/scripts/gds/api.js +78 -0
- package/scripts/gds/architect-audit.js +288 -0
- package/scripts/gds/art-stage.js +152 -0
- package/scripts/gds/audit-authorship.sh +243 -0
- package/scripts/gds/audit-deps.js +121 -0
- package/scripts/gds/audit-exports.js +128 -0
- package/scripts/gds/audit-replay.sh +161 -0
- package/scripts/gds/audit-ships.js +251 -0
- package/scripts/gds/autonomy-gate.js +135 -0
- package/scripts/gds/backfill-cost.js +165 -0
- package/scripts/gds/backfill-sessions.js +351 -0
- package/scripts/gds/backfill-task-rewards.js +408 -0
- package/scripts/gds/backup.js +94 -0
- package/scripts/gds/bfg-principal-token.js +65 -0
- package/scripts/gds/box-auth-check.js +160 -0
- package/scripts/gds/box-connect-lib.js +453 -0
- package/scripts/gds/box.js +1258 -0
- package/scripts/gds/build-bongos.js +94 -0
- package/scripts/gds/capture.js +123 -0
- package/scripts/gds/cf-tunnel.js +419 -0
- package/scripts/gds/ci-grade.js +82 -0
- package/scripts/gds/claim-recall.js +112 -0
- package/scripts/gds/claim.js +333 -0
- package/scripts/gds/classify-discipline.js +153 -0
- package/scripts/gds/claude-materialize.js +176 -0
- package/scripts/gds/cleanup-orphans.js +74 -0
- package/scripts/gds/cli-lib.js +518 -0
- package/scripts/gds/code.js +101 -0
- package/scripts/gds/codemod-rename-src-gds.js +145 -0
- package/scripts/gds/conductor-dispatch.js +426 -0
- package/scripts/gds/context-pack.js +228 -0
- package/scripts/gds/coreB-carve-proof.sh +716 -0
- package/scripts/gds/cost.js +47 -0
- package/scripts/gds/db-backup-nightly.sh +160 -0
- package/scripts/gds/db-backup-offsite.sh +152 -0
- package/scripts/gds/demote.js +40 -0
- package/scripts/gds/design-sync.js +62 -0
- package/scripts/gds/diagnose-achievements.js +118 -0
- package/scripts/gds/diagram-facts.js +319 -0
- package/scripts/gds/discipline-modes.json +25 -0
- package/scripts/gds/discord-channels.js +66 -0
- package/scripts/gds/do-api.js +176 -0
- package/scripts/gds/docs-entropy.js +403 -0
- package/scripts/gds/doctor.js +389 -0
- package/scripts/gds/feedback-latest.js +94 -0
- package/scripts/gds/fetch-art-key.js +106 -0
- package/scripts/gds/fetch-sound-prefs.js +88 -0
- package/scripts/gds/figma-design-sync.js +61 -0
- package/scripts/gds/fitness.js +1446 -0
- package/scripts/gds/gate-review.js +322 -0
- package/scripts/gds/gating.js +325 -0
- package/scripts/gds/gds-db-backup.service +24 -0
- package/scripts/gds/gds-db-backup.timer +20 -0
- package/scripts/gds/gds-db-offsite.service +29 -0
- package/scripts/gds/gds-db-offsite.timer +18 -0
- package/scripts/gds/gen-api-client.js +508 -0
- package/scripts/gds/gen-api-docs.js +1037 -0
- package/scripts/gds/gen-atlas.js +366 -0
- package/scripts/gds/gen-diagrams.js +608 -0
- package/scripts/gds/gen-file-map.js +196 -0
- package/scripts/gds/gen-repo-map.js +519 -0
- package/scripts/gds/gen-session-index.js +210 -0
- package/scripts/gds/git-merge-regen.js +147 -0
- package/scripts/gds/grade-smoke.js +205 -0
- package/scripts/gds/hooks/pre-push.js +169 -0
- package/scripts/gds/http-api-client.js +88 -0
- package/scripts/gds/init.js +903 -0
- package/scripts/gds/install-git-hooks.js +114 -0
- package/scripts/gds/key-card.js +213 -0
- package/scripts/gds/key-status.js +126 -0
- package/scripts/gds/land-watch.js +168 -0
- package/scripts/gds/learning-capture.js +145 -0
- package/scripts/gds/lib.sh +44 -0
- package/scripts/gds/linkify-refs.js +473 -0
- package/scripts/gds/local-preview-lib.js +159 -0
- package/scripts/gds/local-preview.js +95 -0
- package/scripts/gds/login.js +225 -0
- package/scripts/gds/main-audit.js +279 -0
- package/scripts/gds/me.js +88 -0
- package/scripts/gds/memory-map.js +174 -0
- package/scripts/gds/merge-lock.js +71 -0
- package/scripts/gds/migration-namespace.js +200 -0
- package/scripts/gds/mirror-lineage-check.js +319 -0
- package/scripts/gds/mirror-redact.js +305 -0
- package/scripts/gds/module.js +482 -0
- package/scripts/gds/newcomer-floor.config.json +13 -0
- package/scripts/gds/newcomer-floor.js +415 -0
- package/scripts/gds/newcomer-floor.templates.json +86 -0
- package/scripts/gds/newcomer-floor.test.js +235 -0
- package/scripts/gds/next-number.js +163 -0
- package/scripts/gds/oauth-secret.js +197 -0
- package/scripts/gds/onboard.js +217 -0
- package/scripts/gds/onboarding-analyze.js +226 -0
- package/scripts/gds/onboarding-config.js +178 -0
- package/scripts/gds/onboarding-ship.js +92 -0
- package/scripts/gds/package-core.js +684 -0
- package/scripts/gds/paste-token.js +131 -0
- package/scripts/gds/portability-smoke-art.sh +85 -0
- package/scripts/gds/portability-smoke-memory.sh +147 -0
- package/scripts/gds/provision.js +1324 -0
- package/scripts/gds/publish-manifest.js +307 -0
- package/scripts/gds/pulse.js +309 -0
- package/scripts/gds/push-main.js +45 -0
- package/scripts/gds/read-session-export.js +359 -0
- package/scripts/gds/reauth.js +149 -0
- package/scripts/gds/recall.js +135 -0
- package/scripts/gds/release.js +71 -0
- package/scripts/gds/render-ideas.js +173 -0
- package/scripts/gds/repo-metrics.js +363 -0
- package/scripts/gds/resolve-skill-model.js +57 -0
- package/scripts/gds/run-routine.js +197 -0
- package/scripts/gds/run-unit-tests.js +178 -0
- package/scripts/gds/sandbox-stage.js +653 -0
- package/scripts/gds/search-ingest-db.js +209 -0
- package/scripts/gds/search-ingest-md.js +225 -0
- package/scripts/gds/security-baseline-check.sh +180 -0
- package/scripts/gds/seed-adopt-tasks.js +75 -0
- package/scripts/gds/seed-api-contract-goal-tasks.js +141 -0
- package/scripts/gds/seed-bongos-app-tasks.js +294 -0
- package/scripts/gds/seed-bongos-coreB-tranche1-tasks.js +81 -0
- package/scripts/gds/seed-bongos-coreB-tranche2-tasks.js +100 -0
- package/scripts/gds/seed-bongos-goal-hierarchy-tasks.js +307 -0
- package/scripts/gds/seed-bongos-module-system-tasks.js +346 -0
- package/scripts/gds/seed-bongos-tasks.js +214 -0
- package/scripts/gds/seed-gds-v4-tasks.js +624 -0
- package/scripts/gds/seed-governance-tasks.js +340 -0
- package/scripts/gds/seed-medusa-tasks.js +440 -0
- package/scripts/gds/seed-module-upstreaming.js +219 -0
- package/scripts/gds/seed-productization-tasks.js +235 -0
- package/scripts/gds/seed-provisioning-tasks.js +83 -0
- package/scripts/gds/seed-staging.sh +104 -0
- package/scripts/gds/seed-v2-world-tasks.js +283 -0
- package/scripts/gds/seed-v3-tasks.js +1981 -0
- package/scripts/gds/session-cost.js +393 -0
- package/scripts/gds/session-digest.js +179 -0
- package/scripts/gds/session-eval.js +576 -0
- package/scripts/gds/session.js +404 -0
- package/scripts/gds/setup.js +504 -0
- package/scripts/gds/shell.js +100 -0
- package/scripts/gds/ship.js +3618 -0
- package/scripts/gds/smoke-batch-claim.sh +213 -0
- package/scripts/gds/smoke-batch-release.sh +296 -0
- package/scripts/gds/smoke-box.sh +150 -0
- package/scripts/gds/smoke-claim-consistency.sh +212 -0
- package/scripts/gds/smoke-dependencies.sh +84 -0
- package/scripts/gds/smoke-gds.js +125 -0
- package/scripts/gds/smoke-write.sh +168 -0
- package/scripts/gds/start.js +782 -0
- package/scripts/gds/status.js +365 -0
- package/scripts/gds/triage.js +366 -0
- package/scripts/gds/upgrade.js +421 -0
- package/scripts/gds/validate-design.js +254 -0
- package/scripts/gds/version-close.js +549 -0
- package/scripts/migrate.sh +183 -0
- package/scripts/migrate_cost_ledger.sh +178 -0
- package/scripts/public-mirror-export.js +291 -0
- package/scripts/render-diagrams.sh +88 -0
- package/scripts/security/dep-audit.js +276 -0
- package/scripts/setup-builder.js +274 -0
- package/scripts/setup-builder.sh +28 -0
- package/scripts/snapshots/backfill-history.mjs +292 -0
- package/scripts/snapshots/maybe-render-on-deploy.sh +66 -0
- package/scripts/snapshots/render-pre-art-eras.mjs +329 -0
- package/scripts/snapshots/render-world.mjs +322 -0
- package/scripts/status-mirror-sync.js +192 -0
- package/scripts/status-probe.mjs +185 -0
- package/server.js +212 -0
- package/src/asset-version.js +71 -0
- package/src/bongos/CLAUDE.md +64 -0
- package/src/bongos/api-errors.js +281 -0
- package/src/bongos/api-path-404.js +67 -0
- package/src/bongos/api-prefix.js +38 -0
- package/src/bongos/app-pair.js +172 -0
- package/src/bongos/auth.js +979 -0
- package/src/bongos/cascade-dispatch.js +123 -0
- package/src/bongos/db-kernel.js +252 -0
- package/src/bongos/db.js +911 -0
- package/src/bongos/goal-scope-check.js +120 -0
- package/src/bongos/hierarchy-config.js +189 -0
- package/src/bongos/live-channel.js +145 -0
- package/src/bongos/llm-cache.js +260 -0
- package/src/bongos/llm-pricing.js +220 -0
- package/src/bongos/metrics.js +286 -0
- package/src/bongos/middleware/audit.js +274 -0
- package/src/bongos/middleware/error-envelope.js +93 -0
- package/src/bongos/middleware/rate-limit.js +195 -0
- package/src/bongos/module-scope-map.js +271 -0
- package/src/bongos/optimizer.js +166 -0
- package/src/bongos/path-match.js +47 -0
- package/src/bongos/permission-path-check.js +248 -0
- package/src/bongos/pool.js +55 -0
- package/src/bongos/repo-info.js +91 -0
- package/src/bongos/route-rank-check.js +420 -0
- package/src/bongos/routes/CLAUDE.md +43 -0
- package/src/bongos/routes/_helpers.js +369 -0
- package/src/bongos/routes/audit-log.js +59 -0
- package/src/bongos/routes/auth.js +755 -0
- package/src/bongos/routes/backup.js +104 -0
- package/src/bongos/routes/builders.js +526 -0
- package/src/bongos/routes/healthz.js +16 -0
- package/src/bongos/routes/instance.js +129 -0
- package/src/bongos/routes/live.js +125 -0
- package/src/bongos/routes/llm-cache.js +119 -0
- package/src/bongos/routes/me.js +380 -0
- package/src/bongos/routes/modules.js +131 -0
- package/src/bongos/routes/optimizer.js +54 -0
- package/src/bongos/routes/public.js +476 -0
- package/src/bongos/routes/security.js +207 -0
- package/src/bongos/routes.js +166 -0
- package/src/bongos/secret-box.js +177 -0
- package/src/bongos/sensitive-surfaces.js +30 -0
- package/src/bongos/serve-internal.js +889 -0
- package/src/bongos/uptime-poller.js +90 -0
- package/src/bongos-downloads.js +70 -0
- package/src/branding.js +182 -0
- package/src/build-info.js +77 -0
- package/src/devbox-downloads.js +67 -0
- package/src/instance-config.js +200 -0
- package/src/module-api.js +366 -0
- package/src/module-loader/loader.js +268 -0
- package/src/module-loader/manifest-schema.js +140 -0
- package/src/module-loader/provenance.js +28 -0
- package/src/module-loader/semver.js +100 -0
- package/src/module-seams.js +291 -0
- package/src/modules.js +254 -0
- package/src/platform-server.js +135 -0
- package/src/ui/adapters/claude-design/index.js +333 -0
- package/src/ui/adapters/figma/index.js +328 -0
- package/tests/abandon_task.mjs +138 -0
- package/tests/achievements_reconcile.mjs +167 -0
- package/tests/adopt_detect.mjs +141 -0
- package/tests/adopt_import.mjs +132 -0
- package/tests/adopt_preflight.mjs +105 -0
- package/tests/anti_grid.mjs +89 -0
- package/tests/api_client.mjs +231 -0
- package/tests/api_docs.mjs +283 -0
- package/tests/api_error_envelope_buildcheck.mjs +56 -0
- package/tests/api_error_envelope_middleware.mjs +99 -0
- package/tests/api_error_registry.mjs +108 -0
- package/tests/api_pagination_contract.mjs +51 -0
- package/tests/api_path_404.mjs +96 -0
- package/tests/app_pair.mjs +168 -0
- package/tests/architect.mjs +140 -0
- package/tests/art_key.mjs +121 -0
- package/tests/art_stage.mjs +121 -0
- package/tests/asset_version.mjs +94 -0
- package/tests/atlas.mjs +69 -0
- package/tests/audit_deps.mjs +74 -0
- package/tests/audit_middleware.mjs +385 -0
- package/tests/auth_admission_gate.mjs +164 -0
- package/tests/auth_anthropic_identity.mjs +95 -0
- package/tests/auth_duplicate_cookie.mjs +56 -0
- package/tests/auth_error_brand.mjs +77 -0
- package/tests/auth_flow_slice1.mjs +223 -0
- package/tests/auth_inactive_builder.mjs +94 -0
- package/tests/auth_page_gate.mjs +92 -0
- package/tests/auth_session_ttl.mjs +155 -0
- package/tests/autonomous_fit_protected_paths.mjs +115 -0
- package/tests/autonomy_gate.mjs +85 -0
- package/tests/autotile_variants.mjs +256 -0
- package/tests/autotile_xverify.mjs +133 -0
- package/tests/backfill_sessions.mjs +101 -0
- package/tests/backfill_task_rewards.mjs +152 -0
- package/tests/backup_cli.mjs +104 -0
- package/tests/bfg.mjs +327 -0
- package/tests/bfg_write.mjs +423 -0
- package/tests/bongos_box_connect.mjs +89 -0
- package/tests/bongos_dispatch.mjs +74 -0
- package/tests/bongos_downloads.mjs +118 -0
- package/tests/bongos_login.mjs +34 -0
- package/tests/box_access.mjs +186 -0
- package/tests/box_auth_check.mjs +114 -0
- package/tests/box_code_staleness.mjs +116 -0
- package/tests/box_connect_e2e.mjs +196 -0
- package/tests/box_cost.mjs +70 -0
- package/tests/box_dns_repoint.mjs +151 -0
- package/tests/box_host_keys.mjs +102 -0
- package/tests/box_onboard.mjs +317 -0
- package/tests/box_scope_session.mjs +115 -0
- package/tests/box_ship_permissions.mjs +71 -0
- package/tests/box_terminal_ssrf.mjs +90 -0
- package/tests/boxes.mjs +1255 -0
- package/tests/branding.mjs +88 -0
- package/tests/bug_attachments.mjs +189 -0
- package/tests/build_info.mjs +88 -0
- package/tests/builder_needs.mjs +99 -0
- package/tests/cap_newcomer_tasks.mjs +114 -0
- package/tests/cascade-dispatch.mjs +95 -0
- package/tests/cf_tunnel.mjs +459 -0
- package/tests/claim_recall.mjs +150 -0
- package/tests/claims_bind_session.mjs +47 -0
- package/tests/claude_materialize.mjs +148 -0
- package/tests/cli_box_scope.mjs +52 -0
- package/tests/cli_lib_formatters.mjs +87 -0
- package/tests/cli_token_reissue.mjs +147 -0
- package/tests/client_bundle_route.mjs +47 -0
- package/tests/cloud_bongos_pack.mjs +85 -0
- package/tests/conductor.mjs +496 -0
- package/tests/confirm_attribution.mjs +156 -0
- package/tests/conflict_resolve.mjs +462 -0
- package/tests/context_pack.mjs +240 -0
- package/tests/cost.mjs +94 -0
- package/tests/cost_audit.mjs +122 -0
- package/tests/cost_budget_status.mjs +78 -0
- package/tests/cost_reconcile.mjs +102 -0
- package/tests/cost_summary_shape.mjs +94 -0
- package/tests/credit_grant.mjs +376 -0
- package/tests/criterion_progress.mjs +220 -0
- package/tests/criterion_proposal.mjs +109 -0
- package/tests/criterion_ref_parse.mjs +53 -0
- package/tests/currency_label.mjs +119 -0
- package/tests/day_cycle.mjs +197 -0
- package/tests/dependencies_migration.mjs +77 -0
- package/tests/dependencies_polymorphic.mjs +212 -0
- package/tests/deploy_instance.mjs +78 -0
- package/tests/devbox_downloads.mjs +122 -0
- package/tests/diff_derived_signals.mjs +115 -0
- package/tests/discord_approvals.mjs +174 -0
- package/tests/discord_autojoin.mjs +158 -0
- package/tests/discord_bot.mjs +94 -0
- package/tests/discord_bugs.mjs +297 -0
- package/tests/discord_channels.mjs +337 -0
- package/tests/discord_foundation.mjs +76 -0
- package/tests/discord_inbound.mjs +190 -0
- package/tests/discord_message_buffer.mjs +87 -0
- package/tests/discord_oauth.mjs +55 -0
- package/tests/discord_reaction.mjs +170 -0
- package/tests/discord_role_sync.mjs +151 -0
- package/tests/display_name.mjs +123 -0
- package/tests/dns_preflight.mjs +74 -0
- package/tests/event_sound_prefs.mjs +194 -0
- package/tests/eviction_policy.mjs +279 -0
- package/tests/figma_adapter.mjs +199 -0
- package/tests/file_map.mjs +91 -0
- package/tests/first_admin_bootstrap.mjs +40 -0
- package/tests/fitness.mjs +435 -0
- package/tests/fitness_two_root.mjs +104 -0
- package/tests/fixtures/session-506-digest.json +34 -0
- package/tests/gate_approvals.mjs +451 -0
- package/tests/gate_review.mjs +152 -0
- package/tests/git_merge_regen.mjs +151 -0
- package/tests/github_push_ancestry.mjs +119 -0
- package/tests/github_push_land_proof.mjs +127 -0
- package/tests/github_push_merge_driver.mjs +175 -0
- package/tests/goal_abuse_matrix.mjs +187 -0
- package/tests/goal_achievement.mjs +146 -0
- package/tests/goal_conflicts.mjs +305 -0
- package/tests/goal_dependencies_read.mjs +73 -0
- package/tests/goal_member_roles.mjs +420 -0
- package/tests/goal_membership_requests.mjs +332 -0
- package/tests/goal_routes.mjs +203 -0
- package/tests/goal_scope_check.mjs +167 -0
- package/tests/goal_tier.mjs +312 -0
- package/tests/goal_wall_proof.mjs +112 -0
- package/tests/grade_attempts.mjs +73 -0
- package/tests/grade_attribution.mjs +117 -0
- package/tests/grade_diff_hash.mjs +191 -0
- package/tests/grade_server_authoritative.mjs +305 -0
- package/tests/grade_unavailable_display.mjs +66 -0
- package/tests/grader.mjs +1960 -0
- package/tests/grader_bypass.mjs +57 -0
- package/tests/grader_panel.mjs +252 -0
- package/tests/grader_prompt_fencing.mjs +192 -0
- package/tests/helpers.mjs +52 -0
- package/tests/hierarchy-config.mjs +81 -0
- package/tests/init.mjs +463 -0
- package/tests/instance_config.mjs +76 -0
- package/tests/instance_manifest.mjs +110 -0
- package/tests/interaction_prefs.mjs +72 -0
- package/tests/key-card.mjs +110 -0
- package/tests/key-status.mjs +45 -0
- package/tests/land_watch.mjs +115 -0
- package/tests/lifecycle-card.mjs +145 -0
- package/tests/lifecycle_breakdown_view.mjs +236 -0
- package/tests/linkify_refs.mjs +264 -0
- package/tests/live_channel.mjs +128 -0
- package/tests/live_sse.mjs +122 -0
- package/tests/llm-cache-route.mjs +110 -0
- package/tests/llm-cache.mjs +140 -0
- package/tests/llm-pricing.mjs +152 -0
- package/tests/local_preview.mjs +136 -0
- package/tests/main_audit.mjs +137 -0
- package/tests/memory_isolation.mjs +431 -0
- package/tests/memory_map.mjs +107 -0
- package/tests/memory_pull.mjs +429 -0
- package/tests/merge_lease.mjs +100 -0
- package/tests/merge_lock.mjs +312 -0
- package/tests/metrics.mjs +147 -0
- package/tests/migration_allocation.mjs +146 -0
- package/tests/migration_namespace.mjs +185 -0
- package/tests/migrations_fresh_replay_guard.mjs +38 -0
- package/tests/mirror_lineage_fulltree.mjs +45 -0
- package/tests/mirror_lineage_proof.mjs +72 -0
- package/tests/mirror_redact.mjs +193 -0
- package/tests/model_alloc_prefs.mjs +63 -0
- package/tests/module-scope-map.mjs +88 -0
- package/tests/module_api.mjs +110 -0
- package/tests/module_cli.mjs +292 -0
- package/tests/module_contributions.mjs +148 -0
- package/tests/module_loader.mjs +286 -0
- package/tests/module_manifest.mjs +194 -0
- package/tests/module_owned_tests.mjs +105 -0
- package/tests/module_provenance.mjs +34 -0
- package/tests/module_route_rank.mjs +147 -0
- package/tests/module_seams.mjs +68 -0
- package/tests/modules.mjs +156 -0
- package/tests/modules_route.mjs +38 -0
- package/tests/newcomer_floor.mjs +17 -0
- package/tests/newcomer_restock.mjs +80 -0
- package/tests/next_number.mjs +154 -0
- package/tests/oauth_secret.mjs +60 -0
- package/tests/onboard.mjs +70 -0
- package/tests/onboarding_gate.mjs +267 -0
- package/tests/onboarding_observability.mjs +344 -0
- package/tests/onboarding_route_signals.mjs +175 -0
- package/tests/onboarding_state.mjs +346 -0
- package/tests/one_active_claim_per_session.mjs +111 -0
- package/tests/orphaned_claim_ship.mjs +135 -0
- package/tests/override_attribution.mjs +142 -0
- package/tests/override_request_ownership.mjs +235 -0
- package/tests/package_core.mjs +435 -0
- package/tests/parallel-load.mjs +402 -0
- package/tests/path_match.mjs +62 -0
- package/tests/permission_path.mjs +151 -0
- package/tests/platform_boot.mjs +167 -0
- package/tests/pre_compact.mjs +60 -0
- package/tests/preview_server.mjs +127 -0
- package/tests/profile_route.mjs +197 -0
- package/tests/provision.mjs +805 -0
- package/tests/provisioning_github_app_routes.mjs +98 -0
- package/tests/public_mirror_export.mjs +124 -0
- package/tests/public_task_resolver.mjs +112 -0
- package/tests/publish_branch_route.mjs +422 -0
- package/tests/publish_manifest.mjs +184 -0
- package/tests/publish_reconciler.mjs +728 -0
- package/tests/rank_gate.mjs +463 -0
- package/tests/rate_limit_public.mjs +217 -0
- package/tests/read_session_export.mjs +89 -0
- package/tests/recall_cli.mjs +82 -0
- package/tests/recall_hints.mjs +119 -0
- package/tests/recent_shipped_window.mjs +80 -0
- package/tests/regrade_eligibility.mjs +202 -0
- package/tests/render_prefs.mjs +122 -0
- package/tests/repo_map.mjs +92 -0
- package/tests/reward_gate.mjs +284 -0
- package/tests/route_rank_check.mjs +243 -0
- package/tests/route_validation.mjs +490 -0
- package/tests/routine_timers.mjs +72 -0
- package/tests/rubric_fixtures.mjs +140 -0
- package/tests/run_routine.mjs +69 -0
- package/tests/sandbox_stage.mjs +582 -0
- package/tests/scrubber_corpus.mjs +257 -0
- package/tests/search_chunker.mjs +209 -0
- package/tests/search_ingest.mjs +96 -0
- package/tests/search_ingest_db.mjs +88 -0
- package/tests/search_isolation.mjs +204 -0
- package/tests/search_route.mjs +95 -0
- package/tests/secret_box.mjs +189 -0
- package/tests/security_docs.mjs +186 -0
- package/tests/security_route.mjs +108 -0
- package/tests/served_paths_shipped.mjs +118 -0
- package/tests/session-cards.mjs +142 -0
- package/tests/session_506_regression.mjs +69 -0
- package/tests/session_caps.mjs +238 -0
- package/tests/session_cost.mjs +133 -0
- package/tests/session_digest.mjs +73 -0
- package/tests/session_eval.mjs +386 -0
- package/tests/session_index.mjs +105 -0
- package/tests/session_records.mjs +369 -0
- package/tests/session_search.mjs +78 -0
- package/tests/session_start_freshness.mjs +123 -0
- package/tests/setup_smoke.mjs +154 -0
- package/tests/ship_autolinkify.mjs +60 -0
- package/tests/ship_automerge_injection.mjs +174 -0
- package/tests/ship_broadcast_routing.mjs +125 -0
- package/tests/ship_broadcast_server.mjs +175 -0
- package/tests/ship_card.mjs +280 -0
- package/tests/ship_ci_deploy.mjs +374 -0
- package/tests/ship_preflight.mjs +368 -0
- package/tests/ship_premerge.mjs +75 -0
- package/tests/ship_resume.mjs +129 -0
- package/tests/ship_upload_skip.mjs +89 -0
- package/tests/ship_zero_commit.mjs +60 -0
- package/tests/single_host_hall.mjs +98 -0
- package/tests/skill_prefs.mjs +150 -0
- package/tests/smoke_preflight.mjs +66 -0
- package/tests/snapshot_picker.mjs +233 -0
- package/tests/sound_prefs.mjs +198 -0
- package/tests/sprite_facing.mjs +35 -0
- package/tests/status-probe.mjs +89 -0
- package/tests/status_backfill.mjs +94 -0
- package/tests/stop_refcheck.mjs +127 -0
- package/tests/streak.mjs +175 -0
- package/tests/subdomain_auth.mjs +58 -0
- package/tests/task_classifier_vocab.mjs +41 -0
- package/tests/task_create_idempotency.mjs +96 -0
- package/tests/task_goal_link.mjs +93 -0
- package/tests/task_ownership_gate.mjs +125 -0
- package/tests/terrain_picker.mjs +298 -0
- package/tests/touches_overlap.mjs +75 -0
- package/tests/triage_development.mjs +140 -0
- package/tests/turn_in_place.mjs +280 -0
- package/tests/upgrade.mjs +357 -0
- package/tests/verify_task_guard.mjs +64 -0
- package/tests/version_close.mjs +76 -0
- package/tests/versions_route.mjs +93 -0
- package/tests/walkability.mjs +188 -0
- package/tests/wandering_prefs.mjs +176 -0
- package/tests/worktree_disambiguation.mjs +105 -0
- package/tests/worktree_guard.mjs +90 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# ADR 0091 — Bounding the kernel and carving `db.js` per-domain (Config-B core decomposition)
|
|
2
|
+
|
|
3
|
+
**Status:** Accepted (2026-06-26) · task [#1570](https://example.com/builders#/task/1570) (BV1.R67) · criterion **C7 `gds-core-modularized`** (BONGOS-V1) · planning [session 2026-06-26](../session-logs/<redacted>.md)
|
|
4
|
+
|
|
5
|
+
**Amends:** [ADR 0083](<redacted>.md) — the strangler build plan. ADR 0083 §"The four module moves" cut the four *feature* modules (dev-box, game, discord, art-pipeline) around an undifferentiated core. This ADR extends the same strangler to the **core itself**: it bounds the kernel as a real artifact and defines how a *core domain* becomes a module. It changes nothing about 0083's five rules, the loader, or the fitness ratchet — it gives the "kernel" 0083 kept referring to a concrete file roster, and the "carve `db.js` per-domain" 0083 mentioned ([02 §3](../design/modular-architecture/02-module-map.md)) a mechanism.
|
|
6
|
+
|
|
7
|
+
**Builds on:** [ADR 0016](<redacted>.md) (server-enforced rank boundary — the kernel *is* the trust boundary), [ADR 0043](<redacted>.md) (protected paths), [ADR 0086](<redacted>.md) (module-scope-map), [ADR 0062](<redacted>.md) (core↔host split — same "neutral contract, swappable behind it" shape).
|
|
8
|
+
|
|
9
|
+
**Relates to:** [ADR 0095](<redacted>.md) — the *findability* complement to this ADR's *structural* scoping (authored alongside it): 0091 bounds how much an agent loads (kernel + per-domain modules); 0095 helps the agent find the right place within it (docstrings, greppability, retrieval). The module-header doc-comment convention 0095 adopts is authored per module the carve here defines.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Context
|
|
14
|
+
|
|
15
|
+
ADR 0083's Config A moved the four feature modules — the *least*-coupled ~26% of the tree — into `modules/<key>/`. The audit that opened C7 ([planning 2026-06-26](../session-logs/<redacted>.md)) found the remaining ~70% ("core") is **not one thing**: it is ~8–10 cohesive domains sitting on a small (~3.5k-LOC) trust kernel ([02 §1](../design/modular-architecture/02-module-map.md)), but nothing in the code marks where the kernel ends and a domain begins. Three concrete symptoms:
|
|
16
|
+
|
|
17
|
+
1. **The "kernel" is unbounded.** `fitness.js` `KERNEL_FILES` (`fitness.js:449-456`) is only the **6 module-system-machinery files** (`module-api`, `modules`, `module-seams`, the three `module-loader/*`). The real trust kernel — `auth.js`, `route-rank-check.js`, `permission-path-check.js`, `pool.js`, `secret-box.js`, config/identity — is nowhere named, so no fitness check guards it and no one can say "is this file kernel?" with a yes/no answer.
|
|
18
|
+
2. **`db.js` is a 6063-LOC monolith** (383 exports, `require`d by 23 files) spanning every domain — builder identity, audit, tasks/claims/versions, memory search, grade-attempt logs, security docs, merge leases. It is the single biggest blocker to per-module AI-scoping: a "work on memory" task drags the whole file into context.
|
|
19
|
+
3. **The doorway leaks domain queries.** `src/module-api.js` re-exports `getBuilderById`/`createTask`/`insertAuditLog`/`getBuilderGeminiKeyRow`/`setBuilderBoxBlocked`/`captureIdea` (`module-api.js:86-103`). Some of those (identity, audit, rank) are genuinely kernel; others (`createTask`, gemini keys, box-blocked, `captureIdea`) are **domain** capabilities the kernel should not own. There is also **no `withTx`** on the doorway, so a carved domain that needs a transaction (memory does — `memory.js:107,198,441` run raw `client.query('BEGIN')`) has no kernel-blessed way to get one.
|
|
20
|
+
|
|
21
|
+
This ADR settles the three questions C7's tranche-1 tasks (R68–R74) each execute: **what is the kernel**, **how does a carved domain own its SQL**, and **what does the doorway expose**.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Decision
|
|
26
|
+
|
|
27
|
+
### 1. The kernel is a bounded, enumerated file roster
|
|
28
|
+
|
|
29
|
+
The **kernel** is the trust boundary + identity + the module-system machinery — the *only* code a core-domain module may reach, and only through `src/module-api.js`. It is exactly this roster (this list replaces the 6-file `KERNEL_FILES` in `fitness.js`, the R70 ratchet):
|
|
30
|
+
|
|
31
|
+
| Concern | Files | Why kernel |
|
|
32
|
+
|---|---|---|
|
|
33
|
+
| **Authz gates** | `src/bongos/auth.js` | `requireBuilder`/`requireRank`/`rankMeetsThreshold`/`allowBoxScope`/`requireBfgPrincipal` — the ADR 0016 boundary every route composes |
|
|
34
|
+
| **Trust classification** | `src/bongos/route-rank-check.js`, `src/bongos/permission-path-check.js` | deterministic route→rank + protected-path matching (the "unknown write = blocker" rule + `PROTECTED_GLOBS`, ADR 0043) — cross-cutting, enforced by composition, never "called" by a domain ([02 §5](../design/modular-architecture/02-module-map.md)) |
|
|
35
|
+
| **Secret primitive** | `src/bongos/secret-box.js` | AES-256-GCM box for per-builder secrets at rest |
|
|
36
|
+
| **Data substrate** | `src/bongos/pool.js`, **`src/bongos/db-kernel.js`** *(new, R69)* | the singleton pool + `withTx` + the genuinely-kernel `builders`-identity / `audit_log` / rank-ladder slice carved out of `db.js` |
|
|
37
|
+
| **Config / identity** | `src/instance-config.js`, `src/branding.js`, `src/build-info.js` | host context a module reads, never hardcodes (ADR 0062) |
|
|
38
|
+
| **Shared route helpers** | `src/bongos/routes/_helpers.js` | `validateOrRespond`/`LIMITS` — the request validators the doorway re-exports so a module's routes don't vendor their own |
|
|
39
|
+
| **Module-system machinery** | `src/module-api.js`, `src/modules.js`, `src/module-seams.js`, `src/module-loader/{loader,manifest-schema,semver}.js`, `src/bongos/module-scope-map.js` | the doorway, registry, seam switchboard, disk loader, and the module→path scope map (ADR 0086) |
|
|
40
|
+
|
|
41
|
+
**Everything else in `src/bongos/` is a domain**, destined to become a module (memory, grading, economy, onboarding, ideas, builder-settings, sessions/BFG, security, …) or to stay inside the **lifecycle** state machine (tasks/claims/versions/ship — explicitly **not** split, [02 §4](../design/modular-architecture/02-module-map.md)). The roster is a **ratchet, not a wish**: R70 adds `KERNEL_FILES` = this list **and** a check that no kernel file `require`s a soon-to-be-module domain, so a regression is a red build. `db-kernel.js` joins the roster when R69 creates it; until then the roster is the trust files above (all confirmed present at this commit).
|
|
42
|
+
|
|
43
|
+
### 2. `db.js` is carved per-domain — the module owns its SQL, the kernel owns identity/audit/tx
|
|
44
|
+
|
|
45
|
+
The carve pattern is **already proven** by the discord move (`modules/discord/db.js`, BV1.R47) and the game move (`modules/game/db.js`). C7 ratifies it as *the* mechanism every core-domain carve copies:
|
|
46
|
+
|
|
47
|
+
- A carved domain module ships its own `modules/<key>/db.js` that **requires only `../../src/module-api.js`** and reaches Postgres through the doorway's `pool` (and `withTx` — see Decision §3). Its domain queries are **lifted verbatim** out of `src/bongos/db.js` and **deleted from core** (`db.js` shrinks by that slice). The module re-exports any kernel helpers it consumes (e.g. `insertAuditLog`) off the doorway behind the *same* `db.*` namespace, so the module's own files keep `const db = require('./db')` unchanged.
|
|
48
|
+
- **`db.js` shrinks toward two residues:** (a) the **kernel slice** — builder identity (`getBuilderById`), audit (`insertAuditLog`), the rank ladder (`LIVE_RANK_LADDER`), and `withTx` — extracted to `src/bongos/db-kernel.js` (R69) which the doorway re-exports; and (b) the **lifecycle** state-machine queries (tasks/claims/versions/ship), which stay in core because the lifecycle is not a module.
|
|
49
|
+
- **Boundary-forced duplication is allowed and documented.** Where core *and* a module both need a query against a shared table, the module vendors its own copy (the discord `getDiscordLink`/`recordApplause` precedent) rather than importing core — a module can never `require` core internals. Each such twin carries a "keep in sync" note in the module's `CLAUDE.md`.
|
|
50
|
+
- **Migrations stay additive + namespaced** (ADR 0083 §Module-owned migrations, unchanged). Carving *code* does not move *tables*; a domain's tables are reached through the pool and only ever extended by `modules/<key>/migrations/` going forward. No data moves, no down-path.
|
|
51
|
+
|
|
52
|
+
R69 proves the pattern on **one reference slice**; R72 (memory) and R73 (grading) are the first two real carves.
|
|
53
|
+
|
|
54
|
+
### 3. The doorway exposes kernel capabilities permanently and domain capabilities only as marked, temporary re-exports
|
|
55
|
+
|
|
56
|
+
`src/module-api.js` is classified into three buckets. R68 executes the move and bumps `CORE_VERSION` minor (additive: `withTx`).
|
|
57
|
+
|
|
58
|
+
- **Kernel — stays, permanently** (these legitimately belong to the kernel): all auth gates; `pool`/`getPool`/`instanceDbName`; **`withTx`** *(new)*; `secretBox`; `getBuilderById` (identity), `insertAuditLog` (audit), `LIVE_RANK_LADDER` (rank); all config/identity (`branding`/`resolveEnv`/`config*`); all seams; `buildInfo`/`validateOrRespond`/`LIMITS`; `logger`. After R69 these resolve through `db-kernel.js`, not the monolith.
|
|
59
|
+
- **Domain leak — relocate to the owning module's `db.js` slice** (the module exists today; it just lacks a slice): `setBuilderBoxBlocked` → `modules/dev-box/db.js`; `getBuilderGeminiKeyRow`/`setBuilderGeminiKey`/`clearBuilderGeminiKey` → `modules/art-pipeline/db.js`. R68 deletes these doorway re-exports and the module owns the query (R69 pattern). This severs the last `dev-box`/`art-pipeline` → core-`db.js` dependency.
|
|
60
|
+
- **Domain leak — temporary, behind a `pending-seam` note** (the owning domain is *not* carved in tranche 1, so a clean home does not exist yet): `createTask` (lifecycle), `captureIdea` (ideas), `VOTABLE_TASK_STATUSES` (lifecycle/task-classifier). These **stay on the doorway** for now, each tagged in `module-api.js` as "DOMAIN capability, not kernel — relocates behind a `lifecycle.*` / `ideas.*` port when that domain is carved (tranche 2)." Pretending they're kernel is the thing to avoid; deleting them now would break the discord module (its `db.js` consumes all three). The honest state — *known leak, named owner, tracked* — is what the ADR records.
|
|
61
|
+
|
|
62
|
+
**Why `createTask` is not just made a port now:** the consumer (discord-bugs filing a task) is real, but the *provider* (a lifecycle module) does not exist until tranche 2. Registering a `lifecycle.createTask` port with core itself as the provider would be ceremony with no boundary benefit while lifecycle is still core. The port lands when lifecycle is carved; until then the doorway re-export *is* the seam, explicitly marked.
|
|
63
|
+
|
|
64
|
+
### 4. A capability the lifecycle invokes resolves through a kernel PORT, never a direct import
|
|
65
|
+
|
|
66
|
+
The lifecycle (tasks/claims/versions/ship) stays whole, but the capabilities it *calls* are extracted. `routes/tasks.js` (the ship path) currently `require`s `grader.js` directly — a core→domain edge once grading is a module. R73 replaces it with the seam: grading `registerProvider('grade', …)` at boot; the lifecycle does `resolve('grade')(…)` at ship. This proves the design's load-bearing pattern — *keep the state machine, extract the capability behind a seam* ([04 §1](../design/modular-architecture/04-module-lifecycle.md), [02 §4](../design/modular-architecture/02-module-map.md)) — and closes the audit's "ports were illustrative-only" gap.
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## The sub-task shape (C7 tranche 1 — seeded, dependency-wired)
|
|
71
|
+
|
|
72
|
+
This ADR's deliverable is the decision above **plus** the carve broken into claimable steps. Already seeded under C7 ([planning 2026-06-26](../session-logs/<redacted>.md)); dependency edges authoritative:
|
|
73
|
+
|
|
74
|
+
| Task | Delivers | Depends on |
|
|
75
|
+
|---|---|---|
|
|
76
|
+
| **R67** ([#1570](https://example.com/builders#/task/1570)) | *this ADR* — kernel roster + carve strategy + doorway classification | — |
|
|
77
|
+
| **R68** ([#1571](https://example.com/builders#/task/1571)) | doorway: add `withTx`; relocate the dev-box/art domain leaks; mark the lifecycle/ideas leaks; `CORE_VERSION` minor bump | R67 |
|
|
78
|
+
| **R69** ([#1572](https://example.com/builders#/task/1572)) | the per-domain db-slice pattern + extract `db-kernel.js` (identity/audit/rank/tx) as the reference slice | R67, R68 |
|
|
79
|
+
| **R70** ([#1573](https://example.com/builders#/task/1573)) | fitness: `KERNEL_FILES` = the real roster (§1) + "kernel imports no domain" check | R67 |
|
|
80
|
+
| **R71** ([#1574](https://example.com/builders#/task/1574)) | register `memory` + `grading` keys in `module-scope-map.js`; widen goal 10 scope | R67 |
|
|
81
|
+
| **R72** ([#1575](https://example.com/builders#/task/1575)) | carve `memory` → `modules/memory/` (memory·search·search-chunker·learnings + db slice) | R69, R71 |
|
|
82
|
+
| **R73** ([#1576](https://example.com/builders#/task/1576)) | carve `grading` → `modules/grading/`; lifecycle resolves `grade` via a kernel PORT | R68, R69, R71 |
|
|
83
|
+
| **R74** ([#1578](https://example.com/builders#/task/1578)) | proof: memory + grading live as modules, `db.js` shrank, kernel bounded + fitness green, OTB byte-identical | R72, R73 |
|
|
84
|
+
|
|
85
|
+
**Proof of equivalence at every step** (ADR 0083 / 0062 discipline): after each carve, OTB behaves **byte-for-byte the same**. That is the per-task done-when.
|
|
86
|
+
|
|
87
|
+
**Tranche-1 status: PROVEN** (R74, [#1578](https://example.com/builders#/task/1578)). The five claims above are demonstrated, in one re-runnable command, by [`scripts/gds/coreB-carve-proof.sh`](../../scripts/gds/coreB-carve-proof.sh): memory + grading are loader-discovered modules; `db-kernel.js` + the memory query slice left the `db.js` monolith; `KERNEL_FILES` is the bounded 17-file roster with zero fitness hard-failures (incl. the three ENFORCING C7 boundary checks); grading resolves through the `grade` kernel port (`seams.resolveOptional('grade')`) with no core→grader import; and the 27 DB-free tests exercising the carved surfaces pass unchanged (byte-identical). The ongoing guard is CI — `fitness.js` (the kernel-imports-no-domain ratchet flips red at zero leaks) + `run-unit-tests.js` on every PR; the script is the consolidated demonstration, not a new gate. Tranche 2 (the remaining ~8 core domains) stays deferred per owner until greenlit.
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Consequences
|
|
92
|
+
|
|
93
|
+
**Positive.** The kernel becomes a yes/no artifact a fitness check guards (R70) — the trust boundary stops being "wherever the trust code happens to sit." `db.js` shrinks toward the lifecycle + a small kernel slice, so a core-domain task loads its module + the doorway, not a 6k-LOC monolith (the AI-scoping payoff Config A could not deliver). The doorway stops lying about what is kernel. The `grade`-via-port move makes the seam mechanism real instead of illustrative.
|
|
94
|
+
|
|
95
|
+
**Negative / cost.** More boundaries to enforce (mitigated: fitness, not reviewers). `db.js` carving is delicate — a missed call site is a runtime break, so each carve verifies byte-identical behavior + runs the smoke suite. The honest "temporary doorway leak" bucket (Decision §3, third group) is real debt — but *named, owned, and tracked* debt, retired when tranche 2 carves lifecycle/ideas. Touching `module-api.js`, `fitness.js`, `db.js`, and `route-rank-check.js`/`permission-path-check.js` (kernel trust surfaces) means owner Gate approval is expected on those PRs — the boundary working as designed.
|
|
96
|
+
|
|
97
|
+
**Neutral.** Single-package / single-process / no-bundler preserved (ADR 0083 unchanged). Tranche 2 (the other ~8 core domains: economy, onboarding, ideas, builder-settings, sessions/BFG, security, the UIs, lifecycle-as-its-own-module) is deferred per owner — this ADR proves the pattern on the two cleanest-slicing domains first.
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Alternatives considered
|
|
102
|
+
|
|
103
|
+
- **Leave the kernel implicit (status quo) — rejected.** "The kernel is whatever the trust code happens to be" cannot be fitness-enforced and gives an AI agent no answer to "is this file kernel?" Bounding it is the precondition for every later check.
|
|
104
|
+
- **Carve `db.js` by splitting the file in place (sections, not modules) — rejected.** Section comments already exist and did nothing for coupling or scoping; only moving a slice *out* to `modules/<key>/db.js` (behind the doorway) severs the dependency and shrinks the context an agent loads.
|
|
105
|
+
- **Make every doorway leak a port immediately — rejected for tranche 1.** A port with core as its own provider is ceremony with no boundary benefit until the providing domain is actually a module. Mark the leak, carve the domain, *then* add the port (R73 does exactly this for `grade`, where the provider genuinely becomes a module).
|
|
106
|
+
- **Split the lifecycle state machine into per-route modules (Config C) — rejected** (ADR 0083 already; restated because the `db.js` carve makes it tempting). tasks/claims/versions/ship are one coupled cluster; forcing them apart fights cohesion. Extract the *capabilities* (grade, reward), keep the *machine*.
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# 0092 — Hosting module + on-prem (warehouse) hosting target
|
|
2
|
+
|
|
3
|
+
- **Status:** Accepted (direction decided with the owner 2026-06-27; build is task-pending — see Implementation)
|
|
4
|
+
- **Date:** 2026-06-27
|
|
5
|
+
- **Deciders:** Lars (Archon), Claude
|
|
6
|
+
|
|
7
|
+
**Builds on:** [ADR 0083](<redacted>.md) (modular architecture — the module this capability ships as), [ADR 0089](<redacted>.md) (the `ModelProvider` `openai-compatible` adapter the on-prem inference target reuses, and its decisive hosting-cost finding), [ADR 0062](<redacted>.md) (core↔host decoupling — the warehouse box is host-instance config, not portable core), [ADR 0081](<redacted>.md) (swappable adapters against a neutral contract), [ADR 0031](<redacted>.md) (cloud dev boxes — a workload a later phase may partly displace), [ADR 0060](0060-gds-retrieval-layer.md) (recall/embeddings — a consumer), [ADR 0088](<redacted>.md) (the per-character LoRA deferred as "needs GPU training + an open model" — a workload this enables), [ADR 0016](<redacted>.md) / [ADR 0043](<redacted>.md) (server-enforced trust boundary the box must never weaken), [ADR 0033](<redacted>.md) (the precedent for a useful service that sits *outside* the trust boundary).
|
|
8
|
+
|
|
9
|
+
**Track:** `internal` (a portable Cloud Bongos platform capability).
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Context
|
|
14
|
+
|
|
15
|
+
Example wants to stand up a physical server inside the warehouse to (a) cut software-hosting cost, (b) get cheaper access to open-weight LLMs and code, and (c) capture other on-prem advantages. OTB runs on a <$5K/yr budget ([CLAUDE.md §4](../../CLAUDE.md)): a ~$14/mo DigitalOcean droplet for prod, cloud LLM APIs (Claude for code, Gemini for art), and per-builder cloud dev boxes ([ADR 0031](<redacted>.md)). The largest *variable* cost is LLM spend.
|
|
16
|
+
|
|
17
|
+
This ADR records the **scope-of-use** decision — the first of the four phases the owner set: *scope use → scope build → hardware setup → software use* — and the shape the capability ships in. The build, hardware, and software phases are task-pending.
|
|
18
|
+
|
|
19
|
+
### The reframe: a portable module + a host-specific target
|
|
20
|
+
|
|
21
|
+
A warehouse server is *hardware*; a Cloud Bongos module is *software that mounts into a running instance* ([ADR 0083](<redacted>.md)). So "the hosting module" is **not** "the server in a folder." Following the core↔host split already used for branding ([ADR 0062](<redacted>.md)) and design tools ([ADR 0081](<redacted>.md)):
|
|
22
|
+
|
|
23
|
+
- **The `hosting` module (portable core):** a broker, default-**OFF**, that exposes labeled compute/storage **seams** and resolves each to a configured **target**. The default target is today's cloud/APIs, so a vanilla instance behaves exactly as it does now (fail-to-vanilla, like the loader with no `modules/`).
|
|
24
|
+
- **The warehouse box (host-instance config):** one **on-prem target** an adapter points at, declared in OTB's instance config — not in portable code. Another Cloud Bongos instance declares none and stays all-cloud.
|
|
25
|
+
|
|
26
|
+
Two properties fall straight out, and they answer the two standing objections to on-prem:
|
|
27
|
+
|
|
28
|
+
1. **Nothing depends on the box.** Each seam resolves through `resolveOptional(port, cloudDefaultFn)` ([ADR 0083](<redacted>.md)); a target marked unreachable falls back to cloud per-call. The box is an opportunistic cost-saver, never a single point of failure. (This is also why public, real-time prod — the game's Colyseus rooms — stays in the cloud: you can't fail a live socket over mid-session.)
|
|
29
|
+
2. **Every Example instance shares it.** The owner chose to size and abstract the box as a shared backend across all Example Cloud Bongos instances — one GPU amortized across projects is what raises utilization enough to matter.
|
|
30
|
+
|
|
31
|
+
### Honest economics — what the GPU is and isn't good for
|
|
32
|
+
|
|
33
|
+
[ADR 0089](<redacted>.md)'s market sweep is decisive and we adopt it rather than relitigate: **at low volume, pay-per-call open-model APIs (DeepInfra / OpenRouter) beat self-hosting** — a few-thousand-calls/month workload is ~$1–5/mo on API, and a fixed, cached prompt crushes the bill. A self-hosted GPU only wins when it is *kept busy* or when per-call cloud pricing is high.
|
|
34
|
+
|
|
35
|
+
So the warehouse GPU earns its keep on a **narrower** set than "all inference":
|
|
36
|
+
|
|
37
|
+
- **GPU-bound batch generation** — art image-gen at volume across instances (priced per-image in the cloud).
|
|
38
|
+
- **Model fine-tuning / training** — the per-character LoRA [ADR 0088](<redacted>.md) deferred as "level-2 (needs GPU training + an open model)"; cloud charges steep per-GPU-hour, an owned card amortizes.
|
|
39
|
+
- **Always-busy bulk jobs** — overnight eval/analysis at a scale that saturates the card.
|
|
40
|
+
|
|
41
|
+
The **non-GPU wins** stand on their own:
|
|
42
|
+
|
|
43
|
+
- **Backups + bulk storage** — today our secrets live only on the droplet, *unbacked-up*; a NAS role closes a real gap.
|
|
44
|
+
- **An unmetered experimentation sandbox** — run pipelines and model evals without metering every token.
|
|
45
|
+
- **An always-on cron host** for the ~17 scheduled routines.
|
|
46
|
+
|
|
47
|
+
Conversely — correcting an earlier hand-wave in this session — **embeddings and low-volume grading are cheaper on pay-per-call APIs** and are *not* a GPU justification by themselves; they move on-prem only opportunistically once the box exists, or for data-locality. **Code that ships stays on Claude regardless** (the quality-first rule, [CLAUDE.md §2](../../CLAUDE.md)).
|
|
48
|
+
|
|
49
|
+
### Owner decisions (2026-06-27)
|
|
50
|
+
|
|
51
|
+
1. **Who it serves:** all Example Cloud Bongos instances (shared backend; build the cross-instance abstraction now).
|
|
52
|
+
2. **Quality posture:** **conservative** — local open-weight models do NON-SHIPPING work only (batch gen, training, eval, opportunistic embeddings, storage); shipping code stays on Claude. Expanding posture later is a config change, not a rebuild.
|
|
53
|
+
3. **Proceed:** the capability is worth building — justified by the cross-instance multiplier + the owned-asset/training optionality + the storage/sandbox wins, **not** by near-term API savings alone.
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Decision
|
|
58
|
+
|
|
59
|
+
**Ship a portable `hosting` module (default-OFF, fail-to-vanilla) that brokers compute and storage workloads to configured hosting targets through kernel seams, reusing the [ADR 0089](<redacted>.md) `ModelProvider` adapter contract for inference. A GPU box in the Example warehouse is OTB's first on-prem target — one adapter backend declared in host-instance config, shared across Example instances, with automatic cloud fallback so nothing ever depends on the box.**
|
|
60
|
+
|
|
61
|
+
### 1. The module shape
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
modules/hosting/
|
|
65
|
+
module.json # key "hosting"; default false; coreVersion ^1.x
|
|
66
|
+
routes/hosting.js # Archon-gated admin: register/inspect targets, health, routing policy
|
|
67
|
+
pollers/target-health.js # heartbeat each target; flip healthy/unreachable (drives fallback)
|
|
68
|
+
adapters/ # cloud (default) + on-prem (openai-compatible, per ADR 0089) backends
|
|
69
|
+
migrations/001_hosting_targets.sql # hosting_targets, hosting_jobs (namespaced hosting_*)
|
|
70
|
+
CLAUDE.md # per-module reference
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### 2. Seams it provides (ports)
|
|
74
|
+
|
|
75
|
+
The module registers providers; consumers resolve via `resolveOptional(port, cloudDefaultFn)`, so a box-less or module-off instance degrades to cloud automatically.
|
|
76
|
+
|
|
77
|
+
| Seam | Consumer(s) | Conservative-posture target |
|
|
78
|
+
|---|---|---|
|
|
79
|
+
| `inference.run` | grader ([ADR 0089](<redacted>.md)), eval cron | API by default; on-prem only when saturated / data-local |
|
|
80
|
+
| `imagegen.run` | art-pipeline | **on-prem GPU** (batch) when up, else Gemini |
|
|
81
|
+
| `embeddings.embed` | recall ([ADR 0060](0060-gds-retrieval-layer.md)) | API (cheap) by default; on-prem opportunistic |
|
|
82
|
+
| `training.run` | art-pipeline (LoRA, [ADR 0088](<redacted>.md) L2) | **on-prem GPU** |
|
|
83
|
+
| `storage.put/get` | backups, art assets | **on-prem NAS** + offsite copy |
|
|
84
|
+
|
|
85
|
+
Inference does **not** reinvent [ADR 0089](<redacted>.md): the on-prem target is just one more `openai-compatible` `ModelProvider` endpoint (vLLM / Ollama) alongside the hosted ones. The hosting module adds the *target selection + health/fallback + sharing config* around it.
|
|
86
|
+
|
|
87
|
+
### 3. Network + trust boundary
|
|
88
|
+
|
|
89
|
+
- **Ingress:** the cloud instance reaches the warehouse box over an **outbound tunnel the box initiates** (e.g. Cloudflare Tunnel or WireGuard) — no open inbound ports, no static-IP requirement, no DDoS exposure at the warehouse. This sidesteps the whole residential/commercial-internet problem.
|
|
90
|
+
- **Trust boundary ([ADR 0016](<redacted>.md) / [ADR 0043](<redacted>.md)):** the box runs jobs and holds model weights, but authority stays server-enforced in the cloud GDS. The box sits **outside** the trust boundary — like Discord ([ADR 0033](<redacted>.md)): it can compute, it can never grant rank or land code. A compromised box can degrade or poison *non-shipping* outputs (hence the conservative posture, and the grader staying authoritative), never escalate permissions.
|
|
91
|
+
|
|
92
|
+
### 4. How this subproject is filed (the durable home)
|
|
93
|
+
|
|
94
|
+
- **This ADR** — the decision + shape + phased plan; the pickup point a future session reads.
|
|
95
|
+
- **GDS DB (live state)** — the scoping task [#1618](https://example.com/builders#/task/1618) (shipped with this ADR), and the follow-ons [#1619](https://example.com/builders#/task/1619) (build-scope), [#1620](https://example.com/builders#/task/1620) (hardware), [#1621](https://example.com/builders#/task/1621) (cost read-out).
|
|
96
|
+
- **`modules/hosting/` + its nested `CLAUDE.md`** — created in Phase 2 via `bongos module new hosting`.
|
|
97
|
+
- **Session log** — this session's record under `docs/session-logs/`.
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Consequences
|
|
102
|
+
|
|
103
|
+
- A vanilla Cloud Bongos instance stays **byte-identical to today** (module off → every seam resolves to cloud).
|
|
104
|
+
- OTB gains an owned compute/storage asset and an unmetered sandbox, and closes the secrets-backup gap.
|
|
105
|
+
- **New surface to maintain:** the module, the tunnel, the box. Mitigated by fail-to-vanilla + conservative posture — no shipping path depends on it.
|
|
106
|
+
- Near-term dollar savings are **modest**; the bet is on utilization (training + batch gen, pooled across instances) and optionality. Revisit at the build phase against real spend (task [#1621](https://example.com/builders#/task/1621)).
|
|
107
|
+
|
|
108
|
+
## Implementation
|
|
109
|
+
|
|
110
|
+
Owner-set phased arc — scope use ✅ (this ADR, task [#1618](https://example.com/builders#/task/1618)) → scope build (task [#1619](https://example.com/builders#/task/1619)) → hardware (task [#1620](https://example.com/builders#/task/1620)) → software use. The cost read-out (task [#1621](https://example.com/builders#/task/1621)) is an independent prerequisite input. A full done-when criterion + build task tree gets seeded at the build phase (likely via `/planning-session`).
|
|
111
|
+
|
|
112
|
+
### Open questions (deferred to the build phase)
|
|
113
|
+
|
|
114
|
+
- **Warehouse realities** (internet class, static IP, upload bandwidth, ISP terms on servers, power/cooling/space, on-site hands) — Lars to confirm; they gate the hardware spec (task [#1620](https://example.com/builders#/task/1620)).
|
|
115
|
+
- GPU / VRAM class, and whether one card serves both inference and training.
|
|
116
|
+
- Tunnel technology + secret handling for the box (it must never hold a credential that can land code).
|
|
117
|
+
- Final module key (`hosting` vs `compute`) and whether storage is a separate module.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# ADR 0093 — Tranche-2 core-carve sequence (Config-B, completing C7)
|
|
2
|
+
|
|
3
|
+
**Status:** Accepted (2026-06-27) · task [#1627](https://example.com/builders#/task/1627) (BV1.R76) · criterion **C7 `gds-core-modularized`** (BONGOS-V1) · owner-greenlit
|
|
4
|
+
|
|
5
|
+
**Amends:** [ADR 0091](<redacted>.md) — which carved the first two core domains (memory R72, grading R73) and **explicitly deferred tranche 2 "per owner."** The owner greenlit tranche 2 on 2026-06-27. This ADR fixes the order, the remaining kernel ports, and the lifecycle endgame; it changes nothing about 0091's kernel roster, the carve mechanism, or the fitness ratchet — those ship as reusable infrastructure.
|
|
6
|
+
|
|
7
|
+
**Builds on:** [ADR 0083](<redacted>.md) (the strangler plan + 5 module rules), [02 module-map](../design/modular-architecture/02-module-map.md) (the import-graph evidence + the decided ~16-module roster), [04 module-lifecycle](../design/modular-architecture/04-module-lifecycle.md) (the seam/port mechanism).
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Context
|
|
12
|
+
|
|
13
|
+
Tranche 1 ([ADR 0091](<redacted>.md)) did two things: it **proved the core-carve pattern** on the two cleanest-slicing domains (memory, grading — demonstrated by [`scripts/gds/coreB-carve-proof.sh`](../../scripts/gds/coreB-carve-proof.sh), R74), and it **shipped the infrastructure** every later carve reuses — the bounded kernel roster + `KERNEL_FILES` fitness ratchet (R70), the doorway with `withTx` (R68), the per-domain `db.js` slice pattern + `db-kernel.js` (R69), and the `grade` kernel **port** (R73). That infrastructure is generic: each remaining core domain is now a *pure carve* copying R72/R73, with **no new scaffolding**.
|
|
14
|
+
|
|
15
|
+
What remains is the bulk of the core: ~8 cohesive domains + the two web UIs + the lifecycle state machine ([02 §6](../design/modular-architecture/02-module-map.md) roster). The import-graph scan ([02 §2](../design/modular-architecture/02-module-map.md)) already told us which slice cleanly (economy, ideas, security alongside the proven memory/grading) and which is the coupled cluster (the lifecycle — `tasks → grader/github-push/ship-broadcast`). This ADR turns that evidence into a sequence.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Decision
|
|
20
|
+
|
|
21
|
+
### 1. Carve order — clean-slicing-first, lifecycle last
|
|
22
|
+
|
|
23
|
+
Per [02 §2](../design/modular-architecture/02-module-map.md) (import-graph, not intuition) and §68 ("peel the clean, scan-confirmed modules off one at a time, most self-contained first"):
|
|
24
|
+
|
|
25
|
+
| Task | Carve | ≈LOC | Why this slot |
|
|
26
|
+
|---|---|---:|---|
|
|
27
|
+
| **R77** | economy (credits·cost·streak·achievements·leaderboard) | ~1.0k | clean slice; **also registers the `reward` port** — the lifecycle's last extractable capability (see §2), so it must precede lifecycle |
|
|
28
|
+
| **R78** | ideas (inbox·capture·triage·blockers) | ~0.9k | clean, self-contained |
|
|
29
|
+
| **R79** | security (red-team·bounty, rank-gated) | ~1.0k | clean feature slice ([02 §5](../design/modular-architecture/02-module-map.md): security-the-*feature*, not security-the-property) |
|
|
30
|
+
| **R80** | builder-settings (prefs·builder-needs) | ~1.6k | `me`/`public` stay as thin read facades |
|
|
31
|
+
| **R81** | onboarding (admission·setup·newcomer) | ~1.9k | |
|
|
32
|
+
| **R82** | sessions/BFG (records·cost/eval/digest·corpus) | ~2k | |
|
|
33
|
+
| **R83** | autonomy/MAS (conductor·architect·autonomy-gate·routines) | ~1.5k | cross-cutting — carve seams carefully |
|
|
34
|
+
| **R84** | status-UI (`public-status`) | ~3k | web surface; big but mechanical |
|
|
35
|
+
| **R85** | hall-UI (`public-builders`) | ~13k | largest; mechanical |
|
|
36
|
+
| **R86** | lifecycle (tasks·claims·versions·ship) | ~9k | **last + delicate** — the coupled state machine |
|
|
37
|
+
| **R87** | proof: extend `coreB-carve-proof.sh` to all domains → **C7 satisfied** | — | the criterion's final hinge |
|
|
38
|
+
|
|
39
|
+
### 2. economy registers the `reward` kernel port — the twin of `grade`
|
|
40
|
+
|
|
41
|
+
The lifecycle invokes two domain capabilities at ship: **grade** (already a port, R73) and **reward** (credit allocation — `applyGrade`/credit-log). [02 §3/§4](../design/modular-architecture/02-module-map.md) and the [04 lifecycle](../design/modular-architecture/04-module-lifecycle.md) seam design both name `reward` as the second illustrative port. R77 makes it real: economy `registerProvider('reward', …)` at boot; the lifecycle resolves `seams.resolveOptional('reward')` instead of importing economy. This is why **economy is first and lifecycle is last** — by the time the state machine is carved, every capability it calls is already a kernel port, so the lifecycle module imports only the kernel + resolves ports (the [ADR 0091 §4](<redacted>.md) rule, applied to the whole cluster).
|
|
42
|
+
|
|
43
|
+
### 3. The lifecycle stays ONE module, carved last
|
|
44
|
+
|
|
45
|
+
Do **not** split tasks/claims/versions/ship apart ([02 §4](../design/modular-architecture/02-module-map.md), restated in [ADR 0091](<redacted>.md) alternatives). Keep the state machine whole; the only edges it keeps are kernel + the grade/reward ports. Carving it last means the `db.js` residue at the end is exactly the lifecycle slice + `db-kernel.js` — the shape ADR 0091 §2 predicted.
|
|
46
|
+
|
|
47
|
+
### 4. Every carve is proof-gated; C7 is satisfied by R87
|
|
48
|
+
|
|
49
|
+
Each carve ships only when behavior is byte-identical — `coreB-carve-proof.sh` extended to assert the new module + its slice + its tests. Risk stays **per-domain**, never a big-bang. C7 (`gds-core-modularized`) is satisfied when R87 proves the whole core is decomposed — not before. Tranche 1 proved the *pattern*; tranche 2 completes the *decomposition* the criterion's done-when actually demands.
|
|
50
|
+
|
|
51
|
+
### 5. The "temporary doorway leaks" retire as their domains carve
|
|
52
|
+
|
|
53
|
+
ADR 0091 §3 parked three honest leaks on the doorway (`createTask`, `captureIdea`, `VOTABLE_TASK_STATUSES`) because their owning domains weren't carved. They retire here: `captureIdea` → behind an `ideas.*` seam at R78; `createTask`/`VOTABLE_TASK_STATUSES` → behind a `lifecycle.*` seam at R86. Each carve deletes its leak.
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Consequences
|
|
58
|
+
|
|
59
|
+
**Positive.** The core becomes the ~16-module + kernel roster ([02 §6](../design/modular-architecture/02-module-map.md)); `db.js` shrinks to the lifecycle slice + `db-kernel.js`. A "work on X" task loads module X + the doorway, not a 6k-LOC monolith — the AI-scoping payoff, now realized for the whole core, not just two domains. All doorway leaks retire.
|
|
60
|
+
|
|
61
|
+
**Negative / cost.** ~10 carves, each a focused session (low-hundreds of dollars total, negligible vs the budget). The lifecycle carve (R86) is delicate — it's the most coupled file cluster; it's last precisely so the ground under it (ports for grade + reward) is solid first. Kernel-trust-surface touches (`module-api.js`, `fitness.js`) on the economy/lifecycle carves mean owner Gate approval on those PRs — the boundary working as designed.
|
|
62
|
+
|
|
63
|
+
**Neutral.** Single-package / single-process / no-bundler preserved. The ~16 roster is a ceiling, not a floor ([02 §6](../design/modular-architecture/02-module-map.md)) — merging two modules is cheap and the fitness ratchet makes a later split safe, so the first cut is not a lock-in.
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Alternatives considered
|
|
68
|
+
|
|
69
|
+
- **A new criterion for tranche 2 — rejected.** C7's done-when already demands "the GDS core is *itself* decomposed … not just the four feature modules." Tranche 2 *is* C7; a second criterion would split one decision across two rows.
|
|
70
|
+
- **Carve the lifecycle earlier — rejected.** Its capabilities (`reward`) aren't ports until economy is a module; carving the state machine while it still `require`s economy would either break the kernel-only rule or bloat the kernel. Sequence the ports first.
|
|
71
|
+
- **Config C (a module per route-group) — rejected** ([02 §3](../design/modular-architecture/02-module-map.md)). tasks/claims/versions/credits are one cohesive cluster; forcing them apart fights cohesion and sprawls manifests. Extract capabilities behind seams; keep the machine.
|
|
72
|
+
- **Carve all domains in one session — rejected (owner).** Per-domain proof gates keep the blast radius bounded; back-to-back unreviewed carves of a 6k-LOC monolith is exactly the big-bang the strangler avoids.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# ADR 0094 — Repo Atlas: a self-drawing map of the codebase
|
|
2
|
+
|
|
3
|
+
**Status:** Accepted (2026-06-27)
|
|
4
|
+
**Track:** internal
|
|
5
|
+
**Builds on:** [ADR 0061](<redacted>.md) (context layers), [ADR 0063](<redacted>.md) (generate-don't-narrate), [ADR 0062 §8](<redacted>.md) (generated artifacts), [ADR 0083](<redacted>.md) / [ADR 0091](<redacted>.md) (module system), [ADR 0056](<redacted>.md) (hand-installed deploy script), the world-snapshot precedent (`scripts/snapshots/maybe-render-on-deploy.sh`).
|
|
6
|
+
**Promotes:** [idea #457](https://example.com/builders#/idea/457). **Tasks:** [#1640](https://example.com/builders#/task/1640) (this), [#1641](https://example.com/builders#/task/1641) (doc-generator migration).
|
|
7
|
+
|
|
8
|
+
## Context
|
|
9
|
+
|
|
10
|
+
[Idea #457](https://example.com/builders#/idea/457) (owner, from Discord): *"A visual and navigable map which allows a non-technical and technical user to understand the codebase of their project and the modules that make it up. Starting with Cloud Bongos, this map should be generated directly off of the code so it also clearly shows what is spaghetti and what is well structured."*
|
|
11
|
+
|
|
12
|
+
The owner's framing in session: the single most important thing to make legible is **how `.md` files are positioned and how context is managed** in the repo; and, for the module system, to see **the TRUTH — exactly how modules are separated as files and function calls**, not the aspirational doc version. Visual reference: Langfuse's hover-connective boxes, in an isometric (but less-slanted, more-readable) layout, in the Cloud Bongos art style.
|
|
13
|
+
|
|
14
|
+
Two pre-existing facts shape the design:
|
|
15
|
+
- The repo already runs a **"generate self-knowledge on deploy"** pipeline (`gen-repo-map`, `gen-diagrams`, `gen-session-index`, `gen-file-map`) — but those run on the **shipping builder's machine** during `/builder-ship` and are committed into the PR. The owner explicitly wants the **server** to do this regeneration, not the local instance.
|
|
16
|
+
- The world-snapshot renderer already regenerates an artifact **server-side on the droplet at deploy**, writes it to a served directory, and never commits it. That is the exact shape this needs.
|
|
17
|
+
|
|
18
|
+
## Decision
|
|
19
|
+
|
|
20
|
+
Build the **Repo Atlas**: a Builders' Hall page rendering an isometric, hover-connective, click-for-detail map of the repository, in **two views over one engine**:
|
|
21
|
+
|
|
22
|
+
1. **Context Layer** — the always-loaded root `CLAUDE.md` (with its live line/char budget gauge) vs the on-demand nested guides, the docs library (ADRs / recipes / audits / session logs, real counts), the database as live-state (never a file), the self-generating artifacts, and broken-link **drift**.
|
|
23
|
+
2. **Module Truth** — the real modules carved into `modules/<key>/` (clean boundary, green) vs the `src/bongos` **core blob** (with `db.js` the monolith, red) vs the planned-but-still-fused **ghosts** (the `module-scope-map` roster with no `modules/<key>/` dir yet). Edges are real dependency + boundary facts; a module flips to a violation colour if a require reaches a sibling or deep core.
|
|
24
|
+
|
|
25
|
+
**Data pipeline (the load-bearing decision):**
|
|
26
|
+
- A single generator, `scripts/gds/gen-atlas.js`, emits `public-builders/atlas.json`. It is **pure file-reads — no network, no GDS session** — so it runs headless on the droplet.
|
|
27
|
+
- It **reuses the existing truth sources** rather than re-deriving them: `src/bongos/module-scope-map.js` (the MOVED-vs-FUSED roster), `scripts/gds/fitness.js --json` (the kernel-leak count + the boundary rule it applies), `scripts/gds/docs-entropy.js --json` (the stale-link count), the `CLAUDE.md` budget constants, and real `readdir`/LOC counts. The map can't disagree with the gates because it reads the same facts they do.
|
|
28
|
+
- **Regeneration is SERVER-SIDE on every deploy**: a non-blocking step in `scripts/deploy/deploy-prod.sh` runs the generator and writes `atlas.json` into the served dir — copying the world-snapshot precedent exactly. Because prod auto-deploys on every merge to `main`, **every ship → fresh map**, regardless of who shipped or from what machine.
|
|
29
|
+
- `atlas.json` is a **gitignored build artifact** — never committed, never hand-edited (so it can't drift), and not subject to a CI freshness gate. The page degrades gracefully (a "being drawn" notice) when it is absent.
|
|
30
|
+
|
|
31
|
+
**Page:** a vanilla `public-builders/atlas.html` + `atlas.js` (no framework, the hall convention), **self-contained Cloud Bongos styling** (its own `--ab-*` tokens so the instance's injected theme never recolours it), auto-laid-out (ring-by-group seed + a relaxation pass so **no two islands touch**, the owner's requirement), hover lights an island's links, **click opens a popup** with that file/module's detail. Gated to **any signed-in builder** (`serve-internal.js`). Built to port to Cloud Bongos.
|
|
32
|
+
|
|
33
|
+
## Consequences
|
|
34
|
+
|
|
35
|
+
- **The existing doc generators should migrate to the same server-side trigger** (the owner's "do the same for documentation" ask) — task [#1641](https://example.com/builders#/task/1641). `gen-repo-map` / `gen-session-index` / `gen-file-map` are pure file-reads and move cleanly **once their `fitness.js` `--check` freshness gate is retired and the outputs are gitignored** (otherwise every PR fails the staleness check). **`gen-diagrams` is the exception** — it needs a headless browser (the droplet has none) and an authenticated GDS session for its conceptual slices, so it does NOT migrate cleanly; documented, left as-is.
|
|
36
|
+
- **One-time operator step:** `scripts/deploy/deploy-prod.sh` is the hand-installed mirror of the droplet's `~/deploy.sh` (ADR 0056) — the new step goes live only when an operator `scp`s the updated script to the droplet. Until then prod shows the "being drawn" notice.
|
|
37
|
+
- `atlas.json` is **public static** (non-sensitive repo-structure facts; the repo gains a public mirror per V4.R71 anyway). It can move behind an authenticated route later if a future instance needs it.
|
|
38
|
+
- The map **surfaces drift and spaghetti honestly** — the live stale-link count, the kernel leaks, the 26k-line blob, the `db.js` monolith, the ghosts — which is the point of [#457](https://example.com/builders#/task/457), not a blemish to hide.
|
|
39
|
+
|
|
40
|
+
## Amendment (2026-07-03 — task 1737)
|
|
41
|
+
|
|
42
|
+
The "self-contained Cloud Bongos styling" clause is narrowed after the hall redesign (task 1723): the page **chrome** (card, view toggle, caption, legend, popup, badges) now rides the hall's design-token system, so it follows the instance pack and dark mode like every other hall page. What remains isolated — the actual invariant — is the **semantic node/edge palette**: it stays a fixed set (never pack-driven) so an instance's colors can never scramble the map's color-coded meaning. Non-semantic scene values (label ink/halo, ambient wash, hub glow, badge fills) are scoped `--ab-*` vars with dark variants that the renderer reads at draw time and re-reads on `html[data-theme]` flips.
|
|
43
|
+
|
|
44
|
+
## Alternatives considered
|
|
45
|
+
|
|
46
|
+
- **A live `/api/gds/*` endpoint** computing the graph per request — rejected: the file structure only changes at deploy, so a live route would repeatedly query disk/DB to serve data that never changes between deploys. Build-time static JSON is the right tool (the same reasoning that keeps the world snapshots static).
|
|
47
|
+
- **A committed generated file** (like today's repo-map) — rejected: it reintroduces the builder-machine dependency the owner is explicitly removing, and a committed-but-server-regenerated file goes stale between the commit and the next deploy.
|
|
48
|
+
- **Extending the Mermaid diagram pipeline** (`gen-diagrams`) — rejected: those diagrams are conceptual (lifecycle, ranks), not structural, and rendering them needs a headless browser the droplet lacks.
|
|
49
|
+
- **A flat force-directed node-graph or a treemap** — rejected for the audience: a force graph tends to a hairball, a treemap hides connections. The isometric "islands + flight-paths" reads for a non-technical builder and matches the owner's Langfuse reference and the Cloud Bongos (sky-whale) brand.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# ADR 0095 — Borrowed memory, retrieval & collision concepts from claude-mem and graphify
|
|
2
|
+
|
|
3
|
+
**Status:** Proposed (owner-directed 2026-06-27; pending claim + companion ADR)
|
|
4
|
+
**Track:** internal
|
|
5
|
+
**Builds on:** [ADR 0060](0060-gds-retrieval-layer.md) (recall / retrieval layer), [ADR 0063](<redacted>.md) (generated repo-map symbol skeleton), [ADR 0094](<redacted>.md) (repo atlas), [ADR 0049](<redacted>.md) (touches[] advisory), [ADR 0082](<redacted>.md) (server-side conflict resolver), [ADR 0091](<redacted>.md) (memory module carve), [ADR 0026](<redacted>.md) / [ADR 0027](<redacted>.md) (BFG memory).
|
|
6
|
+
**Pairs with:** a companion owner-authored ADR on **grep vs. a semantic/embedding retrieval layer**. This ADR deliberately does **not** decide that question — every item below is independent of which retrieval mechanism we run.
|
|
7
|
+
**Sources evaluated:** [graphify](https://github.com/safishamsi/graphify) (MIT, Python) and [claude-mem](https://github.com/thedotmack/claude-mem) (Apache-2.0, JavaScript), in the 2026-06-27 research session.
|
|
8
|
+
|
|
9
|
+
## Context
|
|
10
|
+
|
|
11
|
+
We evaluated two mature, widely-starred Claude-Code tools that overlap our internal stack:
|
|
12
|
+
|
|
13
|
+
- **graphify** — turns a codebase + docs into a queryable knowledge graph (tree-sitter AST + LLM-inferred edges + Leiden clustering), shipped as a `/graphify` skill + MCP server.
|
|
14
|
+
- **claude-mem** — automatic persistent session memory (lifecycle hooks capture every tool use → AI-compressed summaries → reinjected next session), backed by SQLite + a Chroma vector DB.
|
|
15
|
+
|
|
16
|
+
Both overlap things we already run — recall ([ADR 0060](0060-gds-retrieval-layer.md)), the generated repo-map ([ADR 0063](<redacted>.md)) and the repo atlas ([ADR 0094](<redacted>.md)), the carved memory module ([ADR 0091](<redacted>.md)), the `learnings` table, and `touches[]`/merge-collision handling ([ADR 0049](<redacted>.md), [ADR 0082](<redacted>.md)).
|
|
17
|
+
|
|
18
|
+
**Neither fits wholesale**, for reasons specific to us:
|
|
19
|
+
- graphify is **Python** — a foreign runtime bolted beside a Node/Postgres codebase; it could only ever sit *next to* the GDS, never inside it.
|
|
20
|
+
- claude-mem's architecture is **local-first, single-developer** (a per-machine daemon + local SQLite + a Chroma vector service pulling in a Python/`uv` dependency). We are **centralized and multi-builder** (memory syncs to one Postgres on the droplet, rank-scoped, with the BFG doing cross-builder work). The shape is wrong.
|
|
21
|
+
- graphify's graph has **no rank-scoping**; committing a full-repo graph would expose permission-core structure to low-rank builders, against [ADR 0016](<redacted>.md).
|
|
22
|
+
- Both run an **open-core commercial play** (graphify → Penpax; claude-mem → a server/team beta), and claude-mem additionally endorses an associated **memecoin** — governance signals that argue against *depending* on either, though not against reading them.
|
|
23
|
+
- Claude Code itself deliberately favours **live agentic search over a prebuilt index** (freshness, simplicity) — the philosophy we already follow with lexical recall + a generated map.
|
|
24
|
+
|
|
25
|
+
But several *concepts* in these tools are stack-agnostic, cheap, and land on real gaps. This ADR records **which concepts we adopt and why**, and **what we decline**. The unifying principle: **borrow concepts, not tools** — reimplement in our own Node/Postgres stack, import no third-party code, add no new service, and stay inside the budget and the trust boundary.
|
|
26
|
+
|
|
27
|
+
## Decision
|
|
28
|
+
|
|
29
|
+
Adopt the following eight concepts. Each is reimplemented in-stack; none requires a new dependency or service (the one exception — a parser for the AST work — is called out in G2).
|
|
30
|
+
|
|
31
|
+
### From graphify (the "Tier-2" borrows)
|
|
32
|
+
|
|
33
|
+
- **G1 — Symbol-level collision detection.** Move `touches[]` overlap from *path-prefix* to *symbol/dependency* awareness (`src/bongos/path-match.js` `touchesOverlap`/`matchOne`, consumed by `claims.js`). **Why:** path-prefix over-flags — two tasks editing different functions in one big file (e.g. `db.js`) are falsely serialized, costing parallelism — and under-detects, missing cross-file collisions where one task changes a symbol another file depends on. [ADR 0049](<redacted>.md) already cut the *cost of being wrong* (touches is advisory, backfilled from the real diff); this attacks the *accuracy of the forecast*, the remaining lever. `git merge` stays the ground-truth backstop.
|
|
34
|
+
- **G2 — AST-based repo-map upgrade.** Replace the regex symbol extractor with a real parser via the `extractFile()` seam [ADR 0063](<redacted>.md) explicitly left for this (`scripts/gds/gen-repo-map.js`). **Why:** the regex extractor is server-JS-only, conflates two symbols that share a name, and builds no call graph. A parser (tree-sitter, **WASM build** — which sidesteps the `node-gyp` native-compile cost that [ADR 0063](<redacted>.md) rejected) gives polyglot coverage (the Python `art/` pipeline, client `public/game/` JS, SQL), real symbol resolution, and a dependency graph. That graph is the **substrate G1 needs**, and it feeds [ADR 0094](<redacted>.md)'s atlas **truer edges** than today's `fitness.js` regex-on-`require` facts. This is the one item with a (vendored, no-native-build) dependency cost; accepted for the payoff.
|
|
35
|
+
- **G3 — Surface the "why," forward-facing.** Extract design rationale (`# WHY:`/`# HACK:`/docstrings + ADR rationale) and attach it to the code it explains, surfaced *at the moment of work* rather than left in an archive. **Why:** we already *pay* to capture "why" (the ADR culture, the `# WHY:` convention) — but capture ≠ surfacing, and our builders are memoryless AI agents with a strong instinct to "tidy" load-bearing code, re-breaking solved problems (the fences in our own learnings/memory log). Cheap first cut: feed `# WHY:` + ADR rationale into the recall index; later, auto-inject the governing ADR when an agent opens a file it covers.
|
|
36
|
+
|
|
37
|
+
### From claude-mem (concepts 1–5)
|
|
38
|
+
|
|
39
|
+
- **C1 — Progressive-disclosure retrieval with token-cost visibility.** Layer recall into *cheap index → batch detail*: return a compact index first (IDs + titles, ~tens of tokens each), then fetch full bodies only for the few the agent selects (`modules/memory/routes/search.js`, `scripts/gds/recall.js`, the recall skill). **Why:** recall returns a flat list of snippets today; layering it yields ~10× fewer tokens per query (claude-mem's documented figure), which compounds across every session and serves the $5K / token-frugal posture directly. **Independent of grep-vs-semantic** — it's a presentation/cost pattern over whatever retrieval leg(s) the companion ADR chooses.
|
|
40
|
+
- **C2 — Hook graceful-degradation policy.** Codify one rule across the hook fleet (`.claude/hooks/*`, memory-sync in `ship.js`, the Conductor): an **infrastructure** failure (ECONNREFUSED / timeout / 5xx) → **exit 0, never block** the builder; a **code bug** (4xx / TypeError) → **exit 2, block** so it's fixed. **Why:** we run many hooks; a droplet hiccup must never freeze a session mid-work. (The unreachable-API condition encountered while authoring this very ADR is the canonical example.)
|
|
41
|
+
- **C3 — Memory-usefulness feedback loop.** Record whether a recalled chunk / learning was actually used, and let that signal drive ranking and decay (`modules/memory`, `learnings`). **Why:** nothing today tracks whether recalled knowledge helped; a usefulness signal lets high-value memory rise and dead weight fade, keeping the corpus high-signal as it grows. Pairs naturally with graphify's `save-result` (useful / dead_end / corrected).
|
|
42
|
+
- **C4 — `<private>` content-exclusion marker.** A tag an agent can wrap around sensitive content so it never enters the memory store (`modules/memory` ingest; complements the BFG transcript scrub). **Why:** a simple, explicit opt-out that reinforces the trust boundary ([ADR 0016](<redacted>.md)) — secrets, permission-core internals, sub-Metic-sensitive material fenced out at the source.
|
|
43
|
+
- **C5 — Windowed content-hash dedup.** On write, hash `(session + title + body)` and, if the same hash reappears within a short window, reuse the existing row instead of inserting (`modules/memory`, `learnings.js`). **Why:** stops near-duplicate memory/learning entries; complements the existing `source_ref` soft-idempotency.
|
|
44
|
+
|
|
45
|
+
## What we decline (and why)
|
|
46
|
+
|
|
47
|
+
- **Adopting either tool wholesale** — stack/architecture/trust mismatch (see Context).
|
|
48
|
+
- **Lifting graphify's Python code** — foreign runtime; borrow patterns, not source.
|
|
49
|
+
- **claude-mem's local-daemon + SQLite + Chroma architecture** — wrong shape for a centralized, multi-builder, Postgres server.
|
|
50
|
+
- **The Chroma / `uv` vector dependency** — exactly the dependency weight we deferred embeddings to avoid. *If* we ever add semantic retrieval, it is `pgvector` inside the existing Postgres — but **that decision belongs to the companion grep-vs-semantic ADR**, not here.
|
|
51
|
+
- **Automatic capture of every session** (claude-mem's default) — continuous token cost + noise risk; our deliberate capture is cheaper and higher-signal. Folded in only as auto-*suggestion*: the BFG may *propose* memory/learning entries for confirmation, never auto-commit.
|
|
52
|
+
- **Headline star counts as evidence** — treated as marketing signal; these choices weigh maturity, license, and fit, not stars.
|
|
53
|
+
|
|
54
|
+
## Consequences
|
|
55
|
+
|
|
56
|
+
- **Positive.** Sharper parallelism + fewer surprise merge conflicts (G1); a polyglot, symbol-accurate map that also strengthens the atlas (G2); load-bearing rationale that stops agents re-breaking fences (G3); cheaper recall per query (C1); hooks that never freeze a session (C2); a self-cleaning, higher-signal memory corpus (C3–C5). All in-stack, no new service.
|
|
57
|
+
- **Cost.** Eight follow-on tasks of varied size; G2 is the heaviest (a vendored WASM parser + reworking `gen-repo-map.js`). All modest against the budget. Each ships under its own claim and gate.
|
|
58
|
+
- **Neutral / boundary.** Nothing here changes the retrieval *mechanism* (grep vs. semantic) — that is the companion ADR's call, and C1/G3 are written to compose with whatever it decides. Single-process / single-package / no-new-daemon preserved.
|
|
59
|
+
|
|
60
|
+
## Alternatives considered
|
|
61
|
+
|
|
62
|
+
- **Adopt graphify and/or claude-mem wholesale** — rejected: stack mismatch, dependency weight, no rank-scoping (graphify), local-first single-dev architecture (claude-mem), and open-core/memecoin governance risk. Reading them is valuable; depending on them is not.
|
|
63
|
+
- **Do nothing (status quo)** — rejected: the gaps (false-serializing collisions, JS-only map, archived-not-surfaced "why," flat full-cost recall) are real and recurring; these borrows are cheap relative to the pain.
|
|
64
|
+
- **Bundle the semantic-retrieval decision into this ADR** — rejected: the owner is authoring it separately; keeping the retrieval-mechanism choice in one place avoids splitting it across two records, and every item here is deliberately mechanism-agnostic.
|
|
65
|
+
- **One ADR per concept** — rejected: these eight share one rationale (borrow-concepts-not-tools, from one evaluation); a single record keeps that reasoning together. Each still gets its own implementing task.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# 0095 — Cross-agent context management: adopt docstrings now, defer the portability layer
|
|
2
|
+
|
|
3
|
+
- **Status:** Accepted
|
|
4
|
+
- **Date:** 2026-06-27
|
|
5
|
+
- **Deciders:** Lars (owner) · Claude (Opus 4.8)
|
|
6
|
+
- **Track:** `internal` (Cloud Bongos / context + retrieval)
|
|
7
|
+
- **Relates to:** [ADR 0083](<redacted>.md) / [ADR 0091](<redacted>.md) — the modular decomposition is the *structural* half of low-context AI navigation; this ADR is the *findability* half (see Context). Also [ADR 0094](<redacted>.md) (the codebase map), [ADR 0061](<redacted>.md) / [ADR 0063](<redacted>.md) (the context layers it feeds). Companion: [ADR 0095-a](<redacted>.md) — adopts the memory/retrieval *concepts* and explicitly defers the grep-vs-semantic decision to this ADR (the two collided on `0095` in parallel; see the index note).
|
|
8
|
+
|
|
9
|
+
## Context
|
|
10
|
+
|
|
11
|
+
Cloud Bongos is an AI-first build platform, and today its agent-facing surface is shaped almost entirely for one tool — Claude Code: the always-loaded root `CLAUDE.md` ([ADR 0061](<redacted>.md)), the `.claude/` skills + hooks, a lexical-first retrieval layer ([ADR 0060](0060-gds-retrieval-layer.md)), and a generated repo-map ([ADR 0063](<redacted>.md)). The owner wants Cloud Bongos instances to be editable across many agentic coding tools (Claude Code, OpenAI Codex, Cursor, …). That raises two questions a future version must answer:
|
|
12
|
+
|
|
13
|
+
1. **Retrieval** — how do we make a repo navigable by tools that find code by literal text search ("grep"), and is a meaning-based ("semantic") retrieval layer worth its recurring cost and index-drift?
|
|
14
|
+
2. **Portability** — how should the agent-facing contract (instructions, commands, enforcement, capabilities) be structured so it isn't hardwired to one tool?
|
|
15
|
+
|
|
16
|
+
We did extensive research (two parallel passes, ~50 sources) to inform both. This ADR records the findings as durable framing, but the owner has deliberately scoped the *committed* decision narrow: **adopt docstrings now; everything else is captured as deferred future-decision content, not a commitment.**
|
|
17
|
+
|
|
18
|
+
The durable findings:
|
|
19
|
+
|
|
20
|
+
- **Agents navigate by grep, not embeddings.** Claude Code, Codex, and Cursor all default to literal search (generate query → grep → read → iterate). Anthropic and Sourcegraph both *removed* embedding indexes from their code tools (precision on exact identifiers, freshness/anti-staleness, privacy, cost); Cursor keeps embeddings but only *alongside* grep and fights staleness with incremental Merkle-tree re-indexing. So a literal-search-friendly repo is the high-leverage, low-cost target.
|
|
21
|
+
- **Greppability is mostly free, write-time discipline that doesn't rot:** distinctive (not generic) names, "the Grep Test" (never construct or dispatch identifiers dynamically), one concept = one name (don't re-case across boundaries), unique whole log/error strings, flat namespaces. Generic identifiers are the single biggest documented retrieval-killer for agents.
|
|
22
|
+
- **The best "semantic layer" is meaning written into the source.** Docstrings, module headers, READMEs, and ADRs co-locate concept words with the symbol — which helps grep, agentic search, *and* any future embedding, at zero recurring cost and zero index-drift (the "index" is the version-controlled text). OTB already has the structural half (the generated repo-map with a CI freshness gate) and the ADR/README half; the missing piece is per-symbol/per-module docstrings + consistent concept vocabulary.
|
|
23
|
+
- **Cross-tool portability is an adapter problem** — one canonical source per concern + thin per-tool adapters: instructions → an `AGENTS.md`-style canonical file with thin per-tool pointers; commands → plain CLI (already true — slash-commands wrap `scripts/gds/*.js`); enforcement → server/git/CI, never tool hooks (already true — the trust boundary, [ADR 0016](<redacted>.md)); capabilities → MCP (already cross-tool). This is the [ADR 0062](<redacted>.md) / [0081](<redacted>.md) core↔host / swappable-adapter pattern applied to the agent surface.
|
|
24
|
+
- **The Cloud Bongos shape:** *how a repo is managed for agents* becomes a project-init **profile** that provisions the right adapter set (which context files, which command wrappers, which retrieval posture, which enforcement). It is a start-of-project decision because naming conventions and whether to stand up an embedding pipeline are expensive to retrofit.
|
|
25
|
+
|
|
26
|
+
**Relationship to the modular decomposition ([ADR 0083](<redacted>.md) / [ADR 0091](<redacted>.md)).** These were authored alongside this ADR and are the *other half* of the same goal — an AI agent that navigates the codebase at low context cost. The decomposition bounds *how much* an agent must load: a domain becomes a module reached through one doorway, not a 6k-LOC monolith (0091's explicit "AI-scoping payoff"). This ADR is the complementary *findability* layer — meaning written into the source so the agent locates the right module/symbol by search. They compose directly: **the module-header doc-comments decided here are authored per module precisely because 0091 makes the module the unit of scoping**, and each sits beside that module's nested `CLAUDE.md` and the generated repo-map ([ADR 0063](<redacted>.md)). The deferred `AGENTS.md` adapter + per-project agent profile are likewise the agent-surface counterpart to 0091's core↔module boundaries.
|
|
27
|
+
|
|
28
|
+
## Decision
|
|
29
|
+
|
|
30
|
+
**We will adopt docstrings and module-header doc-comments as a project convention.** This is the one change ratified here.
|
|
31
|
+
|
|
32
|
+
- Every public function/class and each module gets a short natural-language doc-comment describing *what it does and why it exists* (not how), using the concept words a human would search for and naming key collaborating symbols.
|
|
33
|
+
- Rationale: this is the zero-recurring-cost, zero-index-drift core of semantic findability. Meaning lives in the version-controlled source, so it helps literal/grep search, agentic search, and any future embedding alike — with no separate index to pay for or keep fresh.
|
|
34
|
+
- It is a *convention*, rolled out incrementally (new + touched code adopts it by default; high-traffic modules backfilled opportunistically), not a big-bang backfill. Follow-on task [#1654](https://example.com/builders#/task/1654) tracks wiring it into the conventions guidance and an initial backfill; whether to add a non-blocking lint/fitness nudge is left to that task (not ship-blocking without owner sign-off).
|
|
35
|
+
|
|
36
|
+
Everything else from the research is recorded below as **deferred** — explicitly *not* decided here.
|
|
37
|
+
|
|
38
|
+
## Alternatives considered
|
|
39
|
+
|
|
40
|
+
*Per the owner's scope, these are live options for a future planning session, not rejected ones. Captured so the research isn't re-done.*
|
|
41
|
+
|
|
42
|
+
- **Stand up a semantic / embedding retrieval layer now.** Deferred. Embeddings earn their keep mainly on large codebases / pure concept-queries and carry recurring cost + index-drift; the leading tools dropped them or only augment grep with them. If ever pursued: local embedding model + embedded store (e.g. sqlite-vec) + incremental, content-hash, git-hook re-indexing, run *alongside* grep (hybrid), never instead. ([ADR 0060](0060-gds-retrieval-layer.md) already deferred embeddings behind a measured gate — this corroborates it.)
|
|
43
|
+
- **Adopt an `AGENTS.md` cross-tool adapter layer** (one canonical instructions file + thin `CLAUDE.md` / `.cursor/rules` / `copilot-instructions` pointers, generated from a single source). Deferred — likely the highest-value *next* step, but a design decision in its own right (canonical-vs-adapter split; import vs symlink vs generator).
|
|
44
|
+
- **Adopt explicit greppability conventions** (distinctive names, the Grep Test, flat namespaces, unique log strings) as a written, possibly lint-enforced standard. Deferred — strong candidate; pairs naturally with the AGENTS.md work.
|
|
45
|
+
- **Adopt an `AIDEV-NOTE:` anchor-comment convention** (greppable inline notes for landmines and the "why"), guarded by a density / overdue fitness check so it can't rot. Deferred — high agent payoff, but it is *planted maintenance debt* and is only safe with the CI guard, so it needs deliberate design.
|
|
46
|
+
- **Make a "retrieval & agent profile" a Cloud Bongos init setting** that deploys a different set of agents / skills / context-files / enforcement per project. Deferred — the owner flagged this as a serious, start-of-project-level platform decision; needs its own scoping.
|
|
47
|
+
|
|
48
|
+
## Consequences
|
|
49
|
+
|
|
50
|
+
- **Now:** a low-cost convention that improves human readability, grep/agentic retrieval, and any future semantic layer simultaneously — no infra, no drift. The cost is authoring discipline; a stale doc-comment can mislead, mitigated by the same "update the comment when you change the code" rule we already apply to anchors.
|
|
51
|
+
- **Preserved:** the research and the five deferred options are recorded here so a future GDS-V4 / Cloud Bongos planning session starts from them instead of re-researching. This ADR is framing + one decision; it deliberately does **not** commit the platform to the adapter layer, embeddings, or the per-project profile.
|
|
52
|
+
- **Follow-on:** task [#1654](https://example.com/builders#/task/1654) (docstring rollout). The deferred items remain unticketed by design until the owner chooses to scope them.
|
|
53
|
+
|
|
54
|
+
## C4 — `<private>` content-exclusion marker (shipped, task [#1661](https://example.com/builders#/task/1661))
|
|
55
|
+
|
|
56
|
+
An agent can wrap sensitive content in a `<private>…</private>` fence so it **never** enters the memory/learning store nor the recall index — the explicit, write-time opt-out that reinforces the trust boundary ([ADR 0016](<redacted>.md)) and complements the BFG transcript scrub: secrets, permission-core internals, and sub-Metic-sensitive material fenced out *at the source*.
|
|
57
|
+
|
|
58
|
+
Implementation (all in `modules/memory`): a pure `stripPrivate()` in `search-chunker.js` removes every `<private>…</private>` region and is applied at **every** ingest/persist entry point — `storeMemoryFile`, `storeMemoryFilesBatch`, and the BFG cross-builder `bfgWriteMemoryFile` in `memory.js`; `createLearning` in `learnings.js` (title + body); and `chunkMarkdown` (the recall index) itself. The match is **case-insensitive and whitespace-tolerant** (`<private>`, `<PRIVATE>`, `< private >`) and **fail-closed**: an unbalanced `<private>` with no matching close strips to end-of-content, so a half-typed marker can't leak the secret it was meant to hide. A learning whose entire body is fenced strips to empty and is rejected like any other empty body.
|