Skip to content

feat(assertions): promote candidate claims through explicit operator judgment #2182

Description

@Sinity

Metadata

Parent: #1807
Related cleanup umbrella: #2177
Related assertion substrate: #1883
Related archive-debt cockpit: #2179
Status: implementation PR in flight.

Purpose

Add an explicit promotion workflow for candidate assertions.

Polylogue assertions now cover marks, annotations, corrections, suppressions, decisions, caveats, blockers, lessons, handoffs, run state, prompt evals, and transform candidates. Candidate assertions can be stored and queried, but they need a first-class workflow for reviewing a candidate claim, accepting it into active assertion state, rejecting it with a durable reason, deferring it, or superseding it with an operator-authored replacement.

The authority model is intentionally small:

candidate assertion -> explicit judgment assertion -> active / rejected / deferred / superseded lifecycle

Confidence is not authority. A model- or transform-produced candidate must not silently become durable active truth without an explicit judgment path.

Current code reality

The relevant live substrate is:

  • polylogue/storage/sqlite/archive_tiers/user_write.py owns assertion writes, lifecycle defaults, transform-candidate writes, and candidate listing/judgment helpers.
  • polylogue/surfaces/payloads.py owns shared assertion and archive-debt payloads.
  • polylogue/api/archive.py is the Python facade surface.
  • polylogue/cli/commands/user_state.py owns the current user-tier operational surface under polylogue ops state.
  • polylogue/operations/archive_debt.py owns the unified operator debt projection from feat(ops): expose unified archive debt views across import, index, embedding, and transforms #2179.
  • docs/search.md owns assertion query and lifecycle docs.

Assertions already support status=active,candidate, kind=transform_candidate, private/no-inject defaults, and terminal unit queries such as:

polylogue assertions where 'status:candidate AND target:session:codex-session:abc123' --format json

The missing workflow is:

list candidates needing judgment
accept candidate -> active assertion with candidate/evidence provenance
reject candidate -> rejected candidate + judgment reason
supersede candidate -> active replacement assertion with supersedes lineage
defer candidate -> keep candidate pending but record explicit judgment
show candidates as actionable archive debt rows

Chosen surface

Do not create a new root command and do not revive a separate memory/KV/user-state system. The workflow belongs under the existing ops-state surface:

polylogue ops state candidates list --target-ref session:... --format json
polylogue ops state candidates accept assertion:candidate-id --reason TEXT --format json
polylogue ops state candidates reject assertion:candidate-id --reason TEXT --format json
polylogue ops state candidates defer assertion:candidate-id --reason TEXT --format json
polylogue ops state candidates supersede assertion:candidate-id --kind summary --body TEXT --format json

Machine surface:

await archive.list_assertion_candidates(target_ref=..., limit=...)
await archive.judge_assertion_candidate(
    "assertion:candidate-id",
    decision="accept" | "reject" | "defer" | "supersede",
    reason="...",
)

Archive-debt surface:

polylogue ops debt list --kind assertion-candidate --only-actionable --format json

Candidate rows in archive debt should be kind=assertion-candidate, stage=candidate-judgment, owner=user, and action back to polylogue ops state candidates list --format json.

Storage and payload design

Use assertions as the storage substrate. Prefer judgment rows over a new table unless source inspection proves assertion rows cannot represent the lifecycle cleanly.

Concrete storage expectations:

  • A judgment is an assertion row with kind judgment, target assertion:<candidate-id>, private visibility, and context_policy.inject=false.
  • accept and supersede create an active assertion whose evidence refs include the original candidate assertion ref.
  • Active promoted assertions use supersedes=("assertion:<candidate-id>",) so readers can traverse lineage.
  • reject and defer preserve the judgment reason and never erase the original candidate evidence.
  • Candidates stay private/no-inject unless a later surface explicitly opts into candidate context.

Payload expectations:

AssertionJudgmentPayload:
  assertion_id: str
  candidate_ref: str
  decision: Literal["accept", "reject", "defer", "supersede"]
  reason: str | None
  actor_ref: str
  resulting_assertion_ref: str | None
  value: object | None
  created_at_ms: int

AssertionJudgmentResultPayload:
  candidate: AssertionClaimPayload
  judgment: AssertionJudgmentPayload
  resulting_assertion: AssertionClaimPayload | None

Acceptance criteria

  • Candidate assertions can be listed with evidence, lifecycle, target, and context-policy fields.
  • A candidate can be accepted into an active assertion without losing original candidate/evidence provenance.
  • A candidate can be rejected with a reason and later read as rejected when non-active statuses are requested.
  • A candidate can be superseded by a replacement assertion, with candidate -> active assertion lineage represented by refs.
  • CLI and Python API expose list and judgment workflows.
  • Candidate rows appear in the feat(ops): expose unified archive debt views across import, index, embedding, and transforms #2179 archive-debt cockpit as actionable debt.
  • Context compiler/read surfaces continue to default candidate/no-inject behavior unless promotion policy changes it explicitly.
  • Docs explain candidate, judgment, active, rejected, deferred, and superseded lifecycle semantics.

Required tests

Keep tests behavioral; do not add absence/rename memorial tests.

Storage:

  • tests/unit/storage/test_archive_tiers_assertions.py::test_candidate_assertion_acceptance_creates_active_assertion_with_lineage
  • tests/unit/storage/test_archive_tiers_assertions.py::test_candidate_assertion_rejection_preserves_reason_and_filtering
  • tests/unit/storage/test_archive_tiers_assertions.py::test_candidate_assertion_supersede_records_replacement_and_lineage

API:

  • tests/unit/api/test_facade_contracts.py::test_facade_judges_candidate_assertion_in_user_tier
  • tests/unit/api/test_facade_contracts.py::test_no_undiscovered_async_methods

CLI:

  • tests/unit/cli/test_assertion_candidates.py for JSON list and judgment smoke.

Archive debt:

  • tests/unit/operations/test_archive_debt.py::test_archive_debt_reports_candidate_assertions_as_actionable

Generated surfaces:

  • devtools render all --check
  • devtools verify --quick

Non-goals

  • Do not build a full project-management approval system.
  • Do not add a new root command.
  • Do not auto-promote candidates based on confidence alone.
  • Do not block or reopen Unify user overlays as evidence-linked assertions #1883 unless source inspection proves assertion storage itself is incomplete.
  • Do not create a parallel memory, KV, or user-state truth system.

Forensic audit reinforcement

The 2026-06-19 static audit treats #1883 as closeable for the assertion substrate after lifecycle/defaults/terminal-row work. This issue owns the remaining product workflow: candidate promotion through explicit judgment.

This workflow should also help retire older user-state overlay semantics cleanly. Candidate claims, marks, corrections, caveats, lessons, and decisions should converge on assertion lifecycle plus explicit operator judgment rather than reviving a separate memory/KV/user-state system.

Activity

  1. added
    type:feat
    theme:agent-workflow
    theme:evidence-trust
    area:daemon
    on Jun 19, 2026
  2. Sinity commented on Jun 21, 2026

    @Sinity
    OwnerAuthor

    Closure-integrity note from the current issue audit: the implementation surface appears to be polylogue mark candidates ..., not the older polylogue ops state candidates ... path described in this issue body.

    I am not reopening this issue on that basis because the behavior exists under the better current owner. But future readers should treat the ops state candidates examples in the body as superseded by:

    polylogue mark candidates list --format json
    polylogue mark candidates accept assertion:<candidate-id> --reason TEXT --format json
    polylogue mark candidates reject assertion:<candidate-id> --reason TEXT --format json
    polylogue mark candidates defer assertion:<candidate-id> --reason TEXT --format json
    polylogue mark candidates supersede assertion:<candidate-id> --kind summary --body TEXT --format json

    The durable cleanup owner is reopened #1883: assertion-backed public vocabulary still needs to be synchronized around candidate judgment, blackboard/note naming, and the remaining user-state adapter names.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:cliarea:daemonarea:mcparea:storagetheme:agent-workflowtheme:evidence-trusttype:feat

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions