Skip to content

refactor(kinetic): replace production assert in agent_write with explicit guard #61

Description

@MarcoPorcellato

Problem

kinetic.agent_write uses assert parent_uuid is not None after alias resolution (line ~650). Assertions are stripped under python -O and are discouraged in production CLI paths per project Clean Code guidelines (docs/BUG_HUNT_REPORT.md §6).

Proposed Solution

Replace with an explicit guard:

if parent_uuid is None:
    print("Internal error: missing target block UUID.", file=sys.stderr)
    raise typer.Exit(code=1)

Files

  • src/logseq_matryca_parser/kinetic.py

Definition of Done

  • No assert on the agent-write hot path
  • make all passes
  • Optional one-liner test if a branch becomes reachable

Metadata

Metadata

Assignees

No one assigned

    Labels

    cliKINETIC CLI (matryca-parse)enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions