Skip to content

fix: derive reuse lineage from the fitted distillation record - #73

Merged
forrestlinfeng merged 20 commits into
EvoMap:claude/reuse-lineage-reportingfrom
imxyanua:codex/fit-reuse-lineage
Nov 11, 2026
Merged

forrestlinfeng merged 20 commits into
EvoMap:claude/reuse-lineage-reportingfrom
imxyanua:codex/fit-reuse-lineage

Conversation

@imxyanua

@imxyanua imxyanua commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary Follow-up to #69. Build reused_asset_ids from the turns retained in the fitted record sent to the model and Proxy. Assets from turns removed to satisfy the body limit are left out. ## Evidence - Before, an eight-turn session retained only recent turns in the record but attributed the resulting Gene to an asset injected in the removed first turn. - The regression now sends only the asset from the retained last turn, with the body below 256 KiB. - Distillation, prompt and architecture tests passed 60/60 on Windows Node 22.23.4 and 26.13.0. ## Merge Danger Two-way. This PR targets the #69 branch. Scope is the metadata attached to distillation requests.

Includes the captured-null owner fix also on #70 so the existing Kimi Windows hook stays within its budget during CI.

forrestlinfeng and others added 17 commits November 10, 2026 22:04
Kimi's late native terminal now goes through EvoMap#54's confirmTurnCompletion path
instead of native-turn.js / native-monitor.js / TASKS.NATIVE. The shared
mechanism gains, host-neutrally:

- a canonical turnStart event: binds the open turn's id when the host announces
  it with the turn's own prompt, then schedules the shared turn monitor
- turnStatus rows that carry record/answer, passed as recordOf through the turn
  monitor, closeUnfinishedTurn (also at session end) and recoverNativeTurns
- runtime/session-log.js: a generic JSONL turnStatus reader (bounded head+tail,
  task files, confined paths) selected by a log-shaped statusRecord/modelRecord
- the ACP runner on the configStamp + turnEnd.modelOf contract; the stamp hashes
  the config and every credential it names
- a running background check keeps a row pending

Removed: native session fields, deferred finishing, routeConflict /
modelBinding / pendingNativeCheck ranges, correctedTurn. Drafts are written
under sourceCandidate again; ones stored under sourceRange stay readable.
Kept the tested shared fixes: correction lock around distill dispatch, the
agent-Gene gate, isCurrentRange claimer + exact match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…k-c7aa95

# Conflicts:
#	lib/agent/driver.js
- SessionStart reads the owner process only for owner-change hosts; finding
  Kimi's ancestor took the hook past its 3 s budget on Windows Node 22
- a turn end clears `settling` only if it still owns that timestamp
- a distillation that throws still settles its claim; a stale range is dropped
  before calibration; model errors are redacted
- the session-log reader caches only the parsed log, so a background task that
  settles without a log write is seen; the ACP stamp comes from the same config
  read as the selected route
- a record declaration is a query or a session log, never both
- Kimi keeps a task the newest turn names again within its 64 task ids
- epochs stored per work turn by EvoMap#66 stay readable for corrections

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- the session-log tail opens one byte early, so a line starting exactly at the
  window edge is kept; the head is read in full and a header the tail cuts
  comes from it
- the ACP stamp hashes the credential the run uses from that same read
- closeTurn compares the session as sessionOf reads it
- a model answer that arrives after shutdown returns `stopped` and leaves the
  range for the next start
- a stored modelBinding stays out of the calibration corpus
- withoutExpiredLeftovers accepts a missing table

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reader's scope pseudonymises the log home it resolved at start; a later
read whose root resolves elsewhere answers no row rather than reading a
same-named session there under the old scope.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A session epoch is the time its state started over: withWorkTurn no longer
lets a late turn of an older epoch replace the newer range, and a correction
applies only to the range of the epoch it was resolved for.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ispatch

- the session-log reader deduplicates task ids before checking their limit
- a distill request is not dispatched once its signal has aborted

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
withoutWorkTurn takes the epoch its caller judged the turn in, like
withCorrection, so a late "no work" re-judge cannot remove a newer range's
turn of the same number.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…stopped

The Proxy request carries the distillation's combined signal, so a correction
or shutdown while it is in flight now settles as `dropped` or `stopped`
instead of throwing; a model error during shutdown hands the claim back
before it can be recorded as a blocked route.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…g log

The session-log reader tells the decoder which byte span of a long log it left
unread, and Kimi's decoder answers no row for a turn whose records may lie
there, so a check in that span can never be missed and the turn verified.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Windows job helper compiles its Win32 bridge with Add-Type before the native
client starts, which alone can exceed the tests' 10 s completion signal on a
cold CI runner: the signal then aborted mid-compile and the test failed with a
retained scratch. Completions expected to succeed now share a 60 s budget.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reader checks a log or task file is confined to the log home, then opens
it; the file at that path could be swapped in between. The opened file's
device and inode must now match the checked one, as the old native reader
required.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…check a log path once open

- a turn judged again after a later one joined only changes its own turn: the
  range keeps the newer turn's route, snapshot, owner and any route block
- the session-log reader checks a file's path again once it is open, so a
  folder swapped for a link in between cannot pass the identity check

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The stamp's per-credential digest joined secret and device id with a NUL; both
are already validated free of control characters, but a structured encoding
keeps two different pairs from ever sharing a digest.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
baseFor takes the turn's session epoch: a range of another epoch gives no base,
so a new epoch's first turn never inherits the old range's. Its one caller
already only asked within the same epoch; the guard now holds on its own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@evomap-aiqa-bot

evomap-aiqa-bot Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Sentinel 已审核此变更,未发现需要报告的问题。

开发 agent 查询详情: 调用 MCP 工具 sentinel_pr_review_context,传入 owner_repo="evomap/evolver-agent-plugin"、pr_number=73、head_sha="9d8bf1ca2f55aceb3a71bc916fffba4e8b272f26",并按条目追加 finding_id 或 finding_key。

由 Sentinel 审核 · 目标提交 9d8bf1ca2f55

forrestlinfeng and others added 3 commits November 10, 2026 18:04
feat(reuse): 蒸馏关联复用资产,账本写明宿主,source 被拒的报告补发
Run Kimi on the shared late-terminal mechanism and drop its own
The captured-owner change targeted lib/app/native-turn.js, which EvoMap#68 removed; main's shared late-terminal flow
takes precedence, as the PR description anticipated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@forrestlinfeng

Copy link
Copy Markdown
Contributor

Merged after a main merge that drops the owner-retention commit superseded by #68; the lineage fix itself is unchanged. Thanks!

@forrestlinfeng
forrestlinfeng merged commit 431aee6 into EvoMap:claude/reuse-lineage-reporting Nov 11, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants