P5 — Overlay composer + cross-harness (compose-contract) #604

Closed
opened 2026-06-22 01:49:16 +00:00 by jason.woltje · 0 comments
Owner

P5 — Overlay composer + cross-harness (Constitution alpha)

Implements R7 + R8 of the Framework Constitution alpha (lineage: #542; design in docs/design/framework-constitution/).

R7 — Overlay composer. mosaic compose-contract <harness> merges base + SOUL.local.md/USER.local.md/STANDARDS.local.md before injection; per-harness emission; bare-launch base-only documented.

R8 — Cross-harness. Single L0 source; runtime/templates reference, never restate; tiered injection; Tier-3 anchor is a byte-equal L0 substring.

R9 (composer portion). Composer unit test: per-tier anchor + Tier-3 byte-equality.

Scope (this phase)

  • Extract testable composeContract({harness, mosaicHome}) pure fn in launch.ts; buildComposedPrompt delegates to it.
  • Overlay logic: append .local deltas after their base, in precedence order (USER.local under User Profile; SOUL.local + STANDARDS.local in a trailing # Operator Overlays block). Base-only when absent.
  • New command mosaic compose-contract <harness> → prints composed blob to stdout (inspection + tests).
  • defaults/AGENTS.md self-load fallback: one-line bare-launch overlay nudge.
  • compose-contract.spec.ts: per-tier anchors, Tier-3 byte-equality, overlay present/absent, per-harness runtime selection.

Design note (ASSUMPTION)

Overlays are injected as deltas by value under labeled sections; the base files keep their existing residency (USER injected; SOUL/STANDARDS load-on-demand). This honors §3.2 ("model gets one pre-merged blob") without re-injecting large base prose and breaking the P3 byte-budget tiering. Rationale recorded in the P5 scratchpad.

Defer to P6

CONTRIBUTING.md + harness×gate compliance matrix; resident line-count CI ceiling; aiguide reconcile; alpha tag.

## P5 — Overlay composer + cross-harness (Constitution alpha) Implements **R7 + R8** of the Framework Constitution alpha (lineage: #542; design in `docs/design/framework-constitution/`). **R7 — Overlay composer.** `mosaic compose-contract <harness>` merges base + `SOUL.local.md`/`USER.local.md`/`STANDARDS.local.md` before injection; per-harness emission; bare-launch base-only documented. **R8 — Cross-harness.** Single L0 source; runtime/templates reference, never restate; tiered injection; Tier-3 anchor is a byte-equal L0 substring. **R9 (composer portion).** Composer unit test: per-tier anchor + Tier-3 byte-equality. ### Scope (this phase) - [ ] Extract testable `composeContract({harness, mosaicHome})` pure fn in `launch.ts`; `buildComposedPrompt` delegates to it. - [ ] Overlay logic: append `.local` deltas after their base, in precedence order (USER.local under User Profile; SOUL.local + STANDARDS.local in a trailing `# Operator Overlays` block). Base-only when absent. - [ ] New command `mosaic compose-contract <harness>` → prints composed blob to stdout (inspection + tests). - [ ] `defaults/AGENTS.md` self-load fallback: one-line bare-launch overlay nudge. - [ ] `compose-contract.spec.ts`: per-tier anchors, Tier-3 byte-equality, overlay present/absent, per-harness runtime selection. ### Design note (ASSUMPTION) Overlays are injected as **deltas by value** under labeled sections; the base files keep their existing residency (USER injected; SOUL/STANDARDS load-on-demand). This honors §3.2 ("model gets one pre-merged blob") without re-injecting large base prose and breaking the P3 byte-budget tiering. Rationale recorded in the P5 scratchpad. ### Defer to P6 `CONTRIBUTING.md` + harness×gate compliance matrix; resident line-count CI ceiling; `aiguide` reconcile; alpha tag.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaicstack/stack#604