feat(hypothesis-map): pure model + assembler (26 H.1)#170
Closed
bryanmatthewsimonson wants to merge 2 commits into
Closed
feat(hypothesis-map): pure model + assembler (26 H.1)#170bryanmatthewsimonson wants to merge 2 commits into
bryanmatthewsimonson wants to merge 2 commits into
Conversation
Phase 26 slice H.1 (docs/HYPOTHESIS_MAP_DESIGN.md §2–§3): - src/shared/hypothesis-model.js — two chrome.storage.local maps (case_hypotheses, hypothesis_edges) on the EvidenceLinker pattern: canonical claim refs with drift-tolerant matching, deterministic content-hashed ids (label is hypothesis identity), idempotent create, immutable structural fields, suggested_by provenance (user/llm/nostr), supports|undermines role vocabulary local to the module (undermines deliberately NOT in CLAIM_RELATIONSHIPS), no wire-publish fields until H.5 is a decision. - src/shared/hypothesis-map.js — the case-dossier split: storage-aware collector + pure buildHypothesisMap, generatedAt injected. Seeds hypotheses from brief positions (article-hash holders carried as provenance), merges persisted records by normalized label, groups edges by role with per-section counts, detects shared/opposing-edge crux claims (never netted), stamps verdict chain-head chips as context, and discloses dangling edges (P6). Scope question reads authored_fields.scope_question directly (dossier.scope is never populated — substrate note C1). - Reader claim-delete cascades hypothesis edges beside the EvidenceLinker hook, with blast-radius disclosure. - 27 tests incl. the §6 grep guard (no weight/score/probability/ confidence/strength key anywhere in the assembled map, no allowlist) and a determinism deepEqual. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Confirmed findings from the multi-agent review of the H.1 diff: - WORKSPACE_CLEAR_KEYS gains case_hypotheses + hypothesis_edges — authored structure, same class as evidence_links (the list's own contract: extend it when a new content store ships). Pin test updated. Backups need no change (backup.js carries all of storage.local minus exclusions). - Seed loop: two brief positions whose labels normalize equal now UNION into one hypothesis (holders deduped by hash, first core_argument kept) instead of silently dropping the later one; blank-label positions are disclosed via coverage.unlabeled_positions (P6). - Cascade deletes write dependents FIRST (edges, then the hypothesis record — the confirmDeleteClaim order), so a death between writes leaves a visible re-deletable state, never invisible orphan edges. - shared_claims keeps the first RESOLVABLE claim view — a null view from a snapshot-less edge no longer shadows a sibling's snapshot. - Tests: model grep guard now walks nested keys (claim_snapshot); getForCase order actually asserted (distinct created stamps); HypothesisEdgeModel.getForCase cross-case exclusion covered; duplicate/blank position labels covered; null-shadow covered; assembleHypothesisMap composition covered; the live stored-brief read covered via fake-indexeddb. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jul 16, 2026
Owner
Author
|
Landed on main via the #183 consolidation merge — this PR was auto-closed by the base-branch deletion cascade, but its commits are all in main. |
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.
Summary
Phase-26 slice H.1 (HYPOTHESIS_MAP_DESIGN.md §2–§3). Stacked on #169 — merge that first; this PR retargets to
mainautomatically.New modules
src/shared/hypothesis-model.js— twochrome.storage.localstores on the EvidenceLinker pattern:case_hypotheses(label-derived deterministic ids — label is identity) andhypothesis_edges(claim→hypothesis, rolesupports/undermines, canonical claim refs with drift-tolerant matching, idempotent create, immutable structural fields,suggested_byprovenance). The role vocabulary is local to the module —underminesdeliberately stays out ofCLAIM_RELATIONSHIPS. No wire-publish fields until H.5 is a decision.src/shared/hypothesis-map.js— the case-dossier split: storage-aware collector + purebuildHypothesisMap,generatedAtinjected, no clock reads. Seeds hypotheses from the synthesis brief's positions (duplicate-normalizing labels union; blank labels disclosed viacoverage.unlabeled_positions), merges persisted records by normalized label, groups edges by role with neutral per-section counts, detects shared/opposing-edge crux claims (never netted), stamps verdict chain-head chips as context, and discloses dangling edges (P6).Integration
WORKSPACE_CLEAR_KEYSextended with both new stores (+ pin test). Backups need no change.Constitution guards
weight/score/probability/confidence/strengthkey anywhere.deepEqual.Review
A 4-dimension multi-agent adversarial review ran against this diff; all 12 confirmed findings are fixed in the second commit (workspace-key gap, duplicate-label drop, cascade write order, crux null-shadow, and seven test-coverage gaps).
Tests: 1,752 green (33 new) · build clean ·
web-ext lint0 errors.Next
H.2 (side-by-side render on the case dashboard) follows in its own PR.
🤖 Generated with Claude Code