feat(tags): add roar tag why provenance walk#231
Merged
Conversation
Explain how an artifact acquired a tag by walking the stored per-value
{value, origin, job} pointers and the bind ledger back to the human act
(tag add / run --add-tag), annotating any cross-session hop with the
bind that authorized it. Read-only over existing data — no schema change.
Adds TagWhyRequest, TagWhySummary/WhyNode, TagService.why, and the
`roar tag why <kind[=value]> <target>` CLI command, plus unit coverage.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
christophergeyer
force-pushed
the
rc/0.4.0
branch
from
July 13, 2026 20:29
67864e0 to
266bb7a
Compare
`roar tag why` only explains an artifact's tag, but `@N` resolves to a job — a valid target for every other `roar tag` subcommand. The old error said to "target a tracked artifact," implying the reference was untracked, when in fact it named a perfectly tracked job. Distinguish the job case and point at the job's output artifacts (or `tag show @N`). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
TrevorBasinger
approved these changes
Jul 14, 2026
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.
feat(tags): add roar tag why provenance walkImplements the
roar tag whyverb from the audit design doc (20260519 roar audit.md), which was specified but not implemented — the one functional gap found in theroar tagQA onrc/0.4.0.What it does
roar tag why <kind[=value]> <target>explains how an artifact acquired a tag, walking the inheritance path back to the human act that asserted it:Each leaf is a human act (
tag add/run --add-tag); a cross-session hop names thebindthat authorized it — matching the doc's "walks the pointers … terminating at atag addor abind."How
A read-only traversal over data that already exists — the per-value
{value, origin, job}records, thetag.bindledger, andjob → inputs(get_by_uid+get_inputs). No schema change, no new storage, no migration. The value author even left the hook (tag_display_valuesdocstring references "a futureroar tag why").Changes (roar only — local read, no glaas-api/site coupling)
application/query/requests.py—TagWhyRequestapplication/query/results.py—TagWhySummary(renders theWhyNodeforest)application/tags.py—WhyNode+TagService.why()walk (cycle-guarded; graceful on missing producers)application/query/tag.py—tag_why()/build_tag_why_summary()cli/commands/tag.py—roar tag whycommand + helptests/unit/test_tag_why.py— 9 tests (user-leaf, one-hop system, cross-session bind annotation,--add-tagsession-scoped leaf, value filter, absent tag, missing producer, cycle guard, non-artifact rejection)Verification
pytest tests/unit/test_tag_why.py→ 9 passedpytest tests/unit/test_tag_*(regression) → 88 passedruff check/ruff format --check/mypyon changed modules → cleanrc/0.4.0(register-y-confirmation#224+ telemetry tests, unrelated to this change; verified they fail identically on base). Heads-up: those stale tests want updating onrc/0.4.0separately.🤖 Generated with Claude Code