Skip to content

docs(planning): F1 conflict-aware-drafts — deterministic contradiction heuristics - #25

Merged
huaquanghan merged 1 commit into
masterfrom
plan/conflict-aware-drafts
Aug 28, 2026
Merged

huaquanghan merged 1 commit into
masterfrom
plan/conflict-aware-drafts

Conversation

@tinhtute

Copy link
Copy Markdown
Owner

Why

claim draft and ask currently ignore contradictions — a draft negating an approved claim is stored silently. F1 makes contradictions explicit and visible (status: conflict) without auto-resolution, closing a poisoning vector for local-first memory.

Follows mcp-v2-protocol-upgrade backlog F1 (ranked #1 by fit with trust model) — deterministic, no LLM/embed/network.

What

  • At claim draft time, scan approved claims in workspace, normalize title+body+tags, apply 3 heuristics: negation flip, value swap, status change
  • Record advisory contradicts: [{claim_id, heuristic}] in draft frontmatter (preserved via Parse/Render + digest)
  • ask returns ready approved + conflict drafts side-by-side

Status

  • Harness plan docs/plans/active/conflict-aware-drafts.md locked (01M0ZAT3BS4GS7X61V4ZZB9GY9, intake 01M0ZAYX27CD3EKSN1CWTPT4XE, lane normal, status: active)
  • To-plan complete — 2 phases planned:
    • contradiction-detection (01M0ZBG7) — heuristics + metadata + draft wiring
    • conflict-surface (01M0ZBGR, depends contradiction-detection) — query + ask JSON status: conflict
  • Source: docs/planning/CONFLICT-AWARE-DRAFTS.md (this PR) + harness plan

Checklist

Phase 1: contradiction-detection

  • W1.T1 DetectContradictions in claim.go + table tests
  • W1.T2 Contradiction type + frontmatter contradicts + round-trip + digest
  • W2.T1 wire into ClaimStore.Draft / claim draft
  • W2.T2 ScanWorkspace/Rebuild preserve contradicts

Checks: go test ./..., go vet, CGO_ENABLED=0 go build

Phase 2: conflict-surface

  • W1.T1 TrustedQuery return drafts with conflict signal
  • W1.T2 ask JSON status: "conflict"
  • W2.T1 integration test: approved → contradicting draft → reindex → ready+conflict

Checks: go test -race, make smoke, git diff --check

Next Actions

  1. work full phase contradiction-detection (next)
  2. work full phase conflict-surface
  3. check full → handoff → squash-merge

Harness

  • Prior trusted-single-runtime abandoned (inventory mismatch, superseded by 0.3.x)
  • mcp-v2-protocol-upgrade completed and moved to docs/plans/completed/
  • Single active plan now: conflict-aware-drafts

Related: #19 (brainstorm merged), mcp-v2 0.3.0 done.

@huaquanghan
huaquanghan merged commit 00e523b into master Aug 28, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant