Make attestation staleness first-class for downstream agents
Roam already has the strongest shape I have seen for local codebase evidence: roam_attest, roam_cga_emit, PR-risk envelopes, dogfood PR comments, and explicit index freshness hints.
One small thing that would make those packets safer for downstream agents/reviewers: make staleness / replay conditions first-class in the attestation output.
Concrete shape I mean:
{
"schema": "roam.pr_attestation.v1",
"subject": {
"kind": "pull_request|commit_range|working_tree",
"repo": "owner/name",
"base": "...",
"head": "..."
},
"evidence_scope": {
"commands": ["roam health", "roam pr-risk", "roam affected-tests"],
"index_commit": "...",
"indexed_commit": "...",
"head_commit": "...",
"roam_version": "...",
"rule_config_hash": "..."
},
"verdict": "safe|review_recommended|blocked|not_checked",
"not_checked": ["coverage_unavailable", "runtime_tests_not_run"],
"verification_command": "roam attest --verify <bundle>",
"stale_if": [
"head_commit_changed",
"indexed_commit != head_commit",
"rule_config_hash_changed",
"roam_version_major_changed",
"coverage_import_changed",
"target_branch_moved"
],
"privacy": {
"raw_source_included": false,
"raw_prompt_included": false,
"secrets_included": false
}
}
The key bit is not the exact names. It is that an agent reading a Roam attestation later can answer: can I still use this as authority, or do I need to rerun the evidence?
Why this seems useful:
- Roam's current envelopes already expose freshness hints like
indexed_commit != HEAD; promoting that into a stablestale_if/not_checkedcontract would make the packet easier to consume from Claude Code, Codex, CI, or another reviewer without parsing prose. - It keeps the proof local/privacy-safe. No raw prompts, transcripts, source bodies, or secrets need to be embedded.
- It turns
roam_attestfrom “a good review artifact now” into a replay-safe handoff artifact: useful when a PR is resumed by another agent, rebased, re-reviewed after dependency changes, or summarized in a merge note.
If this already exists under a different command/flag, the discoverability gap may just be docs: a short “when is a Roam attestation stale?” section would solve most of it.
Thank you — this is one of the best-shaped feature requests we've had. You gave us the exact field names (stale_if / not_checked / verification_command / privacy), the reason they matter (replay-safe handoff between agents), and you correctly guessed it was partly a discoverability gap. That precision made it easy to say yes, so we just shipped it.
What was already true (you were right)
roam was already computing every raw signal — it was just scattered across three subsystems and none of it landed in the durable roam attest body:
resolve.index_status()already emits{indexed_commit, head_commit, dirty_files}— theindexed_commit != HEADhint you saw. But it was only stamped into_metawhen the index was already stale, so a reader of a fresh-at-emit attestation got nothing.- the index manifest already records
config_hash+roam_version+schema_version+ enabled-extras drift (surfaced today viaroam doctor). roam cga verifyalready re-derives the graph digests and refuses on a commit/dirty/graph mismatch.
The signals were real; they just weren't promoted into one stable, named contract.
The actual gap — and the fix
Your stale_if framing inverts the current model in exactly the right way. Today roam evaluates freshness at emit time, for the current process. Your contract instead records the baseline inside the attestation (indexed commit, head, config hash, roam version, base-branch SHA) so a downstream agent reading it later can evaluate the conditions itself. That inversion is the feature, and we adopted it.
roam attest now emits, on the attestation body:
{
"indexed_commit": "…", // promoted out of _meta, unconditionally
"head_commit": "…",
"stale_if": [
{"condition": "head_commit_changed", "baseline": "…", "check": "…"},
{"condition": "indexed_commit_behind_head", "baseline": {…}, "already_true": false},
{"condition": "working_tree_dirty", "baseline": {…}, "check": "…"},
{"condition": "rule_config_hash_changed", "baseline": {…}, "check": "…"},
{"condition": "roam_version_major_changed", "baseline": "…", "check": "…"},
{"condition": "coverage_import_changed", "baseline": {…}, "check": "…"},
{"condition": "target_branch_moved", "baseline": "…", "check": "…"}
],
"not_checked": ["risk_score", "blast_radius"], // honest, derived from degraded collectors
"verification_command": "roam attest <base>..<head> --format json",
"privacy": { … }
}
Notes on the design choices, since you clearly think about downstream consumption:
stale_ifreuses the manifest's drift vocabulary so the condition names stay aligned withroam doctor, and each entry carries itsbaselineso a later reader can re-evaluate without re-running roam.not_checkedis derived, not decorative — if the graph extras (networkx) weren't available,risk_score/blast_radiusshow up here automatically; if no rules ran,budget_rules; if no tests were selected,affected_tests. It reflects what this specific run actually skipped.- It lives on
attestation, notevidence. That keeps the two axes clean:--sign'scontent_hashcovers evidence-tamper,stale_ifcovers freshness. The signed hash stays byte-stable across this change.
One honesty caveat on privacy
You framed it as privacy-safe, and it nearly is — the attestation carries sha256 hashes + counts, never source bodies/prompts/transcripts/secrets, telemetry: "none", network_required: false, and clone-URL credentials are already stripped. The one thing I don't want to over-claim: it does embed symbol/identifier names (in breaking-changes / effects / tests). So the block states source_code_included: false and identifiers_included: true rather than implying zero content leakage. If redactable identifier names would matter for your use case, say the word — that's a natural follow-up.
If any of the stale_if condition names feel wrong for how you'd consume them downstream, I'd genuinely welcome the input before they harden into something people script against. Thanks again for the unusually clear write-up. 🙏
Following up, and with a correction I'd rather hand you than have you find.
The contract shipped the day after you filed — stale_if, not_checked, verification_command and privacy landed in 6397e79a, released in v13.7.1. I left this open waiting on your read of the condition names, and it sat. That part is on me.
The more useful news: re-checking it against your actual use case turned up that the feature is defeated on large repositories. roam attest --format json runs its envelope through a default 20k-token budget, and the truncator's preserve-list didn't include attestation. Worse, it dropped keys in insertion order, so on Roam's own repo it deleted attestation (1,760 chars, 1.0% of the payload) before evidence (173,325 chars, 98.2%) — sacrificing the whole staleness contract to reclaim one percent.
The knock-on is worse than the missing stale_if: content_hash is stamped onto that same block, so roam attest --sign --output packet.json on a large repo wrote an artifact with no hash at all, no error, exit code 0. That affects v13.7.0 through v13.9.0. If you hold a JSON packet from those versions produced on a repo large enough to truncate, check it for attestation.content_hash and re-issue if it's missing. --format markdown and the default text output were never affected — they render the attestation before the envelope is assembled.
Our tests missed it because the attest fixture is a three-file repo that never crosses the budget.
Fixed: attestation and agent_contract are now preserved, and remaining fields are dropped largest-serialised-first so the field that actually blew the budget goes first. Regression tests force a tiny budget and assert both stale_if and content_hash survive; both fail without the source change. It's committed and goes out with the next release.
On naming — the offer stands and is more concrete now, since you'd be scripting against fields that will actually reach you. If indexed_commit_behind_head or coverage_import_changed read wrong from a consumer's side, this is the cheap moment to change them.
Implemented and shipped in v13.10.0 (commit 6397e79a, landed 2026-07-08). Verified live just now against this repo:
stale_if conditions : ['head_commit_changed', 'indexed_commit_behind_head', 'working_tree_dirty',
'rule_config_hash_changed', 'roam_version_major_changed',
'coverage_import_changed', 'target_branch_moved']
not_checked : []
indexed_commit : 9a92059e80cd
head_commit : 545c1da8
verification_command: roam attest f82b44b3..545c1da8 --format json
privacy keys : ['content', 'identifiers_included', 'network_required',
'remote_url_credentials_stripped', 'source_code_included', 'telemetry']
All seven conditions you specified are present, plus working_tree_dirty which your list did not have but which matters for the same question.
Two places the implementation deliberately differs from the sketch, both because of your framing that "the key bit is not the exact names":
Staleness lives on attestation, not evidence. --sign computes content_hash over evidence only, so putting freshness metadata there would have made the hash churn every time the working tree moved. Keeping them separate means the two axes stay clean: content_hash answers was this tampered with, stale_if answers is this still current. Those are different questions and a consumer should be able to check either independently.
Each stale_if entry carries its baseline and its check, not just a name. For example:
{
"condition": "indexed_commit_behind_head",
"baseline": {"indexed_commit": "...", "head_commit": "..."},
"already_true": false
}
A bare condition name would still require the consumer to know how to evaluate it. Carrying the baseline value means an agent reading the packet later can evaluate the condition itself without knowing roam's internals — which is the thing you actually asked for. already_true is set when the condition holds at emission time, so a packet can be born stale and say so.
Every lookup in the staleness builder is best-effort and routed through log_swallowed: freshness metadata must never crash an attestation build, but a failure to compute it is disclosed rather than silently omitted.
not_checked reads empty above because risk, budget rules and affected tests were all genuinely computed on that run; it populates with risk_score/blast_radius, budget_rules, or affected_tests when they are not.
Thanks for the issue — the framing ("can I still use this as authority, or do I need to rerun the evidence?") is the part that shaped the design, and the same doctrine has since been applied elsewhere in the codebase: a signal that cannot be honestly computed gets disclosed as missing rather than floored to a clean-looking default.