feat(web): Serve a stable console on port 7777 from daemon start - #123
Merged
Merged
Conversation
WA-17 now names daemon URLs only: the in-process fallback prints its own page line inside startWebServer, so a notice could not precede it.
Describe the daemon-owned console on web.port, the stable token file, the year-long cookie and the localhost redirect in the protocol doc. The pty and rename gates now kill their isolated daemon on exit instead of leaving it behind.
Close the Verifier's surviving mutants: the Host and POST rejection tests now assert the spec's forbidden body, and a source check pins that the --web-child entry feeds parseWebChildArgs into runWebChild. Also fix the spec coverage line and the tasks status header.
The Verifier passes all 25 acceptance criteria and kills 28 of 28 mutants after one fix round. Two candidate lessons come from the mutants that survived the first pass.
|
4ndreello
marked this pull request as ready for review
September 25, 2026 02:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Make the web console a stable, bookmarkable page on port 7777 that answers as soon as the daemon is up.
After #119 the console lived in the daemon, but it still started on demand on port 3100, and each web child minted a fresh token. A saved bookmark hit 403 after any restart, and
localhostnever got the cookie set for127.0.0.1.What changes:
start()resolves, without awaiting it, onweb.portfrom the config (default 7777). A new--preferred-portchild argument falls back to an ephemeral port on any listen error.--portstays explicit, with no fallback.~/.run-agent/web-token(mode 0600, published withlinkso a racing reader never sees a partial file). Deleting the file rotates it.Max-Age=31536000and is re-sent on every page visit with a valid cookie.localhostanswers 302 to the same path on127.0.0.1. Cookies are host-only (RFC 6265 §5.1.3), so without this the bookmark onlocalhostwould always be forbidden.codedeck uionce.web.ensuregets explicit port rules. A request withportreuses a matching child. A request withpreferredPortrestarts a child that was not started for that port. A request with neither reuses. Starts are serialized, and a waiting request re-evaluates with its own params. The spec's Supersedes table lists the web-daemon ACs this replaces (WD-02, WD-03, WD-42, WD-44 and others).scripts/pty-gate.shandscripts/rename-gate.shnow kill their isolated daemon on exit. Otherwise the gate's web child would hold 7777 with another token.DEFAULT_WEB_PORTmoved tosrc/config/web-port.tsso the daemon can read it without importingsrc/web(WD-28 boundary).src/web/server.tsre-exports it.One known rough edge is left for a follow-up. A child started with
--port 7777, followed by a command without--port, restarts even though port and token do not change, which drops in-flight requests. Reusing wheneverrunning.port === preferredPortwould fix it.Spec, tasks and the Verifier report live in
.specs/features/web-access/. The Verifier passed all 25 ACs and killed 28 of 28 injected faults after one test-only fix round.