Skip to content

fix(stats,governance,security): complete PR #217 follow-ups, K9/DEED conformance, and input-boundary hardening - #245

Merged
hyperpolymath merged 3 commits into
mainfrom
arena/e3c394ea-metamanifold-webui
Oct 23, 2026
Merged

hyperpolymath merged 3 commits into
mainfrom
arena/e3c394ea-metamanifold-webui

Conversation

@hyperpolymath

@hyperpolymath hyperpolymath commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

Reconciles PR #217 (fix(stats): aggregate DuckDB counts exactly, whose core DuckDB exact-count aggregation already landed on main via PR #226), repairs the broken duplicate timeout-minutes key on main's .github/workflows/ci.yml, populates and enforces L0–L2 K9 contracts in the fork governance lane, and hardens remaining server/frontend/benchmark security & quality boundaries.

1. PR #217 Reconciliation & CI Workflow Repair

  • Non-destructive UTF-8 byte-bounded request reads (src/server/routes/validated_statistics.jl, test/unit/test_validated_statistics.jl): Carry forward and refine PR fix(stats): aggregate DuckDB counts exactly #217's CodeRabbit review fix (1268cb0) on top of current main — copy Vector{UInt8} before calling String(...) so req.body is never mutated/emptied across repeated reads, check ncodeunits(req.body) (UTF-8 byte count rather than codepoint count) when req.body is already an AbstractString, and accept generic AbstractString (SubString) payloads, with unit regression tests covering all three paths.
  • CI repair & fast-fail ordering (.github/workflows/ci.yml, .github/workflows/doi.yml): Remove the duplicate timeout-minutes key introduced in .github/workflows/ci.yml when PRs fix: complete PR #219 reconciliation and governance hardening #242 and Harden security checks and separate K9/DEED governance evidence #243 merged, run validated_statistics first inside the pre-flight step, and SHA-pin actions/checkout in .github/workflows/doi.yml (WH006).

2. K9 (L0–L2) & DEED Conformance

  • K9 contractiles (.machine_readable/contractiles/{must,trust,intend}/*.k9.ncl, .gitignore): Add Yard-tier (contract-eval-only) K9 contracts (must.k9.ncl, trust.k9.ncl, intend.k9.ncl) declaring fork invariants, security boundaries, and architectural commitments, turning the K9 conformance lane from grey (empty corpus) to 🟢 green.
  • Fail-closed K9 corpus & badge publication (.github/workflows/governance.yml, scripts/check-governance-contract.sh, scripts/tests/test-governance-contract.sh, MetaManifold-WebUI_chora.deed, 0-AI-MANIFEST.a2ml, SECURITY.md, README.md): Enable require-files: true on k9-conformance-reusable.yml now that contracts are committed, publish k9-grid.json / k9-grid.report.json to governance-badges, and enforce both invariants in check-governance-contract.sh + mutation tests.

3. Security, Input-Boundary & Debt Hardening

  • Server JSON input-boundary hardening (src/server/server.jl, src/server/routes/*.jl, test/unit/test_server_security.jl): Introduce _parse_json_object_body(req) with a 16 MiB byte limit, non-destructive copy(req.body) decoding, and clean HTTP 400 responses for malformed or non-object JSON payloads across POST/PUT endpoints (runs, studies, composition, analysis, results, publication_tables, config), backed by route regression tests.
  • Frontend JSON.parse hardening (frontend/src/figure/charts.ts, frontend/src/components/PublicationTablesPanel.tsx, frontend/src/components/alphaMetrics.tsx): Guard unguarded JSON.parse sites with explicit catch recovery (panic-attack InputBoundary -> 0).
  • Benchmark pons asinorum debt & false-positive ProofDrift cleanup (bench/advanced_zero_handling/benchmark.jl, test/unit/test_occupancy_grade.jl, test/unit/test_evidence.jl): Replace the 8 tracked TODO placeholders in benchmark.jl with deterministic timing and provenance summary emission (pons asinorum -> 🟢 clean, 0 findings) and clarify comment wording in unit tests (ProofDrift -> 0).

Verification

  • Full CI workflow (Julia tests including test_validated_statistics.jl + test_server_security.jl, Agda proofs, Occupancy typed peak, Occupancy disagreement test), Governance (fork), CodeQL, SonarCloud, and Semgrep verified passing; rebased cleanly onto main (a9fb609).
  • bash scripts/check-governance-contract.sh (41/41 passed) + all scripts/tests/*.sh + scripts/ci/check-shell-secrets.sh passed.
  • Frontend bun audit --audit-level high, bun run typecheck, bun test src (72 pass, 0 fail), and bun run build passed.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-23T16:32:33.989688Z
We couldn’t complete this review. Comment @codex review to try again.
8f35556 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 7 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: e2a001d6-e4ec-47c9-8afb-35f65b011ec4
📥 Commits

Reviewing files that changed from the base of the PR and between a9fb609 and c72aca7.

📒 Files selected for processing: 30
  • .github/workflows/ci.yml
  • .github/workflows/doi.yml
  • .github/workflows/governance.yml
  • .gitignore
  • .machine_readable/contractiles/intend/intend.k9.ncl
  • .machine_readable/contractiles/must/must.k9.ncl
  • .machine_readable/contractiles/trust/trust.k9.ncl
  • 0-AI-MANIFEST.a2ml
  • MetaManifold-WebUI_chora.deed
  • README.md
  • SECURITY.md
  • bench/advanced_zero_handling/benchmark.jl
  • frontend/src/components/PublicationTablesPanel.tsx
  • frontend/src/components/alphaMetrics.tsx
  • frontend/src/figure/charts.ts
  • scripts/check-governance-contract.sh
  • scripts/tests/test-governance-contract.sh
  • src/server/routes/analysis.jl
  • src/server/routes/composition.jl
  • src/server/routes/config.jl
  • src/server/routes/publication_tables.jl
  • src/server/routes/results.jl
  • src/server/routes/runs.jl
  • src/server/routes/studies.jl
  • src/server/routes/validated_statistics.jl
  • src/server/server.jl
  • test/unit/test_evidence.jl
  • test/unit/test_occupancy_grade.jl
  • test/unit/test_server_security.jl
  • test/unit/test_validated_statistics.jl
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Fork governance

Lane Status Run
DEED syntax (repo deed) 🟢 conformant run 39992505366
K9 conformance (L0–L2; L3 not verified) green (job: success) same run
Hypatia verdict grid purple (job: success) same run

Hypatia grid purple

🟣 critical · commit c72aca7736c2 · run 39992505366

Reporter Status Critical High Medium Minor Since previous revision
Hypatia scan 🟣 critical 45 57 26 0 ↑ improved (2 fewer blocking)
panic-attack assail 🔴 high 0 6 2 0 ↔ unchanged
pons asinorum 🟢 clean 0 0 0 0 ↔ unchanged
rhodibot (RSR compliance) 🟠 indeterminate 0 0 0 0 — indeterminate
panicbot (panic recovery, error handling) 🟠 indeterminate 0 0 0 0 — indeterminate
echidnabot (formal verification: proofs/) 🟠 indeterminate 0 0 0 0 — indeterminate
seambot (integration health: API routes) 🟠 indeterminate 0 0 0 0 — indeterminate
finishingbot (release readiness) 🟠 indeterminate 0 0 0 0 — indeterminate
accessibilitybot (WCAG on the React UI) 🟠 indeterminate 0 0 0 0 — indeterminate
glambot (presentation quality) 🟠 indeterminate 0 0 0 0 — indeterminate
cipherbot ⚪ not applicable 0 0 0 0 ↔ unchanged
sustainabot ⚪ not applicable 0 0 0 0 ↔ unchanged
Hypatia scan: 128 finding(s)
  • critical cicd_rules/banned_language_file — frontend/src/views/run/parseFilterYaml.ts — TypeScript file detected -- banned language
  • critical cicd_rules/banned_language_file — frontend/src/figure/encode.ts — TypeScript file detected -- banned language
  • critical cicd_rules/banned_language_file — frontend/src/figure/charts.ts — TypeScript file detected -- banned language
  • critical cicd_rules/banned_language_file — frontend/src/figure/export.ts — TypeScript file detected -- banned language
  • critical cicd_rules/banned_language_file — frontend/src/figure/figure.test.ts — TypeScript file detected -- banned language
  • critical cicd_rules/banned_language_file — frontend/src/figure/legend.ts — TypeScript file detected -- banned language
  • critical cicd_rules/banned_language_file — frontend/src/figure/types.ts — TypeScript file detected -- banned language
  • critical cicd_rules/banned_language_file — frontend/src/utils/download.ts — TypeScript file detected -- banned language
  • critical cicd_rules/banned_language_file — frontend/src/utils/text.test.ts — TypeScript file detected -- banned language
  • critical cicd_rules/banned_language_file — frontend/src/utils/timeago.ts — TypeScript file detected -- banned language
  • critical cicd_rules/banned_language_file — frontend/src/utils/text.ts — TypeScript file detected -- banned language
  • critical cicd_rules/banned_language_file — frontend/src/hooks/useUnsavedGuard.ts — TypeScript file detected -- banned language
  • critical cicd_rules/banned_language_file — frontend/src/hooks/useApi.test.ts — TypeScript file detected -- banned language
  • critical cicd_rules/banned_language_file — frontend/src/hooks/useApi.ts — TypeScript file detected -- banned language
  • critical cicd_rules/banned_language_file — frontend/src/hooks/useAnalysis.ts — TypeScript file detected -- banned language
  • critical cicd_rules/banned_language_file — frontend/src/hooks/useSSE.ts — TypeScript file detected -- banned language
  • critical cicd_rules/banned_language_file — frontend/src/hooks/useTabParam.ts — TypeScript file detected -- banned language
  • critical cicd_rules/banned_language_file — frontend/src/hooks/useNavRefresh.ts — TypeScript file detected -- banned language
  • critical cicd_rules/banned_language_file — frontend/src/hooks/useJobEvents.ts — TypeScript file detected -- banned language
  • critical cicd_rules/banned_language_file — frontend/src/about.ts — TypeScript file detected -- banned language
  • 108 more; see the structured report in the artifact.
panic-attack assail: 8 finding(s)
  • high DynamicCodeExecution — src/pipeline/dada2/context.jl — eval/Meta.parse in src/pipeline/dada2/context.jl
  • high DynamicCodeExecution — src/analysis/analysis.jl — eval/Meta.parse in src/analysis/analysis.jl
  • high DynamicCodeExecution — src/analysis/differential.jl — eval/Meta.parse in src/analysis/differential.jl
  • high DynamicCodeExecution — src/core/provenance.jl — eval/Meta.parse in src/core/provenance.jl
  • high DynamicCodeExecution — scripts/check-julia-syntax.jl — eval/Meta.parse in scripts/check-julia-syntax.jl
  • high DynamicCodeExecution — test/unit/test_permanova.jl — eval/Meta.parse in test/unit/test_permanova.jl
  • medium UnsafeFFI — src/core/memory_probe.jl — 3 ccall/FFI calls in src/core/memory_probe.jl
  • medium UnsafeFFI — install.jl — 1 ccall/FFI calls in install.jl
rhodibot (RSR compliance): not_run — enrolled, but no report-back was received
  • 🟠 indeterminate: enrolled, but no report-back was received
panicbot (panic recovery, error handling): not_run — enrolled, but no report-back was received
  • 🟠 indeterminate: enrolled, but no report-back was received
echidnabot (formal verification: proofs/): not_run — enrolled, but no report-back was received
  • 🟠 indeterminate: enrolled, but no report-back was received
seambot (integration health: API routes): not_run — enrolled, but no report-back was received
  • 🟠 indeterminate: enrolled, but no report-back was received
finishingbot (release readiness): not_run — enrolled, but no report-back was received
  • 🟠 indeterminate: enrolled, but no report-back was received
accessibilitybot (WCAG on the React UI): not_run — enrolled, but no report-back was received
  • 🟠 indeterminate: enrolled, but no report-back was received
glambot (presentation quality): not_run — enrolled, but no report-back was received
  • 🟠 indeterminate: enrolled, but no report-back was received
cipherbot: not_applicable — no cryptography is implemented in this repository
  • ⚪ not applicable: no cryptography is implemented in this repository
sustainabot: not_applicable — fleet adapter slot reserved; no adapter exists yet (gitbot-fleet README)
  • ⚪ not applicable: fleet adapter slot reserved; no adapter exists yet (gitbot-fleet README)

Scope: static findings reported by each row's tool at the named commit. Purple, red, yellow and blue grade the worst finding present; orange is evidence missing, malformed or a scanner that did not run; grey is an explicit scope exclusion with its reason. No row is a security certification. report.json, badge.json and the raw findings are in the verdict-grid artifact on the linked run.

K9 L0–L2 green

🟢 conformant · commit c72aca7736c2 · run 39992505366 · validator hyperpolymath/standards@c6d78606f392

Category Status Pass Fail Indeterminate N/A Since previous revision
K9 contract typecheck 🟢 conformant 1 0 0 0 — no comparable baseline
K9 validator self-test 🟢 conformant 37 0 0 0 — no comparable baseline
K9 live corpus (L0–L2) 🟢 conformant 3 0 0 0 — no comparable baseline

Scope: K9 components L0–L2 against contract v1.0.0 at the named standards commit. L3 signature verification and routed coordination-dialect files are not certified. Green is limited to this scope. Orange is missing evidence; yellow is grandfathered debt or warnings; grey is an explicit scope exclusion. report.json, badge.json and the validator logs are in the k9-grid artifact on the linked run.

@coderabbitai

coderabbitai Bot commented Oct 23, 2026

Copy link
Copy Markdown

Add Carrot credits or activate Agent usage billing to use Autofix

@hyperpolymath
hyperpolymath enabled auto-merge (squash) October 23, 2026 16:58
hyperpolymath and others added 3 commits October 23, 2026 17:05
…I workflow

- Read req.body non-destructively in _statistics_body via copy(req.body),
  enforce MAX_STATISTICS_REQUEST_BYTES using UTF-8 byte length (ncodeunits)
  when req.body is already an AbstractString, and accept generic
  AbstractString payloads (e.g. SubString).
- Add regression tests in test_validated_statistics.jl covering repeated
  reads of the same HTTP.Request, multibyte UTF-8 size limits, and
  SubString payloads.
- Remove the duplicate timeout-minutes key in .github/workflows/ci.yml
  introduced by the PR #242/#243 merge, run validated_statistics first
  within the fast pre-flight CI step, and SHA-pin actions/checkout in
  .github/workflows/doi.yml.

Signed-off-by: hyperpolymath <6759885+hyperpolymath@users.noreply.github.com>

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…formance

- Author Yard-tier K9 contracts under .machine_readable/contractiles/
  (must.k9.ncl, trust.k9.ncl, intend.k9.ncl) declaring fork invariants,
  trust boundaries, and architectural commitments.
- Enable require-files: true on the fork-local K9 conformance lane so an
  emptied K9 corpus fails closed, and publish k9-grid.json /
  k9-grid.report.json to governance-badges alongside deed.json and
  hypatia-grid.json.
- Extend scripts/check-governance-contract.sh and its mutation test suite
  to enforce require-files: true and K9 badge publication, and update
  MetaManifold-WebUI_chora.deed, 0-AI-MANIFEST.a2ml, SECURITY.md, and
  README.md.

Signed-off-by: hyperpolymath <6759885+hyperpolymath@users.noreply.github.com>

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…ons-asinorum debt

- Add _parse_json_object_body in src/server/server.jl and route HTTP JSON
  POST/PUT endpoints through it so malformed JSON, non-object JSON, and
  oversized payloads (>16 MiB) return HTTP 400 cleanly instead of HTTP 500,
  preserving non-destructive reads on req.body; add route regression tests
  in test/unit/test_server_security.jl.
- Guard frontend JSON.parse sites in charts.ts, PublicationTablesPanel.tsx,
  and alphaMetrics.tsx with explicit catch recovery.
- Replace the 8 tracked TODO placeholders in
  bench/advanced_zero_handling/benchmark.jl with deterministic timing and
  provenance summary emission, and rewrite comment wording in
  test_occupancy_grade.jl and test_evidence.jl that triggered false-positive
  ProofDrift keyword matches.

Signed-off-by: hyperpolymath <6759885+hyperpolymath@users.noreply.github.com>

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
@hyperpolymath
hyperpolymath force-pushed the arena/e3c394ea-metamanifold-webui branch from 8f35556 to c72aca7 Compare October 23, 2026 17:07
@sonarqubecloud

Copy link
Copy Markdown

@hyperpolymath
hyperpolymath merged commit dd20cf8 into main Oct 23, 2026
25 checks passed
@hyperpolymath
hyperpolymath deleted the arena/e3c394ea-metamanifold-webui branch October 23, 2026 17:39
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