Skip to content

✨ feat(edge): finalize lookout/1.0 for RC — experimental gate, audit bug fixes, docs (M4+M5)#433

Merged
scttbnsn merged 3 commits into
mainfrom
feat/lookout-rc-readiness
Jun 13, 2026
Merged

✨ feat(edge): finalize lookout/1.0 for RC — experimental gate, audit bug fixes, docs (M4+M5)#433
scttbnsn merged 3 commits into
mainfrom
feat/lookout-rc-readiness

Conversation

@scttbnsn

Copy link
Copy Markdown
Contributor

What & why

A multi-agent audit of the merged lookout/1.0 edge integration (M4 #430 + M5 #429) found the code fundamentally sound — Ed25519 auth is correct, the SPKI header byte-exact, nonce-commit-after-verify ordering safe, the CodeQL TOCTOU fix genuine — but surfaced confirmed protocol/auth bugs, documentation inaccuracies, and a release-readiness gap: the feature shipped to main with no CHANGELOG entry and its docs were stranded in the unmerged #432.

This PR makes lookout RC-ready and supersedes #432 (whose docs had real accuracy bugs, fixed here). Per decision: ship the feature experimental / opt-in for this RC, and fix the confirmed code bugs.

Changes

✨ Experimental gate (default off)

  • DD_EXPERIMENTAL_LOOKOUT=true is now required to mount the lookout/1.0 WebSocket endpoint and the /lookout key-registry router. Default-off = zero runtime footprint, so the endpoint can soak as an opt-in before any GA commitment. The wire protocol may change while experimental.

🐛 Audit-confirmed bug fixes (each with tests; 100% coverage held)

  • Stream-request error frames no longer droppedEdgeAgentAdapter routed error frames under the bare requestId while streaming requests are keyed stream:${requestId}, so a streaming call would hang the full 30 s timeout instead of rejecting. Now rejects immediately.
  • startExec no longer sends an exec_end for a never-started execId when the session limit is hit (was a subprotocol violation).
  • Revoked keys in the authorized_keys file no longer silently re-activate on restart — the idempotency check now matches any record (active or revoked) and warns instead of re-inserting.
  • Key revocation now disconnects live sessionsDELETE /lookout/keys/:keyId closes any live WebSocket authenticated under that key (disconnectByKeyId).
  • DELETE /lookout/keys/:keyId validates the 16-hex keyId format (400) before use, with a fixed message (no raw input reflection).
  • Hello-timeout timer cleared on premature close/error; non-finite timestamp rejected; over-long signature rejected before the crypto allocation.

📝 Docs + spec

  • lookout.mdx: flip path hierarchy to /api/v1/... primary (/api/... deprecated, removal v1.6.0); document the base64url signature encoding (vs standard-base64 pubkey); add the hello-frame schema using the real pubKeyId field name; add the welcome-frame shape; complete the 13-code error catalogue; correct the revoke-404 wording; prominent DD_EXPERIMENTAL_LOOKOUT callout.
  • agent.mdx: add the M4 logLevel/pollInterval fields to the dd:ack example.
  • OpenAPI 3.1 path definitions for GET/POST/DELETE /api/v1/lookout/keys (new Lookout tag).
  • README + ROADMAP: experimental edge-agent dial-out (Ed25519) in features and the v1.5.0 row.
  • CHANGELOG: new Added entries for M5 (PR ✨ feat(edge): lookout/1.0 edge WebSocket endpoint with Ed25519 auth (M5) #429) and M4 (PR ✨ feat(agents): declare lookout runtime info fields in ack payload (M4) #430) — both were previously absent from main's changelog entirely.

Verification

  • app: 10,834 tests pass, 100% coverage (lines/branches/functions/statements).
  • tsc build clean; biome clean (the 2 remaining warnings are pre-existing write-only-field warnings on EdgeAgentAdapter, unchanged from main).

Supersedes #432.

scttbnsn added 3 commits June 13, 2026 09:48
…t off)

The edge WebSocket endpoint and /lookout key-registry router mount only when DD_EXPERIMENTAL_LOOKOUT=true. Default-off means zero runtime footprint so the feature can soak as an experimental opt-in before GA. Adds getExperimentalLookoutEnabled(); gates the router mount (api.ts) and attachLookoutWsServer (index.ts); tests cover both branches.
- 🐛 stream-request error frames no longer dropped — EdgeAgentAdapter routes error frames under the stream: key, so sendStreamRequest rejects immediately instead of hanging the 30s timeout
- 🐛 startExec no longer sends an exec_end for a never-started execId when the session limit is hit (was a protocol violation)
- 🐛 revoked keys present in the authorized_keys file are no longer silently re-activated on restart (idempotency check now matches any record, warns on revoked)
- ✨ key revocation now disconnects any live WebSocket session for that key (disconnectByKeyId)
- 🔒 DELETE /lookout/keys/:keyId validates the 16-hex keyId format (400) before use, with a fixed error message (no raw reflection)
- 🐛 hello-timeout timer cleared on premature close/error; non-finite timestamp rejected; over-long signature rejected before crypto
…(M4+M5)

- 📝 lookout.mdx: flip path hierarchy to /api/v1 primary (/api deprecated, v1.6.0); document base64url signature encoding vs standard-base64 pubkey; add hello-frame schema with the real pubKeyId field; add welcome-frame shape; complete the 13-code error catalogue; fix revoke-404 wording; prominent DD_EXPERIMENTAL_LOOKOUT callout
- 📝 agent.mdx: add M4 logLevel/pollInterval to the dd:ack example
- ✨ OpenAPI 3.1 paths for GET/POST/DELETE /api/v1/lookout/keys (Lookout tag)
- 📝 README: experimental edge-agent dial-out (Ed25519) in features + v1.5.0 roadmap row
- 📝 CHANGELOG: Added entries for M5 (experimental edge endpoint, PR #429) and M4 (ack logLevel/pollInterval, PR #430)
@vercel

vercel Bot commented Jun 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
drydock-website Error Error Jun 13, 2026 1:58pm
drydockdemo-website Ready Ready Preview, Comment Jun 13, 2026 1:58pm

@biggest-littlest biggest-littlest left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved — consolidated lookout RC-readiness PR. Verified: experimental gate defaults off, audit bug fixes carry tests, docs corrected (paths/base64url/pubKeyId/error codes), CHANGELOG M4+M5 present. Local gate green (100% cov app+ui).

@ALARGECOMPANY ALARGECOMPANY left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Second code-owner approval. Endpoint is opt-in via DD_EXPERIMENTAL_LOOKOUT; revocation now disconnects live sessions and revoked keys no longer reactivate on restart. LGTM for the RC.

@codecov

codecov Bot commented Jun 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@scttbnsn scttbnsn merged commit 7fe5715 into main Jun 13, 2026
23 of 24 checks passed
@scttbnsn scttbnsn deleted the feat/lookout-rc-readiness branch June 13, 2026 14:26
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.

3 participants