Skip to content

fix(web): harden scan lifecycle and runtime integrity - #78

Merged
M09Ic merged 12 commits into
masterfrom
fix/web-runtime-integrity
Jul 28, 2026
Merged

fix(web): harden scan lifecycle and runtime integrity#78
M09Ic merged 12 commits into
masterfrom
fix/web-runtime-integrity

Conversation

@h3zh1

@h3zh1 h3zh1 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • make scan cancellation and timeout propagation terminal-safe across SQLite, the Hub, and remote agents
  • reject invalid remote scan results and keep task failures isolated from the Hub process
  • enforce SQLite session foreign keys, migrate legacy child tables, and reject writes to missing sessions
  • subscribe SSE clients before reading snapshots so terminal scan and chat events cannot fall into a replay gap
  • enforce exact multipart upload limits and cancel pending remote uploads when requests end
  • stage, validate, and atomically commit configuration reloads while active scans retain leases on the old runtime
  • restore tidy Go module metadata and run the terminal browser E2E suite against the production handler in CI

User-visible behavior

  • canceling a queued or running scan now converges to one immutable terminal state and releases its concurrency slot
  • missing scans return 404, while attempts to cancel completed or failed scans return 409
  • completed, failed, and canceled scans are replayed immediately when an SSE client reconnects
  • missing chat sessions no longer accept messages, uploads, or orphan AOP history
  • oversized files return 413 instead of being silently truncated
  • a failed configuration candidate leaves both the committed file and current runtime unchanged
  • existing scans continue on the retired runtime until their final lease is released

Commit structure

  1. fix(web): make scan cancellation terminal-safe
  2. fix(web): reject invalid remote scan results
  3. fix(web): enforce session referential integrity
  4. fix(web): close SSE snapshot subscription gaps
  5. fix(web): reject oversized multipart uploads
  6. fix(web): make config reload transactional
  7. chore(deps): restore tidy module metadata
  8. test(web): run real browser terminal e2e

Deferred

The following findings remain intentionally out of scope for this PR:

  • authoritative Hub-side AOP ordering and resumable SSE event IDs
  • latest-history window semantics and cursor pagination

Verification

  • go test ./pkg/web -short -count=1 -timeout=5m
  • go test -race ./pkg/web -short -count=1 -timeout=5m
  • go test -tags full ./cmd/aiscan -count=1 -timeout=5m
  • go test ./... -count=1 -timeout=10m
  • go vet ./...
  • go mod tidy -diff
  • npm --prefix web/frontend run build
  • go test -race -tags e2e ./pkg/web -run '^TestE2ETerminal(OpenAndType|Resize)$'
  • Windows amd64 full-package cross-compilation
  • git diff --check

Dependency

This is stacked on #76 so the PR contains only the eight follow-up commits above. After #76 merges, this PR can be retargeted to master without changing its patch.

@h3zh1
h3zh1 force-pushed the fix/web-runtime-integrity branch from 56c1446 to 7341bc3 Compare July 27, 2026 12:27
@M09Ic
M09Ic force-pushed the fix/llm-profile-configuration branch from 4377f8b to 47be64c Compare July 28, 2026 06:13
@M09Ic
M09Ic force-pushed the fix/web-runtime-integrity branch from 7341bc3 to 27f6424 Compare July 28, 2026 06:13
@M09Ic
M09Ic force-pushed the fix/web-runtime-integrity branch from e7a6aee to 63479ba Compare July 28, 2026 08:13
@M09Ic
M09Ic changed the base branch from fix/llm-profile-configuration to master July 28, 2026 08:13
@M09Ic
M09Ic merged commit fc72a48 into master Jul 28, 2026
2 checks passed
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.

2 participants