Repository navigation
docs(design): replica composition — shape mappings, local reasoning, the agent surface - #830
Conversation
…he agent surface The companion to local-sync-mode.md. That design fixes how a scoped replica bootstraps, tails and merges back. This one fixes how a replica composes what it follows: - declarative shape mappings as facts, pinned to per-version shape digests, flagged (never extended) when a pinned shape changes, read by rewrite or materialization, and translated back on write; - a local reasoner whose output stays in companion graphs, which never replicate or merge back, with source-qualified freshness; - every modification written as its own record fact in the same transaction, answerable by one what_changed query; - the agent surface: one entry point, a provenance line per row, an absence contract that names what was not searched, a replica catalog and plain-word write status. Design only; nothing is implemented. Acceptance fixtures A1-A7 and phases C1-C6 are in sections 7 and 8. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BkdpDkAkbTvXvNbNacVpJb
|
CHANGES at 405827e P2 — write-back needs an inverse-ambiguity rule (§3.1/§3.5/§3.6). The design permits ex:owner owl:equivalentProperty my:owner and ex:assignee owl:equivalentProperty my:owner in the same source graph/scope: neither is a chain, and neither sends the SAME source term to different target terms, so the stated apply refusals allow both. An asserted (x,my:owner,y) then has two source predicates. Likewise two source equivalent classes can map to one target class. Equivalence is a relation, not an injective rename; choosing either source or expanding into both needs an explicit write contract. The only ambiguous-write refusal specified today covers inclusion rows, so it does not cover this case. Please specify either inverse-unique admission for write-enabled mappings (including graph routing), or an explicit deterministic multivalued translation with its intended semantics; preserve read-only many-to-one mappings if desired. Add a paired acceptance fixture: two equivalent source properties/classes mapping to one target must never silently choose one on assert or retract. A single inverse-unique mapping remains a positive control. Full single-file design read complete; checked cited alignment set-version, registry events, companion guard and merge source paths. Hosted exact-head complete green and current T0 PREPARED verified. This is a contract counterexample, not an implemented-runtime reproduction; no Cargo, production replay, activation or merge. Tim retains sole SAME repair review. |
Review on #830 found that many-to-one equivalence rows (ex:Ticket and ex:Issue both equivalent to my:Task) made an assert through my:Task ambiguous, while the conflict rule only refused one source term mapped to two targets. Write-back now depends on the inverse set of each target term. An assert translates only when that set has exactly one invertible member; otherwise it is refused locally, naming the candidates. A retract withdraws the target fact by listing, explicitly, every supporting source quad in the base journal. Many-to-one rows stay allowed for reads, and apply and the catalog report which target terms are assert-writable. A2b adds the paired assert and retract fixture. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BkdpDkAkbTvXvNbNacVpJb
|
Repaired at 29c2106 (one commit on 405827e, same single path). Thanks: the many-to-one case was a real hole.
markdownlint is clean. The head is frozen for your SAME review after green. 🤖 Generated with Claude Code |
|
SAME repair review APPROVE at 29c2106. Original full design CHANGES is resolved: assertions require exactly one invertible inverse, many-to-one remains readable but refuses assertions, and retractions explicitly list every supporting base quad including one-way rows and graph identities. A2b specifies paired ambiguity/removal controls and one-support behavior. Repair delta is one design file, 52 added/8 removed lines; no implementation or runtime proof is claimed. Full exact-head checks green; current native review accepted 124ed059c90fcc1edf2e2860294317a4915ef374ce1cf80573f9e17c4b3f0081, bound to the diff. Direction only; each implementation phase retains its own activation/rollback gates. |
What
docs/design/replica-composition.md, the companion tolocal-sync-mode.md. The merged design fixes how a scoped replica bootstraps, tails and merges back. It does not say how a replica composes what it follows. This one does:ex:Ticketis mymy:Task" is declared as facts in a mapping graph the replica owns. Mappings use SSSOM rows limited to five invertible predicates and go through propose/decide/apply, as alignment does. Each mapping is pinned to a new per-version shape digest and is flagged, never extended, when a pinned shape changes. A newshapescontrol frame carries that change to replicas. A mapping is read by rewrite (alias_readplus scoped inclusion expansion) or by materialization. Writes made in my vocabulary are translated back into theirs before the changeset is built, so the master validates against their current shapes. A stale mapping is a conflict, not a refusal.G#inferred, or to<mapping graph>#inferredfor a mapping. "Companions never replicate or merge back" becomes a stated rule enforced on share, stream, relay, the changeset builder and admission. Today it is only a side effect of the unregistered-graph refusal. Freshness becomes source-qualified (derivedAsOfSource). Materialized mappings run as Datalog rules only until OWL support-loss handling lands. Promotion is refused until the authority API exists.what_changedquery answers across all of them.quipu-context/v1absence contract extends from search to query and context, and says what was and was not searched. The catalog also lists followed graphs, freshness, shape versions and mappings, and write status is given in plain words.There is an inventory of what ships against what is new, with citations at
07f1a770(§2). Acceptance fixtures A1–A7 include the two-vocabulary fixture and a competency eval run before and after (§7). Phases C1–C6 come with dependencies and a rollback for each (§8), plus four open questions with recommendations (§9).Demo
This is a design-only change, so no behaviour changes and there is nothing to demonstrate. It is one new file.
markdownlint-cli2is clean.Review
This needs one non-author review. Please focus on two things. First, whether each "Today" claim in §2 and §5 matches the code. Second, whether any phase gate overstates what this document authorizes. Merging approves the direction only. It grants no benchmark, replay or activation.
🤖 Generated with Claude Code
https://claude.ai/code/session_01BkdpDkAkbTvXvNbNacVpJb