fix: README quick start crashes on string arguments

Open
#7 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
api, backend

Research direction

Start with record in src/agenttrace/tracer.py and compute_hash in src/agenttrace/schema.py, then inspect generate_report in src/agenttrace/report.py and AgentTracer.verify. Reproduce the README quick start and report examples as written, then add tests for string enum values and string paths. Done means both examples run without AttributeError and the tests pass.

Written by the indexing model from the issue text.

Description

bug good first issue

The README and docstrings pass policy_decision="allow" to record_decision, but record in src/agenttrace/tracer.py stores the string as is and compute_hash in src/agenttrace/schema.py calls .value on it, which raises AttributeError. generate_report in src/agenttrace/report.py and AgentTracer.verify also fail on a str path such as "bundle.jsonl", which the README shows. Convert strings to PolicyDecision, RiskTier and EventType in record, wrap path arguments in pathlib.Path, and add tests that run the README examples as written.

Reproduced with:

$ cat quickstart.py
from agenttrace import AgentTracer
tracer = AgentTracer(agent_id="my-research-agent", framework="langgraph")
tracer.start_session()
tracer.record_decision(action="summarise findings", policy_decision="allow")
$ python quickstart.py 2>&1 | tail -1
AttributeError: 'str' object has no attribute 'value'
$ cat report_str.py
from agenttrace import generate_report
generate_report("bundle.jsonl")
$ python report_str.py 2>&1 | tail -1
AttributeError: 'str' object has no attribute 'open'
Dominant language
Python
Stars
0
Forks
1
Avg merge
1d 10h
Merged PRs (30d)
2

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from obielin/agenttrace

All issues in obielin/agenttrace

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.