Skip to content

Build a deterministic Python research core

The build problem

Build a deterministic local Python research core without inventing command parsing, validation, safe querying, or canonical JSON.

Reviewed answer

Recommended path: Use pallets/click, pydantic/pydantic, jmespath/jmespath.py, and trailofbits/rfc8785.py.

You still own: The product-specific research plan, evidence gates, state transitions, and human answer still need a local coordinator.

Option-by-option decision

Use

pallets/click

Composable Python package for creating command-line interfaces.

What it contributes: Owns mature command parsing and help generation while typed domain validation stays outside the parser.

Watch: It does not define research semantics, evidence policy, or the command lifecycle.

Revisit when: The selected major version becomes incompatible or an already-used component fully owns parsing.

Checked 2026-09-17 · Repository · Evidence

Use

pydantic/pydantic

Data validation and settings management using Python type annotations.

What it contributes: Validates strict versioned records and generates JSON Schema at the external data boundary.

Watch: Workflow rules, canonical hashing, and state transitions must remain explicit outside model validation.

Revisit when: A major version breaks the strict immutable record boundary.

Checked 2026-09-17 · Repository · Evidence

Use

jmespath/jmespath.py

Python implementation of the JMESPath query language for JSON documents.

What it contributes: Evaluates safe local expressions over one documented candidate view without arbitrary Python execution.

Watch: It is only the advanced filter evaluator; native gates and the exposed query view remain project-owned.

Revisit when: A required real-world filter cannot be expressed safely.

Checked 2026-09-17 · Repository · Evidence

Use

trailofbits/rfc8785.py

Python implementation of the RFC 8785 JSON Canonicalization Scheme.

What it contributes: Supplies standards-based canonical JSON bytes so content identity does not rely on ordinary sorted JSON.

Watch: It canonicalizes bytes only; immutable receipt policy and safe state persistence remain separate responsibilities.

Revisit when: Published RFC vectors fail or compatibility changes.

Checked 2026-09-17 · Repository · Evidence

What the existing tools already cover

  • Mature libraries already own command parsing, strict records, safe local expressions, and canonical JSON bytes.
  • Each capability can stay behind a narrow deterministic adapter.

What you still need to decide or build

  • The product-specific research plan, evidence gates, state transitions, and human answer still need a local coordinator.

That remaining work is the justified custom scope in this decision. The actions above apply only to the stated problem; they are not universal rankings or guarantees beyond the cited evidence.

Checked 2026-09-17 · See all decisions

Brief research evidence - docs/decisions/canonical-state.json - docs/decisions/cli-filter.json - docs/decisions/dependencies.json