Add development-gated verified repository file creation - #45
Add development-gated verified repository file creation#45Wright-Shawn wants to merge 2 commits into
Conversation
|
Review of exact head P2 — Reject contradictory creation facts in the v3 attestation validatorIn guard/sdk/repository_evidence.py, Two concrete accepted combinations follow directly from the current conditions:
The record-binding branch checks the original authorization receipt/request/authority, so it does not reject these contradictions either. This is an artifact-consistency issue, not a claim that the mediated execution path currently overwrites files or produces these contradictory collision results. Self-hashing is not a replacement for semantic validation. A focused reproduction using the existing acceptance helper, with both development opt-ins enabled: from copy import deepcopy
from guard.runtime.identity import stable_hash
from guard.sdk.local_persistence import validate_execution_attestation
from tools.acceptance.action_policy_creation import run
evidence = run()
bad = deepcopy(evidence["collision"])
bad["repository_operation"].update(created=True, bytes_written=3)
bad["attestation_hash"] = stable_hash(
{key: value for key, value in bad.items() if key != "attestation_hash"}
)
validate_execution_attestation(bad) # Must reject; current conditions accept it.Scope of correction: define and enforce the permitted combinations of outer execution state, operation status, creation/write observations and fixed error codes. Cover the two cases above through both the public validator and saved-attestation loading. Retain valid pre-callback/incomplete/unknown states, zero-byte successful creation, correct collision evidence, and truthful partial-write failure. Do not turn a collision into policy denial or claim rollback. Preserve historical v1/v2 evidence behavior and the current public API. Keep this in PR #45; no upstream implementation or new feature scope is requested. Independently checked evidence
This review is source analysis plus live CI/log verification. I did not execute Python or independently unpack the acceptance artifact ZIPs in this session. Please reproduce the finding locally, add focused regression coverage, and return the corrected exact head with CI/package results. The mount-namespace test remains explicitly unverified. Published dependency compatibility, production availability semantics, and Cloud/customer acceptance remain separate gates in Cloud #143. Keep the PR draft; no merge, release, publication, deletion/rename/macOS work or activation. |
|
Re-review at exact corrected head I reviewed the four-file correction against the previously reviewed I independently checked all 10 job conclusions and the four development logs at this head:
This was source/diff and live CI/log verification, not an independent local rerun. I found no remaining blocker in this correction to beginning the Cloud-side development slice. The real same-device bind-mount/mount-namespace case remains unverified. Production dependencies, the transition from development-only availability, and actual Cloud-connected Guard execution are still separate gates in Cloud #143. Guard's explicit rejection of Cloud clients for this new authority remains intentional: the next Cloud slice will establish authoring/review/native-publication compatibility, with SDK Cloud support coordinated afterward. Keep this PR draft. This review does not authorize merging, tagging, PyPI publication, hosted activation or additional operation/platform scope. |
Implements the Guard-only development path for #36. Verified native Ledger v4 publications evaluate each create/modify action's own role, allow and deny rules. A create-authorized callback receives an expiring capability whose
create_bytes()method exclusively creates one regular file under a held existing workspace parent; it cannot obtain modify capability.Both
WAVEFRAME_GUARD_ACTION_POLICY_DEV=1andWAVEFRAME_LEDGER_ACTION_POLICY_DEV=1are required. Standalone new contracts, caller verification flags, downgraded envelopes, injected facts, authority/cache substitutions and operation mismatches fail closed. Historical authorities cannot authorize creation. The original contract is retained and local replay revalidates the full publication through Ledger.Creation failures preserve the authorization decision. The final local v3 attestation records observed creation and bytes written separately, without content capture or rollback claims. Readers enforce permitted combinations of outer execution state, operation status and fixed error codes: a collision cannot claim creation/writes, and operation success requires successful execution and observed creation. Incomplete snapshots, partial-write failures and zero-byte creation remain valid. Historical v1/v2 evidence and the public API are unchanged.
The review correction adds 34 focused regressions. Both reported contradictions were reproduced before the fix. Rehashed contradictory proofs are now rejected through public validation, validation against the saved record, and saved-attestation loading. The installed-wheel runner also checks both reported cases through public validation and saved loading, alongside real creation, collision, partial-write failure and zero-byte creation.
Exact development dependency commits are verified through installed PEP 610 provenance:
3b91fcc03c804804b2ace7302f37340a787496d9(reports 0.4.0).54379d9c8044544fc1b8f32109bdfce35c1c6a05(reports 0.8.0).All three upstream fixture chains are retained byte-for-byte with source SHA and SHA256SUMS. No upstream validator is copied or bypassed. Development Git requirements remain separate from unchanged published runtime dependencies.
Exact corrected head:
5e41e454ccd54d7dcce34ecacb41b2ea20cf73b1.Local Windows verification passed: Python 3.10 default suite 1,259 passed / 99 skipped; Python 3.14 opted-in suite 1,339 passed / 19 skipped. The 34 new consistency cases and 50 action-policy cases also passed together on Python 3.10. Fresh Python 3.10 wheel/sdist inspection, Twine, isolated installed-wheel acceptance and
pip checkpassed with the exact dependency provenance above.All 10 CI jobs passed on the corrected head. Downloaded artifacts from all four development jobs were checked for exact dependency provenance, contradiction rejection and valid zero-byte creation.
The tested PR merge tree matches the corrected implementation head tree:
9f056a516a2e7f8c78af4f8eb4fc491809187b73.Representative installed-wheel results:
Collisions preserve the existing file and report
exclusive_create_collision. Partial-write failures retain the new file and reportcreation_or_callback_failed; their overall mutation status staysunknown, with observed creation/write facts recorded separately.Development CI and downloadable artifacts retain JUnit, package digests, installed PEP 610 provenance and local operation evidence, including
rehashed_contradictions_rejectedandzero_byte_creation. Existing compatibility/package/governance CI checks historical behavior and published dependencies.Public API: example. Boundary and acceptance commands: documentation.
This PR remains draft and development-only. The real same-device bind-mount test remains unavailable on the Linux CI runners because unprivileged mount namespaces are disabled. Published dependency compatibility, production availability semantics and coordinated Cloud/customer acceptance remain separate gates in Cloud #143. No deletion, rename, macOS, merge, tag, release, publication or Cloud activation is included.