Skip to content

fix: final sweep — three find-and-fix sweeps and a verification pass across every package - #1282

Open
sebyx07 wants to merge 9 commits into
mainfrom
fix/r9-final-sweep
Open

sebyx07 wants to merge 9 commits into
mainfrom
fix/r9-final-sweep

Conversation

@sebyx07

@sebyx07 sebyx07 commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Final bug sweep before the framework is left alone: three find-and-fix sweeps plus a verification pass over the whole diff. One PR on purpose — the halves depend on each other both ways (tier-0 config and wire changes with their consumers), and the owner asked for one large PR.

How it was done

Phase Agents Result
Sweep 1 — audit by tier band, CLI, scripts/CI, concurrency, security 12 read-only auditors → 11 fix workers ~45 findings
Sweep 2 — the files sweep 1 listed as unread, plus a hands-on DX audit (scaffold, build a real feature, 35 planted mistakes, every printed fix: pasted) 13 auditors → 12 fix workers ~75 findings
Sweep 3 — DX round: fix lines that did not work as printed 4 fix workers 16 findings
Verification — five auditors over this diff (security, concurrency, two correctness passes, architecture) 5 auditors → 5 fix workers + integration 2 regressions this sweep had introduced, ~30 further findings

Up to 12 agents at once (Fable + Opus), path-disjoint, one checkout. CodeRabbit refuses a diff this size; the verification pass above replaces it — every confirmed finding is fixed or listed under Deferred.

What changed (highlights; the full list is CHANGELOG.md [Unreleased])

Security and tenancy

  • realtime: a records channel keyed by a non-tenant param no longer delivers other tenants' rows (live and replay).
  • http: x-forwarded-client-cert is read from the proxy-written suffix only; a deadline race could replace the 504 with a 200 carrying no security headers; a production 500 no longer echoes a driver's error code.
  • auth: MFA-enrolled users can finish SSO through the built-in routes (mfaPath); OAuth dynamic registration is capped and unused self-registered clients are purged; limiter buckets keyed by network.
  • mcp: tenant argument cannot be smuggled through the meta dispatchers; a 900 KB docs query no longer blocks the event loop for 15 s.

Data safety

  • db: rollback() reverses the most recently applied migration, not the highest id; x db gen asks consent before turning a plain column into a generated one; an edited applied migration is refused, not blessed.
  • cache: Redis tier no longer serves a value stale for its whole TTL after a mid-bust fill; ISR no longer leases a stale page to a CDN after a tag purge.
  • action: audit batches no longer store every record twice when a commit reply is lost; action Date outputs reach the typed client as Dates.
  • ai: a failed agent run's handle keeps completed tool results, so a continuation does not repeat a charge.
  • jobs: scheduled fan-out carries each job's tenant; Redis driver leases use the server clock; debounce and dead rows expire.

Unattended operation

  • bot-opened PRs (security floors, bench) now get CI; release.yml retries a failed publish (never double-publishes); next-sync files an issue on any failure; tutorial-run runs weekly with a staleness check.
  • four config keys that were validated but read by nothing are wired: jobs.maxAttempts, jobs.backoff, database.ssl, roles.

Developer loop

  • x db migrate beside a running embedded x dev is applied by that dev server (proved in two processes); new x db rollback, x tasks run, x policy explain --input, x docs <topic-id>.
  • 13 fix: lines that did not work when pasted now do.

New public surface

mfaPath, readMfaChallenge, clearMfaChallengeCookie, mfaChallengeOf, mfaChallengeCookie, MFA_CHALLENGE_COOKIE (auth) · AuthServerClient.host · QueueWakeOptions.reproveEveryMs, RedisJobDriverOptions.deadTtlMs, installDefaultRetry/resetDefaultRetry on jobs/adapter · reportLateFault, cappedWireDates, WIRE_DATES_MAX_BYTES (http) · GenerateRequest.toolChoice (ai) · RollbackOptions.confirm (db) · acceptedIdOf on action/adapter · RawTranslator.keys?() · CLI: x db rollback, x tasks run, x policy explain --input, x docs <id> · env: PGSSLMODE, ULTIMATE_TASK_RUN · code: X_TASK_RUN_PRODUCTION. No breaks: scripts/public-api.ts matches the lock; published contracts of the three tracked apps are unchanged except six stated budget values.

Upgrade checks (also in wiki/Upgrading.md)

Config roles vs deployed ROLEs · database.ssl: true now enforced on every pool · cache.defaultTtlMs ≥ 1 · PWA switches must be booleans · undeclared non-X_ error codes are served as X_INTERNAL on a production 5xx · a hang-up is 499 · Redis dead job rows expire after 90 days · action Date outputs are Dates on the client · OIDC apps add mfaPath.

Patterns closed

Test-file byte pins now need a stated why: (pin-raises) · config-readers counts only a qualified read · one shape test for "a workflow that pushes with the job token dispatches CI" · the API-lock classifier accepts an optional trailing method parameter · released guard forms are never dropped by --write · health rows for next-sync and stale tutorial runs.

Deferred

Gate

  • bun run verify ✓ exit 0, 14 of 21 steps passed, 7 app-shaped steps skipped at the root (1405 s).
  • bun run scripts/reference-app-gate.ts ✓ every pin holds — examples/dummy 21/21, dummy/social-media-clone 21/21, dummy/docs-site 21/21 (0 pinned).
  • Budgets: six examples/dummy routes raised by the measured growth (+145 to +773 B), each attributed chunk by chunk against an origin/main build; nothing unexplained.

Codes: X_TASK_RUN_PRODUCTION (wiki updated). Release: not in this PR — a multi-core process mode lands next, then the release.

🤖 Generated with Claude Code

Comment thread scripts/primitive-factories.test.ts Outdated
entries: readonly Entry[],
): boolean => {
const pkg = found.at.split('/')[1];
const named = new RegExp(`\\b${found.factory.replace(/\$/g, '\\$')}\\b`);
@developerz-ai

developerz-ai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Fix failing CI on #1282

Queued — waiting for a free box.


This branch has not been deployed

No deployments
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