Skip to content

Add repository compute sandbox policy guard#392

Open
karollooool wants to merge 2 commits into
SCIBASE-AI:mainfrom
karollooool:codex/repository-compute-sandbox-guard
Open

Add repository compute sandbox policy guard#392
karollooool wants to merge 2 commits into
SCIBASE-AI:mainfrom
karollooool:codex/repository-compute-sandbox-guard

Conversation

@karollooool
Copy link
Copy Markdown

/claim #10

Summary

Adds a self-contained repository compute sandbox policy guard for Project Repository & Version Control.

This slice validates tagged scientific repository release/export candidates before reproducibility execution by checking:

  • digest-pinned sandbox container images
  • blocked/open network egress vs approved DOI-only lookup
  • CPU, memory, runtime, GPU, and deterministic-seed budgets
  • read-only repository inputs plus constrained writable scratch mounts
  • sha256 checkpoints for component manifests, input manifests, lockfiles, expected artifacts, and export bundles
  • protected merge, export bundle, and DOI publication blocking actions

Non-overlap

This targets compute sandbox/resource policy for reproducibility execution. It does not implement a broad repository ledger, release engine, structured diff/rollback, provenance attestation, release embargo, notebook replay, schema migration, citation impact, API/export verifier, merge queue, environment drift, access review, DOI tombstone, metadata readiness, branch hypothesis lineage, sensitive-artifact scanning, dependency-license checks, legal-hold retention, component-owner approval quorum, or restore rehearsal.

Safety

  • Synthetic fixtures only in repository-compute-sandbox-policy-guard/sample-data.js
  • No private repository scans, real credentials, patient data, wallet material, or external service calls
  • Dependency-free evaluator/tests; ffmpeg is only optional for regenerating the committed demo video

Demo artifacts

  • repository-compute-sandbox-policy-guard/reports/demo.json
  • repository-compute-sandbox-policy-guard/reports/demo.md
  • repository-compute-sandbox-policy-guard/reports/demo.svg
  • repository-compute-sandbox-policy-guard/reports/demo.mp4

Validation

  • npm run check
  • npm test
  • npm run demo
  • npm run demo:video with FFMPEG_PATH pointing to a temporary ffmpeg-static binary outside the repo
  • ffmpeg -v error -i repository-compute-sandbox-policy-guard/reports/demo.mp4 -f null -
  • git diff --check
  • git diff --cached --check
  • rg -n "token|secret|password|private key|BEGIN|sk-|ghp_|github_pat|wallet|seed phrase" README.md repository-compute-sandbox-policy-guard -> no matches

AI-assisted with Codex; reviewed and locally verified before submission.

Copilot AI review requested due to automatic review settings May 22, 2026 23:52
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a new self-contained repository-compute-sandbox-policy-guard module that evaluates synthetic SCIBASE repository release candidates against a compute/sandbox policy, producing JSON/Markdown/SVG reviewer artifacts (and an optional ffmpeg-rendered MP4).

Changes:

  • New evaluator (index.js) with policy checks for pinned images, network egress, compute budgets, writable mounts, and hash checkpoints, plus Markdown/SVG renderers.
  • Synthetic fixtures, demo script, test script, and pre-generated reviewer artifacts under reports/.
  • Top-level README link added to surface the new module.

Reviewed changes

Copilot reviewed 10 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
repository-compute-sandbox-policy-guard/index.js Core policy evaluator and renderers.
repository-compute-sandbox-policy-guard/sample-data.js Synthetic candidate fixtures (ready/blocked/needs_review).
repository-compute-sandbox-policy-guard/demo.js Generates JSON/Markdown/SVG reports from fixtures.
repository-compute-sandbox-policy-guard/test.js Node assert coverage for evaluator and renderers.
repository-compute-sandbox-policy-guard/scripts/render-demo-video.js Optional ffmpeg MP4 renderer.
repository-compute-sandbox-policy-guard/package.json npm scripts for check/test/demo/demo:video.
repository-compute-sandbox-policy-guard/README.md Module documentation and scope.
repository-compute-sandbox-policy-guard/reports/demo.{json,md,svg} Pre-generated deterministic reviewer artifacts.
README.md Adds a pointer to the new module.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

];
const font = candidates.find((candidate) => fs.existsSync(candidate));
if (!font) {
return "font=Sans";
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in a87addc. The video renderer now fails up front with a clear error if none of the supported TrueType font files are present, instead of emitting a potentially unsupported drawtext font option.

Comment on lines +255 to +257
const doiOnly =
mode !== "doi-resolution-only" ||
allowlist.every((host) => policy.doiResolverAllowlist.includes(host));
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in a87addc. DOI-only egress now requires a non-empty allowlist and still enforces that every host is in the approved DOI resolver allowlist. I added a regression test for the empty allowlist case.

const sizeOk = numberAtMost(mount.maxGb, policy.maxWritableGb);
addCheck(
pipeline.id,
`WRITABLE_MOUNT_${mount.path || "missing"}`,
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in a87addc. Writable mount checks now use the stable WRITABLE_MOUNT code and keep the user-supplied path in detail; the test suite asserts the code no longer embeds /workspace.

@karollooool
Copy link
Copy Markdown
Author

Follow-up commit a87addc addresses the three Copilot review comments:

  • DOI-only egress now requires a non-empty approved resolver allowlist, with regression coverage.
  • Writable mount checks use stable machine-readable codes and keep paths in detail.
  • MP4 rendering now fails early with a clear missing-font error instead of falling back to an unsupported ffmpeg option.

Re-ran:

  • npm run check
  • npm test
  • npm run demo
  • npm run demo:video
  • MP4 decode check with ffmpeg
  • git diff --check
  • git diff --cached --check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants