Skip to content

Harden edge policy and cache metadata validation; refresh vulnerable HTTP dependencies - #1

Open
nicholas-ruest wants to merge 5 commits into
mainfrom
metaharness/edge-agent-cors-security-20261014
Open

nicholas-ruest wants to merge 5 commits into
mainfrom
metaharness/edge-agent-cors-security-20261014

Conversation

@nicholas-ruest

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

Copy link
Copy Markdown
Member

November 2 cache metadata/security improvement — merge BLOCKED

Resumed this non-draft PR. Final tested head 9abcfbb519edde742d0c733e37fad0b9f01a894e; main 483c8a353855d8d54a1b1dee181f12376b5f592a unchanged. Conflict-free (mergeable=true), no merge.

Substantive implementation

Validate known cache-entry and response-metadata fields before JavaScript truthiness or interpolation drives cache decisions. String-valued validity/success flags previously selected hits/writes. Malformed fields now return400 VALIDATION_ERROR; optional fields remain optional, unknown fields remain compatible. No backend, IAM, deployment or persistence changes.

Compatible lockfile patches: body-parser2.3.0→2.4.0, fast-uri3.1.8→3.1.9, qs6.16.0→6.17.1. No force, advisory suppression or major update.

Gate Baseline Exact final candidate
Frozen native cache-metadata cases (three trials) 0/8 each 8/8 each
Preservation anchors 6/6 each 6/6 each
Existing leaf assertions retained 70/70 70/70
Total leaf assertions 70 84
Full npm audit findings 3 0

Clean final npm ci --ignore-scripts, npm test, CLI metadata and JS syntax checks passed. Original test files byte-identical. Exact-head Edge Functions CI passed both Node20 and live prior-contract lineage/replay jobs. Broad CI: CI in_progress/null; Integration Tests completed/failure.

Full gates and actual orchestration evidence

  • Rust formatting fails. Persistent Cargo checkout first failed ENOSPC; isolated temporary CARGO_HOME/TARGET_DIR allowed fresh dependency retrieval/compilation. Bounded locked final tests/build/strict Clippy still timed out (124); no completed Rust pass claimed.
  • Cached Rust advisory database at ee1a49a2769a24a596afc1c20cb33748d2769586 (October29):73 findings, warnings16unmaintained/26unsound/2yanked. Not a latest-advisory claim.
  • MetaHarness0.4.2 actual score fit73; heuristic only. Darwin0.10.3 real final-source one-generation candidate tied0.985, NO_IMPROVEMENT. Duplicate archive rerun rejected; preserved original archive and retried fresh, not overwritten.
  • Flywheel0.1.12 evaluated actual final source; full gate rejected promotion, signed replay8/8.
  • Ruflo3.56.3 strict coordinator initialized/stopped. Workflow reported zero agents/pending and status errored; completed orchestration is NOT claimed. Offline pinned MiniLM384dimension hook verified all4required flags and2feedback updates; separate policy-anchor mirror failed ENOSPC.
  • Core-memory guidance returned no lessons (unscreened); supplied architectural constraints retained. Existing desktop/bootstrap/OpenSSL verified; no new provisioning. No source-write403 blocker; branch-protection administration GET remains403.

Evidence, reproduction and rollback

Immutable complete report, raw Flywheel and command outputs, all58 repositories/155open PRs and57deferred targets. Evidence-only branch preserves exact tested PR head.

Rollback source/dependency commits 7ada2016808510a5412265e09ef47c98cee32b8a and 9abcfbb519edde742d0c733e37fad0b9f01a894e; original contracts.js bytes+hash in signed inverse, original lockfile in parent history. No production state changed. Do not merge until full Rust/security/CI/approval and orchestration gates pass; recheck main and revalidate after further source changes.

Prior rationale and evidence, preserved

Summary

Retains this recovery branch's exact-origin CORS policy, npm security cleanup and CLI metadata repair. The new implementation enforces the contracts the five Cloud Function policy handlers already publish, before malformed values reach arithmetic or string/array operations:

  • nested object/array/scalar types, required own fields, local definition references, enums and numeric minima;
  • safe integers and finite numbers, without coercing numeric strings;
  • explicit execution-guard limit shapes, including model lists;
  • optional concurrency defaults consistently to zero;
  • bounded validator work: 10,000 visits, depth32 and 32 diagnostics.

Unknown properties remain permitted for forward compatibility. This implements the existing schema subset, not a general JSON Schema engine. Existing caller-supplied estimates/limits remain caller-supplied; this does not establish production IAM or authoritative distributed rate/concurrency tracking.

No Rust source, production dependency graph, deployment/IAM, storage or service-owned database changes.

Exact revision / conflict check

  • Baseline parent: 11da64cb7e409beac9b3c3647767715d6f0b7101
  • Candidate: c07db02705cea0460454481603953cc036f5fea3
  • Main: 483c8a353855d8d54a1b1dee181f12376b5f592a
  • Main remains an ancestor, mergeable and conflict-free. Non-draft; blocked from merge.

Frozen acceptance and measured results

The native HTTP contract/probe were frozen before source changes. They use the real installed Functions Framework5.0.5 public http()/getTestServer() interfaces, actual entry point/parser and native loopback HTTP, not substituted request/response objects or Rust/model-service mocks.

Gate Baseline Candidate
Native malformed/defaulting holdout 0/21 21/21
Valid policy anchors 12/12 12/12
Retained original assertions 33/33 33/33, same names
Additional leaf assertions 0 37
Total leaf assertions 33 70
Five-trial holdout checks 0/105 105/105
Five-trial anchors 60/60 60/60
npm audit findings 0 0

The added Node suite reports38 entries including its parent container, i.e.37 new leaf assertions; no skips. The original33 mock-request tests remain regression coverage only, not native HTTP evidence.

npm ci --ignore-scripts, npm test, CLI metadata, JS syntax checks and npm audit passed. No configured JS lint command exists; node --check is syntax evidence, not lint/build evidence. Native Rust remains separately unvalidated.

Five alternating fresh-listener trials retained all samples. Hosted suite medians:56.007ms baseline /57.363ms candidate; ruOS:96.854ms /102.454ms. These include framework initialization and parsing and are correctness repetitions, not a production speedup, throughput or dollar-cost claim.

Real MetaHarness / Darwin / Flywheel / Ruflo execution

Pinned upstream docs revision:e0dfd44da72b7adfb7c57fdd42d124be58ed7086.

  • MetaHarness0.4.17: actual score ROOT --json,73→73, constraints6/6. Static score is not build evidence.
  • Darwin0.10.3: evolve . --generations 1 --children 2 --concurrency 1 --seed 2026102008 --sandbox real --selection pareto. Nine actual npm-test processes exited0, none timed out or recorded blocked actions. memoryPolicy/retryPolicy variants tied0.985 and were rejected: NO_IMPROVEMENT.
  • Flywheel0.1.12: runFlywheelGenerations with live HTTP evaluator, frozen holdout/anchors and original-assertion retention; meetsPromotionRule, Ed25519 lineage, verifyReplayBundle. One component promotion, all8 replay checks true, including independent replay of the ruOS Node20 receipt on local Node24. Gate:c5942e7c9bf8f28fe7af47a6ec3887d11eeb3f8c8e8601cc6a7a54969ea0b981.
  • Only absent HTTP responses count as no-ops; wrong responses are failed cases. CostPerWin0 is a neutral unmeasured gate input, not invented savings.
  • Ruflo3.56.3 / Transformers4.3.1: actual one-agent hierarchical swarm swarm-1792498048889-eeckd0, pre-task and offline post-task edge-safety-20261020a. Pinned local MiniLM revision 751bff37182d3f1213fa05d7196b954e230abad9,384 real dimensions, remote models disabled, kernel socket restrictions enforced by the documented research-lab launcher. learningUpdates.available/outcomePersisted, feedback.recorded and trajectory.recorded all true. success=false records global blockers.

Reproduction commands and limitations are in security/README.md; exact contract/probe hashes and raw synthetic trials are in the CI evidence.

Exact-head hosted evidence

  • Edge Functions: success, Node20 validation and live contract/lineage/replay/benchmark jobs.
  • Project-only synthetic receipt artifact.
  • Integration Tests: failure, formatting and security gates red; downstream performance/Docker checks skipped.
  • Repository CI: failure, all jobs completed. Test failed on formatting; coverage failed in rdkafka-sys because curl/curl.h is missing; security failed. The Docker image build passed, including cargo build --release --package llm-edge-agent (228.2s). Its existing command is not --locked; this is package/image build evidence, not proof of full-workspace tests or lockfile immutability inside the image.

Current blockers / runtime recovery

Research-lab bootstrap exited0 and pkg-config verified OpenSSL3.0.13. The initial real locked Rust test failed101 because zstd-sys/bindgen could not find libclang. Installed the existing desktop's public Ubuntu libclang-dev prerequisite, verified libclang18 and resumed compilation; this is no longer the missing prerequisite.

After repair, baseline locked tests exceeded180seconds. Exact-candidate locked test/build/strict all-target all-feature Clippy exceeded180/90/90seconds respectively (exit124), with no completed Rust tests. Rustfmt exits1. These are not passing build/test evidence.

Cargo-audit0.22.2 on the unchanged committed graph reports61 vulnerability findings and25 warnings (16 unmaintained,7 unsound,2 yanked). No lockfile was regenerated or advisory ignored. npm audit remains zero.

Branch-protection GET returned403 Resource not accessible by integration; no alternate identity/route or bypass attempted. No merge until full exact-commit Rust/security/coverage/CI and required approvals pass; refresh/revalidate if main changes.

Rollback

Before merge, close this PR. After an authorized merge, revert c07db02705cea0460454481603953cc036f5fea3, rebuild and revalidate; preserve prior CORS hardening. The signed primary-contract inverse plus complete parent source map/hash permit exact source restoration. The reverse patch check and source-map hash verification passed. Rollback restores the validation defects; no deployed rollback, database migration or package publication was performed.

Enforce the published contract subset without coercion, reject malformed guard limits and default optional concurrency consistently. Preserve 33 original tests and add real Functions Framework loopback cases. Retain frozen live Flywheel lineage/replay and bounded benchmark evidence in CI. No deployment, dependency graph or persistence change.

Signed-off-by: Codex <codex@users.noreply.github.com>
@nicholas-ruest nicholas-ruest changed the title fix(security): enforce edge origin policy fix(contracts): enforce nested edge policy validation without coercion Oct 20, 2026
@nicholas-ruest nicholas-ruest changed the title fix(contracts): enforce nested edge policy validation without coercion Harden edge policy and cache metadata validation; refresh vulnerable HTTP dependencies Nov 2, 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