Skip to content

spec(phase-4): Cave surfaces data contract (threads-986.17.1)#1

Merged
BunsDev merged 1 commit into
mainfrom
spec/phase-4-cave-surfaces
Jul 17, 2026
Merged

spec(phase-4): Cave surfaces data contract (threads-986.17.1)#1
BunsDev merged 1 commit into
mainfrom
spec/phase-4-cave-surfaces

Conversation

@BunsDev

@BunsDev BunsDev commented Jul 15, 2026

Copy link
Copy Markdown
Member

Phase 4 opening deliverable per bead threads-986.17.1 — the written contract between coven daemon memory state (weaves, tension, ward_audit, ~/.coven/pending/ staged writes) and the Cave UI, written before any UI code.

OpenTrust MEMORY-API-CONTRACT.md shape (contract-first, freshness metadata everywhere, evidence over summaries) — coven-cave stack, nothing vendored.

Covers:

  1. Read models — TensionView (crate's 3 states + UI-only unknown/stale fail-closed states), WeaveSummary/WeaveDetail, ThreadView, StrandView (+ Frayed current-vs-expected diff), AuditEntryView, ProposalView
  2. Eight API routes — approve/reject are thin daemon-forwarders (UI never mutates protected memory)
  3. Response envelope — observedAt/staleAfter/sourceCursor/adapter/verified on every response
  4. Fail-closed rendering rules R1–R11, each one a required fixture + test
  5. Metaphor-referent glossary for UI copy (§2.5 one layer up)

Epic: threads-986.17 · Phase 3 freeze verified (.14, .11 closed) · fixtures-first until .19 merges.

…shness, fail-closed rendering

Written first per threads-986.17.1, before any UI code. OpenTrust
MEMORY-API-CONTRACT shape (contract-first, freshness everywhere,
evidence over summaries), coven-cave stack. Covers: read models
(TensionView with UI-only unknown/stale fail-closed states, Weave/
Thread/Strand views, ward_audit row, PendingProposal), eight API
routes (approve/reject as thin daemon-forwarders), response envelope
(observedAt/staleAfter/sourceCursor), R1-R11 fail-closed rendering
enumeration, metaphor-referent UI glossary.

Co-authored-by: Sage <sage@opencoven.local>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@BunsDev
BunsDev marked this pull request as ready for review July 17, 2026 14:35
Copilot AI review requested due to automatic review settings July 17, 2026 14:35
@BunsDev
BunsDev merged commit a55d99a into main Jul 17, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds the Phase 4 “Cave surfaces” contract spec that defines the read models, API routes, response envelope freshness metadata, and fail-closed rendering rules for the Coven Cave UI to consume daemon memory state (fixtures-first until daemon integration lands).

Changes:

  • Introduces a new contract document (PHASE-4-CAVE-SURFACES.md) describing sources of truth, adapters, and normalized UI-facing JSON read models.
  • Specifies the Phase 4 API surface (8 routes) and a uniform response envelope with freshness/verification metadata.
  • Enumerates fail-closed rendering rules (R1–R11) and a glossary binding metaphor terms to referents for UI copy.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +108 to +112
{
"id": "weave-uuid",
"familiarId": "sage", // human-readable id, as ward_audit stores it
"threadCount": 4,
"tensionRollup": { "state": "frayed", "…": "worst contained thread state; §4.R1" },
Comment on lines +187 to +191
"eventType": "proposal_submitted|proposal_approved|proposal_rejected|proposal_vetoed|ward_updated|validation_verdict|compaction_ledger",
"proposalId": "uuid | null",
"familiarId": "sage",
"wardVersion": "string | null",
"wardHash": "hex", // weave_hash at decision time — binds decision to authority state

| # | Route | Method | Returns |
|---|---|---|---|
| 1 | `/api/weaves` | GET | `WeaveSummary[]` — optional `?familiar=<id>` filter |
BunsDev added a commit that referenced this pull request Jul 18, 2026
…uqx)

Add substantive annotations from Sage and Echo review (2026-07-18):

Decision #1: rationale callback — ApprovalPath is authoritative, Channel is
derived; if enforcement rule shifts, revisit all eight decisions.

Decision #2: audit implication — close event needs reason field
(applied|vetoed|expired|superseded); delayed-apply without it is a post-hoc
audit black hole.

Decision #3: forward-only promotion — retroactive region projection corrupts
authority trail with apparently-authored writes from before promotion.

Decision #4: fail-closed on extraction ambiguity — not silent LLM fallback;
ambiguity is an explicit ignored/blocked state.

Decision #5: RFC provenance pointer added.

Decision #6: Cave ProposalView labeled [DESIGNED, NOT SHIPPED] from the start.

Decision #7: label-variant round-trip is daemon wire contract (load-time reject
on drift); Cave has zero policy freedom over label strings.

Decision #8: proposal_window_opened paired with close event; window is a
first-class audit interval.

threads-uqx.3 design constraints (Sage): evidence_replay_hash on
ProposalClassification; VetoWindow.min_visible: Duration; label mapping as
daemon wire contract.

Co-authored-by: Sage <sage@opencoven.dev>
Co-authored-by: Echo <echo@opencoven.dev>
Co-authored-by: Nova <nova@opencoven.dev>
@BunsDev
BunsDev deleted the spec/phase-4-cave-surfaces branch July 19, 2026 17:13
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.

2 participants