Skip to content

Harden agent CORS and restore deterministic core validation - #3

Open
nicholas-ruest wants to merge 6 commits into
mainfrom
metaharness/shield-security-hardening-2026-10-12
Open

nicholas-ruest wants to merge 6 commits into
mainfrom
metaharness/shield-security-hardening-2026-10-12

Conversation

@nicholas-ruest

@nicholas-ruest nicholas-ruest commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Summary

This existing recovery PR now combines the original Cloud Function hardening with a reproducible Node-core validation repair.

  • deny browser CORS by default unless CORS_ALLOWED_ORIGINS contains an exact origin
  • reject disallowed preflight requests while preserving origin-less server-to-server health checks
  • make release and production-document publishing manual-only
  • restore package-local, lockfile-backed Node CI on supported Node 20/22 runners
  • pin GitHub Actions and Playwright, restore strict TypeScript checks, and remove false zero-test invocations
  • use monotonic batch timing, preserve absolute error indices across concurrency chunks, and add a real Chromium browser-bundle smoke test

Exact candidate

  • head: 60bcd3c463228ee8c8ccadc4c7c560502d73e273
  • base/current main: 1c46282495b94bb1fcae2d9e63cf34f495226699
  • conflict status: mergeable and zero commits behind
  • no deployment, publication, database, persistence, IAM, or RuVector changes

Measured evidence

Local package validation:

  • npm run lint: pass
  • npm run typecheck: pass
  • unit tests: 38/38 pass (baseline exact-head run: 37/38)
  • integration tests: 4/4 pass
  • bundle build and declaration build: pass
  • size limits: 2.7 kB gzip for both main and browser ESM bundles
  • npm audit --omit=dev --audit-level=moderate: 0 findings
  • Playwright discovery: 1 real browser test; built bundle import and detection behavior also passed through direct module execution
  • local Chromium execution was unavailable only because this runtime has no Playwright browser binary; the hosted exact-candidate browser job passed after installing Chromium

Hosted exact-head evidence:

MetaHarness / Darwin / Flywheel

Pinned upstream MetaHarness revision: e0dfd44da72b7adfb7c57fdd42d124be58ed7086.

  • MetaHarness 0.4.17: score 64, compile confidence 90, task coverage 92, safety 95, hard constraints 6/6
  • Darwin 0.10.3: real sandbox, seed 101308, one generation/child; baseline and child both 0.985; baseline retained, delta 0.000
  • Flywheel 0.1.12: frozen contract improved 0/22 to 22/22, anchor 1.0, candidate promoted
  • Flywheel gate fingerprint: c5942e7c9bf8f28fe7af47a6ec3887d11eeb3f8c8e8601cc6a7a54969ea0b981
  • signed replay: pass; lineage gen1(contract) → gen0(root)

Merge blockers

The repository-wide Rust workflow is independently red:

  • Cargo test, Clippy, WASM, performance, and coverage cannot authenticate to private dependency https://github.com/LLM-Dev-Ops/infra, resolved revision a8bc89c190f63b139812f30a54e21a25b8f70e81
  • cargo fmt --check reports widespread pre-existing workspace formatting drift
  • cargo audit reports 17 vulnerabilities and 12 allowed warnings across the 714-crate lockfile, including affected azure_core, h2, idna, pyo3, quick-xml, quinn-proto, rustls, and rustls-webpki paths

No advisory was ignored, no required check was weakened, and no branch protection was bypassed. This PR must remain unmerged until the exact candidate has a fully green required workflow.

Rollback

Before merge, close this PR. After a merge, revert its merge commit (preferred). If individual branch commits must be unwound, revert the commits from 60bcd3c463228ee8c8ccadc4c7c560502d73e273 back through 5f1c340233c4b0d36b8d85bd3b063b7e101b9987 in reverse chronological order. For browser access, configure exact HTTPS origins rather than restoring wildcard CORS.

Require an explicit origin allowlist at the public Cloud Function boundary, add focused regression tests and deterministic agents CI, and prevent ordinary main pushes from publishing packages or production documentation.

Validated with the deploy graph build, focused boundary tests, MetaHarness, bounded Darwin evaluation, and a signed Flywheel replay.
Run the actual packages/core commands from their package directory, add a deterministic lockfile, pin Actions, retire EOL Node 16, and bound every job. Preserve browser, bundle, audit, unit, integration, macOS, Windows, and Linux coverage.
Pin Playwright 1.40.1 so the package's Node 18 contract remains installable, regenerate the exact lockfile, and remove the nonexistent TypeScript `web` type library already covered by the DOM lib.
Declare the actual Node 20 floor, pin Playwright 1.64.0, add tslib, remove strict TypeScript and ESLint blockers, and keep the hosted matrix on supported Node 20/22 releases.
Pass explicit test paths to Vitest instead of combining --dir with the repository include pattern, which produced a false zero-test failure.
Use monotonic high-resolution timing for batch scans, preserve absolute error indices across concurrency chunks, and add a scoped Playwright smoke test for the built browser bundle.
@nicholas-ruest nicholas-ruest changed the title Harden agent CORS and release controls Harden agent CORS and restore deterministic core validation Oct 13, 2026
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.

1 participant