feat(cli): adjudicate --json for machine-readable verdicts (#137, Slice 2a)#161
Merged
Conversation
Give adjudicate a non-destructive path to action: a --json flag emits the verdicts as a pretty-printed JSON array on stdout, so a user or wrapper can pipe SAME pairs into openkos merge. Establishes the project's first --json convention (Slice 2a of the #139->#137 arc). - pure builder _adjudication_payload(results, *, same_only) -> list[dict] - schema per group: member_ids, okf_type, tier (HIGH/LOW via .name), verdict (SAME/DIFFERENT/UNCERTAIN), rationale - confidence omitted (consistent with #138: uncalibrated, misleading precision) - no survivor/absorbed field (no heuristic exists; the consumer decides) - emits all verdicts by default; --same-only filters the array to SAME - empty results -> [] (valid JSON), never the plain-text no-candidates message - short-circuits after the Ollama error handlers, before all human output, so a degraded run still exits 1 on stderr with no JSON Additive flag only: the non-json human path (incl. #139 tally/legend/Next) is byte-identical. No verdict/merge/ledger changes. Interactive/batch apply are deferred to later slices (batch gated on #138 verdict quality).
jasonssdev
added a commit
that referenced
this pull request
Jul 24, 2026
Merge the adjudicate --json delta into the entity-resolution-adjudication spec (7 new requirements: schema, human-output suppression, --same-only composability, empty->[], deterministic pretty-print, error-path isolation, non-json byte-parity; #139 requirements preserved) and move the change folder to archive/. Implementation shipped in #161. #137 stays open for future apply slices.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of the #139→#137 curation-output arc (Slice 2a). Advances #137.
What
Gives
adjudicatea non-destructive path to action: a--jsonflag emits the verdicts as a pretty-printed JSON array on stdout, so a user or wrapper can pipeSAMEpairs intoopenkos merge. This establishes the project's first--jsonconvention.Schema (one object per group):
[{ "member_ids": ["a", "b"], "okf_type": "person", "tier": "HIGH", "verdict": "SAME", "rationale": "..." }]Locked convention decisions (precedent-setting)
confidenceomitted — consistent with bug: adjudicate reports a flat 0.95 confidence and marks part-whole pairs as SAME #138 (uncalibrated flat value; a JSON number revives misleading precision).mergeis pairwise; HIGH groups can have >2 members).--same-onlycomposes: all verdicts by default;--json --same-onlyfilters toSAME.[](valid JSON), never the plain-text no-candidates message.indent=2, deterministicresultsorder.Scope
merge/ledger changes.Verification
--jsonwiring,--same-onlycomposability, empty→[]on both guards, error-path emits no JSON).--same-onlywas ignored) — fixed in this branch; serializability, error-path isolation, and enum rendering (tier.nameuppercase) all confirmed clean.Diff:
main.py+52/-2, tests +311.