Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .superpowers/sdd/town-trades-art-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Town trades art

Implemented `src/trade-art.mjs` with pure `drawTradeLife(ctx, options)` and shared `tradeSites(options)` geometry. No state, dependencies, polling, world mutation or invented routes.

- Miners use exact resident, roommate or child IDs and occupy the household side yard. One compact site per household avoids overlapping miners. A small timber mine, visible ore, helmet lamp and timed pick sparks make the read/search role legible.
- Roadmenders prefer a visible recorded destination, then the recorded source. They occupy the nearest supplied road rectangle; no street rectangle means no roadmender. Paving, a low striped barrier, stacked stone and a lifting mallet remain inside the existing road.
- Garden work yards fit the lower district margin and avoid cottages/branch signs. They include a potting bench, up to six seedlings, a wheelbarrow and gardener. Growing gardens gently haul; growth spurts pause with a hand at the brow. The visual seedling cap does not change actual arrival data.
- Every site returns `{role, taskId, town, x, y, w, h, evidence, clip}`. Roles are `miner`, `road`, `gardener`. The host can use actual painted bounds and direct evidence for explanatory click targets. Garden task IDs are limited to visible recorded households.
- Site clipping and outer/per-site `save`/`restore` protect the host canvas, including exceptions. Reduced motion and stale force identical paint calls across clocks. Town filtering and supplied visible plots control scope.

Verification: `node --test test/trade-art.test.mjs` — seven tests pass. Tests cover exact household attribution, existing-road geometry, town and visible-plot scope, garden margin fit, bounded seedlings, time-invariant stillness, active animation, input nonmutation, clipping and canvas restoration on paint failure. Parent owns integrated browser verification and the full suite.
11 changes: 11 additions & 0 deletions .superpowers/sdd/town-trades-panel-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Village activity panel

Added `src/trade-panel.mjs`, integrated into `src/command-center.mjs`, and styled in `src/command-styles.mjs`.

The compact, collapsed-by-default Village activity ribbon counts miners, explicit road crews and actual arrivals in the selected town. Expanding exposes keyboard-accessible evidence buttons and a selected story. The story renders current recorded title/reason/time and offers Inspect cottage only for an exact supported task ID. All source strings and attributes are escaped.

The host passes `options.trades` to each command-center update and may call `commandCenter.inspectTrade(site)` for a painted trade. Supported roles are `miner`, `road`, `gardener`; matching uses current story role/town/task identity (or exact event ID). Missing matches open the ribbon without inventing an explanation. Expired/out-of-scope stories close automatically on update. Source changes clear selection and discard previous trades if no replacement was supplied.

`onRehearseGrowth` is a new createCommandCenter callback. The Rehearse growth button appears only when builtInDemo/publicDemo is true, and the click handler rechecks that flag. Field guide text explains real read/search tools, unknown missing evidence, new explicit links, first observed arrivals over ten minutes, and the gardener pause's growth meaning.

Verification: five new pure helper tests pass, plus 42 existing command-center/model/workbench tests. No browser run in this slice; parent owns host integration and browser verification.
73 changes: 72 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Click the map to give it keyboard focus.
| + / − or zoom buttons | Zoom the Townmap between 50% and 200% |
| 0 / percentage button | Reset to the initial map scale (100%) |
| Overview | Frame working and blocked cottages, including active roommates and shed residents |
| Details / Close | Show or hide the floating inspector in fullscreen |
| Evidence / Close | Show or hide the shared inspector in any view |
| Click a cottage or its roster button | Open its inspector without walking there |
| Enter cottage / Leave cottage | Visit or exit using buttons |
| Click a resident / Talk to agent | Open their conversation and recorded activity |
Expand Down Expand Up @@ -116,6 +116,77 @@ and no longer create false input alerts.

Use **Follow from bench** to keep one cottage selected as its work updates. The noticeboard lists changes observed since the previous visit. The scrapbook stores up to 1,600 milestones per feed in this browser, including result snippets and artifact links. Replay steps through that recorded history; it cannot reconstruct unobserved work or expired source logs.

## 🧭 Oversee the village

Townmap remains the playable home. Its **attention strip** shows the actual question
or recorded blocker and cycles through work that needs attention. The **Village,
Attention, Time, Delivery, and Owner lenses** annotate existing plots without
moving cottages. Choose Village for the original scenery.

**Dispatch** is a compact ledger of tasks, public activity, owner/harness, clocks,
and delivery. **Threads** follows recorded issues, parent/child tasks,
dependencies, and shared PRs; narrow screens show a readable cottage trace.
Missing relationships stay missing. PR badges open a preview on hover or keyboard
focus and the existing PR desk on click.

All views share the same evidence inspector, journal, and reply composer.
Switching views preserves Jack, the camera, the occupied room, and the selected
work. Dispatch and Threads open beneath the playable town; the balance slider
gives either surface more room. Walking continues with a workbench open.
Choose a project in the heartbeat rail to scope the evidence and frame its
cottages. Overview can fit below the ordinary manual zoom range for distant annexes.
**Visit activity** brings you to an active or attention cottage in that project
at normal street zoom, including when you start inside a room. Project pulses
show both attention and ready shipments when a neighbourhood has each.

The **Village activity** ribbon explains the small work yards in the scene.
Click a worker or choose its accessible story button:

- **Miners** gather material beside cottages with a read/search tool observed in
the last two minutes, while the canonical task is working. Generic shell tools
and task prose do not imply mining. This is recent tool evidence, not proof
that the individual call is still running.
- **Workshops** light a small workbench beside working cottages with other
recent tool use, including shell calls. They use the same two-minute evidence
window and do not infer what a command does.
- **Roadmenders** work on existing streets for three minutes after a newly
observed explicit parent/dependency link or a recent recorded handoff.
- **Gardeners** gain seedlings for residents first observed in the last ten
minutes. Three arrivals make a growth spurt: more pots and a pause beside the
full bench. The initial snapshot establishes a baseline, without an arrival
parade. A calm garden does not imply idle agents.

Unknown tool coverage stays unknown. Stale feeds and reduced motion stop the
moving trade cues. Source changes clear observations; view changes do not invent
arrivals. In `/?demo=1`, **Rehearse growth** adds three illustrative residents,
recorded read/search tools, and a parent link without contacting real agents.
Expand the ribbon to compare recent, older/stale, and unreported tool evidence
for the selected project, and inspect a working cottage's exact tool name and
observation age. A fresh feed check does not make an older tool event recent.

| Key | Action |
|---|---|
| `1` / `2` / `3` | Townmap / Dispatch / Threads |
| `Cmd/Ctrl+K` | Find a cottage by name, task, town, owner, PR, or recorded issue |
| `J` / `K` in command views | Inspect next / previous visible task |
| `↑` / `↓` / `Enter` in search | Choose and inspect a match |
| `Escape` in command views | Close search/preview first, then return to the same place in town |

Task age includes waiting; recorded execution, session age, last observation, and
last progress are separate evidence. Quiet means at least 15 minutes since explicit
progress, not a confirmed stall. Unknown harnesses and clocks are labeled honestly.
Shared PR counts and states are reconciled across the fleet before filtering.
The header's recorded cost is a partial subtotal of visible live/recent task
records, not spend during a time interval. Running usage and unpriced sources
may be missing; a healthy tool feed does not imply complete cost coverage.
Hub verification remains authoritative through an outage; local staleness cannot
turn an unverified standalone PR green.

Only an explicit Send uses a supported message route. The client rechecks the
latest task, question revision, status, and route, and persists a receipt before
transport. Uncertain delivery stays locked across reloads instead of retrying.
Draft text survives view changes and polling, but not a page reload.

## 🔌 Cottage feed

`npm start` serves the townmap and `GET /agents`. The connect box defaults to that URL. Drop in any other endpoint that speaks the [cottage feed](docs/COTTAGE_FEED.md) shape.
Expand Down
Loading
Loading