Skip to content

feat(web): GitHub link and local diff for a board fact's commit - #25

Merged
springfall2008 merged 6 commits into
mainfrom
feat/commit-diff
Nov 27, 2026
Merged

springfall2008 merged 6 commits into
mainfrom
feat/commit-diff

Conversation

@springfall2008

Copy link
Copy Markdown
Owner

What

Board workers commit on local branches and write Commit: <sha> on <branch> into their facts. This adds two ways to see that commit from the web UI.

  • Repository in the database. An optional board-file key, repo = "owner/name", is validated by the runner. /blackboard start writes it into the goal as a Repo: line. For an existing board whose goal lacks the line, start adds that one line and changes nothing else; this is a second, narrow exception to "from= never edits an existing board".
  • View on GitHub (if pushed). A fact with a Commit: line shows a link to github.com/<repo>/commit/<sha> when the goal has Repo:. Board branches stay local until someone pushes them.
  • Local Diff tab. The same facts get a Diff tab, read from the board's workspace on this machine, so no push is needed. It has two views: "This commit" (git show) and "All changes vs main" (git diff <base>...<sha>, with the commit list). The runner records the workspace in state.json. A board whose runner has not restarted since says so.
  • GET /diff/<board>/<sha>?view=commit|main on the local server:
    • the board name and hex SHA are checked before any git call;
    • git runs with no shell, no pager, no colour, no external diff or textconv, log.showSignature=false, GIT_NO_LAZY_FETCH=1, and stdin closed;
    • it stops after 10 s per call and returns at most 2 MiB, cut at a whole character and marked as cut short.
    • deno task web gains --allow-run=git only.

Design: docs/superpowers/specs/2026-11-27-commit-diff-design.md; plan: docs/superpowers/plans/2026-11-27-commit-diff.md.

Tests

  • deno task check, 332 unit tests, and the runner unittest suite pass.
  • /diff runs against a real temp repo, and against a signed commit in a repo that configures gpg.program and log.showSignature. The control git show runs the program; the route does not.
  • Smoke on a real board workspace: both views, an unknown SHA (404), and an unrecorded board (404).
  • The drawer was not viewed in a browser.

Deferred minors

  • Each git call has its own 10 s timeout, so view=main can take up to about 70 s.
  • The browser diff fetch has no timeout and loads when the drawer opens, not when the tab is selected.
  • The GitHub link shows only from the Board tab's board view.
  • The "restart its board-runner" message is shown on machines that never ran the board.
  • The Python repo check accepts a trailing newline ($).
  • A git status promise leaks if a stdout read throws.
  • A board resumed at its intent limit gets Repo: only on the next start.

After merge

  • Add repo = "…" to a board file and restart its runner.
  • Restart deno task web, for the new --allow-run=git.
  • No hosted change.

🤖 Generated with Claude Code

springfall2008 and others added 6 commits November 27, 2026 09:15
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
start writes Repo: from the board file's repo, and adds it to an existing
board's goal that lacks one, changing nothing else.

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>
A worker can write the workspace's .git/config; with log.showSignature and
gpg.program set, git show ran that program when a fact's drawer opened.
Also no lazy fetch from a promisor remote.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@springfall2008
springfall2008 merged commit df2373f into main Nov 27, 2026
2 checks passed
@springfall2008
springfall2008 deleted the feat/commit-diff branch November 27, 2026 09:45
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