Skip to content

feat: dashboard ★/Goals + batch brief --new with goal provenance (Mind#565) - #624

Merged
Jammy2211 merged 3 commits into
mainfrom
feature/dashboard-input
Nov 13, 2026
Merged

Jammy2211 merged 3 commits into
mainfrom
feature/dashboard-input

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Summary

Pre-M3 build 2 (PyAutoLabs/PyAutoMind#565): the editable dashboard, Brain half.

  • The renderer (_intake.py, intake/dashboard_edit.js):
    • a ★ on each task row and a Goals box;
    • a single CSP with a script pinned by hash, and connect-src limited to api.github.com;
    • all dynamic DOM writes through textContent;
    • the token kept per device, with a forget control;
    • one issue in flight at a time, with taps coalesced;
    • polling for the bot's result comment.
  • batch brief --new <slot>: fills goals: from goals.md. Goals last written by the dashboard, or of unknown provenance, are commented out with "from dashboard, last edited ", and a diff since the last brief is printed.

Test plan

  • Brain pytest tests/: 1870 passed.
  • Headless Chromium run against a fake API: 10/10 steps, zero CSP violations.
  • Skill line counts OK. Tenant firewall OK.

Gate

  • Heart, scoped dev-ship verdict: GREEN for PyAutoMind and PyAutoBrain. No override was needed.
  • Independent security review: 4 rounds, then CLEAN:
    1. Design B (an Actions token) was unsafe, because any old branch's injectable workflow could be dispatched. The human chose design C, an Issues token.
    2. The token must be a dedicated machine account, not the human.
    3. Issue-spam lock and rate cap.
    4. Labelling someone else's issue must cause no writes.
  • Also hardened: 4 pre-existing Mind workflow_dispatch workflows that put inputs into shell. A lint now blocks the pattern. Old branches still carry the old YAML: see draft/maintenance/pyautomind/old_branch_workflow_secret_exposure.md.
  • Human: chose design C on 2026-11-13 and gave the merge command (judge tier).

🤖 Generated with Claude Code

Jammy2211 and others added 3 commits November 13, 2026 18:31
…ox, brief --new (PyAutoMind#565)

Design B, as ruled 2026-11-13. The published dashboard becomes the Mind's
write door for queue.md and goals.md; the Mind's dashboard_input.yml does
the validating and committing.

- dashboard.html: a ★ toggle on every prompt row (pressed with its queue
  position, matched by basename, in every section), and a Goals and queue
  box above the section cards with a Connect panel for the token. The page
  reads right with JS off; stars stay disabled until a token is present.
- dashboard_edit.js (inlined into the one <script>): one tap = one
  workflow_dispatch with an Actions-only fine-grained token kept in this
  browser (forget control; a 401 clears it; writes off inside a frame).
  Optimistic, serialised per task, confirmed when the run succeeds, reverted
  with the workflow's own ::error reason (read from the check-run
  annotations) when it refuses. Live state re-read from main on load.
- A meta CSP pins the script by sha256 (computed at render, so --check stays
  deterministic) and allows connect-src https://api.github.com only.
- dashboard.md gains read-only Goals and Queue sections.
- batch/_steer.py: the queue.md/goals.md readers the renderer and the
  planner share. `batch brief --new <slot> --review-at <ISO>` prints a
  skeleton brief with goals: from goals.md (backlog scoped to their
  epics/tags, merge-cap 0); `brief --check` warns when goal 1 is missing.
- Tests: golden HTML (stars, box, CSP hash, escaping, absent files), JS
  parsers held to the Python readers in node, brief --new prefill + check,
  and tests/dashboard_edit_browser.cjs (Chromium, fake API, 320/390 px).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ard goals untrusted in briefs (PyAutoMind#565, design C)

Design B (workflow_dispatch with an Actions token) was blocked by review:
such a token can run any workflow at any ref. Design C, as ruled:

- dashboard_edit.js opens one `dashboard-input` issue per edit (fixed
  key: value body, Issues-only token), then polls the issue until it is
  closed and reads the result comment — only the workflow bot's counts.
  One issue in flight at a time; taps made meanwhile coalesce (latest
  state per task wins, a tap and its undo send nothing). A label GitHub
  drops means no run, so the stray issue is closed and the tap reverted.
- The Connect panel asks for Issues: read and write; the token link
  prefills issues=write. CSP, textContent and the rest unchanged.
- batch brief --new: goals whose line was last written by a
  `Via: mind-dashboard` commit (git blame) are emitted commented out,
  "from dashboard, last edited <date>", so a worker never sees page text
  the human did not adopt; their epics/tags do not widen the dip. Prints
  the goal diff since the newest brief on stderr. --check no longer
  nudges toward a dashboard-sourced goal 1.
- Tests: issue form held to the Mind parser, bot-only results,
  coalescing, provenance with a git fixture; browser harness reworked for
  issue create then poll (10 steps).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… issue after creating it (PyAutoMind#565)

- batch brief --new: when provenance cannot be read (no git, uncommitted
  goals.md, blame out of step with the goals) every goal is emitted
  commented out, "provenance unknown" — none reaches a worker until the
  human adopts it; --check no longer nudges toward an unknown goal 1.
- dashboard_edit.js: the Mind workflow now runs on `issues: labeled`
  (labels set at creation are dropped for an account without push
  access, and the token is a Triage machine account's). The page opens
  the issue, then adds `dashboard-input`; if the label is refused it
  closes the stray issue and reverts.
- Connect panel: the machine account's token, never the human's own.
- Tests: fail-closed provenance (3 cases), git fixtures for hand-written
  goals, Mind parser parity on the labeled event; browser harness 10/10.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Jammy2211
Jammy2211 merged commit 5496e4d into main Nov 13, 2026
2 checks passed
@Jammy2211
Jammy2211 deleted the feature/dashboard-input branch November 13, 2026 19:16
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