@sema-agent/core 7.68.1 → 7.68.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +49 -0
- package/dist/agents/repair-loop.js +1 -1
- package/dist/agents/verify.js +1 -1
- package/dist/core/engine-capabilities.d.ts +8 -1
- package/dist/core/engine-capabilities.js +1 -1
- package/dist/core/file-history-store.d.ts +229 -44
- package/dist/core/file-history-store.js +288 -93
- package/dist/core/runner/contracts.d.ts +1 -1
- package/dist/core/runner/file-history-request.d.ts +10 -2
- package/dist/core/runner/file-history-request.js +17 -1
- package/dist/core/runner/file-history-restore.d.ts +11 -4
- package/dist/core/runner/file-history-restore.js +19 -5
- package/dist/core/runner/prepare-file-history.js +3 -3
- package/dist/core/runner/rewind-files.js +11 -8
- package/dist/core/store-contracts/file-history-store-contract.js +210 -13
- package/dist/core/task-spec-members.d.ts +31 -18
- package/dist/core/task-spec-members.js +11 -8
- package/dist/core/task-spec.d.ts +7 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/orchestration/goal.js +3 -1
- package/dist/stores/file/file-history-store.d.ts +5 -3
- package/dist/stores/file/file-history-store.js +42 -60
- package/package.json +2 -2
- package/test/export-surface.snapshot.json +17 -1
- package/wire-changes/core-stores-sql@7.68.2.json +39 -0
- package/wire-changes/core-stores-sql@7.68.3.json +39 -0
- package/wire-changes/core@7.68.2.json +612 -0
- package/wire-changes/core@7.68.3.json +125 -0
- package/wire-changes/mods-kernel@7.68.2.json +39 -0
- package/wire-changes/mods-kernel@7.68.3.json +39 -0
- package/wire-changes/primitives@7.68.2.json +39 -0
- package/wire-changes/primitives@7.68.3.json +39 -0
- package/wire-changes/wiki-gate@7.68.2.json +39 -0
- package/wire-changes/wiki-gate@7.68.3.json +39 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,52 @@
|
|
|
1
|
+
## 7.68.3 — 2026-11-14
|
|
2
|
+
|
|
3
|
+
### A composition's later legs continue the session its first leg entered and never enter it again: a file rewind, a branch point and the other operations a run performs on entering a session now act once, on the leg that enters (#4510; behavior change; narrowing: one, below, open to veto @server; widening: none; two further changes of reading, below (a goal handed an empty `sessionId`; a session deleted between two legs); hard-breaking: none; closed sets: none; exports: none; wire: none)
|
|
4
|
+
|
|
5
|
+
- **Before.** The verification gate's fix legs (`runWithVerification`, `runDeveloperTask`, `verifyCompleted`, `resumeWithVerification`), the repair loop's later attempts (`runRepairLoop`) and a goal's later iterations (`runGoal`) were built from the caller's whole spec plus the session to continue, dropping only `wake`. Every other session-bound member rode along, so each later leg entered the session again: `rewindFilesTo` (and `resumeAt` + `restoreFiles`) converged the tracked files back to the target boundary before the leg ran — over the earlier legs' edits, deleting the files they had created — and `resumeAt` branched the session again, so the later leg was not shown the earlier legs' turns. Measured on 7.68.2 (real Runner, scripted model, real files, the in-memory file-history store): with `{ rewindFilesTo: <turn>, verify }` the fix leg started on the target turn's bytes (`a.txt` back to the target turn's, the first leg's new `b.txt` gone) and the run ended `completed` with `verification.verdict: "PASS"` after two rounds; each later fix round did the same (three rounds: every fix leg started on the target turn's bytes); so did the repair loop's repair attempt and a goal's second iteration; with `resumeAt` alone (no `restoreFiles`) the fix leg's first request no longer held the first leg's turn — the branch point is taken again on every later leg whether or not files are restored (the read-only review leg, three fix legs: the session branched four times on 7.68.2, once on 7.68.3).
|
|
6
|
+
- **Affected versions.** Measured on 7.68.2 only. By reading the code, every release read — 7.50.0, 7.60.0, 7.66.0 and each of 7.67.0 – 7.68.2 — builds the fix leg, the repair attempt and the goal iteration from the caller's whole spec with a new `sessionId`, and `rewindFilesTo` is a `TaskSpec` member at 7.50.0 (read, not run, on those; releases before 7.50.0 were not read). No release read is free of it.
|
|
7
|
+
- **Now.** The session-bound column of `TaskSpec` has two kinds: the session's address and the run's demand on it (`sessionId`, `requireExistingSession`), and the operations a run performs on entering it (`wake`, `resumeAt`, `resumeAtMode`, `restoreFiles`, `acceptPartialRestore`, `unplacedHistoryRecordedUnder`, `rewindFilesTo`). A later leg of a composition runs in the session the leg before it reported and carries none of the entering operations; `requireExistingSession` rides on as the caller wrote it (a session gone between the legs is still refused `resume.session_not_found`, as before). The leg that enters keeps its members and applies each exactly once: a call's first leg (the caller's spec as written), and a resumed repair loop's first attempt (it enters on its carried diagnoses; it opens on an objective of its own and so, as in 7.68.2, does not carry `wake` — a leg opens on an objective or on `wake`, never both). A member added to either kind later is read by its kind. Measured, same lane, same scripted model (7.68.3): the fix leg starts on the first leg's bytes (`a.txt` as the first leg wrote it, `b.txt` there) and is shown the first leg's turn; every restore the history store performs happens while the first leg is being prepared, none after any leg reached the model; three rounds, the repair attempt and the goal's second iteration read the same.
|
|
8
|
+
- **Behavior change, `runGoal` with an empty `sessionId`.** Iterations from the second on now continue the session the previous iteration ran in. Before, `sessionId: ""` was handed to every iteration and each one ran in a session of its own (measured on 7.68.2: the two iterations in two sessions, the second not shown the first's turn), so the goal's work was split across sessions. A named `sessionId` is unchanged (every iteration in it, measured on both); a goal that names none still mints one session id for the whole goal, as before (by the code, not measured).
|
|
9
|
+
- **Behavior change, a session gone between the legs.** When the session is deleted between two legs and the caller did not write `requireExistingSession`, a later leg used to be refused only as a side effect of the entering operation it re-applied — `rewind_snapshot.unresolvable` (`rewindFilesTo`) or `resume_at.not_found` (`resumeAt`), the target being absent from the new session's log (measured on 7.68.2, the default `TtlSessionStore` without a repository, the session released by the host after the first leg — that store deletes an unplaced row on `release`; an idle sweep does the same by the code, not measured). It now continues by `sessionId` alone and, like a later leg of a caller that wrote no entering operation, runs on a newly created empty session (measured on 7.68.3: `completed`, `verification.verdict: "PASS"`, the leg's request without the earlier turns; the leg started on the files as the first leg left them). The repair loop and a goal read the same way (the read-only review leg's probe, the `rewindFilesTo` shape; on 7.68.2 all three roads were refused `rewind_snapshot.unresolvable`): the repair loop's later attempt runs on the new empty session and the loop ends `candidate_only`; a goal's later iterations run on it and the goal ends `max_iterations`. To have it refused, write `requireExistingSession: true`: the later leg keeps it and is refused `resume.session_not_found` before reaching the model, on 7.68.2 and 7.68.3 alike (measured: the verification gate by the pin; the repair loop and a goal by the review leg's probe, refused on the second leg on both releases). A later leg that requires its session on its own is #4521. Nothing here deletes a session: on the default store with the row left alone, the session row is still there after the first leg and the fix leg continues it (measured, both versions).
|
|
10
|
+
- **Narrowing (open to veto).** A caller that relied on a fix leg / later attempt / later iteration re-applying its rewind or its branch point no longer gets it: the later leg starts on the files and the conversation the leg before it left.
|
|
11
|
+
- **Not changed.** `runCascade` still drops the whole column from every rung, the first included: a `rewindFilesTo` / `resumeAt` handed to a cascade is not applied, and nothing on the result says so (measured on both versions: zero restores, the rung in a session of its own, no `rewindNotes`; #4519). A workflow agent spawned without a governance object (the trusted-dev lane passes the script's whole spec) that names `sessionId` and an entering member would apply that member again on a stall / throttle retry — read from the code, not measured (#4520); under governance the script cannot name the column (its whitelist and the column share no member, by the code). An untyped `rewindFilesTo` in `resumeWithVerification`'s resume config is not refused by the resume door: the resumed leg applies it once (measured on both versions; its fix legs no longer apply it again, 7.68.3); and a goal's `doneCheck` state still carries the session id the caller preset, which with an empty `sessionId` is not the session the iterations ran in (read from the code, not measured) — both #4522. The repair loop's clean restart already ran without the column (a session of its own, measured on both).
|
|
12
|
+
- **Rules.** The column's one reading becomes two kinds read off the same table (`withoutSessionBinding` drops both, unchanged); the per-call-site spread `{ ...spec, sessionId }` at the three later-leg sites is gone — one derivation (`withOpeningObjective(spec, objective, continues?)`) answers both the entering leg and a later leg; −1 behavior (entering operations re-applied per leg); `runGoal`'s later iterations read the session the same way the gate and the repair loop do (the previous leg's result).
|
|
13
|
+
- **Pins.** `test/backlog4510-later-leg-session-entry.test.ts` — V1–V11 (the gate: rewind, multi-round, `resumeAt` + `restoreFiles`, `resumeAt` alone, the qualifiers, the fix leg's spec, `verifyCompleted` and `resumeWithVerification` handed the column untyped, `requireExistingSession` with the session gone, then the two readings: the default store between the legs, and the session gone without `requireExistingSession`), R1–R3 (repair attempt, the clean-restart road, a resumed loop's entering attempt), G1–G4 (goal: rewind, branch, empty `sessionId`, named session), T1–T4 (the derivation reads the kinds), C1 (the cascade reading); 17 of 23 red on 7.68.2, 23 of 23 green on the fix; ten mutations, each red on its cells (implementation car's lane log).
|
|
14
|
+
- **Consumers.** @server: the admission door's refusal of a file rewind (`rewindFilesTo`, and `resumeAt` + `restoreFiles`) beside `verify` can be lifted for a deployment whose engine is 7.68.3 or later — raise the engine requirement to 7.68.3 and drop the refusal under it: the rewind is applied once, before the implementation leg, and never again in the gate (pins V1–V8). `runRepairLoop` and `runGoal` read the same if you expose them. The condition holds for a resume whose configuration carries no entering operation: the engine's resume door still accepts an untyped `rewindFilesTo` in `resumeWithVerification`'s resume configuration and applies it once on the resumed leg, on 7.68.2 and 7.68.3 alike (7.68.3 only stops that run's fix legs from applying it a second time, pin V8; the door's own acceptance is #4522) — keep it out of what you hand the resume. Keep the refusal beside `cascade`: a cascade does not apply the member at all (above). No export, wire or closed-set change; no consumer code is asked for.
|
|
15
|
+
|
|
16
|
+
## 7.68.2 — 2026-11-13
|
|
17
|
+
|
|
18
|
+
### A file rewind writes a recorded version only under the directory it was recorded under — one recorded elsewhere is refused file by file, a run that does not accept a partial restore moves nothing, and the preview and the restore name every file (#4328, closes the write shapes of #4446; behavior change; narrowing: six, below, open to veto @server @cli @client-core; widening: two, below, open to veto @server @cli; hard-breaking: none at runtime — compliance-kit cells a backend that has not followed reads red, below; closed sets: `FILE_HISTORY_REFUSAL_CLASSES` +2 (`recorded_elsewhere`, `place_unrecorded`; the same two on a refused file's `FileRestoreApplyOutcome.class`), `ENGINE_CAPABILITIES` +1 (`file_history.recorded_place`), new `FileRestoreApplyOutcome.action` (`write`, `delete`); exports: +6 functions, +2 types, none removed; signatures: `restore` and `diffStats` of `FileHistoryStore` and of both bundled stores take an optional last parameter `options` (`FileHistoryRestoreOptions`); wire: optional members only — `TaskSpec.unplacedHistoryRecordedUnder`, `RewindFilesRequest.unplacedHistoryRecordedUnder`, `files` on the restore result and the preview, `recordedUnder` / `action` on a refused row, `failed` on a `files` row, `absoluteEntriesOmitted` on the export envelope)
|
|
19
|
+
|
|
20
|
+
- **Before.** (#4446, as the 7.68.1 notes disclose it.) A version carried no fact of where it belonged: its key was relative to the root of the leg that recorded it, its `parentIdent` relative to the same root, and a restore joined the key on the root of the leg that asked. A later leg handed another root — the terminal's `/cd` / `!cd`, entering or leaving a worktree, the same session continued in another worktree; an embedder's `cwd` per leg, a fork handed another root, the deletion cascade's `adoptScope` — had the file at the same relative path under its root written with the earlier root's bytes and the rewound turn's created files deleted there, answered `complete`, while the files under the earlier root stayed as they were. Two more write paths rode the same restore. A run that does not accept a partial restore wrote every restorable file before it reached the one it refused, then answered `rewind.restore_failed` (measured: a target replaced by a symbolic link — `b.txt` written, `a.txt` refused). A fork's rewind to a turn carried from its source wrote the source's edits outside its directory back over the source's later edits (measured: `o.txt` back to `o-0` over the source's `o-2`). The preview listed names and line counts only.
|
|
21
|
+
- **Now.** One rule: a tracked entry is one file, and its identity is the directory its versions record — `parentIdent` now holds the parent's absolute real path (the nearest existing ancestor's real path with the rest of the path appended; the member is unchanged). A restore writes or deletes a version only when the place it would land on (this leg's root + the key) is that directory; otherwise the file is refused `recorded_elsewhere`, its row naming the directory (`recordedUnder`) — unless the file at its own directory already holds the version, which is a restore with nothing to do (`identical`). A version that records no directory — every version an engine before this one recorded — is refused `place_unrecorded`, unless the rewind names the directory such versions were recorded under (`unplacedHistoryRecordedUnder`, an absolute path, on `TaskSpec` and `Runner.rewindFiles`): the same comparison then judges it, and a version that records its directory never reads it. A directory renamed in place only in letter case or Unicode normal form on a volume that does not tell those apart is the same directory (its real path is the recorded one folded, and no component of the recorded path is a link); a recorded directory that now resolves elsewhere through a link is not, and nothing is written through it (`link_safety`). A boundary re-reads each tracked file where it was recorded and versions it again when that place changed, so every turn this engine runs stands on versions that name their place; it HOLDS a file (keeps its last version, reads nothing) whose recorded directory no longer resolves to itself or which is a symbolic link there now; it reads the file in that recorded directory as it stands, never through the path the leg's root joined with the key spells (so a link inside the root pointed elsewhere cannot redirect the read); and it reads a file whose history records no place (an earlier engine's, an imported one) only when its path under the root, links followed, lies under the root's real path — a key that runs through a link inside the root out of it is never read and records no place (closed in this release, pre-existing: an engine ≤ 7.68.1 read such a file and stored its bytes in the history, and an export carried them; an entry such an engine already gave a place outside the root is read there — KL-4328-l, in the known limits below); a second file whose relative name another directory's file already keys is tracked under its own absolute key, and a file already tracked under its absolute key (first edited from a leg whose root did not hold it) stays that one entry when a later leg's root holds it. A run that does not accept a partial restore, and the preview, plan first — the store's own `restore` on a view of the environment that reads the disk and performs no write: the preview is that plan's projection, and the run refuses on the plan, nothing written and nothing deleted (`Runner.rewindFiles` without `dryRun`, and a run with `acceptPartialRestore`, restore file by file as before and answer the ledger). **The zero-change guarantee ends when the plan passes**: a write that fails after it is a partial restore, reported file by file with the files already written named — a file whose bytes landed stays named when the step after the write fails: a mode change that throws leaves it in the store's ledger with `modeNotPreserved` (on 7.68.1 it was reported `failed` though its content was restored), and a file the store answers `failed` after its write or delete landed is a `files` row with that `action` and `failed: { reason }` (the run's sentence names it `written` / `deleted`). A history carried into another session (a fork's carry, the deletion cascade's step 10) or exported takes only its entries under a root-relative key (`fileHistoryEntryTravels`); an export counts what it left out (`absoluteEntriesOmitted`), never naming the paths. A version's place never crosses the export door: an export leaves out every place (`fileHistoryParentIdentTravels`), the import door refuses an envelope that carries one (`unsupported_format`, in the absolute key's words), and a root-relative `parentIdent` — an older engine's form, or whatever an envelope carries — is read as no place, never joined onto a root or a named directory. So an imported version records no place, and no value an envelope this release imports becomes a path the engine reads bytes from: an imported key is read only under the root's real path (above; the gap between that check and the read is KL-4328-k, and entries an engine ≤ 7.68.1 imported and already placed outside the root are KL-4328-l, both below), and the check resolves the key's real location — a lookup that reads no bytes and answers the same either way (a carry within one store keeps its places: they were recorded on this machine). The restore result, the run's `rewind.restore_failed` detail and the preview answer `files`: one row per file, `{ path, targetPath, action, refused? }` — `path` the history key (a relative name, or an absolute key where the relative name was another directory's file's), `targetPath` the absolute path this rewind writes or deletes (on a refused row, where it would have), `refused: { class, reason, recordedUnder? }`. `reason` is for a person; a consumer branches on `class` only, and `class` is an open set. `files` absent = an engine before this one (no per-file facts — not "nothing refused"). `filesChanged` stays: the keys of the rows not refused.
|
|
22
|
+
- **More refused (narrowings, open to veto).** ① A rewind on a leg handed another root than the one the versions were recorded under: P1 parent → child, P2 child → parent, another worktree, X1 / X2, a fork handed another root, the deletion cascade on both hops — per file, nothing written; on the verb `partial` (the same-directory files restore), on a run `rewind.restore_failed` with nothing moved. ② A whole root moved or copied to another path: refused at the new path (the version records the old one). ③ Versions recorded by an earlier engine: `place_unrecorded` until the rewind names their directory; a turn this engine runs re-versions the tracked set, so a rewind to it restores. The directory is named, never read off the version: the key's own parent under it is the place, so an earlier engine's version whose parent directory was reached through a link inside the root is refused even when named (`link_safety`: the named directory's path to the file runs through the link; rare). ④ A fork's rewind to a turn carried from its source no longer restores the source's edits outside its directory: those entries are not carried, so they appear neither in the fork's preview nor in its result. ⑤ A session synced in (export, then import on another store or machine): a rewind to a turn recorded before the sync is `place_unrecorded` wherever it runs — today it writes by relative key at whatever root the rewind runs on — until the rewind names the directory those versions were recorded under (`unplacedHistoryRecordedUnder`: restored there, `recorded_elsewhere` anywhere else); the first turn after the sync records this machine's places. And an envelope an engine ≤ 7.68.1 exported carrying an absolute `parentIdent` (a parent directory that resolved outside the root through a link) is refused whole at the import door (rare; KL-4328-g). And on a lane whose root path changes from leg to leg (a remote mount rotating), the earlier legs' versions are refused (KL-4328-b). ⑥ A file a session's history records no place for (an earlier engine's version, or a synced one) whose path under the root runs through a link out of the root — a linked directory inside the repository pointing elsewhere — is no longer re-read at a boundary: no new version, and its bytes are not stored (on ≤ 7.68.1 each boundary read the outside file and stored it); edits to it from this release on get no restore point, and a rewind refuses it (`place_unrecorded`, or `link_safety` when the directory is named). A file this engine tracks first records its own place and is read there (a file the model edits through such a link records the directory the link resolves to).
|
|
23
|
+
- **Write errors closed.** Every shape in ① (the same relative path under the new root written, the rewound turn's created names deleted); the fork rewind over the source's file outside its directory (G0, above); a same-named file below the root the session never touched, written back after a leg there (K1); the write-then-discover order of a run that refuses its restore.
|
|
24
|
+
- **Widened (open to veto @server).** A session whose history held an entry under an absolute key exported an envelope the import door refused whole (`unsupported_format`, "is an ABSOLUTE key" — measured). Such a session's file history now imports without those entries (counted in `absoluteEntriesOmitted`), and the imported relative entries are written only where the rewind names the directory they were recorded under (⑤). The door's own refusal is unchanged: an envelope that carries an absolute key is refused whole (pinned). **Widened (open to veto @cli @server).** On a volume that does not tell letter case apart (the macOS default), a directory inside the root renamed only in letter case (`Sub` → `sub`), or only in Unicode normal form (NFC → NFD), since the version was recorded: 7.68.1 refused it `link_safety`, it now restores in that directory (measured on darwin, both bundled stores — the normal-form shape by the release review; the root renamed so, and a root renamed between Unicode normal forms, restored on 7.68.1 too and still do). A directory swapped for a link to another stays refused (pinned).
|
|
25
|
+
- **Not changed.** A rewind on the same directory however it is spelled (`/tmp` and `/private/tmp`, a symbolic link to it, another letter case on a case-insensitive volume, the root renamed in letter case or Unicode form only); a `cd` the model runs inside a leg (it does not change the leg's root); a file created under a new deep directory (removed) and a file whose directory was deleted since (recreated); a conversation-only rewind; two Runners on one root; a fork on its source's directory. In this release a fork that works in a tree of its own still records no file history (the coarse rule, the carry's two-root judgment and their two sentences stay; they only refuse, and leave in 7.69.0).
|
|
26
|
+
- **Known limits.** Twelve, KL-4328-a … KL-4328-l, each stated in full in the next section; none is changed by this release, and KL-4328-l reads more widely than 7.68.1 on one shape.
|
|
27
|
+
- **The 7.68.1 known defect (#4446), item by item.** *When*: every entrance it lists — `!cd` / `/cd`, entering or leaving a worktree, the session continued in another worktree, an embedder's `cwd` per leg, a fork handed another root, `adoptScope` as the deletion cascade calls it — on all three entries: closed, each file refused, nothing written or deleted. *What happens*: the same relative path under the new root written, the same-named file deleted — closed; `complete` — now `partial` on the verb, `rewind.restore_failed` on a run; the restore the person asked for still does not happen at the new root, and now says so — each refused row names the directory its version was recorded under, and a rewind from that directory restores it; the preview — now each file with the path it writes or deletes (`targetPath`) and `delete` marked; `adopt_failed`'s sentence — rewritten: a rewind to a point before the fork is refused, as a point with no boundary on the fork, or file by file as recorded elsewhere where the fork's history was filled through another channel. *Still open*: a lane handing each leg a new instance at the same path (KL-4328-a; the advice "check the preview before a rewind" still applies there), an absolute-key entry an earlier engine already carried into a fork (KL-4328-d), and versions an earlier engine recorded, refused until the rewind names their directory (③ above).
|
|
28
|
+
- **Rolling upgrade and rollback.** A version this engine records names its place as an absolute path in `parentIdent`, a member an engine ≤ 7.68.1 reads as a root-relative parent identity: such an engine refuses a rewind to a turn recorded on this release file by file (`link_safety`, its sentence "restore target's parent chain changed identity since it was recorded"), nothing written; the turns it then records are versions with no place here (`place_unrecorded` until the directory is named, ③). Measured on one file store at one root: rows this release wrote, read by the published 7.68.1 — both turns refused `link_safety`, the file untouched; 7.68.1's next turn, read back by this release — `place_unrecorded`. So workers of the two versions sharing one store, or a rollback, refuse a rewind to a turn the other version recorded; neither writes a wrong root. An export from this release carries no place, and an engine ≤ 7.68.1 imports it as an export of its own (read from code).
|
|
29
|
+
- **Rules.** −1 reading (where a version restores: the leg's root decided it; now the version's own directory), −1 reading (a root-relative `parentIdent` was joined onto the root as a parent identity; now it is no place), +1 comparison in the shared restore half (the existing link-safety check of the recorded parent is the same comparison), +1 projection (preview = plan), +2 predicates (`fileHistoryEntryTravels` read by carry and export; `fileHistoryParentIdentTravels` read by export and the import door — one rule with the absolute key's: nothing absolute crosses the door), +2 refusal classes. A file's key: its absolute key when the store already tracks it there, else its root-relative name unless another directory's file holds that name — one file, one entry, and the retraction reads the same choice from the tracked set (it replaces "the root-relative name under whichever root the leg was handed", which tracked one file under two keys after a root change). +1 judgment: a file with no recorded place is read only where its path, links followed, lies under the root (it replaces "the key joined on the leg's root is read"); one sameness of a recorded place (its real path, or the recorded spelling folded by letter case and Unicode form with no link on it) read by the restore check, the boundary re-read and the first touch's key — it replaces byte equality, no rule added; "a file whose bytes landed is named" is one reading over the mode change and the store's own failure. Retired: the bundled stores' own preview arithmetic (`diffStats` is the plan's projection). Kept until 7.69.0: the coarse fork rule and the carry's two-root judgment.
|
|
30
|
+
- **Pins.** `test/file-history-recorded-place.test.ts` — P1 / P2 / another worktree × the three entries (rows, preview = plan, nothing written), P4 × three, X2, K1, W1 / FC × three, R8, six spellings of one directory × three, D1 / D2, a root moved / copied, ATOM-symlink, the failure after the plan, O1 × three + the re-versioning turn, O3, O4, O5 (stores the released v7.68.0 wrote, `test/fixtures/file-history-v7680/`), R17, the input's door and its two statements, the capability word, R17 (synced versions refused until named; named: restored there, refused elsewhere) and R17b (the first boundary after the sync records places), a forged envelope (`id_rsa` × an absolute place / a `..` escape / a link-directory name: refused at the door or read as no place, and an env probe sees no path outside the root handed to it), a file directly under the filesystem root, a store that reads through the env's text and path members, one file one entry (absolute-key reuse, the retraction's key, a waiting touch that does not write back a stale tracked set), an imported key through a link out of the root × {link kept, link removed} and a tracked file or its directory swapped for a link (no bytes read, nothing stored, the boundary keeps the file), a mode change that throws after the write and a store that answers a landed file failed (the file named), a root / an inner directory renamed in letter case and a root renamed between Unicode forms on a case-insensitive volume (restored; a directory swapped for a link refused), a folded spelling whose directory reads as a link or cannot be read (refused), a row an older engine left through a link kept inside the root × {an edit by the model through Write, an edit by the person} × both stores, then a turn under a directory below (a rewind at the first root to that turn restores the file as it was then — a boundary that held the row at its older version wrote the older bytes back), a place a link inside the root led to × {link kept} (captured and restored) and × {the link pointed elsewhere before the boundary's read} (the read stays in the recorded directory), K1 the other way (a rewind at the first root restores the file as it was when the turn under the second root began), Write / Edit through a link inside the root × {a directory below, a sibling tree} (keyed by the real path; restored as it was then), an ordinary backslash-named directory (a POSIX name) re-read from another root, KL-4328-l as it stands × {link removed, replaced by a directory} (a known limit, not a contract). `test/file-history-carried-absolute-keys.test.ts` — G1 / G2 / G0 × three, EX. `test/file-history-same-path-new-instance.test.ts` — KL-4328-a × three (the same cells green on v7.68.0). Compliance kit (`fileHistoryStoreContract`): E4 and the track-key coordinate cell now refuse a moved root; the import round trip restores where the rewind names the directory; new cells K1, K2, W1, older versions + the input, carry, export (entries and places).
|
|
31
|
+
- **Consumers.** @server — wiring, first: **following half is the one way to write wrong: minting a second file's absolute key (`fileHistoryTrackKeyForEdit` / `fileHistoryTrackKeyForAnnul`, the W1 cell) and the carry filter (`fileHistoryEntryTravels` in `adoptScope`, the carry cell) are followed in the same release or not at all** — the first without the second has a fork's rewind write the file its source still edits, and the carry cell's failure names that combination. Hard gates on taking this release: the cells `adoptScope carries only the entries that travel…` (your `INSERT…SELECT` copies every row: filter on `key_kind = 'root-relative'` and copy only the kept keys' boundary rows), `K1 one relative name, two files…` (your boundary re-read joins the key on the leg's root: read it through `fileHistoryResolveTrackedFile(env, root, key, versions, keyDescriptor?, signal?)` — async; its `held` answer = keep the entry's last version and read nothing — and version again on `fileHistoryPlaceProvenDifferent` beside the mode rule; this signature replaces the synchronous `(root, key, versions, keyDescriptor?)` the pre-pickup notes named, so a binding wired to that form fails to compile) and `K2 a boundary reads no file through a link out of the root…` (green with the same change as K1: an imported key that runs through a link inside the root out of it, and a tracked file swapped for a link, are held and their outside bytes never read — your store reads them today, a pre-existing hole). Also a hard gate: `export carries only the entries that travel, and no version's place…` — your SQL export leaves out every `parentIdent` that `fileHistoryParentIdentTravels` answers `false` for (the places your captures record from this release on), and every absolute-key entry (`fileHistoryEntryTravels`); not following ⇒ a 7.68.2 import door refuses your envelopes whole (`unsupported_format`). Your sync entry (a client's pushed envelope → `importHistory`) refuses whole, on this release, an envelope an exporter ≤ 7.68.1 wrote with an absolute `parentIdent` (a parent directory resolved outside the root through a link; rare — KL-4328-g); a synced session's rewind to a turn before the sync is `place_unrecorded` unless your rewind entry passes `unplacedHistoryRecordedUnder` — the caller's assertion, forwarded by the host; the engine does not check it against where the imported history really came from, and a wrong one writes by relative key at the declared root (KL-4328-h). May be held back by name in your binding (`ContractAssertionRunner` receives the cell name): `W1 a second file whose root-relative name…` (never before the carry cell; not following ⇒ W1 / FC over-refuse). Green by reusing the two shared halves: the moved-root cell, the diffStats cell; the older-versions cell and the import round-trip cell need your `restore` to pass its sixth parameter (`options`) on to `applyFileRestoreViaEnv` (not passing it ⇒ older and imported versions are always `place_unrecorded`). A `files` row gains an optional `failed: { reason }` (a file whose write or delete landed and which the store then answered failed; only on a restore, never on a preview) — a reader that does not know it still sees the row's `action`. Optional: copy `recordedUnder` / `action` onto your refused rows (not copied ⇒ the directory reaches a shell only inside `reason`). The engine previews by planning your `restore` (it no longer calls your `diffStats`): your `restore` must keep writing nothing to your own tables. Not following anything ⇒ the reroot shapes, atomicity and older versions are closed on your store with zero code; K1 reads as today; W1 / FC over-refuse. The import door's code for the new refusals (a malformed `absoluteEntriesOmitted`, a version carrying a place, a non-string `parentIdent`) is `unsupported_format`. @cli @client-core: read `files`, not only `filesChanged` — a preview whose every file is refused (a rewind on a leg handed another root) answers `filesChanged: []` with zero counts, which a shell reading only those shows as "nothing to change"; show each `files` row (its `targetPath`, and `delete` as a deletion) in the rewind preview, and on a failed restore a row's `failed` as "written (or deleted), then failed"; on a refused row show `recordedUnder` ("recorded under …: rewind from that directory"); `place_unrecorded` carries no `recordedUnder` (read it as absent) and covers both versions an earlier engine recorded and versions that came with a synced session; branch on `class` only; a fork's rewind no longer lists its source's files outside its directory; gate on `file_history.recorded_place`. After a session sync, say "N files' restore points did not come with the session" from the envelope's `absoluteEntriesOmitted`. @test: black-box criteria are in the release post (the same-root forms unchanged; each reroot form refused with nothing written on all three entries; the moved root refused; the older store refused, and restored when its directory is named).
|
|
32
|
+
|
|
33
|
+
### Known limits, not changed by this release: what the first slice of the file-rewind fix (#4328) does not cover
|
|
34
|
+
|
|
35
|
+
Each limit is stated in full here. Unless an item says otherwise, its fix is the rewind's final form (#4328): a version that records the root it was recorded under.
|
|
36
|
+
|
|
37
|
+
- **KL-4328-l — entries an earlier engine imported through a link inside the root are still read outside the root after the upgrade, and on one shape more widely than on 7.68.1.** *Which sessions*: a session whose file history an engine ≤ 7.68.1 imported (a session sync) holding a key whose path under the root runs through a link inside the root to a directory outside it (`lnk/secret.txt`, `lnk` pointing elsewhere), on which that engine then ran a turn — the turn recorded the outside directory as the file's place. The engine's own write tools do not mint such an entry: they key a file by its real path, so a file the model edits through such a link is tracked under the outside file's absolute key and restores correctly (measured through the real Write and Edit tools, then a turn under a directory below or in a sibling tree, then a rewind at the first root; NotebookEdit and the tool that saves a tool result read from code). A host that calls a store's own `trackEdit` with a path through such a link does mint it, on this release too. *What happens after the upgrade*: every boundary reads that outside file and stores its bytes in the history store — as 7.68.1 did while the link stood — **and also after the link is removed or replaced by a real directory of the same name, a shape 7.68.1 does not read (it read the path under the root): this release is wider there**. A rewind to such a turn reads the outside file once more (a hash comparison) and refuses it (`recorded_elsewhere`), writing nothing; 7.68.1, with the link removed, wrote the bytes it had stored into a recreated file under the root, and with a directory in its place refused it (`link_safety`). *Why it is not closed here*: a version does not record the root it was recorded under, so the engine cannot tell "the link is gone" from "the session moved to another root"; closing it by judging the recorded path's shape made a rewind write older bytes back on such a session after a turn under a directory below, answering `complete` (measured, and withdrawn before release). *Not affected*: entries imported or recorded from this release on — an imported key through such a link is never read (the compliance kit's K2 cell); a deployment that never imported a file history on an engine ≤ 7.68.1 (and whose host never handed a store's `trackEdit` such a path) holds no such entry.
|
|
38
|
+
- **KL-4328-k — the gap between a boundary's check and its read.** A boundary checks where a tracked file really is before it reads it (an entry that records no place: under the root's real path; an entry that records one: the place still resolves to itself and the file there is no link), and then reads it; a link swapped in between the two — an ancestor directory, or the file itself — is read (reproduced with a deterministic swap). This narrows what 7.68.1 read through such a link (any history that carried such a key, unchecked) to a process rewriting the tree at the moment of the boundary. It closes when the execution environment offers a member that opens a path without following links component by component, or answers a held handle's real location, and the capture checks the handle it reads.
|
|
39
|
+
- **KL-4328-h — `unplacedHistoryRecordedUnder` is the caller's word; never fill it with the current root by default.** The engine does not check the directory named for versions that record none against where that history was really recorded. Named wrongly, those versions are written and deleted by relative key under the named directory: a host that fills it with the current leg's root by default brings the 7.68.1 defect back for them (measured: a turn recorded under one root on 7.68.1, rewound on this release under another root with that other root named — its same-named file written with the first root's bytes, answered `complete`). Pass it only when the caller knows where those versions were recorded; left out, they are refused `place_unrecorded`.
|
|
40
|
+
- **KL-4328-a — two workspace instances at one path are one place.** The place is a path, so a lane that hands each leg a new instance at the same path rewinds there as recorded (measured; what a rebuilt instance holds is the host's lane fact); the directory named for older versions is a path too.
|
|
41
|
+
- **KL-4328-b — a lane whose root path changes from leg to leg refuses the earlier legs' versions.** The place is compared as the absolute real path the leg's execution environment sees, so where the workspace path differs between instances a rewind to an earlier instance's versions is refused (read from the server's code: its container, e2b and k8s lanes use fixed workspace paths; in reach are a host lane's random temporary root, and an image or template swapped between legs that moves the workspace's real path). A host checks its lane by reading `env.canonicalPath(<workspace root>)` on two of its instances.
|
|
42
|
+
- **KL-4328-c — the same path on another machine is the same place** (not measured; as before).
|
|
43
|
+
- **KL-4328-d — an entry under an absolute key that an earlier engine already carried into a fork is still restored by the fork's rewind** (measured on a store v7.68.0 wrote).
|
|
44
|
+
- **KL-4328-e — entries under an absolute key do not travel with a session**: a fork's carry and an export leave them out (an export counts them in `absoluteEntriesOmitted`).
|
|
45
|
+
- **KL-4328-f — "nothing written when one file is refused" holds for what the plan can read.** A failure that only the write meets (a guarded write's precondition, an I/O error, a cancel) leaves a partial restore, every landed file named.
|
|
46
|
+
- **KL-4328-g — an envelope an engine ≤ 7.68.1 exported with an absolute `parentIdent` is refused whole at the import door** (`unsupported_format`; a parent directory that resolved outside the root through a link; rare).
|
|
47
|
+
- **KL-4328-i — a named directory that does not exist** refuses each file `recorded_elsewhere` (a directory deleted since is a legitimate answer, not a bad value).
|
|
48
|
+
- **KL-4328-j — two legs on two roots touching the same relative name for the first time at the same moment track it as one entry**: no wrong write (a rewind at the second root is refused), but the second file's edits have no restore point (measured at the store by the release review).
|
|
49
|
+
|
|
1
50
|
## 7.68.1 — 2026-11-13
|
|
2
51
|
|
|
3
52
|
### A tool approval an engine before 7.67.0 parked resumes when its tool names no peer — built-in, caller and host tools; an MCP tool's row is still asked again (#4424; behavior change: a v10 row that carries its tool identity without the word `raw_name_identity` is read as written when the identity recomputes from the row's own `toolName` and `contractId` for a source that names no peer; narrowing: none; widening: one, below, open to veto @server @cli @client-core; hard-breaking: none; closed sets: none; exports: none; wire: none)
|
|
@@ -201,7 +201,7 @@ export async function runRepairLoop(runner, implSpec, config) {
|
|
|
201
201
|
const spec = restartedOnce
|
|
202
202
|
? cleanRestartSpec()
|
|
203
203
|
: isRepair
|
|
204
|
-
? withOpeningObjective(
|
|
204
|
+
? withOpeningObjective(laterAttemptSpec, repairObjective(bundle), lastResult.sessionId)
|
|
205
205
|
: isSeededResume
|
|
206
206
|
? withOpeningObjective(implSpec, implSpec.sessionId ? repairObjective(bundle) : `${implSpec.objective}\n\n${repairObjective(bundle)}`)
|
|
207
207
|
: implSpec;
|
package/dist/agents/verify.js
CHANGED
|
@@ -285,7 +285,7 @@ async function verifyCompletedPlaced(runner, result, specBase, objective, config
|
|
|
285
285
|
}
|
|
286
286
|
refuseUnhonorableInternals(internals, "before_leg");
|
|
287
287
|
const fixLegSpec = {
|
|
288
|
-
...withOpeningObjective(
|
|
288
|
+
...withOpeningObjective(allowance.spec, fixObjective(outcome.findings), current.sessionId),
|
|
289
289
|
...childClampSeats({
|
|
290
290
|
...clampSourceOf(specBase),
|
|
291
291
|
readFace: foldedRootsFace ? "roots" : specBase.readFace,
|
|
@@ -39,7 +39,14 @@
|
|
|
39
39
|
* else, each handed to the model once, and a wake with nothing handed over ends `config.nothing_to_wake` before any model
|
|
40
40
|
* request. An engine without the word refuses the key (`config.spec_unknown_key`), so a shell that wakes a session gates
|
|
41
41
|
* on the word.
|
|
42
|
+
* - `file_history.recorded_place` — a file version records the directory it was recorded under (its absolute real path) and a
|
|
43
|
+
* rewind (`Runner.rewindFiles`, `rewindFilesTo`, `resumeAt` + `restoreFiles`) writes or deletes it only there: a version
|
|
44
|
+
* recorded under another directory is refused per file (`recorded_elsewhere`, with `recordedUnder`), one that records none
|
|
45
|
+
* (`place_unrecorded`) unless the rewind names where such versions were recorded (`unplacedHistoryRecordedUnder`, which an
|
|
46
|
+
* engine without the word refuses as an unknown key); a run that does not accept a partial restore moves nothing when any
|
|
47
|
+
* file would be refused (the restore is planned first); and the preview and the restore answer `files`, one row per file. A
|
|
48
|
+
* shell gates on the word, not on a version number.
|
|
42
49
|
*/
|
|
43
|
-
export declare const ENGINE_CAPABILITIES: readonly ["inherit_env.own_credentials_withheld", "inherit_env.own_credential_values_withheld", "mods.skill_seat", "user_attachments.read_state", "task.wake"];
|
|
50
|
+
export declare const ENGINE_CAPABILITIES: readonly ["inherit_env.own_credentials_withheld", "inherit_env.own_credential_values_withheld", "mods.skill_seat", "user_attachments.read_state", "task.wake", "file_history.recorded_place"];
|
|
44
51
|
/** One word of {@link ENGINE_CAPABILITIES}. */
|
|
45
52
|
export type EngineCapability = (typeof ENGINE_CAPABILITIES)[number];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const ENGINE_CAPABILITIES = Object.freeze(["inherit_env.own_credentials_withheld", "inherit_env.own_credential_values_withheld", "mods.skill_seat", "user_attachments.read_state", "task.wake"]);
|
|
1
|
+
export const ENGINE_CAPABILITIES = Object.freeze(["inherit_env.own_credentials_withheld", "inherit_env.own_credential_values_withheld", "mods.skill_seat", "user_attachments.read_state", "task.wake", "file_history.recorded_place"]);
|