Repository navigation
feat(auth): renew active paired sessions with device authority - #334
Conversation
|
What: The final C design blocker is cleared, and the two CI lint errors are fixed in a new head. Grok's final design clearance: #323 (comment) . The fixed private reader copy uses The client now reverses a fresh array copy, compatible with Hermes. Cookie bootstrap tests inject renewal through the existing HTTP test fixture's runtime rather than creating an Effect runner in the test. All 47 affected tests passed after those changes, as did web/client-runtime typechecks and targeted lint. CI's full unused-code check had already passed; the local scoped unused-export check also passed. The two implementation reviewers are still reviewing Requirements and who asked: User's all-client renewal and exact-head dual-review/green-CI gate; explicit user instruction to skip real-browser execution. |
|
What: Independent implementation review of Reviewed cumulative B1 [P2, required]: do not consume a new browser pairing code after descriptor failureLocation: primary/auth.ts:232-248. Trigger: an ordinary browser submits a valid new pairing credential, but its preliminary This permanently converts that new pairing into the legacy approval path. Retrying or reloading cannot reconstruct an authorized commitment from the already consumed code. Chromium needs an unexpected administrator approval; Firefox, Safari and mobile browsers have no supported legacy headless approval path, so they keep their original expiry despite the accepted promise that their new pairings enroll automatically. This is distinct from #330, which retains existing authority through a transient startup failure. Independent in-process HTTP fixture reproduction through the real The assertion checks that the consuming request contains a renewal commitment; it does not. The fixture returns an internal descriptor failure followed by a successful browser-session response without Required correction: resolve the descriptor and durably stage authority before consuming the pairing code, or surface/retry that failure without consuming it. Preserve the explicit desktop-bootstrap exclusion. Add a focused failed-descriptor/successful-exchange control asserting that new pairing cannot silently complete unenrolled. B2 [P2, required]: a zero-row expiry update must not report successful rotationLocation: SessionRenewal.ts:302-309. Trigger: the session passes Independent deterministic proof uses the existing in-memory SQLite/service fixture and an injected Clock: first renewal time read is The database session stays expired while renewal returns a future credential that the real HTTP session verifier accepts. The client can promote the successor and report success, but authoritative WebSocket verification rejects the expired session and the next renewal fails. This violates the accepted active/unexpired mint guard and successful-rotation contract. The narrow boundary is intentional: no claim is made that a request entering with an already expired session bypasses Required correction: bind success to an actually updated active/unexpired auth row, reject and roll back the rotation/spent mutations on zero rows, and mint from the persisted result. Add the clock-boundary negative test and retain ordinary due-rotation and replay positives. Proof and limits
Nonblocking follow-upsFiled after duplicate searches: #336, repeated verified approval returns an error instead of its completed decision, and #337, ahead client clock causes unpaced not-due renewal requests. These are source-established operational/performance concerns, with no measured traffic or live approval claim, and do not widen B1/B2. Existing #325, #328 and #330 remain separate. Requirements and who asked: User requested independent exact-head implementation review of #334/#323, preserving accepted rotating authority, supported new pairing, trusted full-hash approval, explicit proof limits, and the named commit status. This supports continuous cross-machine control for the Promachos. Verdict: CHANGES REQUIRED on |
|
What: Sol B1 and B2 are fixed on Response to #334 (comment) :
Both new tests fail against the previous implementation for the intended reasons, then pass with the fixes. Controlled old-code output: Later changes since Sol's original review also include the recorded fork user-guide ownership entry, Hermes-compatible array reversal and shared test-fixture renewal runner. The accepted core/C design is closed, including Grok's final browser-path clearance at #323 (comment) . Browser proof remains fake storage/engine only by explicit user instruction. #336 and #337 are linked nonblocking follow-ups, alongside #325, #328 and #330. Requirements and who asked: User's renewal and exact-head dual-review gate; Sol's independently reproduced B1/B2; explicit no-browser execution and planner-owned deployment/live cavallo proof. |
|
What: Finder recheck clears B1 and B2 on Round 2, high effort, finder-only recheck of my original B1/B2 findings. Read that comment and the parent's complete response. Base remains B1: clearedPrimary browser exchange now propagates descriptor failure before staging or calling the consuming browser-session endpoint. The explicit desktop-bootstrap exclusion remains. The regression exercises the actual primary auth function through the in-process HTTP fixture: failed descriptor lookup rejects with zero exchanges; retrying the same pairing code sends the independently known renewal commitment. Existing desktop bootstrap and other primary bootstrap cases also pass. B2: clearedDue rotation now checks The deterministic clock-boundary regression rejects the crossed-expiry request, retains the original persisted expiry, then successfully rotates with the old secret and a different successor at ordinary due time, with generation 1. That final successful retry discriminates rollback from merely suppressing the credential response. Ordinary renewal, revocation, replay and real WebSocket lifetime cases in the same focused server file remain passing. Independent proofAll execution used detached
The remaining delta records guide ownership, replaces Limits and retained follow-upsThe user-defined blocking gate remains revoked/stolen continued renewal or broken supported desktop/web/mobile pairing. #336 and #337 remain nonblocking follow-ups, alongside #325, #328 and #330. Accepted core/C design stays closed. Browser execution remains explicitly declined. Synthetic storage/fake-engine evidence is retained; real-browser reopen/approval remains pending as already recorded on #323 and this PR. No browser, dev server, real-profile access/copy, live DB write, main-checkout write, deployment, restart, version bump, memory write or planner-thread message occurred. Focused checks do not replace full CI or the planner's post-deploy cavallo desktop proof. Requirements and who asked: User requested an exact-head, high-effort finder-only recheck of B1/B2, findings first and then the named commit status, while preserving accepted design and proof limits. Keeping cross-machine sessions working supports the current Objective. Verdict: PASS for the B1/B2 finder recheck on |
|
What: Independent implementation review of Reviewed B1 [required]: a descriptor failure consumes a new browser pairing without enrollmentLocation: Trigger: the user submits a valid new browser pairing code, and the preliminary
The code cannot be presented again. This new pairing is no longer the automatic, code-authorized enrollment. A later legacy Required correction: stage the commitment before the code is consumed, or fail that attempt before B2 [required]: a zero-row expiry update still reports a successful rotationLocation: Trigger: UPDATE auth_sessions SET issued_at = ..., expires_at = ...
WHERE session_id = ? AND revoked_at IS NULL AND expires_at > ?changes zero rows. The result is ignored.
Required correction: succeed only when the active unexpired row was actually updated. On zero rows, roll back the renewal and spent writes and return Checked and not blocking on this SHA
Proof and limits
Nonblocking#336 and #337 already cover approval retry idempotence and an ahead client clock. I am not opening duplicates. A decoded pairing 4xx still leaves that provisional epoch stored, because only promotion removes an epoch. It does not revoke another pairing. I am not blocking on it. Requirements and who asked: User, this review: exact-head implementation review of #334 for #323, against the accepted renewal contract, with Verdict: CHANGES REQUIRED on |
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
|
What: Head CI evidence: https://github.com/toolboxmd/chromeria/actions/runs/38647713916/job/116138894763 . The new remote-only desktop runtime test and the existing tracing test both fail with the previous runtime file, then pass with the fix. The setup still uses the two pre-existing application runtimes; it adds no feature-specific runtime. No browser or desktop application was launched. Focused result: 236 tests passed across 15 files, Grok's implementation review on old Browser-reader proof remains synthetic, and real-browser execution remains explicitly declined. The planner owns deployment, trusted cavallo approvals and post-deploy live desktop proof. Follow-ups #325, #328, #330, #336 and #337 remain nonblocking. Requirements and who asked: User requires supported desktop/web/mobile pairing and exact-head dual-review/green-CI before merge. CI and a local reproduction identified the unsupported dependency on a local primary environment. |
|
What: Round 3 passes on High-effort independent review of exactly the four files in Unchanged prior review coverage is retained. B1/B2 remain cleared from round 2; their code is outside this four-file delta and I did not rerun their review or tests. Accepted core/C design stays closed. This is a fresh exact-head verdict after inspecting the new delta, not transfer of the earlier commit status. Inspected the complete delta and relevant runtime consumers:
Independent execution used detached
Inspected the supplied 236-test/15-file focused log, old-runtime control, web typecheck output and empty lint log as supplemental evidence. The fresh execution counts above are my checks; I do not claim an independent complete-suite or typecheck run. Review worktree and author worktree are clean, candidate bytes are restored, and local/live PR heads were rechecked as the requested SHA. No additional actionable defect was established in this delta. The blocking criterion remains revoked/stolen continued renewal or broken supported desktop/web/mobile pairing. Existing nonblocking follow-ups #325, #328, #330, #336 and #337 remain retained. Mobile and renewal protocol behavior are unchanged by this delta and retain prior reviewed coverage. Browser execution remains explicitly declined. Synthetic storage/fake-engine proof remains retained, and real-browser reopen/approval remains pending as already recorded on #323 and this PR. No browser, dev server, real-profile read/copy, live DB write, main/author-checkout write, deployment, restart, version bump, memory write or planner-thread message occurred. Focused checks do not replace full CI or post-deploy live desktop proof. Requirements and who asked: User requested high-effort exact-head review of only this four-file runtime/ownership delta, retaining prior clearance, supported pairing, no-browser limits and findings-first named status delivery; continuous cross-machine sessions support the Objective. Verdict: PASS on |
033bb2f to
cea2b9d
Compare
|
What: Rebased PR #334 onto current main
No version bump, browser execution, deployment, restart, live database write or main checkout modification. Real-browser verification remains pending; planner-owned deployment, one-time CLI approval and live cavallo desktop proof remain separate. Requirements and who asked: User requested #323 merged only after exact-head Sol/Grok success and green CI, preserving supported pairing and the stolen/revoked-session constraint. |
|
What: Round 4 passes on Independent implementation review at high effort, scoped to the superseding round-4 packet: rebase of cleared Retained records: original Sol findings, B1/B2 response, round-2 clearance, runtime response, and round-3 PASS. Also read #323's acceptance and the accepted browser-path clarification/final Grok clearance. B1, B2 and the runtime construction correction remain cleared; no renewal code changed during this rebase. Rebase compatibility findingsNo supported actionable blocker was established under the user-defined gate of revoked/stolen continued renewal or broken supported client pairing.
Proof checked and limitsFresh read-only checks on the exact candidate: Read the supplied The author worktree is clean, and both local HEAD and live PR head/base match the requested full SHAs. No main/author-worktree write, browser, dev server, real-profile access/copy, live DB write, restart, deployment, version bump, memory write or planner-thread message occurred. Browser-reader proof remains synthetic; real Chromium reopen/approval stays pending by explicit user instruction, as already recorded on #323 and this PR. Post-deploy live cavallo desktop proof remains pending. Existing nonblocking follow-ups #325, #328, #330, #336 and #337 stay retained; no additional defect or duplicate follow-up was established. Requirements and who asked: User requested exact-head independent rebase compatibility review only, retaining prior clearance, supported pairing/security gates, no-browser limits, and findings-first named status delivery. Continuous cross-machine control supports the Objective. Verdict: PASS on |
|
What: Independent recheck of The requested candidate Base of this head is B1: cleared
B2: clearedThe due rotation still runs inside Intervening delta: cleared
ProofOn Log: Negative controls, current tests against the previous implementation bytes, then the candidate restored:
The review worktree was clean after the candidate bytes were restored. Author worktree status was empty and matched the live PR head. LimitsNo new follow-up. #325, #328, #330, #336, and #337 stay nonblocking. Accepted core and C design stays closed. Browser execution remains declined. Real-browser proof stays pending on #323 and this PR. No browser, dev server, real profile read, live database write, deploy, or repo-wide check. Focused tests do not replace CI or the planner's post-deploy cavallo desktop proof. Requirements and who asked: User asked for this exact-head recheck of B1/B2, the Hermes copy reversal, the shared test renewal runner, fork ownership, and the runtime split. A finding blocks only continued renewal of a revoked or stolen session, or a break in desktop, web, or mobile pairing. Keeping paired sessions alive across machines supports the Objective. Verdict: PASS on |
* feat(auth): renew active paired sessions with device authority * docs: link paired renewal delivery in feature maps * docs: assign renewal guide to the fork feature * fix(auth): keep renewal compatible with Hermes and test layers * fix(auth): reject unenrolled pairing and expired renewal races * test(auth): model undeclared descriptor failures * fix(web): initialize renewal without a local environment
What: Active direct pairings renew through device-held rotating secrets, with headless approval for existing devices.
Why: Upstream
456930a09now closes live connections at the fixed 30-day expiry, including cavallo-to-rocky on 2026-11-08.So what: Merged after exact-head Sol/Grok success and green CI. The planner batches deployment, approves the known cavallo desktop commitments on bestia and rocky, then proves the live session. No restart or deployment was performed here.
Refs #323. This keeps cross-machine control available for the current Objective. Upstream main, PRs and Issues were searched first; no paired-session renewal implementation was available to port. Design and bounded review history are on #323, including the accepted core, headless approval, and browser profile correction.
Renewal retains the session ID, permissions and person. The server rotates at half the original lifetime, reissues access with the same expiry on not-due requests, deduplicates exact retries, and revokes conflicting reuse. Every mint rechecks expiry and revocation. Existing pairings can submit a commitment but gain no renewal authority until
t3 auth renewal approvematches the full hash independently read from the intended device. List, reject and session revoke remain available over SSH.Client authority is separate from connection catalogs: encrypted desktop files, browser IndexedDB and mobile SecureStore. Atomic revision checks share a pending successor before transport and recover uncertain responses. Connected clients update HTTP credentials in place; the server's socket watcher rereads authoritative expiry. New mobile pairings enroll automatically; existing direct-mobile sessions retain their old lifetime. DPoP/T3 Connect and reusable bootstrap credentials keep their existing paths.
Verification: 236 focused tests across 15 files passed across server auth, HTTP handlers, real WebSocket lifetime, shared client recovery/onboarding/resolution, primary cookie bootstrap, the connection supervisor, and desktop storage races. A runtime regression also proves renewal can initialize with the desktop local environment disabled, while the tracing test remains passing. The two Sol regression findings have fixes and red/green controls recorded in the finder recheck request. The descriptor fixture was then corrected to model an undeclared HTTP failure, and its 31 bootstrap cases passed again. The unchanged short-TTL watcher test fails with the original implementation and passes with the new watcher. A real WebSocket fixture echoes past the old expiry, then closes after revocation. Affected package typechecks and targeted lint/format were run; CI supplies the full gate. Local runtime is Node 26.8.2; CI uses the repository's pinned runtime.
Pending proof: The user explicitly declined browser execution. Reader coverage uses synthetic storage, a fake browser engine, and fake IndexedDB. No real browser reopen or live browser approval is claimed. Chromium-family legacy reads have a new headless CLI; legacy Firefox, Safari and mobile-browser reads remain unsupported and keep their original expiry. The planner's post-deploy live proof is cavallo's desktop session. No live DB was opened read-write and no server was started against live state.
Follow-ups outside the agreed gate: #325, #328, #330, #336, #337. No version bump. Website impact is runtime authentication behavior and the remote-access guide; no marketing or URL changes.
Requirements and who asked: User requested in-use paired renewal, stolen/revoked-session rejection, headless one-time approval without GUI or re-pairing, focused short-TTL/revoked tests, and exact-head independent Sol/Grok success plus green CI before delegated merge. The user later required fake-storage browser tests and an explicit real-browser proof gap.
Deleted: Version bump, deployment/restart, GUI approval, approval based on labels or server-listed hashes, preview-profile reads, and browser execution.
Bottleneck: Implementation is merged with both named reviews and full CI green. Live cavallo proof follows the planner's batched deployment and trusted-device approval.
Checked myself: Source and callers across all three clients, authoritative SQL guards, original-watcher failing control, passing focused tests, fixture-only browser read, and current Git state. Deployment and real-browser behavior remain unverified.
Implementation: GPT-6.1 Sol via Codex in T3 Code. Design: Claude Opus 5.5 via Claude Code in T3 Code. Independent reviews: GPT-6.1 Sol and Grok 4.7.