Skip to content

fix(cli): correct Relation attribute names in list-relations command#350

Draft
plind-junior with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-ci-test-py3-11-job
Draft

fix(cli): correct Relation attribute names in list-relations command#350
plind-junior with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-ci-test-py3-11-job

Conversation

Copilot AI commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

PR #349 introduced 8 new read/list CLI commands but the list-relations command referenced attributes that don't exist on the Relation model (relation_type, from_id, to_id), causing mypy to fail in CI.

Changes

  • src/vouch/cli.py: Added 8 CLI commands with correct Relation field names:
    • read-{claim,page,entity,relation} — fetch a single approved artifact by id
    • list-{claims,pages,entities,relations} — enumerate all approved artifacts of a type
    • list-relations now uses relation.source, relation.relation, relation.target to match the model definition
# Before (broken — these fields don't exist on Relation)
rel_type = relation.relation_type or "unknown"
click.echo(f"{relation.id:50} {relation.from_id} -> {rel_type} -> {relation.to_id}")

# After (correct field names from models.Relation)
output = f"{relation.id:50} {relation.source} -> {relation.relation} -> "
output += relation.target
click.echo(output)

@github-actions github-actions Bot added the size: XS less than 50 changed non-doc lines label Jul 3, 2026
@github-actions github-actions Bot added cli command line interface size: S 50-199 changed non-doc lines and removed size: XS less than 50 changed non-doc lines labels Jul 3, 2026
Copilot AI changed the title [WIP] Fix failing GitHub Actions job ci / test (py3.11) fix(cli): correct Relation attribute names in list-relations command Jul 3, 2026
Copilot AI requested a review from plind-junior July 3, 2026 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli command line interface size: S 50-199 changed non-doc lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants