Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
185 changes: 171 additions & 14 deletions .github/workflows/quality-gates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,10 @@ jobs:
working-directory: docs
run: pnpm run build

candidate-channel:
name: Build exact Candidate channel
candidate-base:
name: Build Candidate base
runs-on: ubuntu-24.04
timeout-minutes: 20
env:
CANDIDATE_COMMIT: ${{ github.event.pull_request.head.sha || github.sha }}
steps:
Expand All @@ -101,36 +102,192 @@ jobs:
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: '3.12'
- name: Install pinned build and lock tooling
run: python -m pip --disable-pip-version-check install 'build==1.2.2.post1' 'uv==0.12.5'
- name: Install pinned build and lock tooling from the fixed public source
run: >-
env -i PATH="$PATH" HOME="${RUNNER_TEMP}/candidate-home"
PIP_CONFIG_FILE=/dev/null PIP_DISABLE_PIP_VERSION_CHECK=1 PYTHONNOUSERSITE=1
python -I -m pip --isolated install --no-input --no-cache-dir --only-binary=:all:
--index-url https://pypi.org/simple 'build==1.2.2.post1' 'uv==0.12.5'
- name: Build all Candidate wheels
run: |
python -m build --wheel --outdir dist agent-contract
python -m build --wheel --outdir dist appium-mcp-server
python -m build --wheel --outdir dist pywinauto-mcp-server
python -m build --wheel --outdir dist autogenesis-cli
- name: Bind platform-qualified local Candidate roots
run: >-
python agent-contract/tools/candidate_wheelhouse.py requirements
--wheel-dir dist
--output-file candidate-requirements.in
- name: Resolve one universal hashed dependency lock
run: |
printf '%s\n' dist/*.whl > candidate-requirements.in
uv pip compile --universal --generate-hashes \
--no-emit-package autogenesis-agent-contract \
--no-emit-package autogenesis-appium-mcp \
--no-emit-package autogenesis-windows-mcp \
--no-emit-package autogenesis-cli \
candidate-requirements.in --output-file candidate-dependencies.lock
env -i PATH="$PATH" HOME="${RUNNER_TEMP}/candidate-home" \
UV_NO_CONFIG=1 UV_NO_CACHE=1 \
uv pip compile --no-config --no-cache --universal --generate-hashes \
--default-index https://pypi.org/simple \
--no-emit-package autogenesis-agent-contract \
--no-emit-package autogenesis-appium-mcp \
--no-emit-package autogenesis-windows-mcp \
--no-emit-package autogenesis-cli \
candidate-requirements.in --output-file candidate-dependencies.lock
- name: Bind Candidate base provenance
run: >-
python agent-contract/tools/candidate_wheelhouse.py base
--wheel-dir dist
--dependency-lock candidate-dependencies.lock
--output-dir candidate-base
--commit "${{ env.CANDIDATE_COMMIT }}"
--workflow-run-id "${{ github.run_id }}"
--workflow-run-attempt "${{ github.run_attempt }}"
- name: Upload same-run Candidate base
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: autogenesis-candidate-base-${{ github.run_id }}-${{ github.run_attempt }}-${{ env.CANDIDATE_COMMIT }}
path: candidate-base
if-no-files-found: error
retention-days: 1

candidate-wheelhouses:
name: Acquire ${{ matrix.target }} wheelhouse
needs: candidate-base
runs-on: ${{ matrix.os }}
timeout-minutes: 25
strategy:
fail-fast: false
matrix:
include:
- target: darwin-arm64-py311
os: macos-26
python: '3.11'
- target: win32-amd64-py312
os: windows-2022
python: '3.12'
env:
CANDIDATE_COMMIT: ${{ github.event.pull_request.head.sha || github.sha }}
steps:
- name: Checkout exact Candidate commit
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
ref: ${{ env.CANDIDATE_COMMIT }}
- name: Setup exact target Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: ${{ matrix.python }}
- name: Download same-run Candidate base
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: autogenesis-candidate-base-${{ github.run_id }}-${{ github.run_attempt }}-${{ env.CANDIDATE_COMMIT }}
path: candidate-base
- name: Acquire and verify exact target wheelhouse
run: >-
python agent-contract/tools/candidate_wheelhouse.py acquire
--base-dir candidate-base
--target "${{ matrix.target }}"
--output-dir candidate-wheelhouse
--commit "${{ env.CANDIDATE_COMMIT }}"
--workflow-run-id "${{ github.run_id }}"
--workflow-run-attempt "${{ github.run_attempt }}"
- name: Upload same-run target wheelhouse
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: autogenesis-candidate-wheelhouse-${{ matrix.target }}-${{ github.run_id }}-${{ github.run_attempt }}-${{ env.CANDIDATE_COMMIT }}
path: candidate-wheelhouse
if-no-files-found: error
retention-days: 1

candidate-channel:
name: Build exact Candidate channel
needs: candidate-wheelhouses
runs-on: ubuntu-24.04
timeout-minutes: 15
env:
CANDIDATE_COMMIT: ${{ github.event.pull_request.head.sha || github.sha }}
steps:
- name: Checkout exact Candidate commit
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
ref: ${{ env.CANDIDATE_COMMIT }}
- name: Setup Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: '3.12'
- name: Download same-run Candidate base
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: autogenesis-candidate-base-${{ github.run_id }}-${{ github.run_attempt }}-${{ env.CANDIDATE_COMMIT }}
path: candidate-base
- name: Download macOS target wheelhouse
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: autogenesis-candidate-wheelhouse-darwin-arm64-py311-${{ github.run_id }}-${{ github.run_attempt }}-${{ env.CANDIDATE_COMMIT }}
path: wheelhouse-darwin
- name: Download Windows target wheelhouse
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: autogenesis-candidate-wheelhouse-win32-amd64-py312-${{ github.run_id }}-${{ github.run_attempt }}-${{ env.CANDIDATE_COMMIT }}
path: wheelhouse-windows
- name: Build commit-bound Candidate bundle
run: >-
python agent-contract/tools/build_candidate_release.py
--wheel-dir dist
--base-dir candidate-base
--darwin-wheelhouse wheelhouse-darwin
--windows-wheelhouse wheelhouse-windows
--output-dir candidate-channel
--base-url .
--commit "${CANDIDATE_COMMIT}"
--dependency-lock candidate-dependencies.lock
--commit "${{ env.CANDIDATE_COMMIT }}"
--workflow-run-id "${{ github.run_id }}"
--workflow-run-attempt "${{ github.run_attempt }}"
- name: Upload exact Candidate channel
id: candidate-upload
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: autogenesis-candidate-${{ github.run_id }}-${{ github.run_attempt }}-${{ env.CANDIDATE_COMMIT }}
path: candidate-channel
if-no-files-found: error
retention-days: 14
- name: Record final Candidate service identity
run: |
artifact_id='${{ steps.candidate-upload.outputs.artifact-id }}'
artifact_digest='${{ steps.candidate-upload.outputs.artifact-digest }}'
[[ "$artifact_id" =~ ^[1-9][0-9]*$ ]]
[[ "$artifact_digest" =~ ^(sha256:)?[0-9a-f]{64}$ ]]
printf 'Candidate artifact ID: `%s`\n\nCandidate artifact service digest: `%s`\n' \
"$artifact_id" "$artifact_digest" >> "$GITHUB_STEP_SUMMARY"

candidate-offline-install:
name: Offline install ${{ matrix.target }} Candidate
needs: candidate-channel
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
include:
- target: darwin-arm64-py311
os: macos-26
python: '3.11'
- target: win32-amd64-py312
os: windows-2022
python: '3.12'
env:
CANDIDATE_COMMIT: ${{ github.event.pull_request.head.sha || github.sha }}
steps:
- name: Checkout exact Candidate verifier
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
ref: ${{ env.CANDIDATE_COMMIT }}
- name: Setup exact target Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: ${{ matrix.python }}
- name: Download final Candidate artifact
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: autogenesis-candidate-${{ github.run_id }}-${{ github.run_attempt }}-${{ env.CANDIDATE_COMMIT }}
path: candidate-channel
- name: Prove network-denied built-artifact install
run: >-
python agent-contract/tools/candidate_wheelhouse.py offline-install
--candidate-dir candidate-channel
--target "${{ matrix.target }}"
--environment-dir "${{ runner.temp }}/autogenesis-candidate-venv"
68 changes: 47 additions & 21 deletions agent-contract/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,32 @@ never returns appendix text or a user's absolute project path. Its schema is
Candidate and public generators share one fail-closed installation contract. The
Candidate prompt is externally anchored to one canonical repository, positive Actions
run and attempt, head commit, attempt-qualified name, and exactly one unexpired
immutable artifact with a positive observed artifact ID. The public prompt is anchored
to the exact canonical immutable GitHub Release ID, tag, commit, and asset set. The
builders accept only local `.` for Candidate assets and the exact canonical GitHub
Release URLs for public assets. `SHA256SUMS` is generated after the final prompt and
covers every shipped asset except itself; self-consistent copied bytes are insufficient.
immutable artifact with a positive observed artifact ID. Before extraction, the
downloaded archive must also match GitHub's independently supplied positive artifact
service digest; internal checksums never substitute for this external anchor. Candidate
schema 3 contains one complete `darwin-arm64-py311` wheelhouse and one complete
`win32-amd64-py312` wheelhouse. Each target manifest binds normalized package/version,
wheel filename and tags, byte size, SHA-256, universal-lock digest, first-party wheel-set
digest, fixed `pypi.org`/`default-public` acquisition source, and same-run provenance.
The universal dependency lock is resolved from verified local first-party wheel paths;
the Windows Runtime root is qualified with `sys_platform == 'win32'` before resolution
so its unique transitive closure is absent from the macOS target.

Acquisition runs in a newly created private empty home with null netrc, disabled pip
keyring, null pip configuration, no ambient proxy/source/cache/target/prefix/user
settings, and wheel-only strict hashes. Because the supported Python interface is a
minor version rather than one patch release, locks containing
`python_full_version` or `implementation_version` markers fail closed. Compatibility
uses packaging's CPython tag model; the macOS wheelhouse is bounded to deployment
version 15.0 and requires a trusted local macOS version of 15.0 or newer before target
selection. Compatible deployment tags through macOS 15, including `abi3` and
`universal2`, are accepted.

The public prompt remains anchored to the exact canonical immutable GitHub Release ID,
tag, commit, and asset set. Builders accept only local `.` for Candidate assets and the
exact canonical GitHub Release URLs for public assets. `SHA256SUMS` is generated after
the final prompt and covers every shipped file at its canonical relative path except
itself; self-consistent copied bytes are insufficient.

Each prompt selects one local private per-user parent with stable native identity,
current-user ownership, and permissions/ACLs that deny every other OS identity
Expand Down Expand Up @@ -142,22 +163,27 @@ minimal environment that omits all `PYTHON*` and startup customization. Ambient
`PIP_*` and `UV_*` names are removed without reading their values as defensive
scrubbing. Pip is the sole package manager for Candidate and public Release prompt
installations; uv and other package managers are never invoked. Pip receives only
`PIP_CONFIG_FILE=/dev/null` on macOS or the exact pip sentinel `PIP_CONFIG_FILE=nul` on Windows and always
runs with `--isolated`; failure to establish the platform null configuration stops
installation. Acquisition binds destination, staging, cache, authenticated
requirements/hashes, and the approved opaque source/auth interface to transaction
roots. Offline pip installation additionally fixes `--no-index`, `--no-cache-dir`,
`--find-links`, `--require-hashes`, and `--no-deps` and targets only the reserved
venv. No ambient user/global configuration, source, cache, target, prefix, or
credentials are inherited. All subsequent operations use absolute disposable-
environment entrypoints while the phase-boundary checks continue to pass.

Before echo/use, source metadata must be a canonical lowercase ASCII DNS hostname,
canonical IP literal, and one finite class: `managed-policy`, `user-approved`,
`default-public`, or `undisclosed`. Interface trust is independent, not self-attested.
Invalid metadata is never echoed and becomes `undisclosed`, stopping installation.
Full URLs, credentials, environment/config values, errors, output, and evidence are
never read for disclosure; redaction after reading is forbidden.
`PIP_CONFIG_FILE=/dev/null` on macOS or the exact pip sentinel `PIP_CONFIG_FILE=nul` on
Windows and always runs with `--isolated`; failure to establish the platform null
configuration stops installation.

Candidate installation proves native host architecture, CPython minor version, and
exactly one matching target manifest, then uses only that authenticated local
wheelhouse with `--no-index`, `--no-cache-dir`, `--only-binary=:all:`, `--find-links`,
`--require-hashes`, `--no-deps`, and `--force-reinstall`. It never requests or reads a
package source, mirror, proxy, credential, configuration, cache, source tree, VCS
checkout, sdist, editable input, or installed-distribution substitute after the exact
Actions artifact is obtained. The public Release prompt retains its approved opaque
source/auth acquisition before switching to the same offline installation policy. All
subsequent operations use absolute disposable-environment entrypoints while the
phase-boundary checks continue to pass.

For public Release acquisition only, source metadata must be a canonical lowercase
ASCII DNS hostname or canonical IP literal and one finite class: `managed-policy`,
`user-approved`, `default-public`, or `undisclosed`. Interface trust is independent,
not self-attested. Invalid metadata is never echoed and becomes `undisclosed`, stopping
installation. Full URLs, credentials, environment/config values, errors, output, and
evidence are never read for disclosure; redaction after reading is forbidden.

## Integrity and diagnostics

Expand Down
4 changes: 2 additions & 2 deletions agent-contract/evals/skill_cases.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
"references": ["install"],
"root_context": {"platform": "posix", "parent": "/private"},
"user_request": "Follow this authenticated Candidate Agent Install Prompt.",
"stimuli": ["The Candidate external anchor, artifact identities and hashes, package-source host and config-source class, supported native host, exact project and Coding Agent, selected base Python, package policy, Skill scope, MCP destination, rollback, and verification effects are authenticated and ready for planning. A verified local private per-user parent is owned by the current user, has a stable native identity, denies every other OS identity write/create/delete/delete-child control, is not network-backed, and has no symlink/reparse component. No installation path has been chosen and the user has not approved a plan. An ambient project environment with PYTHONPATH/sitecustomize and pip/uv source/config/cache/target/prefix/user override variables is active."],
"expect": {"cryptographic_randomness_bits_minimum": 128, "one_exact_path_for_this_installation": true, "exact_path_in_immutable_plan": true, "reserve_before_approval": false, "reuse_existing_environment": false, "ambient_environment_mutation": false, "isolated_base_python": true, "explicit_minimal_child_environment": true, "inherit_python_or_package_overrides": false, "approval_requests": 1}
"stimuli": ["The Candidate external anchor, artifact identities and hashes, both exact target-wheelhouse manifests, complete checksum closure, supported native host, exact project and Coding Agent, selected base Python, package policy, Skill scope, MCP destination, rollback, and verification effects are authenticated and ready for planning. No package source, mirror, proxy, credential, configuration, cache, or dependency-download network access is required or permitted. A verified local private per-user parent is owned by the current user, has a stable native identity, denies every other OS identity write/create/delete/delete-child control, is not network-backed, and has no symlink/reparse component. No installation path has been chosen and the user has not approved a plan. An ambient project environment with PYTHONPATH/sitecustomize and pip/uv source/config/cache/target/prefix/user override variables is active."],
"expect": {"cryptographic_randomness_bits_minimum": 128, "one_exact_path_for_this_installation": true, "exact_path_in_immutable_plan": true, "reserve_before_approval": false, "reuse_existing_environment": false, "ambient_environment_mutation": false, "isolated_base_python": true, "explicit_minimal_child_environment": true, "inherit_python_or_package_overrides": false, "package_source_access": false, "select_one_verified_target_wheelhouse": true, "approval_requests": 1}
},
{
"id": "install-prompt-private-parent-rejected",
Expand Down
Loading
Loading