F5: cross-rung format contract + round-trip (#14) #15

Merged
benstull merged 11 commits from feature/14-cross-rung-format into main 2026-06-11 06:07:39 +00:00
Owner

Summary

Implements Feature #14 (F5) per the graduated spec vscode-cowriting-plugin-content/specs/coauthoring-cross-rung-format.md — the .threads/ sidecar graduates from the editor's private shape into the published cross-rung contract.

  • SLICE-1 — contract published: normative prose (specs/coauthoring-sidecar-contract.md v1.0, content repo, INV-14) + JSON Schema (schemas/coauthoring-sidecar.schema.json) + rung-neutral validator (scripts/validate-sidecar.mjs, ajv dev-only); schema wired into the unit suite (drift fails CI).
  • SLICE-2 — writer conformance: Provenance.email + agent.onBehalfOf (git's identity model, fork c); serializer unknown-field preservation at every level (INV-15); isNewerMajor + store write-refusal backstop; VersionGuard — newer-major sidecars render best-effort, warn once, write nothing (INV-16, PUC-4); currentAuthor() populates email from workspace git config, fail-open.
  • SLICE-3mergeArtifacts: pure 2-way union-by-id, deterministic symmetric tie-breaks, every resolved divergence surfaced in conflicts (INV-17); throws on differing majors.
  • SLICE-4scripts/crossrung-reply.mjs Gitea-rung stand-in (independent contract implementation; byte-fidelity unit test is the drift tripwire) + host E2E: editor thread → stand-in reply → external change → reply renders at the re-resolved anchor (PUC-2); newer-major warning + untouched bytes (PUC-4).
  • SLICE-5 — README cross-rung section.

All additive — schemaVersion stays 1; existing sidecars unchanged.

Test plan

  • npm run typecheck clean
  • npx vitest run — 98 passed (schema validation, identity, INV-15 preservation, INV-16 refusal, merge cases, stand-in byte-fidelity)
  • npm run test:e2e — 18 + 3 passing (incl. F5 round-trip + fail-safe)

Closes #14

🤖 Generated with Claude Code

## Summary Implements Feature #14 (F5) per the graduated spec `vscode-cowriting-plugin-content/specs/coauthoring-cross-rung-format.md` — the `.threads/` sidecar graduates from the editor's private shape into the published cross-rung contract. - **SLICE-1** — contract published: normative prose (`specs/coauthoring-sidecar-contract.md` v1.0, content repo, INV-14) + JSON Schema (`schemas/coauthoring-sidecar.schema.json`) + rung-neutral validator (`scripts/validate-sidecar.mjs`, ajv dev-only); schema wired into the unit suite (drift fails CI). - **SLICE-2** — writer conformance: `Provenance.email` + `agent.onBehalfOf` (git's identity model, fork c); serializer unknown-field preservation at every level (INV-15); `isNewerMajor` + store write-refusal backstop; `VersionGuard` — newer-major sidecars render best-effort, warn once, write nothing (INV-16, PUC-4); `currentAuthor()` populates email from workspace git config, fail-open. - **SLICE-3** — `mergeArtifacts`: pure 2-way union-by-id, deterministic symmetric tie-breaks, every resolved divergence surfaced in `conflicts` (INV-17); throws on differing majors. - **SLICE-4** — `scripts/crossrung-reply.mjs` Gitea-rung stand-in (independent contract implementation; byte-fidelity unit test is the drift tripwire) + host E2E: editor thread → stand-in reply → external change → reply renders at the re-resolved anchor (PUC-2); newer-major warning + untouched bytes (PUC-4). - **SLICE-5** — README cross-rung section. All additive — `schemaVersion` stays 1; existing sidecars unchanged. ## Test plan - [x] `npm run typecheck` clean - [x] `npx vitest run` — 98 passed (schema validation, identity, INV-15 preservation, INV-16 refusal, merge cases, stand-in byte-fidelity) - [x] `npm run test:e2e` — 18 + 3 passing (incl. F5 round-trip + fail-safe) Closes #14 🤖 Generated with [Claude Code](https://claude.com/claude-code)
benstull added 11 commits 2026-06-11 06:07:31 +00:00
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
benstull merged commit 4651410136 into main 2026-06-11 06:07:39 +00:00
Sign in to join this conversation.