Repository navigation
P5 O10 M10: mawsd binds the endpoint, loaded when it is needed (acceptance 14 within, both readings) - #310
Merged
Conversation
…d-in for bufferutil broke every masked frame of 48 bytes or more) ws's optional native helpers are installed nowhere; Vite stands an empty object in for each, which ws's try/require takes as present, so mask() and unmask() of a frame of 48 (32) bytes or more call an absent function. The main build defines WS_NO_BUFFER_UTIL and WS_NO_UTF_8_VALIDATE, so ws keeps to its own code; the bundle guard holds mawsd's graph free of any such stand-in. Main's bundle carried the same stand-in (its remote links bundle ws). One endpoint log line loses a parenthesis the guard read as a dynamic import(). Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
…t with the daemon's build id)
loadEndpointModule(build) returns createEndpoint({build}); the seam test holds DaemonServices and EndpointServices equal and the module bound. The process-level scene (src/mawsd/process-endpoint.test.ts, in node-timing): a built mawsd on a scratch profile enrolls against desk-hub's Worker in Miniflare with the code on stdin, keys --json shows org-listed with no path or key material, a test device opens a channel over the relay and over the direct listener (MAWS_ENDPOINT_DIRECT=1, a preload standing a tailnet address on loopback), mawsd restart closes both with restart, and the device resumes by cursor on the daemon that comes back; every endpoint command runs through the command line; O6's two private daemons each enroll under their own key and state and neither binds the listener. O2's command-line scene now meets an unenrolled module.
Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
…ade, class, unavailable) Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
…ndency's stand-in too Master's out/main/index.js carries ws's empty bufferutil stand-in (its remote links bundle ws); the define fixes both entries, and the guard now reads both. Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
Conflict: vitest.config.ts's TIMING_NODE_TESTS, both entries kept (O8 M2's rows suite, M10's process scene). Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
…e by the caller's path; the no-module branches go Through #300's secret-command table: revoke and grant are its source commands, '-' read from stdin to its end and sent as daemon.endpoint's secret, a relative file made absolute against the caller's cwd (the daemon's is its own). cli.ts's 'none (arrives with P5 O10)' and keys's no-module fallback, dead since M10 binds the module, are removed with the tests that pinned them: a daemon with no module answers keys like any command. The process scene drives revoke from a relative path, revoke - and grant - through the built daemon. Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
…lever (a) on acceptance 14) The module, ws and org-protocol stay off an unenrolled daemon's resident set: loadEndpointModule binds a LazyEndpoint that loads the module at the daemon's start when an enrollment is on disk (src/endpoint/presence.ts, a few lstats of the store's names), else at its first command, enroll included, and starts it then with the daemon's services as before. Until then status() is the unstarted module's own (UNENROLLED_STATUS), stop() stops whatever loaded, and nothing loads after a stop. A chunk that can't be loaded (an app update replaced the bundle under a running daemon) answers code 1 with `mawsd restart`, logged, tried again at the next command. The daemon's onAttachment and onUpstream now tell a listener that comes later the state as it stands, since the module can start after the app attached and the upstream connected. Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
test/support/guarded-entry.ts reads a built entry's graph in the build's CommonJS: at start, Node builtins, the entry's allowed externals or chunks under out/ by relative path; deferred (the build's Promise.resolve().then(() => require())), only a chunk under out/ by relative path, and only where the entry admits deferred loads. A computed specifier is refused. The bundle guard holds mawsd to it (deferred admitted) and the engine and pty hosts (none), and holds the endpoint, ws and org-protocol off mawsd's run path. O3's hosts reuse the rule. Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
…, so the ws-bundle PR's stand-in case merges as one Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
src/mawsd/pack-chunks.test.ts packs this build (scripts/mawsd-pack.mjs, without the Linux runtime): the pack's mawsd.js is a guarded entry inside the pack's own out/, its graph, deferred chunks included, the build's, the endpoint's chunk among them. The packaged daemon-shape check (e2e:supervisor-daemon:packaged) runs `mawsd endpoint status` through the packaged binary as Node: an unenrolled mawsd starts without its endpoint, and the first command loads it from inside app.asar and answers. Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
… adds to the daemon shape (P5 Decision Log 114) The idle spec's fourth case runs the first case's scene, reads its window unenrolled, enrolls the scene's mawsd with its code on stdin in an org on desk-hub's local runner (e2e/support/local-org.ts: test/endpoint/local-hub.ts bundled for Playwright, wrangler dev on loopback at the deployed hub's 15 s heartbeat), and reads the same processes' window again once the hub link is up. Its line (enrolledLine) names the increment in footprint and CPU, each process's share, the 8 MiB budget's verdict, the validity and both loads, and asserts no bound. The scene is shared with the first case (keptIdleScene); the window now keeps each process's CPU. A measured group on MEASURED_E2E with its package script; the other daemon-idle scripts leave the case out. Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
…one string literal
Round 2's finding: the literal matchers needed the paren straight after the string and the computed count skipped any
argument starting with a quote, so `import("./chunks/" + name)` and the deferred `require("./chunks/" + name)` read as
no load at all. loadsOf now reads every `import(` and `require(` call at its paren: one string literal and nothing else
is a load (deferred when it is an `import` or the arrow of `Promise.resolve().then(() => …)` returns it); anything else,
a concatenation, a template literal or a variable, is computed and refused.
Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
…s two readings on the mini) Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
The conflict was daemon-idle.spec.ts's imports: O3-A's machineSettingsDefaults with M10's enrolled readers. Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
…eline, never the bound's Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
SSFSKIM
added a commit
that referenced
this pull request
Oct 28, 2026
…e missed on V8's sizing, not M10's; the idle lever and the re-derivation owed Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
SSFSKIM
added a commit
that referenced
this pull request
Oct 28, 2026
…p5-o10-readonly The tracker's two new rows, the unloaded answers' PATH_MAX gap and session-plane's holdOrgKey set-up, both kept. Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
SSFSKIM
added a commit
that referenced
this pull request
Oct 29, 2026
…idle-aba Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
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.
P5 O10 M10 (
docs/doperpowers/plans/2026-10-27-p5-o10-endpoint.md, §M10):mawsdbinds the endpoint module. Everymawsd endpointcommand,enrollandkeysincluded, now works on a scratch profile.What changed
loadEndpointModule(build)gives the daemon its endpoint, built bycreateEndpointwithmawsd's build id.DaemonServices≡EndpointServicesand the twoEndpointModuleshapes are held equal by a type-level test.mawsdpays nothing forws, the endpoint ororg-protocol.mawsd restart, and is retried at the next command.onAttachmentandonUpstreamreplay the current state to a late listener.test/support/guarded-entry.ts) is written once for any guarded entry, so O3 can reuse it.out/.out/, and any load whose argument isn't one string literal are refused.mawsdadmits deferred chunks. The engine and pty hosts admit none.pack-chunks.test.tspacks the real build) and the packaged app (e2e/supervisor-packaged.spec.tsrunsmawsd endpoint statusthrough the packaged binary).wsis bundled intomawsd.json its JavaScript paths. The defines landed first as P5 O10 follow-up: the built bundle's ws keeps to its JavaScript paths (masked frames of 48 bytes or more threw) #301.mawsd endpoint revokeandgrantread-from stdin through P5 O14 M1, the src/mawsd half: mawsd endpoint provision reads its code from a prompt or stdin and waits as the module does #300's secret-command table, and resolve a file against the caller's cwd.cli.ts's no-module branches are gone, since M10 is what made them dead.src/mawsd/process-endpoint.test.ts):mawsdon a scratch profile enrolls against the local hub with the code on stdin, andkeys --jsonshowsorg-listedwith no path or key material;MAWS_ENDPOINT_DIRECT=1, reached through a test preload's fake tailnet address, so production gains no knob);mawsd restartcloses the channel withrestart, and the device resumes by cursor;revoke -with stdin, and a relativerevoke <file>from another cwd, both work through the built daemon.e2e:daemon-idle-enrolled, records the increment an enrolled endpoint adds to the daemon shape, against desk-hub's local runner at the deployed 15 s heartbeat. It asserts no bound.queriedcomment now names the reasons the code gives:grade,classandunavailable. Progress, Surprises and the Decision Log record M10.Files outside
src/endpoint/andapps/org-protocol/:src/mawsd/:endpoint-seam.ts,daemon.ts,cli.tsand their tests, plusprocess-endpoint.test.ts,process.test.tsandpack-chunks.test.tssrc/engine-host/bundle-guard.test.tstest/support/:guarded-entry.ts,daemon-idle.ts,local-org.test.tsand their testse2e/daemon-idle.spec.ts,e2e/supervisor-packaged.spec.ts,e2e/support/local-org.ts.github/workflows/gate.yml(MEASURED_E2Egainsdaemon-idle-enrolled),package.json,eslint.config.js(one block for the scene's harness imports),vitest.config.ts,tsconfig.node.jsonValidation Evidence
ci-gate --gates e2e:daemon-idle --runner macos --evidence, run 40733174443:[daemon-idle] footprint 96291 KiB (median of 21) · cpu 0.13 s over 600 s · processes mawsd 31233 KiB, maws-supervisor 65057 KiB · within the bound 101113 KiB and 1.11 s · load 3.1The run is valid. For comparison, before lever (a) (eager, 8744e93, run 40721630909) it read 103747 KiB, with mawsd at 35569. That run is invalid on load (12.8).
ci-gate --gates e2e:daemon-idle-enrolled --runner macos --evidenceon bc536df (the code tree at head), run 40735795915:[daemon-idle] enrolled endpoint footprint +5728 KiB (enrolled 119987 KiB, unenrolled 114259 KiB; medians of 21 and 21) · cpu +0.12 s over 600 s (enrolled 0.26 s, unenrolled 0.14 s) · processes mawsd +5808 KiB +0.11 s, maws-supervisor -80 KiB +0.01 s · within the 8192 KiB budget (P5 Decision Log 114) · valid · load 3.4 enrolled, 3.8 unenrolledThis is the CPU reading that sets the enrolled endpoint's share at 1.5 times its value. The increment is +0.12 s per 600 s, so 1.5 times it is 0.18 s.
ci-gate --gates static,unit,probes,e2e:default,e2e:desk-web-hub,e2e:supervisor-daemon,e2e:daemon-unit --class1a pool --runner macos --lane hosted. GREEN, run 40742508810.flaky:line. ci-gate's coverage warning named e2e:default, which is included.cli.ts(stdin for-, the caller's cwd).Confusions
e2e:daemon-idlerun on the same code read 96291 KiB (mawsd 31233, engine host 65057).Residue
mawsdrestarted between its windows, and a private daemon with the app quit has no path for that today.mawsdstart-up graph, stays the tracker row's lever. It now matters to O3's budget rather than to M10's.loadDeviceKeysstill has no production caller (O8).Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)