Repository navigation
Conversation
… provenance gate Add CLI integration tests that drive the real `atomic agent hooks claude-code` verbs in a Git-imported repository, mirroring the issue's reproduction script under an isolated HOME / ATOMIC_CONFIG_DIR: - after SessionEnd, `atomic git push --no-push` refuses the hook-recorded change: its attestation is signed by the user's own default identity, which the gate reports as "unknown (not configured)" - the same refusal blocks `atomic insert view <draft>` into shared main - an `[author] identity` given by identity name is never matched against the signer DID, so naming the repository identity does not help - the in-session refusal does not say attestations are written at session end - the untrusted-signer refusal does not say how to configure `[git.trust]` All five tests fail on this commit; the following commit fixes them. Run: cargo test -p atomic-cli --test it agent_hook_publication_gate_test:: Refs atomicdotdev#330 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cdotdev#330) Session attestations written at SessionEnd are signed with the host's default identity (`create_session_attestation` -> `load_did_signing_identity`), but the trusted provenance gate's only implicit root was `[author] identity` from `.atomic/config.toml`, which `atomic init` / `atomic git import` never write. Every hook-recorded change was therefore refused at every protected boundary (`atomic git push`, `atomic push`, `atomic insert` into a shared view, triage promotion), with the user's own DID reported as "unknown (not configured)". - `PublicationGateConfig` gains `local_identity`: the DID of the host's default identity, read without creating the store. It is a self-root like the repository identity; `signer_trust` evaluates both through `GitTrustConfig::evaluate`, so revocation still wins. No third-party default (web of trust, delegation chains) is introduced. - `[author] identity` may now be an identity name or ID: it is resolved to its DID through the repo-local identity store, then the default store. Previously a name was compared verbatim against signer DIDs and could never match. - `MissingAttestation` records whether the session is still active; the refusal then says attestations are written when the session ends. - An unknown DID signer's refusal says how to trust it (`[git.trust] signers` in `.atomic/config.toml`); an unknown `session-mac:*` signer's refusal says to create a default identity instead. - Document the trust roots and the session-end timing in docs/shim-operating-guide.md. Fixes atomicdotdev#330 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Zaba505
force-pushed
the
fix/330-hook-publication-trust
branch
from
November 11, 2026 22:07
b3cd7a5 to
8615f40
Compare
Zaba505
marked this pull request as draft
November 12, 2026 03:58
Author
|
@geekgonecrazy I've reverted this to a draft because I realized that manually setting my DID in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #330.
Problem
Changes recorded by the agent hooks could not cross any protected publication boundary (
atomic git push,atomic push,atomic insertinto a shared view, triage promotion):unknown (not configured).no same-session attestationand didn't mention that attestations are only written at session end.Root cause
create_session_attestationsigns with the identity store's default identity (load_did_signing_identity→IdentityStore::get_default). But the gate's only implicit trust root was[author] identityin.atomic/config.toml, whichatomic init/atomic git importnever write. So the key that signs every session attestation was never trusted by the gate.A related problem: when
[author] identitywas set, it was often an identity name (atomic org setwrites it that way), and the gate compared it verbatim against the signer DID, so it could never match.Fix
PublicationGateConfig::local_identity: the DID of the host's default identity, read withIdentityStore::open_default_existing(no files are created). It is a self-root alongside the repository identity.PublicationGateConfig::signer_trustevaluates both roots through the unchangedGitTrustConfig::evaluate, so revocation still wins. This adds no third-party default (web of trust, delegation chains), so RFC §19 Q4 stays open as before. Rationale: an attestation that verifies under this key was signed with this machine's own secret key. That is the same self-root argument already used for the repository identity.[author] identityresolution: accepts a DID, an identity name, or an identity ID. Names and IDs are resolved to the DID through the repo-local identity store, then the default store. A reference that can't be resolved is kept verbatim (same behaviour as before).MissingAttestationnow records whether the session ledger is stillActive. If it is, the refusal adds: "the session is still active and its attestation is written when the session ends (the agent's SessionEnd hook): end the agent session, then retry".signers = ["did:…"]line to add under[git.trust]in.atomic/config.toml.session-mac:*signer means no default identity existed when the session ended. That refusal points toatomic identity new <name> --set-defaultinstead of suggesting allowlisting a per-session MAC.docs/shim-operating-guide.md§7 documents the trust roots, the[git.trust]syntax, and when session-end attestation happens.To answer the issue's questions: trust has always been configurable with
[git.trust] signers = [...]in.atomic/config.toml, but nothing told users that. And yes, session attestations are written at SessionEnd by design. This PR changes neither of those; it makes both explicit in the refusals.How to verify (commit by commit)
The branch is split so the failure can be reproduced first:
678e14atest: reproduce #330 …atomic agent hooks claude-codeverbs in agit imported repo (mirrors the issue's script, isolatedHOME/ATOMIC_CONFIG_DIR)8615f40fix: trust the host's default identity …The reproduction tests:
hook_recorded_change_is_git_pushable_after_session_endhook_recorded_change_inserts_into_shared_view_after_session_endauthor_identity_name_is_resolved_as_the_repository_trust_rootin_session_refusal_says_attestations_are_written_at_session_enduntrusted_signer_refusal_explains_how_to_configure_trust: also checks that following the advice (adding the DID to[git.trust] signers) lets the push throughI also re-ran the issue's original bash script against the fixed binary. The in-session push is still refused, now with the "end the agent session" hint. After
session-end,atomic git push --no-push -b featureexits 0, andatomic insert view <draft>lands the change onmain.Testing done
Rebased onto
devat8053c02. The following was re-run after the rebase:678e14ahas 0/5 passing, with the sameatomic git pushprovenance gate refuses every change recorded by the agent hooks (no attestation until SessionEnd, then signer "unknown") #330 refusals as before;8615f40has 5/5 passing.cargo test -p atomic-config -p atomic-repository --lib: 46 + 1576 passedinsert_promote,push_integration,git_push_cb4b,remote_sandbox_client,provenance_integration,session_integration,git_guard_cb0c,bridge_agent_workflow,git_shim_cb10a,agent_hook_publication_gate): 72 passedcargo clippy -p atomic-config -p atomic-repository -p atomic-cli --tests: no new warnings. The existing warnings, including one that arrived with the newdev, are all in files this PR doesn't touch.Before the rebase (on
5c31fae), I ran the fullcargo test -p atomic-cli --test itsuite (651 tests). Everything passed except two crash-injection tests,graph_only_export_cb9b_test::graph_only_export_matrix_from_recorded_graphandgit_shim_cb13d_test::crash_during_effect_recovers_without_partial_bytes. Both also fail on unmodified5c31faeon my machine, because theATOMIC_FAIL_*failpoint never fires, so they are pre-existing and unrelated.diagnostics_integration_testmodule copies the 2.2 GB debug binary for every test, so full parallelism on a 16 GB tmpfs/tmpruns out of space and OOMs the test binary. Running with--test-threads=8avoids it.Not changed, worth a look
atomic agent identity set repro+repro-claudereports "recording hooks now sign as it". The change author is the agent identity, but the session attestation is still signed by the store's default (user) identity. This PR trusts the key that actually signs today. Whether attestations should be signed by the delegated agent identity, and the delegator trusted through the delegation, is a policy question I left for you.resurrection.rs::evaluate_trust,atomic git binding verify) still compares[author] identityverbatim. It is a separate path thatatomic git pushprovenance gate refuses every change recorded by the agent hooks (no attestation until SessionEnd, then signer "unknown") #330 doesn't cover.resolve_identity_didcould be reused there if you want the same name resolution.verify-receive),local_identityis the server's own default identity. That gate runs without key providers, so attestations still fail closed as unverifiable before trust is checked. Nothing changes there in practice.🤖 Generated with Claude Code