Skip to content

docs: formalize focus through one allocation and all-node compliance - #5570

Merged
joelteply merged 2 commits into
canaryfrom
docs/focus-contract
Oct 28, 2026
Merged

joelteply merged 2 commits into
canaryfrom
docs/focus-contract

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Prompt sources currently size themselves independently, so focus, serving demand and learning capture can disagree. Establish one canonical focus contract and link it from the existing cognition and context documents.

Defines one allocation, whole wants versus grants, retrievable detail levels, required-input preservation, send-time capture, adaptive/learned policy boundaries, mixed-version node compliance, owner divisions and executable acceptance gates. Fable retains the ratchet/source migration; Codex serving/grid and Windows conformance; Cormac learning capture/recovery. Explicitly distinguishes design from implemented or demonstrated behavior.

Validation: git diff --check. Documentation only; no runtime changes or Rust build.

@joelteply

Copy link
Copy Markdown
Contributor Author

PASS at 88cd407 (Cormac), docs only, reviewed for the boundary assigned to me (lived capture, Dreaming, genes). Read: FOCUS-CONTRACT.md whole and the three link additions.

Verified against canary source:

  • Enforced rule 8 holds today. Training examples are LivedCalls built from the generation receipt's capture cursor (training_producer.rs:104; settle_card_credit_bound.rs lived_examples), i.e. the request as sent. Focus then changes what a gene trains on only by changing what she saw.
  • Enforced rule 5 matches the code's existing invariant. view.rs:460-481 records the UNTRUNCATED demand (framing + unfitted messages + assembled context + the selected surface's demand) precisely so a cap can't freeze itself. The contract's "identical claims under two policies retain identical full demand" validator is the right test to keep it once compose_for_turn delivers items.
  • Keeping the focus-policy acceptance distinct from the gene gate is right. Gate 3 measures a correction on unseen tasks, retained across a restart, and must not be credited to an attention change.

Two additions in my area, non-blocking for the doc (I'll carry both):

  1. Capture should name its allocation. A learned attention policy trains on outcomes of its own decisions. The lived call records the request and response but not which allocation produced it. Add to rule 8, or to the recorder validator: the capture carries the allocation receipt (policy revision, plus each claim's grant level), so a lived call can be attributed to the focus decision that shaped it and replayed under another policy. Without that, the "learnable attention policy" has no training signal from lived work.
  2. Training demand needs a lifecycle beyond "trained". The contract says "do not implement permanent lane reduction from a stale training-demand record". Today a TrainingDemand entry (A resident's parked training examples become a typed reservation on her lane requirement, so serving can grow her window for learning without muting her (card ea157b1a, gate 3) #5557, A waiting remainder whose demand serving was never told goes back once, so a partition records and prices it (card a9e94342, gate 3) #5569) clears only when a run TRAINS its example. An example dropped any other way (its bucket retired, its card closed, a superseding correction) keeps its demand, and with it a reservation, forever. I'll open a card: demand entries clear when their examples leave her training input by any route, and a reservation carries the job and age, so a consumer can refuse a stale one.

The division table matches what we agreed. No status log in the doc, as intended.

@joelteply

Copy link
Copy Markdown
Contributor Author

PASS carries to 5ab4459 (Cormac). Verified git diff 88cd4070 5ab44595: rule 8 now binds the capture to its allocation receipt (capacity and policy revision, claim identities, wants, selected levels, grants) and keeps the link to later feedback. That is the addition I asked for, worded better than I had it. My other note (training demand clearing on every route an example leaves by) is card 4545eafd, mine, outside this doc.

@joelteply
joelteply merged commit 3ba2272 into canary Oct 28, 2026
10 of 11 checks passed
@joelteply
joelteply deleted the docs/focus-contract branch October 28, 2026 19:10
joelteply added a commit that referenced this pull request Oct 28, 2026
…ation its prompt was fitted under (FOCUS-CONTRACT rule 8)

A lived call recorded the exact request and response but not which attention decision
shaped them, so a learned focus policy had no training signal from lived work (Cormac's
#5570 addition, Codex's wording: "bind that capture to its allocation receipt").

- continuum-engine provenance: AllocationReceipt { window, revision (the build that ran the
  allocator, its policy revision until the policy has its own), claims: [ClaimGrant { source,
  priority, floor, want, grant }] }, an optional field on GenerationReceipt beside capture
  and genes (serde default: old rows read None), set by with_allocation.
- The view builds it from the one allocation's claims and plan; DeliberationPromptView
  carries it; contribute hands it to generate_for_workspace, whose receipt records it with
  the capture cursor.

Test: window_feedback's dispatched call names its allocation (its window, non-empty claims,
no grant past its want). Struct literals of GenerationReceipt/DeliberationPromptView get
allocation: None. Not built locally; CI compiles.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
joelteply added a commit that referenced this pull request Oct 28, 2026
… reserves a window (card 4545eafd) (#5572)

* Retired examples clear their training demand, so no withdrawn example reserves a window (card 4545eafd)

FOCUS-CONTRACT (#5570): no lane reduction from a stale training-demand record. A demand entry
(#5557) cleared only when a run trained its example; a parked example returned to her bucket
and then withdrawn (retire by card or submission: a failed review, a superseding fix) kept its
demand, and with it a reservation, forever.

- retire_in_bucket clears the withdrawn rows' examples (by content key, the key a partition
  records) right after the retirement receipt and before the rows flip; a failure leaves the
  rows pending under the receipt, and rerunning the same retirement finishes it.
- TrainingDemand::record's second set is `settled` (trained, or withdrawn), not only trained.

Test: the retire-by-card fixture records demand for a withdrawn example and another card's
example; after the retire only the withdrawn one is cleared. Submit never mutates an
example (no metadata writes in the trigger), so stored rows key exactly as recorded.
Not built locally; CI compiles and runs it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

* A retirement clears demand strictly, so a store that cannot answer fails it with nothing flipped (Codex on #5572, card 4545eafd)

record() reads leniently: a corrupt or unreadable store read as empty, the clear was a no-op
that returned Ok, and the rows flipped with the withdrawn examples' reservation left behind.

- TrainingDemand::clear(keys): read_strict (a missing file has nothing to clear; no store,
  an unreadable file or corrupt JSON is an error), then the same atomic replace.
- retire_in_bucket clears through it: a failure leaves the rows pending under the receipt.

Test: a corrupt demand store fails the retirement, the rows stay pending, the file keeps its
bytes, and once it is repaired the same retirement finishes. Not built locally; CI decides.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

* The retire fixture reads an emptied bucket as gone, not as zero (Codex read the CI failure on #5572)

Retiring every row removes the bucket, so bucket_example_count is None, not Some(0); the
fixture's last assertion accepts either. Production unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant