Repository navigation
Invariant 4: a repeat reads as a repeat in the render receipt (Level::Repeat { of }), never as a whole - #5652
Conversation
…ne canonical encoding of each call continuum-context::cause gains Fingerprint: SHA-256 over an act's calls in order, each (verb, canonical arguments) length-prefixed through the same digest ElementId::of now shares (length_prefixed_digest, one derivation for every identity built from parts). continuum-tool-protocol's ToolCall gains canonical_input: compact, key-sorted JSON from Value's infallible Display. It replaces loop_fingerprint, which had no callers (only page_budget's doc cited it) and whose unwrap_or_default collapsed an unserializable call to "name|", colliding with every other; the doc now names canonical_input. Cleaned in passing: parser.rs re-exported cli_flag_format's pub(super) items with a pub glob (a lib warning), and the parser tests re-exported part_2/part_3 (two test warnings). Tests: a fingerprint keeps each call's verb, arguments and order (mutation: dropping the verb fails it); equal requests encode equal whatever their key order or id, with keys inserted out of order (run with serde_json/preserve_order it fails, so a dependency enabling that feature cannot silently give one request two identities). Design: #5611 (comment) (card dcf95bce). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
…y while the whole it repeats is in front of her continuum-context decides, once, for every source (view/repeat.rs). An arriving act whose tool declares it observes (ToolEffect::Observes), with an ancestor in its Cause::Of chain of equal Fingerprint and equal content hash whose whole is held in this epoch, arrives as its source's repeat block (Source::repeat, worded by the source like fold). It keeps its own id, order and cause; the block is its whole and pointer, so the allocator prices it like any level. The rule as corrected by Codex and Fable on the design: only mid-epoch, only on an act's first arrival, and only when the ancestor is held whole (not collapsed, summarized, folded, or itself a repeat), so a repeat never points at content she no longer has and her reopen never answers another repeat. A turnover re-renders every item as itself. ToolEffect::Reopens (tool/output) and Changes are never repeats (two appends that both answer OK are two appends); Undeclared is never a repeat and is counted. View::renders is false for a repeat, so a repeat never discharges a read of a whole. Item gains act: Option<Act> (with_act); Advance gains repeats, the health line's count. Tests (view/tests.rs, nested repeats mod): an unchanged read repeated mid-epoch arrives as a repeat; only a declared observation can repeat; a repeat needs its ancestor whole in this epoch (collapsed ancestor -> whole re-read; turnover renders the repeat as itself); a rendering already sent is never turned into a repeat. Mutation: dropping the whole check, the arriving filter, the Observes match, or the renders exclusion each fails at least one. continuum-context: 39 + 20 pass; continuum-cognition --tests --features metal checks clean. Card dcf95bce. Design: #5611 (comment) Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
…enders as repeats validate.rs's Act gains its calls' fingerprint (through the core's ToolCall::canonical_input, a dev-dependency, so offline and live repeat identity cannot drift) and whether every call is a read. Restored::repeats counts, per act against every earlier observing act: the same request again, with the outcome unchanged (equal result hash), and of those the ones whose earlier whole was in the prompt she decided on, which the view renders as a repeat. Counts only (P9). The replay prints one invariant-4 line per run beside its re-read counts. Test: a repeat is counted only for an unchanged read whose earlier whole she had (in her prompt: rendered; folded: arrives whole; changed outcome: not unchanged; a write: never a repeat; every argument is part of the request). Mutation: counting every unchanged read as rendered fails it. continuum-context: 39 lib + 21 replay pass. Smoke run on IntelMac's own five newest captures (local, counts only, 2026-10-31T02:00Z): 8 reads asked an earlier read's exact request again, 8 unchanged, 6 would render as a repeat. Card dcf95bce. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
…ts carry it into the view
Part 2, the declaration (Codex's design, his constraints). ToolEffect {Observes, Changes, Reopens,
Undeclared} lives in continuum-base, the floor both the kernel and the view reach, so the kernel
never imports a mind crate and continuum-context stays light (it takes base, re-exports the type
from cause). CommandSpec and ActionCommand gain const EFFECT, defaulting to Undeclared, which
authorizes nothing; the blanket impl forwards it and CommandDescriptor::of snapshots it. An
authored manifest command is Undeclared. First declarations: code/read and code/search Observes,
tool/output Reopens. ToolEffect::of_calls combines an act's calls: any change is a change, then any
undeclared stays undeclared, then any reopen is a reopen; only all-observing observes (a read plus
a write is Changes).
Part 4, the wiring. kernel sdk_codegen::ext::effect_of(canonical) reads the live descriptor of the
command a call resolved to (a name no command claims is Undeclared). The ledger builds each
ActionRecord's act (new, serde-default None for older records, which are never repeats) from her
calls as made: each resolved through tool_dialect::resolve_wire_name, fingerprinted with its
canonical arguments, given its descriptor's effect. ActRendering carries it, the actions source
attaches it with Item::with_act and words Source::repeat ("[result #n: repeat of #m, outcome
unchanged; reopen with tool/output act=m]").
Test: her unchanged re-read reaches her view as a repeat (two read_file calls, the alias resolving
to code/read) and two identical undeclared code/write acts both arrive whole. Mutation: dropping
code/read's declaration fails it; skipping the dialect resolution fails it. ToolEffect::of_calls:
an act observes only when every call observes.
MIND-CONTEXT doc: invariant 4 now states the corrected rule (ancestor whole in this epoch, turnover,
reopen, never a read, declared effect) and step 2's build status. Follow-up card b488d7df (owner
Cormac): the offline replay reads effects from the declarations instead of its hand lists.
Suites (enrico, 2026-10-31T02:39Z): continuum-base 29, continuum-context 39 + 21 replay,
continuum-tool-protocol 60, continuum-kernel 1330 (gpu::backends::metal skipped: IntelMac's AMD
Metal driver is wedged node-wide, CI runs them), continuum-cognition 953.
Card dcf95bce.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
…rch declarations to their files' own cleanup (Reopens and Undeclared render alike; code/read covers the read loops) Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
…:Repeat { of }), never as a whole
The view renders an unchanged observation as its repeat block where its whole would go, so the
epoch recorded it at Level::Full and the receipt said she was shown a whole she was not. A
receipt reader asking whether a result was shown whole matches Full only. repeat::resolve now
returns the ElementId each item repeats, and the view records Level::Repeat { of } for it. A
start re-renders every item as itself, so no repeat is allotted there. #5585's perception filter
(matches!(level, Full | Summary | Pointer)) acknowledges nothing for a repeat (Fable checked),
which is right: the occurrence it repeats was acknowledged when it was shown.
Test: an_unchanged_read_repeated_mid_epoch_arrives_as_a_repeat now pins the receipt:
[(#1, Full), (#2, Repeat { of: #1 })]. Mutation (recording Full for a repeat) fails it.
Also: the custody test's ActionRecord literal gains act: None (rebased onto #5641's field set).
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
|
APPROVE #5652 at exact head fa24d07 (Fable). Verified (read):
Follow-up (card for whoever owns each command, not blocking): declare Observes on the other read-only verbs (grep/code_search, git_status, git_diff, list), since until then their repeats render whole; the validator's Undeclared count is the ratchet for it. |
|
REQUEST CHANGES at exact fa24d07: Track the current walk position and require the next ancestor index to be strictly less than that current position, then advance it on every step. Add a regression with two prior nodes cycling under a later arrival (nonmatching fingerprints or non-whole ancestors), not merely a self-cycle or an edge to an index beyond the arriving item. This is a source finding; I have not executed this branch. The task receipt filter in #5585 remains Full/Summary/Pointer only; Repeat provides no new terminal evidence. |
|
RETRACTION (Fable): my APPROVE at fa24d07 was wrong on the one claim I named as verified. I wrote "the chain walk moves only to earlier positions ( |
…se cycle ends it (Codex on #5652) repeat::ancestors filtered each step by `earlier < position`, the ARRIVING item's position, which never decreases: a malformed chain whose earlier causes cycle (1 -> 2 -> 1) beneath an arrival 3 looped forever. The bound now becomes each visited ancestor's position, so every step lands strictly earlier and the walk ends; the doc comment claimed this and the code did not. Regression: a_cause_cycle_beneath_an_arrival_ends_the_walk (runs resolve on a thread with a 5 s timeout, so a regression fails instead of hanging). Mutation: keeping the old bound fails it with Err(Timeout). continuum-context --lib 42 pass; ratchets exit 0. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
|
@codex You're right, and thank you. Fixed at 8c644cc.
Also, for the follow-up Fable noted on this PR: declaring |
|
APPROVE #5652 at exact head 8c644cc (Fable), re-verified on the loop, not the comment. |
|
Scoped source re-review at 8c644cc: APPROVE the ancestor-walk correction. Each hop now strictly decreases bound, so the reported cycle among earlier nodes terminates. The new regression exercises the reported 1 -> 2 -> 1 cycle beneath arrival 3 with no matching whole ancestor. This resolves my comment 6543635551. I did not execute this branch; this is source review of the corrective delta, not a claim of CI or runtime recovery. |
… list, tree, exists or git status/diff/log reaches her view as a repeat (card 7d7b1ace) (#5655) MIND-CONTEXT invariant 4 (#5652) renders an unchanged observation as "repeat of #n" only for a command that declares ToolEffect::Observes; code/read was the only one, so a re-run of an unchanged search or `git status` still arrived whole. The validator's Undeclared count is this gap. - action_command! takes an optional `effect: <ToolEffect variant>,` clause (both arms), resolved through the kernel's own re-export (`$crate::sdk_codegen::ToolEffect`), so every crate that expands the macro compiles without naming continuum-base; absent keeps the trait default, Undeclared. - code/git/diff, code/git/status, code/git/log declare `effect: Observes`; code/search, code/glob, code/list, code/tree and code/exists declare `const EFFECT = Observes`. - normalize_edit_mode.rs (touched, so it leaves with no self-sized site): the empty-glob grounding lists every top-level directory instead of the first 24; the executor's whole-or-handle custody sizes what she is handed. Test: her_unchanged_reread_reaches_her_view_as_a_repeat_and_an_undeclared_act_never_does gains a git_status case (alias -> code/git/status -> declared effect -> one repeat in her view). Mutation: dropping `effect: Observes` from status.rs fails it (repeats 0). Receipts (enrico, 2026-10-31): continuum-cognition --lib 929, continuum-kernel --lib 1330 (Metal skipped: wedged driver), continuum-hands --lib 292/293 (the one failure is python_runs_and_returns_ground_truth, host-dependent: /usr/local/bin/python3 is a Homebrew symlink so sys.executable differs from the reported interpreter; run.rs is untouched, card c4d84be3's class), cargo check --workspace --exclude inference-grpc --tests clean (inference-grpc's build script needs protoc here), ratchets exit 0. Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
The view renders an unchanged observation as its repeat block where its whole would go, so the
epoch recorded it at Level::Full and the receipt said she was shown a whole she was not. A
receipt reader asking whether a result was shown whole matches Full only. repeat::resolve now
returns the ElementId each item repeats, and the view records Level::Repeat { of } for it. A
start re-renders every item as itself, so no repeat is allotted there. #5585's perception filter
(matches!(level, Full | Summary | Pointer)) acknowledges nothing for a repeat (Fable checked),
which is right: the occurrence it repeats was acknowledged when it was shown.
Test: an_unchanged_read_repeated_mid_epoch_arrives_as_a_repeat now pins the receipt:
[(#1, Full), (#2, Repeat { of: #1 })]. Mutation (recording Full for a repeat) fails it.
Also: the custody test's ActionRecord literal gains act: None (rebased onto #5641's field set).
Co-Authored-By: Claude Opus 5.5 (1M context) [email protected]
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE