@bongos/core 1.19.390 → 1.19.392

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.
@@ -0,0 +1,108 @@
1
+ # The /projects hub, direction v2: the chrome and the card in the chrome world, three versions (task 1003299)
2
+
3
+ **Date:** 2026-08-27 · **Goal:** 1000080 (Apex UI pass 2) · **Criterion:** `apex-hub-chrome-and-card` (this round is the composition half; the builds are task 1003300, the chrome, and task 1003301, the poster card) · **World:** chrome-blobs, composition A, recorded in `DESIGN.md` from the built landing (task 1003298, ADR 0196).
4
+
5
+ This document records the hub composition round: what it had to do, how it was run, the three versions put in front of the owner, what each changes on the page beyond its skin, what the build will need that no feed carries yet, and the owner's decision. It supersedes `projects-hub-direction.md` (the 2026-08-13 marigold hub) for the LOOK of the bar, the menus, the search and the card; that document's structural decisions (map first, "only mine" in both browse views, "your projects" as a view, the `?view=` contract, the C1 to C9 build constraints) carry as givens. No build file was touched: `public-landing/projects.html`, `public-landing/assets/cosmos.css`, `DESIGN.md` and every test are as they were.
6
+
7
+ ## 0. Starting point: the hub on the new pack, measured
8
+
9
+ Rendered on 2026-08-27 through a local stub running the real serving transforms (`docs/design/mocks/hub/` mocks were verified the same way):
10
+
11
+ - **The bar** (`header.shell`, `cosmos.css:461-538`) is 69px at 1440: the self-typing wordmark at the left; the nav row `Home | Map · Your projects · New project` centred as a pill group; at the right the `Builders' hall` pill (an emoji glyph), a 34px mode toggle, the avatar + login chip and a `Sign out` pill (signed out: the hall pill, the toggle, `Sign in`). It has no ground of its own: the pills float over the sky and a scrim compensates. At 390 it **stacks to 161px** (the mark row, the right-group row, the nav row) and the toolbar adds three more rows (Sky | Table, Only mine, the search), so the sky starts about 300px down. That stack is what the givens retire.
12
+ - **The toolbar** under the bar (`projects.html:413-428`): the `Sky | Table` segmented pill, the `Only mine` switch, the search pill (`#mapQ`, `Search projects by name or description…`, the count `4 projects` inside it).
13
+ - **The sky** on the new pack: black ground (paper in light), the gravity grid, a starfield in dark only, four glossy orbs (`a.worldOrb`, 122px for the platform's own, smaller for the rest) with the name under each, `this platform` in mono under the self orb, the `yours` badge in the accent above an owned orb, the hint rail (`drag pan · scroll zoom · click a project open it`), the footer. The sky, the orbs and the hover card are task 1003258's rule and do not change: the orb is the door, the card is the room.
14
+ - **The table**: a rounded panel with Project / Type / Builders / Runs / Status / Open, the disc at the row's left, `Open ->` pills.
15
+ - **The card** (`projects.html:513-536`): the modal over the sky with the disc, the name at 21px, the tagline, the relationship pill, the facts (Builders / Type / Runs / Owner / Listed) and one `Open site` door. It is the floor of the poster card's degradation ladder: the state every rung degrades to.
16
+ - Since A3 the controls are already Manrope on the pack's grey-paper / black grounds; the shapes and the composition are the marigold pass's.
17
+
18
+ ## 1. The givens (goal 1000080, owner, 2026-08-25 and 26; not re-opened here)
19
+
20
+ 1. One top bar, a real surface with its own ground and a bottom edge, not floating controls; not sticky.
21
+ 2. The logo top-left is the way home.
22
+ 3. `Projects` moves to the right group and becomes a dropdown holding `Map`, `Your projects`, `New project`; the nav row leaves the bar ("this way we dont clutter the bar").
23
+ 4. A profile dropdown on the identity chip: `My projects`, `Sign out`; a `Settings` slot deferred (a place, nothing rendered).
24
+ 5. The map search moves into the bar's left group and hides on the views it cannot filter; `#mineQ` untouched.
25
+ 6. `Home` is removed.
26
+ 7. The Builders'-hall pill leaves the bar and becomes a per-project, member-only affordance on the card (and a glyph on the table row), rendered only where the project's hall address differs from its site address (owner decision (a), 2026-08-26).
27
+ 8. The project card is overhauled into the poster card: a 5:2 art banner with the accent disc surviving, the name, the tagline, the relationship pill, up to five faces and an `+N` chip, two figures (builders, shipped in the last 30 days), the facts (Type / Runs / Owner / Listed), the actions (`Open site`, the hall entry), and a degradation ladder down to today's card with everything null.
28
+
29
+ Not changing: the sky, the orbs, the hover card, the toolbar (Sky | Table, Only mine, the count), the table (except the glyph), the mine view, the new view, the footer.
30
+
31
+ ## 2. Method, as run
32
+
33
+ 1. Code-led (`.impeccable/config.json`: `buildPath: code`); the world is `DESIGN.md`, read and not rewritten; no comps, no images generated (the Higgsfield rule: hero plates only, and the hub has none). The only image in the round is the landing's own social card (`public-landing/assets/world/og-card.jpg`), used as the platform's art on the poster card because the feed carries no art for any project yet.
34
+ 2. Two mappers read the page and the tests first: the hub as it is (every id, class, copy string, feed and view-switch, with line refs) and the test contract (which assertion pins what, and which of the eight givens collides with which test when built). Both appendices went to every builder so the proposals could name their collisions instead of avoiding them.
35
+ 3. One shared brief: the givens, the two-voices rule from the goal (the bar and the triggers are chrome; the panels and the card are cards), the world's rules from `DESIGN.md`, the token mechanics for a mock (cosmos.css linked for the unchanged regions; the world's derived tier declared on `body` with the dark twins; no `:root`; `--line` and the status vocabulary left to cosmos), a **state contract** of twenty states (every bar state signed out and in, both menus open, keyboard focus, the search focused, the three views, the table, seven card rungs, and three boards: the bar states, the card ladder, the menu component), real data only, the poster card's content, the taste pre-flight, the exact copy strings, and one thesis paragraph per version.
36
+ 4. Three builders ran in parallel under `/impeccable` (setup on the surface, the craft floor, the bounded verify rule), each writing one file under `docs/design/mocks/hub/`, each verified through the stub in both modes at 1440 / 390 / 320 across every state (console clean, no overflow, controls at 24px, the bar under 80px, reduced motion dead) and a mechanical rule check (no `:root`, dark twins byte-identical, no literal colour, the state contract, the head comment, the card's vocabulary, the disclosure pattern).
37
+ 5. A review pass per version (a fidelity lens over the renders against `DESIGN.md` and the thesis; a measurement lens with a browser: glyph-pixel contrast, control boxes, the keyboard path through both menus, every state, the bar's height and non-stickiness; a code lens over the file), every must/should handed to a skeptic, the survivors fixed in one batch per version, the fixes confirmed.
38
+
39
+ ## 3. The three versions
40
+
41
+ | # | File | The bar | The menu | The card | Light | 390 | Honest risk |
42
+ |---|---|---|---|---|---|---|---|
43
+ | v1 | `mocks/hub/v1.html` | **The shelf.** The landing's three pill groups set down on a `bg-frame` shelf with a hairline bottom edge, 72px: mark pill, a 46px glass search pill (260 to 340px focused, the count inside it), `Projects` pill + caret, the toggle, the sign-in door or the chip pill | A card: `bg-card`, 16px, hairline edge, 240px, hung 8px under its trigger; 44px lowercase rows; the current view marked by a 6px accent dot; rise + fade 220ms | **The poster as a stack.** The 5:2 banner, the 48px disc half over its lower-left edge, the name at 28px/300, the tagline, a glass relationship pill, five faces + `+N`, a centred two-up figure band, four hairline ledger rows, the landing's door bar (`open site` accent + `builders' hall`) | Paper on paper, told apart by the edge; near-opaque pill tints | One row; the search steps onto a second full-width lip of the shelf; menus drop full width | Closest to what shipped and to the landing, so the least new information; the shelf is one more grey band |
44
+ | v2 | `mocks/hub/v2.html` | **The hairline.** No pill on the bar: the page ground closed by one `rule` hairline, 64px; the mark as plain type; a bare search field with only a bottom hairline (`ink` on focus), the count to its right; lowercase text triggers, the OPEN one underlined in the accent | A full-width **band** that unfolds under the bar and pushes the page down: `bg-card`, hairline bottom edge, three cells each a 24px/300 title over one clause (`the sky of every project`, `the ones you own or build on`, `five questions and a home`); the current cell carries a 2px accent hairline on its top edge; the profile band the same mechanism | **The specimen.** The 5:2 banner with the two figures as leader-line callouts ON the art (feathered grounds, measured 5.9 to 17.9:1), the 54px disc, the name at 32px/300, the relationship as a mono label, faces, a two-column mono ledger, one accent door + `builders' hall` as an underlined text link | Paper with hairlines; nothing inverts; the callout grounds show as soft patches on the art | One 60px row to 320; the search keeps a real narrower field; the bands stack; under 560 the callouts become the two-up band | The boldest reading of the world's structure rule; the band costs 121px of sky while open and the callout patches are visible in light |
45
+ | v3 | `mocks/hub/v3.html` | **The glass strip.** One continuous glass surface over the sky (`void-glass` + blur in dark, a 5% ink tint on paper in light), 64px, a `glass-edge` bottom hairline; the mark, a hairline, the search fused into the plate (no chrome at rest, an inset field on focus), the right end cut into three **segments** by hairlines (`projects`, the toggle, the identity), the open segment filled `glass-strong` | A card-voice panel **welded to the strip's edge** (no top radius, 16px below), 252px, 44px items; the current view marked by a 2px accent bar at its left edge | **The room.** The name and tagline sit on the banner's lower third over a scrim that is a gradient of the card ground (measured 16.97:1 light, 19.01:1 dark); a shelf line across the banner's lower edge holds the disc (with the orb's gloss), the relationship pill and the faces; the figures and the facts are ONE hairline ledger (builders, shipped in 30 days at figure scale, then Runs / Owner / Listed); a full-width door bar | A tint over paper, hairlines only; the art itself stays a photograph (dark) above a paper card | One plate to 320; the search keeps a field taking the plate's slack; the segments keep 44px; panels drop to the strip's width | The most "one surface" and the most different from the landing's pills; the given's "its own ground" is satisfied by glass, which the owner may read as floating; a dark photograph on a paper card is the one ungraded image in light mode |
46
+
47
+ All three: the sky, the orbs, the hover card, the toolbar (Sky | Table, Only mine), the table (plus the hall glyph in the existing Open cell), the mine and new views and the footer verbatim from today's page; the same real data (the platform's own project with the landing's social card as its art, nine builders holding credits, `30+` shipped in 30 days at the feed's cap; Example with no art, 13 builders and a real 0); the twenty states and the three boards; every render clean in both modes at 1440 / 390 / 320 with reduced motion dead; the mechanical rule set green.
48
+
49
+ ### 3.1 What the review found, and what was fixed before the owner saw the sheet
50
+
51
+ Each version was reviewed by three independent lenses (a design director over the renders against `DESIGN.md` and the version's thesis; a verifier with a browser measuring glyph-pixel contrast, control boxes, the keyboard path through both menus, all twenty states, the bar's height and non-stickiness; a senior front-end reviewer over the file), 136 findings in all (37 must, 62 should, 37 nit); every must and should went to a skeptic (99; 15 refuted, 84 survived), the survivors were fixed in one batch per version and the batch confirmed by a fresh measurement. What changed:
52
+
53
+ - **v1** (24 survived, 14 applied, confirm clean): the search pill carried two focus indicators and painted a ground-coloured slug on focus (now one two-tone ring on the pill's `:focus-within`, the whole 46px pill a `<label>` for the field); the `Type` fact never rendered on any rung (Example now shows `Type / Game`, the platform pair-hides it, which is the only rung that proves pair-hiding both ways); the banner crop cut the landing's headline in half and repeated a door pill above the card's own doors (re-framed on the chrome, identical 2.5:1 crop on every art rung); every fact row's hairline broke into two misaligned segments (one rule per row); signed-out states still claimed membership (two `you build here` badges and the self pill; now gated on auth); the current-view mark stayed on `Map` in the mine and new states; the card overflowed short viewports with no scroll (the scrim scrolls under 820px tall); `--label-face` never reached the facts (specificity); the boards restyled the components they exist to compare. Findings recorded, not fixed: `id="cardBuilders"` leaves the facts when Builders becomes a figure, which breaks `projects_hub.mjs:496-498, 586-602` (the build keeps a hidden dt/dd pair or moves the assertion); the LIGHT paragraph's "nothing black on a light page" is not true of dark art on a paper card (see v3's proposal).
54
+ - **v2** (25 survived, 12 applied, confirm found two regressions, closed in a second batch): the hall glyph is now on the platform row only with seven cells on every row; one focus ring on the search; the dt/dd hairlines meet; the band's cells are real targets. **Closed 2026-08-28 (second batch, confirm clean):** the callout ground is one patch per callout, solid to 10px past every glyph edge and feathered by a token-only mask, not a shadow (the caption measures 7.04:1 light / 10.45:1 dark under every column, the figures 17.1 / 19.2; the first batch had thinned it to 1.61 / 3.11, and one patch per figure and one per caption had stacked into a stepped slab); under 480 the search folds into a 44px magnifier that drops one hairline row of the page ground under the bar with the full-width field and its count (a typed query at 320 sits in a 196px field, focus lands on it, Escape or an opening menu folds it; the bar had left 45px for the field, and no floor fits beside four controls); and `Runs` is the address on every rung (Example: example.com), the table keeps the module list.
55
+ - **v3** (35 survived, 17 applied, confirm clean but two nits): the search pill takes the shared two-tone ring; the current-view mark follows the view across the six states; the seven board labels paint in both modes; the strip's light tint separates from the paper by its edge in the measured band; the signed-out states drop the membership claims; the card's scrim keeps the name at 16.97:1 light / 19.01:1 dark. Two nits, closed 2026-08-28: the close button is sticky inside the scrolling card (still in view at 320 × 568 with the door reached); the tray around a lone door goes, so the pill stands alone on the ladder's short rungs.
56
+
57
+ Every version ends `ALL CLEAN` on the render (all states, both modes, 1440 / 390 / 320, reduced motion dead) and `ALL RULES PASS` on the mechanical check after its batch. The refuted findings (15) were either by-design behaviour the brief asks for, a given the reviewer re-opened, or a measurement the skeptic could not reproduce.
58
+
59
+ ## 4. Review
60
+
61
+ Open `docs/design/mocks/hub/hub-sheet.html` in a browser from the checkout. Dark is the default; flip to light. The **state** picker shows the same state in every version's first tile (signed out, signed in, each menu open, keyboard focus, the search with a query, the mine and new views with the search gone, the table with the glyph); the **card** picker walks the ladder in the second tile. The two phone tiles show the menu open and the card at 390. Under each version the three **boards** put every bar state, every card rung and the menu component on one tall page, so a version can be read whole without clicking. `open full` walks any state at full size; the head comment of each version states its thesis, its bar, its menu, its card, its light answer, its 390 answer, what changes beyond the skin, its data and its tokens.
62
+
63
+ ## 5. Beyond the skin: what each version changes on the page, and what it proposes
64
+
65
+ Every item is tagged as the builders tagged it: **given** (one of the eight), **consequence** (follows from a given), **proposal** (the version's own). Test collisions are named from the test map so the build can retarget rather than discover.
66
+
67
+ **Shared by all three (consequences of the givens):**
68
+ - The nav row's height returns to the sky; at 390 the bar goes from a 161px stack to one 56 to 60px row and the sky starts about 244px higher. `.field{height:calc(100vh - 232px)}` assumed the old bar and a three-control toolbar; retarget.
69
+ - The toolbar keeps `Sky | Table` and `Only mine`; `#mapCount` travels with the search into the bar (`4 projects` at rest, `1 of 4` under a query). `projects_hub.mjs:389,393` pin the computation, not the wording; the copy registry regenerates.
70
+ - The relationship pill loses the accent (it states a fact and is not pressable: the One Warm Thing Rule); the PAIRS rows for `.cardRel` / `.tbl .pill` retarget.
71
+ - The hall glyph rides inside the existing `.colGo` cell beside `Open ->`, so the six-cell parity test (`projects_hub.mjs:531-535`) never fires.
72
+ - The mark is the landing's static bongo-glyph + name pill/type. **This retires the self-typing wordmark** (`cloud|bongos`), which the 2026-08-13 pass kept on purpose as the carrier of the "type bongos in any AI" metaphor and which is frozen by `projects_hub.mjs:116-134, 400-434`. All three builders read given 2 ("the logo") as the landing's mark; the owner should say whether the typing stays. If it stays, it types inside the mark's slot in any version.
73
+ - The table's "could not ask" mark is an em dash, banned by the taste rule the card already obeys; the mocks render a middot (`projects_hub.mjs:564-580` pins the dash).
74
+ - One first-level heading per document (today's page carries ten `<h1>`s, one per view); the view headings become `<h2>`.
75
+ - The contract's `in-table` wording ("glyph on every member row") contradicts given 7 ("only where the hall address differs"): Example is a member row whose hall is at its own site. v1 built the given (glyph on the platform row only), v2 and v3 built the wording and flagged it. **Recommendation: address-gated in both places**, one rule for the glyph and the card door.
76
+
77
+ **v1 proposes:** `About` (goal 1000063) as a fourth Projects-menu item under a hairline; the card at 560px (cosmos's `min(420px,100%)` today) with `--shadow-card` dropped; `Runs` as the project's address on the poster while the table keeps the module list (`projects_hub.mjs:586-602` pins Runs = tags); the mine view's empty state as a hairline instead of a 2px dashed box; the status cell's `not checked` in place of `• —`.
78
+
79
+ **v2 proposes:** the toolbar as a second hairline row under the bar; the mine view's empty state as a band of the same grammar; `About` as a fourth cell of the band; the card at 560px; `Runs` as the address on every rung (the table keeps the module list); under 480 the search folded into a 44px magnifier that drops one hairline row under the bar with the full-width field and its count (a 320 bar cannot hold a query beside four controls, and the row is this version's own grammar); the three carried controls under the 24px floor (footer links, the table's `all:unset` sort buttons, the `.search` inputs) floored (`projects_hub_pre_uat.mjs:430-433` pins the sort button rule verbatim).
80
+
81
+ **v3 proposes:** the card at 640px on desktop ("the room earns it"); the hover card taking the panel's glass instead of `--bg-card` + `--shadow-card` (the world has no shadow vocabulary for UI); the search finding by tag as well as by name; the table view scrolling inside its own panel under 500px (today `body{overflow-x:hidden}` makes Status and Open unreachable on a phone); the wizard's bongo pair on the `--chrome-*` / `--skin-*` ramp instead of its marigold hex literals; a decision on dark project art over a paper card in light mode (accept photographs as exempt, or matte them).
82
+
83
+ ## 6. What the build needs that the page does not have yet (recorded so the pick is informed; not design questions)
84
+
85
+ These were found by the test and page mappers and confirmed against the feeds; they belong to tasks 1003300 / 1003301, not to this round.
86
+
87
+ - **No feed carries a per-project hall address.** `clientBranding()` deliberately withholds domains and `{{buildersOrigin}}` is one value per instance, so "hall entry only where the hall address differs from the site address" needs a new field on `/api/bongos/projects/featured` (or `/my-projects`), e.g. `hall_origin`, null where the hall is at `<site>/builders`. On the apex the hall is `builders.cloudbongos.com` (differs); on a child it is `<site>/builders` (same).
88
+ - **No feed carries faces or a 30-day count.** The enrichment (`modules/platform-identity/project-stats.js`) returns `builders`, `tags`, `owner`, `owner_avatar`; the faces need the remote leaderboard's avatar rows kept (the count already comes from them), and `shipped_30d` needs the remote `/api/gds/public/recent-shipped` (row-capped at 30, hence the `N+` rule). `art_url` is already on the feed and is read by nothing.
89
+ - **Tests that pin the retired chrome and must be retargeted in the build** (from `tests/projects_hub.mjs`, `tests/projects_hub_pre_uat.mjs`, `tests/landing_page.mjs`): the `Home` link (`projects_hub.mjs:40, 46, 48`), the hall pill's `data-link-hall href="{{buildersOrigin}}"` (`landing_page.mjs:214-220`, `projects_hub.mjs:105`), the `.shell .navrow` rule in cosmos (`projects_hub_pre_uat.mjs:203`), the card's slice rule (`projects_hub.mjs:487`: the first adjacent `</div></div>` ends the slice, so every new card region must be a direct child and the banner a bare `<img>`), the `<td>` count across the header, `#selfRow` and the row template if the glyph becomes a cell (`projects_hub.mjs:531-535`), and the singular `querySelector('[data-nav="mine"]')` at `projects.html:5307` (a `My projects` item with `data-nav="mine"` would be a second node; hide by `querySelectorAll` or hook it differently). The dropdown items keep `href="?view=map" data-nav="map"` (etc.) as adjacent attributes so `projects_hub.mjs:42-43` holds unchanged. A new bar-ground token goes into cosmos with both dark twins and a `PAIRS` row in `tests/cosmos_token_contrast.mjs`.
90
+ - **Copy.** Every string that changes on the built page re-runs `node scripts/gds/copy-inventory.js` (CI checks the registry).
91
+
92
+ ## 7. The owner's decision
93
+
94
+ **2026-08-28: v2, the hairline.** Move forward with v2's bar, menus, search and card ("in terms of template preference I would say the hairline is the best to move forward with"); v1 and v3 stay on disk as built. The raises and rulings made with the pick:
95
+
96
+ - **The self-typing wordmark lives on the landing only** ("can probably only live on the landing page"). The hub carries the static mark, the bongo glyph and "Cloud Bongos" as plain type, as all three mocks did; `projects_hub.mjs:116-134, 400-434` retarget to the static mark, and the "fixed slot measured via `#markMeasure`" line in task 1003300 is void on the hub.
97
+ - **Sky and Table become two views in the Projects menu**: Sky / Table / Your projects / New project (+ About under a hairline, §5). The `Sky | Table` pill leaves the toolbar. **Only mine moves beside the search in the bar as a filter**, member-gated as today. With `#mapCount` already in the bar, nothing is left in the toolbar row: it goes, and the sky starts under the bar's hairline. Retargets on top of §6: `.field{height:calc(100vh - 232px)}`, the `#sub-sky` / `#sub-table` `aria-pressed` pins, the `.switch` placement, and the menu-item pins (`Map</a>` becomes `Sky</a>` + `Table</a>`) in `tests/projects_hub.mjs`; the copy registry regenerates.
98
+ - **The map's look improves beyond this round**: the planets as **templates** styled like the landing's hero blocks (the chrome-world objects, in different colours, shapes and styles), plus the field itself, filed as its own task, task 1003319, under this goal after 1003300.
99
+ - **The §5 proposals travel with the version** unless the owner strikes one: the toolbar as a hairline row (moot: the toolbar goes), the mine view's empty state as a band of the same grammar, `About` as a cell of the band, the card at 560px, the three under-floor controls floored, `Runs` as the address on every rung (the table keeps the module list), the search folded into a magnifier under 480.
100
+ - **Not ruled on, adopted by recommendation until the owner says otherwise**: the hall glyph and the card's hall door are address-gated in both the table and the card (given 7's reading, one rule); dark project art on the paper card in light mode is accepted as photographs are, no matte.
101
+
102
+ The criterion `apex-hub-chrome-and-card` moves to the builds: task 1003300 (the chrome, now with the Sky / Table menu, the Only mine filter in the bar and no toolbar), task 1003301 (the card), and task 1003319 (the planets and the field). Both build tasks carry the pick as an amendment to their descriptions (written 2026-08-28).
103
+
104
+ ## 8. What carries forward
105
+
106
+ - **Task 1003300** builds v2's bar, menus (Sky / Table / Your projects / New project) and search, with Only mine beside the search and the toolbar retired, into `public-landing/projects.html` + `cosmos.css` (the hub's sheet moves onto the world's derived tier the way `world.css` did, keeping `--line` and the status vocabulary), retargets the tests in §6, regenerates the copy registry.
107
+ - **Task 1003301** builds the picked card and its ladder, adds the enrichment fields (§6) inside the same `Promise.allSettled` with the shared null object, gates the hall entry on the new hall-address field and membership, and keeps the orbs and the hover card untouched.
108
+ - The unpicked versions stay on disk as built and verified; what they leave behind is listed per version in §3.
package/docs/file-map.md CHANGED
@@ -152,7 +152,7 @@
152
152
  │ ├── discord-channels.js ← Archon CLI: plan/apply the Discord channel layout via the API (ADR 0036, #727)
153
153
  │ ├── setup.js ← one-time GitHub Device Flow → ~/.config/otb/gds-session.json
154
154
  │ ├── start.js ← list claimable tasks + active claims (`/builder-start`)
155
- │ ├── claim.js ← atomic POST /api/gds/claims (`/builder-claim`); prints the claim-time context pack incl. next-free ADR/migration numbers (V4.R26); printDisciplineMode() reads discipline-modes.json to route a claimed task to its playbook skill
155
+ │ ├── claim.js ← atomic POST /api/gds/claims (`/builder-claim`); runs the worktree-per-claim guard (worktree-claim-guard.js) BEFORE the session check and the POST; prints the claim-time context pack incl. next-free ADR/migration numbers (V4.R26); printDisciplineMode() reads discipline-modes.json to route a claimed task to its playbook skill
156
156
  │ ├── discipline-modes.json ← discipline→operating-playbook map read by claim.js: ideator→/ideate, artist→/paint, engineer→/dev; absence of an entry = the default build-and-ship loop, fail-open ([#1267](https://example.com/builders#/task/1267))
157
157
  │ ├── next-number.js ← deterministic next-free ADR + migration number from origin/main ∪ local working tree; supersedes the drift-prone claim-time DB counter (V4.R26, [#964](https://example.com/builders#/task/964)). `node scripts/gds/next-number.js [--json]`
158
158
  │ ├── gen-repo-map.js ← Path B (ADR 0063, [#1224](https://example.com/builders#/task/1224)): zero-dep, deterministic symbol-skeleton generator → docs/repo-map.md + the generated factual block in each nested CLAUDE.md; ranks exported symbols by reference frequency. `--check` = CI gate; regenerated on deploy by ship.js regenerateRepoMap()
@@ -181,6 +181,7 @@
181
181
  │ ├── recall.js ← `/recall` CLI: two-call progressive-disclosure search (summary → `--expand <id>`) over Bongos retrieval layer (ADR 0060); `node scripts/gds/recall.js <query>`
182
182
  │ ├── capture.js ← file an idea_inbox row from the CLI (the ideas.capture kernel port); backs the "capture a tangent" flow across skills. Task 1002927 / R151 taught it the GRADES: `--full --fields-file f.json` files a Full Idea, `--spark` is capture-then-mark (two requests — the route refuses a pre-marked capture), and after a plain quick capture it OFFERS to develop further. That offer is TTY-gated (`--no-prompt` too): capture.js is run by agents with no terminal and reads its body from stdin, so an unguarded prompt would hang every non-interactive caller
183
183
  │ ├── spark.js ← (tasks 1002920 / R144 + 1002921 / R145 + 1002922 / R146) the whole spark handoff from the terminal: mark one of your OWN quick ideas as a Big Idea Spark (`--undo` withdraws it), `--list` is the SPARK QUEUE, `--template` prints the five Full Idea fields, `--develop <id> --fields-file <json>` is the PICKUP (any builder; author + developer both recorded). Author-only server-side for the mark (it is the consent); its own command because sparking acts on an EXISTING idea, which is why capture.js refuses grade='spark'
184
+ │ ├── worktree-claim-guard.js ← (task 1002579) the PURE decision behind worktree-per-claim, enforced at claim time: claiming in the MAIN CHECKOUT is refused (escape hatch `--here` → loud warning), a linked worktree passes, an unclassifiable tree fails open. Stops the ship-time "the main checkout is on <branch>, not main" strand at its cause
184
185
  │ ├── worktree.js ← (task 1002809) junction-safe worktree add/remove/list — outside-repo worktrees get a node_modules junction via node (no shell quoting), removed BEFORE `git worktree remove`
185
186
  │ ├── learning-capture.js ← file a `learnings` row (DB-backed short-form rule capture, replacing hand-edited recipe files for a single gotcha)
186
187
  │ ├── docs-entropy.js ← ([#…] docs-entropy) markdown-corpus linter: broken internal links + cross-file duplicate-prose detector across every tracked `.md`; `--verbose` / `--file-ideas`
package/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@bongos/core",
3
- "version": "1.19.390",
3
+ "version": "1.19.392",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@bongos/core",
9
- "version": "1.19.390",
9
+ "version": "1.19.392",
10
10
  "license": "AGPL-3.0-or-later",
11
11
  "dependencies": {
12
12
  "express": "^4.21.2",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bongos/core",
3
- "version": "1.19.390",
3
+ "version": "1.19.392",
4
4
  "description": "Cloud Bongos — the AI-first build platform core (GDS + platform surfaces + module system), installed as a versioned dependency (ADR 0108).",
5
5
  "license": "AGPL-3.0-or-later",
6
6
  "main": "src/platform-server.js",
@@ -2,7 +2,7 @@
2
2
  // Builder claim — atomically claim a task.
3
3
  //
4
4
  // Usage:
5
- // node scripts/gds/claim.js <task-id> [--worktree NAME] [--enforce-touches] [--join]
5
+ // node scripts/gds/claim.js <task-id> [--worktree NAME] [--enforce-touches] [--join] [--here]
6
6
  //
7
7
  // On success: prints the claim id, the task title, and the touches[] so the
8
8
  // builder knows the parallel-safety boundary they're working within.
@@ -13,8 +13,9 @@ const path = require('node:path');
13
13
  const { cliClient, requireSession, fmtTouches, printOnboardingNudge, rewardPolicy, costPlusOnlyNote } = require('./cli-lib');
14
14
  const { nextNumbers, padAdr, padMig } = require('./next-number');
15
15
  const { CORE_NS } = require('./migration-namespace');
16
- const { contextPack, formatContextPack } = require('./context-pack');
16
+ const { contextPack, formatContextPack, resolveWorktreeRoot } = require('./context-pack');
17
17
  const { printClaimRecall } = require('./claim-recall');
18
+ const { decideWorktreeClaim, ESCAPE_FLAG } = require('./worktree-claim-guard');
18
19
  // task 1003153 — the DEAD dependency edge, one definition shared with the route
19
20
  // and the detector. A lifecycle CLI may require the lifecycle module directly
20
21
  // (the documented exception in modules/lifecycle/CLAUDE.md).
@@ -81,6 +82,34 @@ function printDisciplineMode(task) {
81
82
  }
82
83
  }
83
84
 
85
+ // task 1002579 — the I/O half of the worktree-per-claim guard. Probes the tree
86
+ // with resolveWorktreeRoot (the same signal the context pack and skill-preflight
87
+ // read, so there is one answer to "is this the main checkout") plus the current
88
+ // branch, hands both to the pure decision, prints it, and exits 2 on a refusal.
89
+ // Every probe failure degrades to isMainCheckout=null, which the decision treats
90
+ // as allow — a guard that cannot see the tree must never block a real claim.
91
+ function enforceWorktreeClaim(taskId, { allowMainCheckout }) {
92
+ let tree = { isMainCheckout: null };
93
+ let branch = null;
94
+ try {
95
+ const runGit = (a) => execSync(`git ${a.join(' ')}`, { encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] });
96
+ tree = resolveWorktreeRoot({ runGit, cwd: process.cwd() });
97
+ branch = runGit(['rev-parse', '--abbrev-ref', 'HEAD']).trim() || null;
98
+ } catch (_) {
99
+ /* fail-open: an unclassifiable tree is allowed through */
100
+ }
101
+ const d = decideWorktreeClaim({
102
+ isMainCheckout: tree.isMainCheckout,
103
+ branch,
104
+ allowMainCheckout,
105
+ taskId,
106
+ });
107
+ if (d.verdict === 'allow') return;
108
+ for (const line of d.lines) console.error(line);
109
+ if (d.verdict === 'refuse') process.exit(2);
110
+ console.error('');
111
+ }
112
+
84
113
  function captureHeadSha() {
85
114
  try {
86
115
  return execSync('git rev-parse HEAD', { encoding: 'utf8' }).trim();
@@ -423,13 +452,17 @@ async function runGoalJoinFlow({ api, d, taskId, assumeYes }) {
423
452
  }
424
453
 
425
454
  async function main() {
426
- await requireSession();
427
455
  const args = process.argv.slice(2);
428
456
  const taskId = Number(args[0]);
429
457
  if (!Number.isFinite(taskId)) {
430
- console.error('usage: node scripts/gds/claim.js <task-id> [--worktree NAME] [--enforce-touches] [--join]');
458
+ console.error('usage: node scripts/gds/claim.js <task-id> [--worktree NAME] [--enforce-touches] [--join] [--here]');
431
459
  process.exit(2);
432
460
  }
461
+ // task 1002579: worktree-per-claim, enforced BEFORE anything happens — before
462
+ // the session check, before the POST. The whole point is that the builder
463
+ // learns at claim time, not from a stranded ship hours later.
464
+ enforceWorktreeClaim(taskId, { allowMainCheckout: args.includes(ESCAPE_FLAG) });
465
+ await requireSession();
433
466
  const wIdx = args.indexOf('--worktree');
434
467
  // Explicit --worktree always wins; otherwise auto-detect a linked worktree so
435
468
  // parallel worktrees off one login each hold their own claim (the server guard
@@ -0,0 +1,104 @@
1
+ // scripts/gds/worktree-claim-guard.js — worktree-per-claim, enforced at CLAIM
2
+ // time instead of discovered at ship time (task 1002579).
3
+ //
4
+ // THE FAILURE THIS KILLS. A builder with direct repo access runs
5
+ // `git checkout -b task-N` in the PRIMARY worktree (the main checkout) rather
6
+ // than in a dedicated `.claude/worktrees/<name>`. Everything looks fine for the
7
+ // whole session — and then ship.js's local auto-merge finds the receiving tree
8
+ // is the very tree holding the feature branch, so there is nowhere to merge
9
+ // INTO. The ship bails with "the main checkout is on <branch>, not main"
10
+ // (ship-merge.js) and the task strands at `confirmed` until the server
11
+ // reconciler or /merge-mode catches it. The cause is at claim time; the symptom
12
+ // was hours away at ship time.
13
+ //
14
+ // Worktree-per-claim has been the documented default since task 1642 and the
15
+ // claim-time context pack has warned about it since task 1002573 — but both
16
+ // speak AFTER the claim lands, and neither stops anything. Owner directive
17
+ // (2026-08-05): make it the enforced project default for ALL builders.
18
+ //
19
+ // The whole decision is the pure function below so it can be unit-tested without
20
+ // a git repo; claim.js supplies the two facts (which kind of tree, which branch)
21
+ // from resolveWorktreeRoot() — the SAME probe the context pack and
22
+ // skill-preflight already use, so there is one answer to "is this the main
23
+ // checkout", not three that can disagree.
24
+
25
+ 'use strict';
26
+
27
+ // The documented escape hatch. Named here so the refusal text and claim.js's
28
+ // argv parse can never drift apart.
29
+ const ESCAPE_FLAG = '--here';
30
+
31
+ // Decide whether a claim may proceed in the tree it is being run from.
32
+ //
33
+ // isMainCheckout true | false | null — null means "could not tell" (git
34
+ // unavailable / odd checkout)
35
+ // branch the current branch name, or null when unknown
36
+ // defaultBranch the branch the main checkout must stay parked on
37
+ // allowMainCheckout the builder passed the escape hatch
38
+ // taskId only used to spell the remedy commands concretely
39
+ //
40
+ // Returns { verdict: 'allow' | 'warn' | 'refuse', reason, lines }.
41
+ // - 'allow' — a linked worktree (the correct setup), or a tree we cannot
42
+ // classify. NEVER refuse on a guess: an unknown tree fails open,
43
+ // because a false refusal blocks real work and the ship-time bail
44
+ // still catches the real thing.
45
+ // - 'refuse' — the main checkout, no escape hatch. Exit before the claim lands.
46
+ // - 'warn' — the main checkout WITH the escape hatch: the builder has said
47
+ // they mean it, so say loudly what it costs and continue.
48
+ function decideWorktreeClaim({
49
+ isMainCheckout,
50
+ branch = null,
51
+ defaultBranch = 'main',
52
+ allowMainCheckout = false,
53
+ taskId = null,
54
+ } = {}) {
55
+ if (isMainCheckout !== true) {
56
+ return { verdict: 'allow', reason: isMainCheckout === false ? 'linked worktree' : 'tree kind unknown', lines: [] };
57
+ }
58
+
59
+ // Two shapes of the same mistake, and the second is already broken: a main
60
+ // checkout parked OFF its default branch has ALREADY lost the merge target,
61
+ // so say that rather than warning about a future that has happened.
62
+ const parked = branch && branch !== defaultBranch && branch !== 'HEAD';
63
+ const headline = parked
64
+ ? `the main checkout is already parked on \`${branch}\`, not \`${defaultBranch}\``
65
+ : `you are in the main checkout (on \`${branch || defaultBranch}\`), not a per-claim worktree`;
66
+ const cost = parked
67
+ ? `The local auto-merge at ship time merges INTO this tree — while it holds \`${branch}\` there is nowhere to merge to, so the ship strands at \`confirmed\`.`
68
+ : `Branching here parks the main checkout off \`${defaultBranch}\`, and the local auto-merge at ship time then has nowhere to merge INTO: the ship strands at \`confirmed\` until the server reconciler (or /merge-mode) catches it.`;
69
+
70
+ const id = taskId == null ? '<task-id>' : String(taskId);
71
+ const remedy = [
72
+ ' Work this claim in its own worktree instead:',
73
+ ` node scripts/gds/worktree.js add ${id}`,
74
+ ` cd .claude/worktrees/task-${id}`,
75
+ ` node scripts/gds/claim.js ${id}`,
76
+ ];
77
+
78
+ if (allowMainCheckout) {
79
+ return {
80
+ verdict: 'warn',
81
+ reason: headline,
82
+ lines: [
83
+ `⚠ Claiming in the MAIN CHECKOUT (${ESCAPE_FLAG} given) — ${headline}.`,
84
+ ` ${cost}`,
85
+ ' Automation that resets this tree mid-session can also take your uncommitted work with it.',
86
+ ...remedy,
87
+ ],
88
+ };
89
+ }
90
+
91
+ return {
92
+ verdict: 'refuse',
93
+ reason: headline,
94
+ lines: [
95
+ `✗ Refusing to claim here — ${headline}.`,
96
+ ` ${cost}`,
97
+ ' Worktree-per-claim is the project default (task 1642); this is the check behind it.',
98
+ ...remedy,
99
+ ` If you genuinely mean to work in the main checkout, re-run with ${ESCAPE_FLAG} (you will land at \`confirmed\` and finish through /merge-mode).`,
100
+ ],
101
+ };
102
+ }
103
+
104
+ module.exports = { decideWorktreeClaim, ESCAPE_FLAG };
package/src/module-api.js CHANGED
@@ -1220,8 +1220,12 @@ const { validateOrRespond, LIMITS, parseId, asyncHandler, corsPublicGet, parsePa
1220
1220
  // landed since 1.19.388 with no explicit bump. run 33126279278. (task 1002620)
1221
1221
  // 1.19.390 — CI auto-patch (publish-on-merge, ADR 0161): carrier for merges
1222
1222
  // landed since 1.19.389 with no explicit bump. run 33133575931. (task 1002620)
1223
+ // 1.19.391 — CI auto-patch (publish-on-merge, ADR 0161): carrier for merges
1224
+ // landed since 1.19.390 with no explicit bump. run 33134514193. (task 1002620)
1225
+ // 1.19.392 — CI auto-patch (publish-on-merge, ADR 0161): carrier for merges
1226
+ // landed since 1.19.391 with no explicit bump. run 33176032603. (task 1002620)
1223
1227
  // ---------------------------------------------------------------------------
1224
- const CORE_VERSION = '1.19.390'; // CI auto-patch carrier (ADR 0161); see changelog above
1228
+ const CORE_VERSION = '1.19.392'; // CI auto-patch carrier (ADR 0161); see changelog above
1225
1229
 
1226
1230
  // A namespaced logger so a module's log lines are attributable + consistent.
1227
1231
  // Usage: const log = api.logger('dev-box'); log.info('mounted');
@@ -0,0 +1,105 @@
1
+ // tests/worktree_claim_guard.mjs
2
+ //
3
+ // task 1002579 — worktree-per-claim, enforced at CLAIM time. The failure it
4
+ // kills: branching in the PRIMARY worktree (the main checkout) instead of a
5
+ // dedicated `.claude/worktrees/<name>` leaves the main checkout parked off
6
+ // `main`, so ship.js's local auto-merge has nowhere to merge INTO and the task
7
+ // strands at `confirmed` — a symptom hours away from its cause.
8
+ //
9
+ // decideWorktreeClaim() is the pure core; these tests pin every branch with
10
+ // injected facts (no git, no repo, no claim).
11
+ //
12
+ // Run: node tests/worktree_claim_guard.mjs
13
+
14
+ import { strict as assert } from 'node:assert';
15
+ import { createRequire } from 'node:module';
16
+
17
+ const require = createRequire(import.meta.url);
18
+ const { decideWorktreeClaim, ESCAPE_FLAG } = require('../scripts/gds/worktree-claim-guard.js');
19
+
20
+ let passed = 0;
21
+ let failed = 0;
22
+ function t(name, fn) {
23
+ try { fn(); passed++; console.log(` PASS ${name}`); }
24
+ catch (e) { failed++; console.log(` FAIL ${name}\n ${e.message}`); }
25
+ }
26
+
27
+ const text = (d) => d.lines.join('\n');
28
+
29
+ // ---- the core case: the primary checkout, on main -------------------------
30
+ t('REFUSE: the main checkout on `main` — the exact shape task 1642 documents', () => {
31
+ const d = decideWorktreeClaim({ isMainCheckout: true, branch: 'main', taskId: 42 });
32
+ assert.equal(d.verdict, 'refuse');
33
+ assert.match(text(d), /main checkout/i);
34
+ });
35
+
36
+ t('REFUSE names the fix concretely, with the task id spelled into the commands', () => {
37
+ const d = decideWorktreeClaim({ isMainCheckout: true, branch: 'main', taskId: 42 });
38
+ const s = text(d);
39
+ assert.match(s, /worktree\.js add 42/, 'names the worktree-create command');
40
+ assert.match(s, /cd \.claude\/worktrees\/task-42/, 'names where to go');
41
+ assert.match(s, /claim\.js 42/, 'names the re-run');
42
+ });
43
+
44
+ t('REFUSE names the escape hatch, so the refusal is never a dead end', () => {
45
+ const d = decideWorktreeClaim({ isMainCheckout: true, branch: 'main', taskId: 42 });
46
+ assert.match(text(d), new RegExp(ESCAPE_FLAG.replace(/-/g, '\-')));
47
+ });
48
+
49
+ t('a missing task id still yields runnable-shaped guidance, not "undefined"', () => {
50
+ const s = text(decideWorktreeClaim({ isMainCheckout: true, branch: 'main' }));
51
+ assert.match(s, /worktree\.js add <task-id>/);
52
+ assert.doesNotMatch(s, /undefined|null/);
53
+ });
54
+
55
+ // ---- the already-broken shape: primary checkout parked off main -----------
56
+ t('REFUSE: the main checkout ALREADY parked on a task branch reads as already-broken', () => {
57
+ const d = decideWorktreeClaim({ isMainCheckout: true, branch: 'task-99', taskId: 42 });
58
+ assert.equal(d.verdict, 'refuse');
59
+ const s = text(d);
60
+ assert.match(s, /already parked on `task-99`/, 'names the branch it is stuck on');
61
+ assert.match(s, /nowhere to merge/, 'names the ship-time consequence');
62
+ });
63
+
64
+ t('a detached HEAD in the main checkout is not reported as "parked on HEAD"', () => {
65
+ const s = text(decideWorktreeClaim({ isMainCheckout: true, branch: 'HEAD', taskId: 42 }));
66
+ assert.doesNotMatch(s, /parked on `HEAD`/);
67
+ });
68
+
69
+ t('defaultBranch is honoured — a `master` instance is not told main', () => {
70
+ const d = decideWorktreeClaim({ isMainCheckout: true, branch: 'master', defaultBranch: 'master', taskId: 7 });
71
+ assert.equal(d.verdict, 'refuse');
72
+ assert.doesNotMatch(text(d), /already parked/, 'master IS the default branch here');
73
+ });
74
+
75
+ // ---- the escape hatch: loud, but it proceeds ------------------------------
76
+ t('WARN, not refuse, when the escape hatch is given — and it still costs something out loud', () => {
77
+ const d = decideWorktreeClaim({ isMainCheckout: true, branch: 'main', allowMainCheckout: true, taskId: 42 });
78
+ assert.equal(d.verdict, 'warn');
79
+ assert.match(text(d), /confirmed/, 'says what it will cost at ship time');
80
+ assert.match(text(d), /worktree\.js add 42/, 'still names the better path');
81
+ });
82
+
83
+ // ---- no false positives ---------------------------------------------------
84
+ t('ALLOW: a real linked worktree is untouched — silently, no lines', () => {
85
+ const d = decideWorktreeClaim({ isMainCheckout: false, branch: 'claude/task-42', taskId: 42 });
86
+ assert.equal(d.verdict, 'allow');
87
+ assert.deepEqual(d.lines, []);
88
+ });
89
+
90
+ t('ALLOW: a linked worktree that happens to be on `main` is still fine', () => {
91
+ assert.equal(decideWorktreeClaim({ isMainCheckout: false, branch: 'main' }).verdict, 'allow');
92
+ });
93
+
94
+ t('ALLOW: tree kind UNKNOWN fails open — a guard that cannot see must not block', () => {
95
+ const d = decideWorktreeClaim({ isMainCheckout: null, branch: null, taskId: 42 });
96
+ assert.equal(d.verdict, 'allow');
97
+ assert.deepEqual(d.lines, []);
98
+ });
99
+
100
+ t('ALLOW: called with no facts at all (every probe threw) still fails open', () => {
101
+ assert.equal(decideWorktreeClaim().verdict, 'allow');
102
+ });
103
+
104
+ console.log(`\nworktree_claim_guard: ${passed} passed, ${failed} failed`);
105
+ process.exit(failed ? 1 : 0);