spec(proposal): Phase 5 — approval semantics over the Phase-2 Ward (threads-uqx)#6
spec(proposal): Phase 5 — approval semantics over the Phase-2 Ward (threads-uqx)#6BunsDev wants to merge 6 commits into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…s-k9s)
Cave implementation wraps route-1 data as { weaves, degraded } rather than
overloading a WeaveSummary[] with degraded entries — the wrapped shape avoids
any fabricated health fields on degraded familiars. Same-day alignment of the
2026-07-18 §2.7/R12 amendment.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
All 8 open questions resolved on Sage's recommended defaults: - ApprovalPath separate from Channel (load axis preserved) - Delayed apply only for veto windows (fail-closed posture) - Classify-first for harness regions - Deterministic + probe for invariants (not LLM-judge-only) - RFC #3/#4 blocker resolved (familiar-contract@2a5bb98) - Daemon contract before Cave ProposalView extension - Display labels preserved, typed variants internal - proposal_window_opened audit event lands with delayed apply Rename PHASE-5-PROPOSAL -> PHASE-5-APPROVAL-SEMANTICS to reflect open status. Co-authored-by: Nova <nova@opencoven.dev>
…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>
|
Independent coherence review (fresh-context, commissioned by coordinator session; reviewed branch tip 3fe72ca) — NEEDS-REVISION, record-level. Five findings before/alongside merge: HIGH — decision #1 annotation contradicts frozen Phase-0. "ApprovalPath is authoritative; Channel is a derived load descriptor. Never gate on Channel" — but frozen PHASE-0 makes Channel a first-class enforcement axis: §2.1 (every gate check = 'does thread T hold under channel C'), §5 (unknown channel → Reject), §3.3 (C7 requires SerializationMarker under Channel::Serialization; two-compaction is channel-keyed). Taken literally the rule makes C7 unimplementable, and it misbinds the Phase-0 term descriptor (§2.2) onto Channel (§2.5 violation). Rescope to: "never derive ApprovalPath from Channel" — the underlying decision (classification independence) is sound. Urgent because uqx.3–.5 are already committed on MEDIUM×4:
Verified sound: ApprovalPath lattice = RFC §5.3 exactly (incl. MUST NOT auto-promote protected surface); delayed-apply-only holds everywhere (no provisional-apply reintroduction); strand-kind and channel extension discipline respected; metaphor binding otherwise exemplary. Full analysis on bead threads-uqx. |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Authority-review remediation is now pushed in |
|
Upstream RFC/schema gate is now implemented as stacked draft OpenCoven/familiar-contract#4 ( |
* spec(proposal): draft Phase 5 approval semantics
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* spec(phase-4): align route-1 Returns with WeaveListView shape (threads-k9s)
Cave implementation wraps route-1 data as { weaves, degraded } rather than
overloading a WeaveSummary[] with degraded entries — the wrapped shape avoids
any fabricated health fields on degraded familiars. Same-day alignment of the
2026-07-18 §2.7/R12 amendment.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* spec(phase-5): record Val+Nova decisions, open Phase 5 (threads-uqx)
All 8 open questions resolved on Sage's recommended defaults:
- ApprovalPath separate from Channel (load axis preserved)
- Delayed apply only for veto windows (fail-closed posture)
- Classify-first for harness regions
- Deterministic + probe for invariants (not LLM-judge-only)
- RFC #3/#4 blocker resolved (familiar-contract@2a5bb98)
- Daemon contract before Cave ProposalView extension
- Display labels preserved, typed variants internal
- proposal_window_opened audit event lands with delayed apply
Rename PHASE-5-PROPOSAL -> PHASE-5-APPROVAL-SEMANTICS to reflect open status.
Co-authored-by: Nova <nova@opencoven.dev>
* spec(phase-5): fold Sage + Echo review into decision record (threads-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>
* feat(audit): add ApplyAudit event type, detail column, migration SQL (v0.1.4)
Closes coven-threads#5. Unblocks coven#414.
Changes:
- AuditEventType::ApplyAudit variant + apply_audit CHECK tag
- WardAuditRecord.detail: nullable JSON column for event-specific payload
- WardAuditRecord::for_apply() constructor
- apply_prev_sha256_hex() / apply_bytes_written() decode helpers
- WARD_AUDIT_MIGRATION_V014_SQL: transaction rebuild for v0.1.3 stores
- APPLY_AUDIT_DETAIL_KEY_PREV / _BYTES stable constants
- Exhaustiveness test extended; 3 new tests (shape, roundtrip, migration)
- Workspace version bumped 0.1.3 -> 0.1.4
- CHANGELOG.md created
Design: prev_sha256+bytes_written ride in detail JSON (Option A);
migration exports SQL constant, no rusqlite dep added (Option B-lite).
Bead: threads-3ym
* review(audit): add user_version ladder + explicit detail invariant doc
Addresses two Sage review notes (neither was blocking):
1. WARD_AUDIT_MIGRATION_V014_SQL now stamps PRAGMA user_version = 14
inside the transaction. Future migrations gate on 'user_version < N'
instead of substring-sniffing sqlite_master DDL. Migration doc-comment
updated to name the gate rule and explain the intentional non-idempotence
of the CREATE step (double-run fails loudly, not silently).
2. WardAuditRecord::detail doc-comment now names the full invariant for
ApplyAudit rows (prev_sha256 hex 64 chars + bytes_written u64) and
explicitly states other event types MAY leave it None or use their
own documented shape. Turns the implicit decoder contract into a
searchable spec.
CHANGELOG updated. Tests still green, clippy clean.
* feat(phase-5): core approval types — ApprovalPath, VetoWindow, ProposalClassification (threads-uqx.3)
Adds crates/coven-threads-core/src/approval.rs with the Phase-5 core type
sketch from specs/PHASE-5-APPROVAL-SEMANTICS.md §3, decisions 1/2/7/8.
Types introduced:
- ApprovalPath (AutoRegression | FamiliarCoherence | HumanApproval |
HumanApprovalWithRationale) — promotion ceremony, separate from Channel
- ApprovalPathKind — variant without inner fields for label round-trip
- VetoWindow — delayed-apply only; min_visible + duration; deadline helpers
- ProposalClassification — channel, regions, tier floor, approval_path,
evidence_replay_hash (WARD-C7 generalised)
- SurfaceRegionId — opaque region ref, full predicate in uqx.5
- WindowCloseReason — applied | vetoed | expired | superseded (decision 2+8)
- ProposalWindowAuditDetail / ProposalWindowCloseAuditDetail — detail payloads
for proposal_window_opened and close events
- ApprovalPathWireEnvelope — daemon wire format {variant, label, veto_deadline}
Key constraints enforced:
- ApprovalPath != Channel (decision 1); highest ceremony wins
- VetoWindow is delayed-apply only; min_visible <= duration (decision 2)
- display_label() + from_display_label() round-trip is exhaustive; unknown
labels return None so daemon rejects at load (decision 7)
- evidence_replay_hash on ProposalClassification (WARD-C7)
Tests: 15 passing (all approval tests green; full suite 90 passing)
Closes #8
* feat(phase-5): identity invariant predicates + advisory probes (threads-uqx.4)
Adds crates/coven-threads-core/src/identity_invariants.rs.
Types / implementations:
- FamiliarNameInvariant: PatternPredicate over Blake3 content hash of an
identity surface (e.g. IDENTITY.md). Fails closed on mismatch, snapped
thread, or missing thread (decision 4: ambiguity → reject, not fallback).
- ManifestAnchoredInvariant: PatternPredicate over manifest entry hash;
holds under Forced channel (WARD-C1..C6: must survive compaction).
- CompositeIdentityInvariant: all-components-must-hold composite predicate;
identity invariant is a unit — no partial pass.
- AdvisoryProbeResult: Gate-3 supplementary evidence shape; is_authoritative
always false; confidence validated in [0.0, 1.0].
- AdvisoryProbes: the advisory_probes block (Q4 decision) — separate from
deterministic probes block; empty means 'no advisory signals ran'.
Key constraints enforced:
- Predicate-first; no new strand kind (decision 3/4)
- Fail-closed on ambiguity (decision 4)
- advisory_probes structurally separate from probes; never sole authority
- descriptor is derived, never enforced on (§2.3)
Tests: 16 new (identity_invariants::tests), all passing.
Full suite: 106 tests, 0 failures.
Closes #9
* feat(phase-5): SurfaceRegionPredicate + Gate-4 replay (threads-uqx.5)
Adds crates/coven-threads-core/src/surface_regions.rs.
Types introduced:
- MaterializedDiff / SurfaceDiff: pure diff input; predicates are pure
functions of this (Gate-4 replay constraint — no Cave state, no stale
metadata, no agent self-report)
- RegionEvidence: predicate output; feeds ProposalClassification.affected_regions
and evidence_replay_hash; includes replay_bytes for Gate-4 deadline check
- SurfaceRegionDescriptor: derived, Cave-renderable, never enforced on
- SurfaceRegionPredicate trait: materialize (authoritative) + describe (derived)
- ExecutionPromptRegion: SOUL.md / AGENTS.md, tier-0 floor, human review
- ToolDefaultsRegion: TOOLS.md, tier-1 floor, familiar review
- HeartbeatBehaviorRegion: HEARTBEAT.md, tier-1 floor
- SurfaceRegionRegistry: classify_all + descriptors + path_tier_floor helper
Key constraints enforced:
- Classify-first; threads stay source-bound (decision 3)
- materialize is pure over MaterializedDiff — daemon-replayable at Gate-4
- replay_bytes are deterministic (sorted surface order)
- path_tier_floor = min across evidence (most protective wins)
- SurfaceRegionDescriptor never enforced on
Tests: 12 new (surface_regions::tests), all passing.
Full suite: 118 tests, 0 failures.
Closes #10
* spec(phase-5): resolve coherence review findings
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* feat(phase-5): harden authority-boundary core
Bind semantic identity evidence into Gate-4 validation, commit replay to the complete materialized diff, validate wire contracts, and make proposal audit lifecycle persistence fail closed while preserving legacy history.
Bump the breaking public API to 0.2.0 and cover the retired invariant corpus, delayed approval semantics, schema migration paths, and append-only terminal behavior.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Document Phase 5 and harden approval contracts
Updates docs and status pages to reflect Phase 4 freeze and active Phase 5 approval semantics, including a new delayed-apply scheduler diagram and expanded architecture/FAQ/glossary guidance.
In `coven-threads-core`, tightens fail-closed behavior by requiring the `auto_regression.veto` wire key, preserving stronger veto windows across path promotion, validating `ApplyAudit` detail shape and event-type accessors, enforcing advisory probe validation at deserialization, adding `#[must_use]` on key APIs, and expanding tests around these contracts.
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Nova <nova@opencoven.dev>
Co-authored-by: Sage <sage@opencoven.dev>
Co-authored-by: Echo <echo@opencoven.dev>
Summary
Records the provisional Phase 5 approval-semantics design over the Phase-2 Ward.
Val opened implementation on the recorded defaults; independent Nova attestation
and final Val freeze remain explicit human gates.
Authority constraints
Channelremains the load/enforcement axis;ApprovalPathis an orthogonalpromotion ceremony.
authorize promotion.
or Val gates.
Remaining freeze gates
threads-uqx.2: merge familiar-contract PR RFC-0001 §5.5: add S_p(F) ∈ S_p(F) as explicit closure precondition (Cody soundness flag) #3 for closure and provenance.threads-uqx.12: align RFC/schema approval-tier declarations with typeddaemon semantics.
threads-uqx.13: create an authorized, sanitized, reproducible v0.1 migrationfixture.
threads-uqx.8: complete implementation and migration fidelity.threads-uqx.7: extend the Cave contract after daemon read models exist.threads-uqx.9: independently attributable Nova coherence sign-off.threads-uqx.10: direct Val freeze or rejection.Review evidence
Fresh-context authority review identified four blocking defects. Commit
7eb8522fixes all four and a second fresh-context review reported nosignificant issues. The Beads graph is acyclic.