Skip to content

feat(sdlc): approve with short issue comments and reopen the web monitor - #40

Merged
mingchuno merged 1 commit into
mainfrom
user-frictions-2-approval
Oct 22, 2026
Merged

mingchuno merged 1 commit into
mainfrom
user-frictions-2-approval

Conversation

@mingchuno

Copy link
Copy Markdown
Owner

Phase 2 of 3 (stacked on #39). Approving work no longer needs the CLI or a 100-character string.

Summary

Provider approval (D1).

- agent-workflows approve 9b2e…-uuid scope 3c1f…64-hex-revision
+ /approve scope 3f9a2c1d4e5f

The code is the first 12 hex characters of the gate's contract digest, computed without sourceRevision. That is what lets the published section print it; the full revision covers the issue body, so the body can't contain it (ADR 0011). syncWorkApprovals accepts the short form only when all of these hold (ADR 0013):

short comment counts when
  author is an allowed human
  issue revision == observed source revision    (unchanged rule)
  issue body shows render(current contract)
  comment.createdAt > workItem.updatedAt        (a source edit + reassessment voids older comments)

The long form is still accepted. The published section ends with an Approval block giving the exact comment per gate, or "Approve in the agent-workflows monitor" for local-operator. WorkInspection.approvalComment carries it to work inspect, the TUI and the web monitor.

Getting back to the web monitor.

 run
-  Web monitor: http://127.0.0.1:8787/?token=…   # printed once, lost with scrollback
+  Port 8787 is in use; using 51234.              # only when the default is taken
+  Web monitor: …  → kept in the mode-600 runner control record
+monitor --web [WORK_ID]   # prints and opens the current link, optionally #work=WORK_ID
+doctor --json / work …    # monitorUrl without the token, deep-linked for Work Items

The web app opens #work=ID directly in the Work Items view. An explicit --web-port still fails rather than moving to another port.

Skill. delegated.md now tells the human in one line where to approve: the issue comment, the monitor link, or monitor --web WORK_ID.

Evidence

  • tests/work-publication.test.ts:
    • the code ignores sourceRevision and changes when the content changes
    • a comment posted before the last change, a comment from an outsider, and a comment with the wrong code all import nothing; the correct comment imports exactly one approval and the item becomes ready
  • tests/web.test.ts: with 8787 taken, run moves to a free port. monitor --web prints the same link, monitor --web work-1 appends #work=work-1, and doctor --json reports monitorUrl without token=.
  • tests/work-console.test.ts: in Playwright, ${url}#work=<second> opens on the second Work Item.
  • pnpm verify: 401 tests, 398 passed, 0 failed (3 live-provider tests skipped).

Merge Danger

Door: two-way

Blast Radius: approvals

  • This adds a second accepted approval syntax. If the timestamp rule is wrong, an old comment could approve reassessed work whose contract text is identical. The rule plus the published-body check limit that.
  • Clock skew can make the runner ignore a valid comment. Reposting fixes it.

🤖 Generated with Claude Code

@mingchuno
mingchuno force-pushed the user-frictions-2-approval branch from 84393f0 to 585ef6b Compare October 22, 2026 09:01
@mingchuno mingchuno changed the title feat(sdlc): Approve with short issue comments and reopen the web monitor feat(sdlc): approve with short issue comments and reopen the web monitor Oct 22, 2026
@mingchuno
mingchuno force-pushed the user-frictions-2-approval branch from 585ef6b to a7a4177 Compare October 22, 2026 09:14
Base automatically changed from user-frictions to main October 22, 2026 09:37
@mingchuno
mingchuno added this pull request to stack #42 October 22, 2026 09:37
- provider approval accepts `/approve GATE CODE`, where CODE names the
  gate's contract content printed in the published issue section; it
  counts only while the issue shows the current contract and after the
  Work Item last changed (ADR 0013); the long form still works
- inspections expose approvalComment, shown by start-work, the TUI and
  the web monitor
- run keeps the web monitor link in its control record, falls back to a
  free port when the default is taken, and `monitor --web [WORK_ID]`
  reopens it
- `#work=ID` links open the web monitor at a Work Item; work commands
  and doctor return token-free monitorUrl links

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mingchuno
mingchuno force-pushed the user-frictions-2-approval branch from a7a4177 to ab3182f Compare October 22, 2026 09:40
@mingchuno
mingchuno merged commit 3b0411c into main Oct 22, 2026
4 checks passed
@mingchuno
mingchuno deleted the user-frictions-2-approval branch October 22, 2026 09:41
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