Skip to content

feat(web): add hints, intents, amendments and run controls from the board view - #19

Merged
springfall2008 merged 14 commits into
mainfrom
feat/web-ui-writes
Nov 26, 2026
Merged

springfall2008 merged 14 commits into
mainfrom
feat/web-ui-writes

Conversation

@springfall2008

Copy link
Copy Markdown
Owner

What it does

The web UI (PR #18) could only watch a board. Now a person can steer one from the board view, and every change goes through the database, so it works for a board run on any machine. Design: docs/superpowers/specs/2026-11-26-web-ui-hints-intents-design.md; plan: docs/superpowers/plans/2026-11-26-web-ui-hints-intents.md.

  • Add hint: on any node. It stores Hint: … / From: <you>, linked relates-to the node, or board-wide on the goal. The lead weighs it at its next round, as with /blackboard hint.
  • Add intent: "try doing X", on the goal or on a fact it builds on. Workers pick it up without waiting for the lead to think of it. Its Why: line starts Why: added by, and the lead never drops such an intent as pointless. It counts toward Max intents, and the form shows the count first.
  • Add amendment: a sub-goal or fallback, e.g. "if 20% is out of reach, 15% is acceptable, as long as X is unchanged". The goal itself is never edited. The lead plans toward a fallback only once the goal's own target is out of reach. On a board with [measure], the runner's measurement still decides Done, so a met fallback stops the board with Stopped: amended target met (amendment <id>).
  • Goal controls:
    • Pause lead / Resume lead: the new state:paused. The lead plans nothing, workers carry on with open intents, and the runner checks every 2 minutes. A measurement that finishes while paused is held until resume.
    • Stop: confirmed in-page, with focus on Cancel.
    • Restart: "run board-runner run again".
    • Intent limit: raise or lower it. Raising it on a board stopped at its limit resumes it.

How

  • web-api:
    • POST /hints, /intents, /amendments, /boards/control.
    • The browser sends only text, ids and an action. The server builds every template line, tag and link in _shared/board-writes.ts, kept in step with the skill. A unit test pins the Why: added by marker to the skill files.
    • Newlines are folded, so no field can forge a template line.
    • Writes run as the caller, so RLS decides who may write. A failed link deletes the memory just stored.
    • No migration.
  • Local proxy: admits exactly those four POSTs. Each must be same-origin (Sec-Fetch-Site, or Origin when that is absent), JSON, at most 16 KiB, with a 30 s timeout. A cross-site text/plain request gets 403 and never reaches upstream.
  • Skill:
    • state:paused across SKILL.md, lead.md, work.md and start.md;
    • commands pause, resume-lead, intent and amend;
    • the amendment and fallback rules;
    • a worker no-steering rule: never change or write the goal, rules or an amendment. Hints about their own work stay.
    • Every existing BOARD-* line is unchanged.
  • Runner: parses BOARD-LEAD paused free=<n> open=<m>, keeps filling worker slots, uses a 2-minute heartbeat while paused (never slower than a running board), and holds measurement results until resume. Scheduler changes were test-first.

Hosted

web-api was redeployed earlier from this branch's routes. The final-review fix wave then changed web-api.ts again: a safe-integer check on the limit, and using the resolved fact id. So hosted needs one more redeploy after review.

Known limits

  • Amendments are guarded by a rule, not the database. Agents use the same member token as the person. The follow-up is a bot member for agents, with a database rule that bot members cannot write kind:amendment, kind:goal or kind:rules, or edit the goal.
  • Restart is offered on every stopped board. One stopped as Unreachable or at its limit just stops again at the next round.

Test plan

  • deno task check
  • Unit tests: 305 pass
  • Integration tests: 158 pass
  • pgTAP: 567 pass
  • Runner tests: 136 pass
  • Local smoke through the proxy on a toy board: hint, intent, amendment, pause and resume, limit, stop and restart, plus the 409, 400 and 403 cases.
  • Hosted probes after the first redeploy: empty text gives 400, an unknown board gives 404, cross-site gives 403. Nothing was written.
  • Drawer and controls viewed in Chrome on a real board, read-only.
  • Redeploy web-api with the fix-wave changes, pending the maintainer's OK.
  • A toy-board run to check the skill's paused branch, the amendment fallback and the round:<n> wording on a real lead and workers. Skipped so far, at the maintainer's choice.

🤖 Generated with Claude Code

springfall2008 and others added 14 commits November 26, 2026 20:56
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…2 minutes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
POST /hints, POST /intents and POST /boards/control build the blackboard
skill's templates, tags and links on the server as the caller. Text is
folded onto one line so no field can forge a template line; a failed link
deletes the memory just stored.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
POST /amendments stores an Amendment/From memory linked depends-on the goal (409 once done).
The skill gains the amend command, the lead's Amendments handling and the worker rule that only
a person steers the board.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ew Done when

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
POST is admitted for hints, intents, amendments and boards/control only, and
only with proof of same-origin (Sec-Fetch-Site, else an Origin equal to the
request's own), a JSON content type and a body of at most 16 KiB, read with a
streaming cap. Writes get a 30 s upstream timeout; GETs keep 15 s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On the Board tab the drawer's Memory tab gains Add hint on every node, Add
intent on the goal and on facts while the board runs or is paused, and on the
goal its amendments, Add amendment and the board controls (pause, resume, an
in-page confirmed stop, restart, the intent limit). Each write disables its
form while in flight and polls the graph at once through mountBoard's new
pollNow. The status strip shows paused in amber, and amendments sit in the
graph's header band with their own colour and shape.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A held or repeated Enter on Stop… no longer lands on the newly focused Stop
board button; confirming takes a deliberate Tab or click.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- runner: hold a measurement result while the lead is paused, so the first
  round after resume delivers it and passed_sent is set only when sent; the
  paused heartbeat is never slower than a running one, and the stuck-lead
  check waits two running heartbeats (at least two paused ones).
- web-api: maxIntents must be a safe integer >= 1; an intent built on a fact
  names the fact's stored id in its Why line and link.
- web: the amendment list redraws after Add amendment; a 409 from a control
  re-reads the goal state and redraws the buttons.
- skill: one From: test in lead and work; the fallback candidate waits until
  the goal's own target is out of reach; workers' hints are partial results,
  ideas and problems; only a person changes the goal's text or limits.
- tests: the skill names the server's person-intent marker.
- docs: README write and limit wording; design doc Non-goals, Restart on
  every stopped board, the held measurement.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@springfall2008
springfall2008 merged commit 0975d58 into main Nov 26, 2026
2 checks passed
@springfall2008
springfall2008 deleted the feat/web-ui-writes branch November 26, 2026 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant