Skip to content

feat: minimize v2 runtime images - #28

Open
sozercan wants to merge 1 commit into
mainfrom
feat/v2-runtime-minimization
Open

feat: minimize v2 runtime images#28
sozercan wants to merge 1 commit into
mainfrom
feat/v2-runtime-minimization

Conversation

@sozercan

Copy link
Copy Markdown
Owner

Summary

  • make V2 runtime assembly minimal by default, without a user-selectable profile
  • prune bounded non-runtime payloads from exact transitive homebrew/core Formulae while preserving requested Formulae, runtime-critical content, legal files, and link integrity
  • add attributed compact prune evidence and update release validation, examples, and documentation

Validation

  • ./scripts/check.sh
  • amd64 hf + curl live image: real HTTPS and model-weight downloads passed under the hardened non-root/read-only configuration
  • compressed image size: 72,296,566 B, down 28.5% from the previous 101,163,570 B image

Notes

  • the live validation image remains amd64-only
  • runtime caches require writable HF_HOME and XDG_CACHE_HOME paths, such as /models

Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Copilot AI balanced review requested due to automatic review settings August 13, 2026 23:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds release-bound V2 runtime minimization while preserving V1 behavior and producing verifiable pruning evidence.

Changes:

  • Prunes bounded development-only payloads from transitive core Formulae.
  • Binds minimization to V2 policy, resolution, inventory, and evidence.
  • Expands integration tests, release validation, and documentation.
Show a summary per file
File Description
SECURITY.md Documents minimization guarantees.
scripts/vm-live-validate.sh Accepts prune manifest v4.
release/components-v2.example.json Updates policy digest.
README.md Describes automatic minimization.
policy/v2/policy.json Defines minimal profile rules.
policy/v2/policy.go Models and validates the profile.
policy/v2/policy_test.go Tests embedded profile integrity.
internal/spec/canonical_order_test.go Rejects user profile selection.
internal/runtimefs/types.go Adds schemas and prune reasons.
internal/runtimefs/scan.go Implements minimization classification.
internal/runtimefs/prune_compaction_test.go Tests attributed evidence compaction.
internal/runtimefs/policy.go Normalizes and digests profiles.
internal/runtimefs/minimal_profile_test.go Tests pruning and retention behavior.
internal/runtimefs/evidence.go Produces compact attributed evidence.
internal/runtimefs/assemble.go Verifies retained inventory policy.
internal/resolution/v2.go Validates V2 profile identity.
internal/resolution/v2_test.go Tests profile serialization behavior.
internal/resolution/record.go Adds in-memory profile identity.
internal/resolution/record_test.go Tests V1 profile rejection.
internal/resolution/project_v2_test.go Tests profile projection.
internal/policy/v2.go Binds the minimal V2 policy.
internal/policy/v2_test.go Tests binding and replay inference.
internal/materializer/v2_prepare_test.go Updates policy mismatch expectation.
internal/frontend/handler.go Binds profile into effective input.
internal/frontend/handler_test.go Tests effective-input identity.
internal/buildfiles/release_workflow_test.go Tests release minimization gates.
examples/live-redis.yaml Updates evidence schema check.
examples/live-python.yaml Updates evidence schema check.
examples/live-hf-curl.yaml Exercises minimized runtime behavior.
examples/live-graphviz.yaml Updates evidence schema check.
examples/live-glibc.yaml Updates evidence schema check.
docs/usage.md Documents minimization contract.
docs/release.md Adds release policy requirements.
docs/architecture.md Explains minimization architecture.
CONTRIBUTING.md Adds validation guidance.
cmd/live-input-verify/main_test.go Tests profile-extension rejection.
.github/workflows/release.yml Generates and validates release evidence.

Review details

馃挕 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 37/37 changed files
  • Comments generated: 2
  • Review effort level: Balanced

Comment on lines +760 to +764
if reason == PruneRuntimeDocs || reason == PruneRuntimeShareDoc || reason == PruneRuntimeShell {
if pathContainsLegalText(sub) {
return ""
}
}
Comment on lines +543 to +546
if reason := minimalRuntimePruneReason(entry.Path, entry.Package, policy); reason != "" && (reason != PruneRuntimeStatic || entry.Type != TypeDirectory) {
if _, approvedAncestor := profileAncestors[entry.Path]; !approvedAncestor || entry.Type != TypeDirectory {
return runtimeError(CodeVerification, entry.Path, "inventory retains path forbidden by runtime profile (%s)", reason)
}

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

馃挕 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 71e72753d2

鈩癸笍 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".

If Codex has suggestions, it will comment; otherwise it will react with 馃憤.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

func looksLikeLegalText(filename string) bool {
base := strings.ToLower(path.Base(filename))
return strings.HasPrefix(base, "license") || strings.HasPrefix(base, "copying") || strings.HasPrefix(base, "notice") || strings.HasPrefix(base, "copyright")
for _, name := range []string{"license", "licenses", "copying", "notice", "notices", "copyright", "copyrights"} {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve British-spelled licence files

For a transitive core Formula containing legal text such as share/doc/<pkg>/LICENCE or LICENCE.txt, this allowlist does not recognize the common British spelling, so minimalRuntimePruneReason classifies the file as non-legal documentation and removes it under PruneRuntimeShareDoc. This violates the V2 contract that legal and license text remains and can produce redistributed images without required licence notices; include licence/licences and other explicitly supported legal filename variants in this predicate.

AGENTS.md reference: AGENTS.md:L75-L77

Useful? React with 馃憤聽/ 馃憥.

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