fix(rank,ledger): review-confirmed defect fixes + feat(collide): parallel-session conflict radar - #120
Merged
Conversation
…fDiff tombstone edges; determinism hardening Adversarial review (4 finder dimensions, 2 skeptics per finding, 16/16 confirmations) surfaced eight defects in the v0.28.0 rank/ledger work. All fixed, each pinned by a regression test: - history() never matched a production claim: hook-minted lessons and deja summaries store raw tool-input paths (ABSOLUTE — cortex_hook stores file_path verbatim), while atlas files are repo-relative POSIX. hazard silently degenerated to bare centrality; fail-open hid it, and tests passed only because fixtures hand-minted relative paths. The join now relativizes claim paths against the repo root, and the test uses the production path shape. - beliefDiff: a claim minted AND retracted inside the window was pushed to appeared with a live val — a retracted claim presented as a current belief. The tombstone test now runs first (retired, from:null, to:null). Claims already dead at dayA no longer show up as strengthened/weakened via pure decay. - Determinism: every ordering in rank.js now uses locale-independent codepoint comparison — localeCompare consults ICU collation tables that differ across machines, contradicting the module's own cross-machine guarantee. - centrality() dedupes node ids like pagerank already did (a duplicate id no longer counts its file's score twice). - rankReport survives a corrupt .forge/atlas.json (built:false instead of a CLI crash and a hung rank_code MCP call) and clamps a negative --top (slice(0, -n) returned nearly the whole graph). - CLI: ledger diff refuses <since> after <until> (previously printed silently inverted classes); ledger at/diff reject impossible calendar dates instead of letting Date.parse roll 2026-02-31 into March. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LXmzxfRVDRVPU6LG8W39Rz
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LXmzxfRVDRVPU6LG8W39Rz
…ool) The everyday failure of the agent-fleet era: two sessions — your agent and a teammate's, or two of your own — silently edit the same or import-coupled files and the conflict surfaces only at merge time. The ledger already holds the answer: deja mints a session-summary claim (body.files) for every session and those claims team-merge over plain git, so "who else was just in here?" is a pure read — no server, no presence protocol, no new storage. (Workspace-awareness research — Palantír-style conflict early warning — rebuilt on a CRDT ledger instead of a central server.) risk = 1 − ∏(1 − rec_i × strength_i): the house noisy-OR over recent foreign sessions, where recency uses a deliberately short 7-day half-life (a collision is about NOW, not the 45-day belief clock) and strength counts direct file hits full, 1-hop import neighbors half. Own-author sessions and tombstoned summaries are skipped; hook-minted absolute paths are relativized like the rank history join; everything is advisory and fail-open. Surface: forge collide [<file>…] [--json] (Labs; default input is the working diff via anchor's gitFiles, now exported) and the collide_check MCP tool — an agent can ask "is anyone else in here?" before its first edit. All command tables, the MCP tool table, and the 21-tools counts were regenerated by forge docs render. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LXmzxfRVDRVPU6LG8W39Rz
The format-on-edit hook rewrites at 80 columns; the repo's Biome config is 100. Whole-scope `biome format --write .` sweep so the committed bytes match the CI formatter exactly. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LXmzxfRVDRVPU6LG8W39Rz
CodeWithJuber
marked this pull request as ready for review
August 7, 2026 14:08
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Two things, same branch: (1) fixes for eight adversarial-review-confirmed defects in the v0.28.0 rank/ledger work, and (2)
forge collide— the next everyday-agentic feature, built on the fixed foundations.1. Review-confirmed fixes
An adversarial review workflow (4 finder dimensions → 8 findings → 2 independent skeptics each, 16/16 confirmations, 0 refutations, reproduced against the live modules):
history()never matched and hazard degenerated to bare centrality. Now relativized against the repo root, with the production path shape pinned by a test.beliefDifftombstone edges — a claim minted and retracted inside the window was reported as "appeared" with live confidence (nowretired,from:null,to:null); claims dead before the window no longer move via pure decay.localeCompareis ICU/locale-dependent).centrality()dedupes node ids; corruptatlas.jsondegrades instead of crashing the CLI/hangingrank_code; negative--topclamps;ledger diffrefuses<since>after<until>; impossible calendar dates rejected instead ofDate.parserollover.2.
forge collide— parallel-session conflict radar (+collide_checkMCP tool)The everyday failure of the agent-fleet era: two sessions silently edit the same or import-coupled files, and the conflict surfaces at merge time. Every session already mints a ledger summary claim of the files it touched, and those claims team-merge over plain git — so "who else was just in here?" is a pure read: no server, no presence protocol, no new storage (workspace-awareness research à la Palantír, rebuilt on a CRDT ledger).
risk = 1 − ∏(1 − recᵢ × strengthᵢ)over recent foreign sessions — 7-day recency half-life (a collision is about now), direct hits full weight, 1-hop import neighbors half. Advisory, fail-open, own-author sessions skipped, absolute hook paths relativized.forge collide [<file>…] [--json]defaults to the working diff; agents get it as thecollide_checkMCP tool (21 tools).All command tables, the MCP tool table, and every count phrase were regenerated by
forge docs render— the doc-sync automation from #119 doing its job on its first real change.Checklist
npm testpasses (1,111 pass / 0 fail locally, Node 20)npm run checkpasses (Biome lint + format)feat:/fix:/docs:…)CHANGELOG.mdupdated under## [Unreleased]forge substrate,forge impact, router/gate, or MCP substrate tools (GUIDE + mintlify sections; generated tables/counts viaforge docs render)Risk & rollback
Extra checks (tick if applicable)
npm run typecheckpasses🤖 Generated with Claude Code
https://claude.ai/code/session_01LXmzxfRVDRVPU6LG8W39Rz