Skip to content

feat: roar tag add/rm/show/history (Phase 1 — local storage)#214

Open
jongeyer wants to merge 3 commits into
mainfrom
jg/roar-tag-p1
Open

feat: roar tag add/rm/show/history (Phase 1 — local storage)#214
jongeyer wants to merge 3 commits into
mainfrom
jg/roar-tag-p1

Conversation

@jongeyer

@jongeyer jongeyer commented Jul 2, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds roar tag command group with four subcommands: add, rm, show, history
  • Tags live under the tag.* key in the existing versioned label documents (no schema changes)
  • Each tag kind stores a JSON array with set semantics; duplicates are silently ignored on add
  • Non-canonical kinds get a warning on stderr; canonical kinds: license, contains_pii, jurisdiction, classification, special_category

New files

File Purpose
roar/core/label_constants.py TAG_NAMESPACE + CANONICAL_TAG_KINDS constants
roar/application/tags.py TagService — set-accumulation read-modify-write over tag.*
roar/application/query/tag.py Orchestration layer (same pattern as label.py)
roar/application/query/requests.py TagAdd/Rm/Show/HistoryRequest DTOs
roar/cli/commands/tag.py Click group with add/rm/show/history subcommands
tests/unit/test_tag_service.py 23 unit tests for TagService set-accumulation logic
tests/application/query/test_tag.py 16 tests for query orchestration

Test plan

  • python -m pytest tests/unit/test_tag_service.py tests/application/query/test_tag.py — 39/39 pass
  • Verify CI passes
  • Smoke-test roar tag add license=MIT @1 against a real roar project

Deferred (Phase 2)

  • Tag propagation at job-record time (copy tag.* from input artifacts to outputs)
  • --add-tag / --block-tag flags on roar run / roar register
  • GLaaS sync verification (tags should publish automatically via collect_label_sync_payloads)

Jon Geyer and others added 3 commits July 2, 2026 16:05
Implements `roar tag add | rm | show | history` for hereditary compliance
tags, as specified in the 2026-05-19 audit design doc (Phase 1, local-only).

Tags live under the `tag.*` key inside the existing versioned label
documents (no schema changes — the labels table already exists).  Each
kind stores a JSON array with set semantics; duplicates are silently
ignored on `add`.

New code:
  roar/core/label_constants.py  — TAG_NAMESPACE + CANONICAL_TAG_KINDS
  roar/application/tags.py      — TagService: set-accumulation over tag.*
  roar/application/query/tag.py — thin orchestration (matches label.py pattern)
  roar/application/query/requests.py — TagAdd/Rm/Show/HistoryRequest DTOs
  roar/application/query/__init__.py — lazy exports for the four tag functions
  roar/cli/commands/tag.py      — Click group with add/rm/show/history
  roar/cli/commands/__init__.py — registers `tag` in the command registry
  tests/unit/test_tag_service.py      — 25 tests for TagService logic
  tests/application/query/test_tag.py — 16 tests for query orchestration

39/39 tests pass.

Deferred: tag propagation at job-record time, --add-tag/--block-tag on
roar run, and GLaaS sync (tags publish automatically via the existing
collect_label_sync_payloads path on roar register).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Fixes 5 ruff errors caught by CI:
  I001 (x2): unsorted import blocks
  F401: unused `call` import
  SIM117 (x2): nested with statements

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant