Skip to content

Follow-ups from #72 review: persona regex, set/load validation parity, traceback docstring #79

Description

@Antawari

Follow-up nits from the dual-lens review of #72 (CLI/persona/scanner hardening). All LOW severity — none blocked the merge.

  1. cli/commands/persona.py (~99-105) — the r'^persona\s*=\s*"[^"]*"' re-write regex mis-matches an already-escaped persona value on disk (e.g. persona = "evil\"name"), producing corrupt TOML. Match the full quoted value including escapes, or parse-and-rewrite structurally.

  2. persona set-path vs load-path validation paritypersona_set accepts any name in available() (no slug check) and writes it TOML-safely, but PersonaLoader.load() now rejects non-slug names and silently falls back to minimal. So bonfire persona set MyPersona reports success yet the persona never loads. Validate in persona_set too (reuse _is_valid_persona_name), or filter available().

  3. dispatch/sdk_backend.py traceback-redaction docstring — claims "Python tracebacks include local-frame repr data"; stdlib format_exc() does not dump locals (that needs capture_locals=True). The redaction fix is still net-positive, but correct the rationale comment so a future reader doesn't trust a false premise. Also stale: tool_policy.py:30 docstring still references permission_mode='dontAsk' as the deny-all combination.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions