Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
4d0b3e1
Add source-bound Linux kernel budget qualification controls
crimson-knight Oct 20, 2026
510b76a
Keep missing Linux runner admission as a failed gate
crimson-knight Oct 20, 2026
9f94f22
Pin the reviewed Ubuntu runner and live Docker tool identities
crimson-knight Oct 20, 2026
81f2229
Admit separately reviewed complete Linux runner profiles
crimson-knight Oct 20, 2026
cede571
Read current-process kernel files through their physical PID path
crimson-knight Oct 20, 2026
98ce154
Reject incomplete and untyped external kernel snapshots
crimson-knight Oct 20, 2026
89e329d
Preserve the executed Linux control archive and qualification scopes
crimson-knight Oct 20, 2026
568aee6
Qualify transient build descendants and sibling memory isolation
crimson-knight Oct 20, 2026
b2da5a8
Require complete live parent membership and worker windows
crimson-knight Oct 20, 2026
493124d
Publish executed descendant evidence and the reader correction
crimson-knight Oct 20, 2026
3ea3bfc
Distinguish largest-child RSS from overlapping whole-group charges
crimson-knight Oct 20, 2026
e4a9287
Preserve RSS contrast and the original OOM signal refusal
crimson-knight Oct 20, 2026
c33b033
Measure shared-page charge ownership across live sibling consumers
crimson-knight Oct 20, 2026
372bc33
Publish verified shared-page charge and RSS observations
crimson-knight Oct 20, 2026
6e99271
Package representative Grant build sources and portable controls
crimson-knight Oct 20, 2026
87b9e8d
Fix portable Grant source compression and provider metadata
crimson-knight Oct 20, 2026
8f19ce9
Stage public Grant evidence before uploading artifacts
crimson-knight Oct 20, 2026
7a58f70
Teach agents to validate installed memory budget tooling
crimson-knight Oct 20, 2026
22ce320
Include installation guidance in the verified SDK bundle
crimson-knight Oct 20, 2026
87ff66d
Preserve admitted wrapper link paths in SDK backend runs
crimson-knight Oct 20, 2026
58c20ac
Validate wrapper source before version-dependent shell parsing
crimson-knight Oct 20, 2026
1a6bb7c
Preserve installed SDK link paths and teach installation validation
crimson-knight Oct 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
328 changes: 328 additions & 0 deletions .github/workflows/grant-source-package-controls.yml

Large diffs are not rendered by default.

58 changes: 58 additions & 0 deletions .github/workflows/linux-kernel-budget-controls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Linux kernel budget qualification
on:
pull_request:
paths:
- tools/installation_provenance/**
- .github/workflows/linux-kernel-budget-controls.yml
- tools/whole_build_memory/**
permissions:
contents: read
concurrency:
group: linux-kernel-budget-qualification-${{ github.ref }}
cancel-in-progress: false
jobs:
kernel-budget:
name: Record runner identity and exercise reviewed Linux controls
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
persist-credentials: false
- name: Read runner identities and compare the reviewed profile
id: profile
shell: bash
run: |
sudo --non-interactive --preserve-env=ImageOS,ImageVersion /usr/bin/python3 -I -S -B tools/installation_provenance/record_linux_runner.py \
--output "$RUNNER_TEMP/atlas-linux-runner.json" \
--expected-profile tools/installation_provenance/runner_profile.json \
--github-output "$GITHUB_OUTPUT" --github-env "$GITHUB_ENV"
- name: Exercise capped, OOM, uncapped and terminal controls
if: steps.profile.outputs.admitted == 'true'
shell: bash
env:
ATLAS_SOURCE_PINS_SHA256: 15e27eea749e5d08f7d41256515b078f256c89fed5c49647c09dc99b99406eae
ATLAS_TERMINAL_READER_SHA256: f35e2a9804afadf514beced484b02777f4ece92a1a33436afb0f10d82bfcdca9
run: |
/usr/bin/python3 -I -S -B tools/installation_provenance/test_runner_profiles.py
printf '%s %s\n' "$ATLAS_SHA256SUM_SHA256" /usr/bin/sha256sum | /usr/bin/sha256sum --check --strict
printf '%s %s\n' '2177c969114ad070329c3689e98501ea18f99e610189e97c19b98417a79106ee' tools/installation_provenance/run_ci.sh | /usr/bin/sha256sum --check --strict
bash tools/installation_provenance/run_ci.sh
- name: Exercise transient descendants and sibling isolation
if: ${{ always() && steps.profile.outputs.admitted == 'true' }}
shell: bash
run: |
/usr/bin/python3 -I -S -B tools/whole_build_memory/run_host.py \
--pins-sha256 233f9658ccd015e2c9e7c268723963ed3713dbb2fc4a552f65d2b52a13288cfd \
--runner-metadata "$RUNNER_TEMP/atlas-linux-runner.json"
- name: Retain runner profile and complete control evidence
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: linux-kernel-budget-${{ github.run_id }}-${{ github.run_attempt }}
path: |
${{ runner.temp }}/atlas-linux-runner.json
tools/installation_provenance/ci-evidence-*/
tools/whole_build_memory/ci-evidence-*/
if-no-files-found: error
retention-days: 14
2 changes: 1 addition & 1 deletion .github/workflows/memory-budgets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
ruby -rrbconfig -rdigest -e "puts Digest::SHA256.file(RbConfig.ruby).hexdigest" > /results/ruby-sha256.txt
ruby -Itest -e "Dir[\"test/*_test.rb\"].sort.each { |file| require File.expand_path(file) }" > /results/portable-fixtures.stdout 2> /results/portable-fixtures.stderr
cat /results/portable-fixtures.stdout
ruby -e "text=File.read(ARGV.fetch(0)); abort \"Incomplete portable fixture suite\" unless text.match?(/^112 runs, [0-9]+ assertions, 0 failures, 0 errors, 0 skips$/)" /results/portable-fixtures.stdout
ruby -e "text=File.read(ARGV.fetch(0)); abort \"Incomplete portable fixture suite\" unless text.match?(/^143 runs, [0-9]+ assertions, 0 failures, 0 errors, 0 skips$/)" /results/portable-fixtures.stdout
MEMORY_BUDGET_TEST_OUTPUT_PARENT=/tmp ruby test/native_platform_behavior.rb /tmp/native-platform-behavior > /results/native-platform.stdout 2> /results/native-platform.stderr
ruby -rjson -e "r=JSON.parse(File.read(ARGV.fetch(0))); abort \"Incomplete native platform fixture cohort\" unless r.fetch(\"passed\") && r.fetch(\"test_count\")==27 && r.fetch(\"cases\").all?{|v| v.fetch(\"passed\")} && r.fetch(\"ELF_link_or_loaded_provider_acceptance\")==false" /tmp/native-platform-behavior/RESULT.json
ruby scripts/install_bundle.rb "/tmp/ordinary consumer" > /results/bundle-install.stdout
Expand Down
14 changes: 9 additions & 5 deletions PACKAGE_PINS.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,19 @@
},
{
"file": "docs/0.1.1/native-toolchain.md",
"sha256": "5a0fc398e7cac3cc2beb4e71677383bc722342105cb0268faeaae2d6a7550d33"
"sha256": "6c96c085bf5bb7cadeb45c6d1c37862e076f872e068e195b829c738877f6a987"
},
{
"file": "docs/0.1.1/prepare-toolchain.md",
"sha256": "cdf175d9538fcd39165da44fd78fea4511eb76b665ddc162f426820bbccf170b"
},
{
"file": "docs/corpus-manifest.json",
"sha256": "837e7c571b25af6e6aceb987268527f02d850f42f982f2e8d4911051cd03a5c8"
"sha256": "d4e6a7e23d6b9795b736a6645c102fb3aa6cdd6785e9a6facc7ed1f33c758000"
},
{
"file": "docs/corpus.json",
"sha256": "b515d90dfe74db78ad0ae6184f12092c82bd599f6c3f2186a6f0c7ddb4ece4db"
"sha256": "d1f368d6d5bb917f9989308f3cbba4369a7408605f9f0b4e0fb6a60e08cba4d1"
},
{
"file": "examples/c_allocation_owner.cr",
Expand Down Expand Up @@ -153,16 +153,20 @@
},
{
"file": "scripts/toolchain_profile.rb",
"sha256": "3bf554c7bca8606bf24b3f4b01e41c552b2d454da8b253a164bf73622e117091"
"sha256": "03d437ba7ce3d44bf6ae92b3298afa0db676fc2667b87c34d72686002b1f445f"
},
{
"file": "skills/crystal-memory-budgets/SKILL.md",
"sha256": "dd8fda6c5e0faa6cd85f5ac2cd2c187955697f041ce98c09999df2a08b5b44ce"
"sha256": "8d5acc89dd11b4dbe54cf85e61f2a4b7b31f7431821c271f773e1a0d0aacd1e1"
},
{
"file": "skills/crystal-memory-budgets/agents/openai.yaml",
"sha256": "7678cc353f933b0dd881b32a8aa6be50a72ddfcbb2fa56e3c9c2ebd152e6784e"
},
{
"file": "skills/crystal-memory-budgets/references/installation-validation.md",
"sha256": "7ec59d18241d7dc4e19b3777f54d8999bced1826f967fe5a509983f68eee5eca"
},
{
"file": "spec/fixtures/c/SOURCE_PINS.json",
"sha256": "43230cbf98d7e1deaab93e9550a650ded6c545468146c6b62d04cc548faad5bb"
Expand Down
10 changes: 10 additions & 0 deletions docs/0.1.1/native-toolchain.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ Apple Ruby can clear `DYLD_LIBRARY_PATH` on exec. `budget.rb` admits the origina

The app runner template uses the same helper before and after each build, spec, regression and verifier child. Its report includes the toolchain schema and native manifest SHA. The frozen dependency installer requires schema 3, adding the [Git provider admission](git-provider.md) to these native identities. It restores the approved environment for Minecart version and install children and rechecks native files, Git providers and Minecart bytes after each child. App-owned native link flags, spec helpers and database isolation remain app configuration. A returned native identity keeps an immutable manifest and rechecks its pinned bytes and physical roster before reuse.

## Carry an admitted wrapper's Linux link-search setting

An ordinary Homebrew Alpha wrapper can assign `LD_RUN_PATH` before its static backend `exec`. The SDK admits that wrapper's hash and backend identity, then calls the backend directly so the prepared allocation-counter `CRYSTAL_PATH` overlay stays active. `ToolchainProfile.wrapper_runtime_environment` restores the wrapper's literal `LD_RUN_PATH` through both `Identity#environment` and `revalidate_selection` at that boundary. It returns this single link-search variable; `run_specs.rb` continues using its prepared overlay and admitted backend.

Supported source begins with the exact `#!/bin/bash` or `#!/bin/sh` interpreter header and contains one unconditional static backend `exec`, with a leading environment-assignment list, or one unconditional explicit `export` immediately before that `exec`. Whole-line comments and empty lines are supported with ASCII space/tab separation and LF line endings. Other control bytes require a reviewed wrapper form. Raw assignment identifiers use shell assignment syntax; neighboring values are literal. This complete statement roster establishes that the declared setting reaches the backend. The value uses double-quoted, literal absolute colon-separated paths, including paths containing spaces. The actual Homebrew form is `LD_RUN_PATH="${LD_RUN_PATH:+${LD_RUN_PATH}:}/ordinary/lib:/ordinary/opt/openssl@4/lib"`: existing ambient entries keep their position before the literal paths. The reviewed alternate `LD_RUN_PATH="/ordinary/lib${LD_RUN_PATH:+:$LD_RUN_PATH}"` keeps the literal paths first. A literal-only assignment replaces the ambient value. Repeated restoration keeps the same completed search list.

The helper uses the existing wrapper parser's bounded4096-byte source window and rechecks wrapper/backend hashes before and after interpretation. Restoring a matching runtime assignment requires the complete executable source to fit that window. Matching assignments with dynamic values, unsupported quoting/context, duplicate assignments, relative paths or empty search entries are refused explicitly. Extra statements, control flow, a later `unset`, a quoted command token containing an assignment, and a token printed by `echo` or `printf` each require a separately reviewed wrapper form. Existing wrappers without an `LD_RUN_PATH` assignment and direct-backend profiles keep their prior environment behavior.

An admitted native overlay is merged afterward. Its explicit nil removals remain authoritative, including the complete loader-variable removals from native manifest schema2 under toolchain profiles2/3. Restoring a wrapper's search setting establishes the direct-backend environment boundary; actual selected ELF libraries, loaded images, ordinary SDK39+39 specs and consumer behavior still need their own hosted qualification. The Ruby fixture controls exercise that boundary without compiling Crystal or loading native consumer libraries.

## Acceptance evidence

Run a named native binary directly first to establish its emitted linker arguments, actual loaded images and normal behavior. Then qualify the ordinary SDK spec entrypoint and ordinary app target under the same pinned native identity. Use `loader_trace: true` in a separately pinned diagnostic manifest to restore `DYLD_PRINT_LIBRARIES=1` at the same boundaries; this changes the manifest and profile identity.
Expand Down
16 changes: 10 additions & 6 deletions docs/corpus-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"schema_version": 1,
"package_name": "memory_budget",
"package_version": "0.1.1",
"distribution_state": "local_candidate",
"distribution_state": "public_review_candidate",
"counter_protocol": 1,
"source_binding": "Resolve the actual checkout commit/clean state when building a release or projection; this tracked manifest hashes canonical source bytes.",
"source_repository": "https://github.com/amberframework/memory_budget",
"proposed_repository": "https://github.com/amberframework/memory_budget",
"repository_state": "owner_verified_public_source_readback_pending",
"repository_state": "public_source_verified",
"api_basis": {
"package_version": "0.1.0",
"source_commit": "1a1f89e981b820ff5b375da9b9365be85180190b"
Expand Down Expand Up @@ -39,27 +39,31 @@
},
{
"file": "docs/0.1.1/native-toolchain.md",
"sha256": "5a0fc398e7cac3cc2beb4e71677383bc722342105cb0268faeaae2d6a7550d33"
"sha256": "6c96c085bf5bb7cadeb45c6d1c37862e076f872e068e195b829c738877f6a987"
},
{
"file": "docs/0.1.1/prepare-toolchain.md",
"sha256": "cdf175d9538fcd39165da44fd78fea4511eb76b665ddc162f426820bbccf170b"
},
{
"file": "docs/corpus.json",
"sha256": "b515d90dfe74db78ad0ae6184f12092c82bd599f6c3f2186a6f0c7ddb4ece4db"
"sha256": "d1f368d6d5bb917f9989308f3cbba4369a7408605f9f0b4e0fb6a60e08cba4d1"
},
{
"file": "examples/support/memory_budget_sample_record.cr",
"sha256": "683f164b14ad9cd483f34d17283368dc533c21889811d640d6634de2ec4adda9"
},
{
"file": "skills/crystal-memory-budgets/SKILL.md",
"sha256": "dd8fda6c5e0faa6cd85f5ac2cd2c187955697f041ce98c09999df2a08b5b44ce"
"sha256": "8d5acc89dd11b4dbe54cf85e61f2a4b7b31f7431821c271f773e1a0d0aacd1e1"
},
{
"file": "skills/crystal-memory-budgets/agents/openai.yaml",
"sha256": "7678cc353f933b0dd881b32a8aa6be50a72ddfcbb2fa56e3c9c2ebd152e6784e"
},
{
"file": "skills/crystal-memory-budgets/references/installation-validation.md",
"sha256": "7ec59d18241d7dc4e19b3777f54d8999bced1826f967fe5a509983f68eee5eca"
}
],
"list_of_api_sources": [
Expand Down Expand Up @@ -89,7 +93,7 @@
},
{
"file": "scripts/toolchain_profile.rb",
"sha256": "3bf554c7bca8606bf24b3f4b01e41c552b2d454da8b253a164bf73622e117091"
"sha256": "03d437ba7ce3d44bf6ae92b3298afa0db676fc2667b87c34d72686002b1f445f"
},
{
"file": "scripts/budget.rb",
Expand Down
4 changes: 2 additions & 2 deletions docs/corpus.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
"schema_version": 1,
"package_name": "memory_budget",
"package_version": "0.1.1",
"distribution_state": "local_candidate",
"distribution_state": "public_review_candidate",
"counter_protocol": 1,
"api_basis": {
"package_version": "0.1.0",
"source_commit": "1a1f89e981b820ff5b375da9b9365be85180190b"
},
"source_repository": "https://github.com/amberframework/memory_budget",
"proposed_repository": "https://github.com/amberframework/memory_budget",
"repository_state": "owner_verified_public_source_readback_pending",
"repository_state": "public_source_verified",
"website_prefix": "docs/v2/guides/memory-budgets",
"public_prefix": "public/memory-budget-docs/0.1.1",
"skill_directory": "skills/crystal-memory-budgets",
Expand Down
Loading
Loading