Repository navigation
feat(discovery): add opt-in OMP session discovery to the Pi adapter - #151
kunchenguid merged 26 commits into
Conversation
|
|
Speaking as Kun's firstmate. Reviewed head Diff (high level): Pi adapter default scan adds VISION per-rule
contract-class: new-default — unconfigured Security: clean. Local read-only discovery; CI: fork workflows approved. Required checks green on this HEAD — CI ubuntu+macos 36060341084, Guard 36060341386, no-mistakes 36060341142 (attestation matches Hold: waiting on captain, not on the author. Auto-merge is blocked solely by the new-default decision. Flagging for Firstmate/captain merge-or-not. Overlap: #129 (mdc2122, narrower adapter-only) stays open until captain lands one; #150 stamped superseded by this PR. |
| if (config?.discovery?.includeOmp === true) { | ||
| specs.push({ path: home(".omp", "agent", "sessions"), direct: false, nested: true }); | ||
| } |
There was a problem hiding this comment.
OMP sessions skipped by default
An ordinary Pi scan does not visit ~/.omp/agent/sessions/ because discovery.includeOmp defaults to false. Users with OMP transcripts must discover and enable that setting before their sessions appear. This conflicts with the stated intent to discover the OMP store through the Pi adapter.
Context Used: If there is a VISION.md file at the root of the repo, the PR must not conflict / diverge / drift from it. If the PR description has an "Intent" section, respect that as the accepted user intent. - Do make comments if anything in the implementation ... (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| - **backpass must never analyze itself**: keep `SELF_SESSION_SENTINEL` (`src/prompts.js`) at the start of every | ||
| model-facing prompt (`src/discovery/self.js` drops those sessions). | ||
| - **Gap evidence**: one ledger sighting per (gap, transcript) (`src/gap-ledger.js`); record before pruning; | ||
| never surface uncorroborated singletons; gap identity is judged by the consolidation call, with bigram |
There was a problem hiding this comment.
The replacement guidance omits both ~/.omp/agent/sessions/ and the fact that parent and nested subagent files share the root corroboration identity. The stated intent requires both to be documented in AGENTS.md as well as README.md. Maintainers relying on this file lose that discovery and evidence-counting guidance, so this repository requirement must be met before merging.
Context Used: If there is a VISION.md file at the root of the repo, the PR must not conflict / diverge / drift from it. If the PR description has an "Intent" section, respect that as the accepted user intent. - Do make comments if anything in the implementation ... (source)
omp (Oh My Pi) writes the same version:3 JSONL session format as pi under
~/.omp/agent/sessions/, but prepends a fixed-width {type:"title"} record so
the {type:"session", cwd} entry is line 2, and nests subagent transcripts
one level deeper at <escaped-cwd>/<session-id>/<Name>.jsonl.
- Add ~/.omp/agent/sessions as a default nested store root (omp honors
PI_CODING_AGENT_DIR, so an env redirect still dedupes against it).
- classify() scans the first head lines for the session entry instead of
requiring it on line 1.
- enumerate() descends one extra level inside nested roots.
- read() accepts model_change.model as a fallback for modelId.
…nest OMP subagents
5287c0d to
8afb786
Compare
|
Speaking as Kun's firstmate. Re-triaged head Diff (high level, vs main VISION per-rule
contract-class: opt-in — Security: clean. Local read-only discovery; no secrets/egress/workflow edits in the three-dot delta. CI help done this pass
Author blocker (blocking): no-mistakes attestation still binds to Notes: Sibling #150 remains the dirty-history twin — leave it; #151 stays the live path. #129 closed-stale earlier. Intent mentioned AGENTS.md OMP docs; tip documents the opt-in in README only (AGENTS.md unchanged vs main after the always-loaded trim) — not a merge blocker once attestation is current. @MrGTV-love please re-attest on |
…, and descendant classification
…ution, and selected provenance migration
…al ledger provenance
… evidence provenance
|
Speaking as Kun's firstmate. Re-triaged head Delta since VISION per-rule
contract-class: opt-in, with one caveat to weigh at merge time. OMP collection is off unless configured. One change does touch the default path: in CI this pass: I approved the fork workflows on this head. Required checks:
Greptile is red but isn't a gate here, so I ignored it. Author blocker: @MrGTV-love, please fix the macOS-only failures at the root (not by skipping on darwin) and re-attest via no-mistakes on the new head. Since your pipeline is actively driving this branch, I'm not pushing to it. Once every required check is green on one head, we'll re-stamp and take it to the captain for the merge decision. #150 stays the superseded twin. |
…alpath-normalizing the temporary root once in harness(), matching production checkoutRoots behavior. This shared correction covers all four sibling routing consumers and keeps State paths, transcript cwd, and checkout roots consistent across macOS symlinked temporary directories. Product code, evidence semantics, and assertions are unchanged. Re-traced the failing and ordinary paths before verification. Ran node --test test/gap-ledger.test.js with TMPDIR set to the value returned by getconf DARWIN_USER_TEMP_DIR: all 49 tests passed, including both reported failures and sibling routing regressions; zero failures or skips. No pipeline-control or publication actions were performed; current-head forge verification remains with the outer executor
|
Speaking as Kun's firstmate. Re-triaged head Delta since VISION per-rule (unchanged from the last pass apart from the fix rule)
contract-class: opt-in, with one default-path caveat. OMP collection is off unless configured. But in CI on this head: all required checks are green, and the PR is CLEAN and mergeable.
Thanks @MrGTV-love, the author blocker is cleared. This is now waiting on the captain's merge decision. #150 stays the superseded twin. |
|
Update on head
#150 is the older duplicate; I am closing it in favor of this PR. |
|
Speaking as Kun's firstmate. Thanks for the status update, @MrGTV-love. The head is still |
|
Speaking as Kun's firstmate. Thanks so much for all the work here, @MrGTV-love, and for chasing down the macOS test fix. Kun had a look and would like to split this into two PRs so each one can be reviewed on its own:
Once both are up and green, we'll pick them back up. Thanks again! |
…change Keep this branch to opt-in OMP discovery: an edit whose evidence lacks a native session is routed as on main (the unattributed evidence is left out of ownerOf), instead of falling back to the root memory file. The fallback moves to its own PR.
…on from discovery
|
Speaking as Kun's firstmate. Thanks for doing the split so fast, @MrGTV-love. Moving the I re-read the tip against main
Once those are split or gated, please post a short live run of VISION per-rule (tip vs main):
contract-class: new-default as the tip stands (default Pi enumeration, interaction labels, and fold routing change with |
…uting to main With includeOmp unset, plain Pi stores now list and read exactly as on main: the two-level walk, subagent tagging, ancestor lookup, and title-header parsing apply only to the ~/.omp store when discovery.includeOmp is on. scan --json omits the observer fields unless a transcript shares an observer with a parent. Fold routing goes back to main's route.ownerOf over cluster sessions; the incomplete-attribution root fallback and its native-ownership tests move to the separate routing change.
| const entries = readJsonl(ref.path); | ||
| const events = []; | ||
| let model = null; | ||
| const omp = entries[0]?.type === "title"; |
There was a problem hiding this comment.
Title-free OMP models disappear
The OMP classifier accepts a session record on the first line, but read() recognizes OMP model metadata only when the first record is title. For an accepted title-free OMP transcript whose model_change uses model rather than modelId, the model is silently reported as unknown, making its session metadata less useful.
Comments Outside DiffThese findings could not be posted inline.
|
|
Both points are addressed at head
Two more default-path differences turned up in review and are fixed: Live The same store at the previous head
|
|
Speaking as Kun's firstmate. Thanks @MrGTV-love, this is exactly the split Kun asked for, and the before/after scan against main is really helpful. I approved the fork workflows on I re-read the tip against main with
VISION per-rule (tip vs main):
contract-class: opt-in. With This is ready on our side. Kun wanted to look at #151 and #205 together, so it's queued for his merge decision now. Thanks again for the patience through the split! |
* fix(acpx): report acpx budget kills as timeouts, not empty-output (kunchenguid#145) Closes kunchenguid#143. Names acpx --timeout blank-quiet kills as timedOut on execOneShot and sessionPrompt (0.9 budget floor); leaves genuine fast blanks as empty-output; leaves synthesis openSession/prompt() alone. * chore(main): release backpass 0.1.27 (kunchenguid#149) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix(redact): stop secret redaction from eating benign tool arguments (kunchenguid#153) * fix(redact): anchor ASSIGNMENT identifier, bound value, skip numerics Benign telemetry names that merely contain a secret word (max_output_tokens, prompt_tokens, token_count) no longer match: the identifier must now end with the secret word. The value stops at whitespace, a quote, or a comma, so comma-joined JS-literal argument lists survive, and purely numeric values are left alone. Genuine assignments (API_KEY=, GITHUB_TOKEN:, password=) still redact. * no-mistakes(review): restore secret-word breadth, drop numeric redaction bypass * no-mistakes(review): redact unterminated-quote secrets, pin value-bound tests * no-mistakes(document): format new redaction tests, docs already accurate * no-mistakes(document): align redact comment with final value pattern * fix(redact): keep quoted values on one line An unterminated quote no longer redacts across newlines: the closed-quote alternatives exclude \n, so a truncated assignment falls through to the bounded unquoted form and following trace text survives. * no-mistakes(ci): ci-4 fixed in src/redact.js. Invariant: a fully closed quoted secret value must be redacted whole, even across newlines, without a stray later quote swallowing benign prose. Change: the ASSIGNMENT pattern now tries two newline-spanning quoted alternatives first — `"([^"]{8,})"` and `'([^']{8,})'`, each gated by a lookahead `(?=[ \t]*(?:$|[,;})\]]))` with the `m` flag — before the existing single-line quoted alternatives and the bare fallback. Both quote directions (double and single) got the same edit, and the replace callback's group chain became `dqMulti ?? sqMulti ?? dq ?? sq ?? bare` so every alternative still feeds the already-redacted guard. Traced: `PASSWORD="abcdefgh\nijklmnop"` (closing quote at end of line) now masks both lines. `DB_PASSWORD="hunter2hunter2secret\nRun tests and note "done"` still fails the lookahead (the only candidate closing quote is followed by `done"`), so it falls through to the bare form and masks only the first-line value, leaving the Run-tests line visible. The single-line quoted alternatives remain reachable (e.g. `password="secretvalue" trailing words`). Comma/unterminated-quote cases from earlier rounds unchanged. Test added in test/distill.test.js next to the existing unterminated-quote case. `pnpm run check` exits 0: 692 tests pass, lint, format:check and typecheck clean --------- Co-authored-by: firstmate <firstmate@local> * docs: trim always-loaded agent guidance (kunchenguid#156) * docs(agents): trim AGENTS.md to every-session invariants with pointers AGENTS.md is loaded into every agent session. Keep only hard invariants and orientation as short lines pointing at the source file that owns the detail. Before: 406 lines, 4663 words, 33498 bytes. After: 87 lines, 907 words, 7001 bytes. No detail moved to docs: every removed explanation already lives in the named module's header/inline comments and tests. CLAUDE.md stays the @AGENTS.md pointer. * no-mistakes(ci): Corrected AGENTS.md to state that skillSearchPaths skills are withheld from staging but remain fingerprinted, and restored the >= 20% placement table as prompt guidance rather than a buildProposal gate. pnpm run check passed (692 tests) * chore(main): release backpass 0.1.28 (kunchenguid#155) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * feat: train named nested memory files in monorepos (kunchenguid#159) * test(harness-invoke): widen the signal-forwarding budget The signal round-trip test spawns two node processes and forwards a signal between them. Alone it finishes well under a second, but with the whole suite running in parallel it intermittently exceeded the 2-second bound. A wrapper that swallows the signal never exits, so a 10-second bound still fails it. * feat(memory): train nested memory files in a monorepo Monorepos keep per-directory memory files (apps/api/AGENTS.md) that harnesses load on top of the root file only when a session works under that directory. backpass only trained the root file, and a nested file listed in memoryFiles was misreported as a separate file to consolidate. nestedMemoryFiles (project scope, default []) names each nested file a human wants trained; nothing is discovered. Each named file is a weight of its own: - evidence: only sessions that worked under its directory, judged against it with the root file shown as already loaded, in its own state under .backpass/nested/ - attribution: deterministic, from the session cwd and the paths tool calls name in structured fields (plus apply_patch file headers), resolved against known checkouts of the repo; ssh sessions and paths outside every checkout stay unattributed and feed only the root file - routing: a new instruction lands in the most specific named file whose directory every session behind it worked in; cross-cutting or unattributed evidence stays with the root file, enforced by fold and by a buildProposal gate on pure additions - budget: nestedBudgetTokens (budgetTokens when unset), re-checked at apply against the accepted subset - review: one proposal and one apply surface, each nested edit labeled with its file; the 2-session floor, verbatim evidence, and apply as the only writer are unchanged The per-directory pointer model matches the root: a sibling CLAUDE.md that imports the nested AGENTS.md is fine, and a nested entry that is only a pointer is refused by name. --target on a nested file is refused and --memory-file runs never train nested files. With nestedMemoryFiles unset, runs are unchanged. Closes kunchenguid#158 * no-mistakes(review): Fix nested evidence routing and per-directory memory checks * no-mistakes(review): Correct nested attribution for tool paths and cwd * no-mistakes(review): Guard nested apply scope and independent budgets * no-mistakes(review): Allow nested proposals past unchanged over-budget roots * no-mistakes(review): Share root-owned gap decisions with nested passes * no-mistakes(test): Document root-owned gap route type in foldEvidence * no-mistakes(document): Clarify nested targeting and apply scope in README * no-mistakes(review): Require nested synthesis before exempting root budget * no-mistakes(document): Clarify nested memory budgets and skipped training * no-mistakes(review): Fix mixed-edit routing and relative path attribution * no-mistakes(review): Protect named memory files during synthesis * no-mistakes(review): Include nested ancestors in analysis context and hash * no-mistakes(test): Fix tuple typing and formatting; focused tests pass, checks prohibited * no-mistakes(test): Adjust nested formatting; focused tests pass, formatter verification prohibited * no-mistakes(document): Clarify nested memory documentation and pass lint checks * doc: Revise explanation of AGENTS.md and backpass functionality Updated README to clarify the role of AGENTS.md and backpass. * doc: Update README to include skills in backpass description * fix(discovery): include Hermes TUI sessions with absolute cwd (kunchenguid#146) * fix(hermes): discover TUI sessions with absolute cwd * no-mistakes(document): Confirm Hermes documentation and format changed test * feat(apply): keep reworded rejected edits suppressed and record optional reject reasons (kunchenguid#162) * feat: remember rejected gaps and instruction units across rewordings Rejecting an add, rewrite, or remove now stores measured gap and instruction identities so a later proposal of the same decision in different bytes stays suppressed until more sessions arrive. Extract and move stay hunk-key only. The browser apply surface can attach an optional reason; terminal review does not prompt for one. * no-mistakes(review): Key rejections on unit hashes and absorbed gap aliases * chore(main): release backpass 0.1.29 (kunchenguid#160) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * docs: trim trailing space in README (kunchenguid#170) Prettier format:check fails on main because the scientific rigor sentence has a trailing space after the period. Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Kun Chen <kunchenguid@users.noreply.github.com> * test: isolate the suite's config home and temp fixtures per test process (kunchenguid#167) * test: isolate the suite from the developer's personal config home loadConfig layers $XDG_CONFIG_HOME/backpass/config.json under every run, and the suite never set XDG_CONFIG_HOME, so a contributor with personal ladders in ~/.config/backpass/config.json saw 14 failures in agents.test.js and config.test.js (0 with an empty config home). A setup module loaded with --import gives every test process an empty config home of its own; tests that need one still set and restore XDG_CONFIG_HOME themselves. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * no-mistakes(ci): I fixed the Greptile P2 in `test/helpers/hermetic-config.js`, following your instructions. Before this, the temporary config home was only removed on a normal `exit`, so a test run stopped with SIGINT or SIGTERM left it behind in the temp directory. **Change:** the existing `exit` cleanup is unchanged, now through a shared `removeConfigHome` function. I added one `process.once` listener each for SIGINT and SIGTERM. When a signal arrives, the listener: - deletes the directory (recursive, force, and any error is ignored); - removes its own listeners for both signals; - re-sends the same signal with `process.kill(process.pid, signal)`, so the process still ends the normal way for that signal. Every process that loads the helper through `--import` gets this, and nothing else changed. **Verification:** - **Signals:** I started a process with the helper loaded, checked its config directory existed, then sent it a signal. After SIGTERM it exited with 143 and the directory was gone; after SIGINT it exited with 130 and the directory was gone. - **Tests:** `npm test` passed 738 of 738, with 0 failed and 0 cancelled. - **Lint, types, formatting:** eslint and `tsc --noEmit` pass, and prettier passes on the changed file. - **`pnpm run check`:** this still fails at `format:check`, but only on `README.md`, which this change doesn't touch. Open PR kunchenguid#166 already fixes that file. I have not committed the change; it is left in the worktree for the pipeline * test: give each test process its own temp root so fixtures stop leaking Tests create fixtures with fs.mkdtempSync(os.tmpdir()) and never remove them: a full run left about 1,275 backpass-* directories (~130 MiB) in the system temp dir, over 10,000 after a day of runs. The hermetic helper now points TMPDIR (read by os.tmpdir() on every call, inherited by spawned CLI children) at one per-process root and removes it on exit, SIGINT and SIGTERM. The config home moves inside that root. Full suite 743/743 and 0 directories left behind. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test: make the temp-root cleanup best-effort and survive read-only fixtures Now that one root holds every fixture, a test that fails before restoring a 0o555 directory (apply-cli, proposal, user-apply tests) made rmSync throw EACCES inside the exit listener: exit 1, an unrelated stack trace, and the root left behind. Removal now restores write permission and retries, and never throws from exit or signal handlers. Old vs new on that scenario: exit 1 + stack + root left, vs exit 0 + clean + removed. Full suite 743/743, 0 leaked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * fix(acpx): retry timed-out adapter verification instead of aborting the run (kunchenguid#168) * fix(acpx): a timed-out adapter-config check fails the call, not the run verifyHarnessInvocation read a timed-out `acpx config show` (code null) as a permanent verification failure and raised a UserError, which analyze.js rethrows: one slow node start on a loaded host (load average ~30) rejected the analysis pool at 23/100 with advice to upgrade acpx. A timeout says nothing about the adapter map, so it is now handled before generic exits: retried once with three times the budget, then raised as a timed-out AcpxError, which the analysis stage records per transcript and retries on the next run. The budget is injectable (verifyTimeoutMs) so the tests do not wait on real timeouts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * no-mistakes(review): Let pinned agents' timed-out acpx errors propagate unchanged * no-mistakes(review): Print a retry hint for timed-out harness calls * no-mistakes(review): Give verify timeouts their own accurate CLI hint * no-mistakes(test): Isolate agents tests from host XDG config ladders * no-mistakes(document): Strip trailing README whitespace failing format check * no-mistakes(ci): Fixed Greptile finding ci-1 in AgentResolver.withFallthrough (src/agents.js), as the user instructed. The invariant: a timed-out AcpxError always propagates unchanged. It is never classified, demoted, or retried, for pinned and auto-picked agents alike. This matches the AGENTS.md rule that a timeout is never cached as a negative probe. Before the fix, a timeout whose stderr contained 'AUTH_REQUIRED' was classified as 'unauthenticated'. For a pinned pick, demote() returned false without throwing, so the loop called the same harness again with no end. For an auto-picked pick, the agent was demoted and written to the cache as a negative probe. The fix is one shared check at the top of the catch: `if (isAcpxError && err.timedOut) throw err;`. After that, the pinned conversion is back to plain `if (isAcpxError && pick.pinned)`, with the old `!err.timedOut` guard removed. All non-timeout pinned conversions (classifiable verdicts and 'failed unexpectedly') behave as before. The doc comment now says this. Tests added in test/agents.test.js: 1. A pinned synthesis pick whose fn throws a timed-out AcpxError with stderr 'AUTH_REQUIRED' rejects with that same error, and fn is called exactly once. 2. An auto-picked analysis candidate given the same error rejects with it once and is not demoted: resolve() still returns pi. Verification: - With src/agents.js reverted to the old code, the agents test file never finished inside 60s. That is the endless loop the finding describes. - With the fix, agents + config tests pass 52/52 under an isolated XDG_CONFIG_HOME. Lint, format:check and typecheck all exit 0. - Full `pnpm run check`: 741/743 pass. The 2 config.test.js failures come from this host's user config (~/.config/backpass sets a gpt-6-luna ladder), not from this PR: they fail identically with both changed files stashed and pass with an isolated XDG_CONFIG_HOME. - In a re-run under the isolated config home, the only failing test was gap-domain-cli ('an orchestration gap is counted…'). It exited 143 (SIGTERM after 30s) at host load average about 30, and passes 3/3 when run alone. That is host load, not this change. Changes are left uncommitted in the worktree for the outer executor --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * ci: add restricted workflow_dispatch path to republish npm 0.1.29 (kunchenguid#172) Allow a one-off trusted-publishing republish of the already-tagged backpass@0.1.29 release without bumping the version or creating a new release-please release. Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Kun Chen <kunchenguid@users.noreply.github.com> * chore(main): release backpass 0.1.30 (kunchenguid#171) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix(agents): treat "does not support this model" as model-unavailable (kunchenguid#185) * fix(agents): fall through when the harness is too old for the model An adapter can advertise a model that its bundled harness cannot call. The provider then rejects the first prompt with "does not support this model". Classify it as model-unavailable so withFallthrough demotes the candidate, caches the negative verdict, and tries the next rung. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * fix(agents): label model-unavailable as "model not available" The verdict now also covers a listed model that the harness is too old to call, so "model not advertised" was wrong for that case. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: zxliu <zxliu@scientechresearch.io> Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * fix: isolate SQLite session raw transcripts and reclaim expired files (kunchenguid#178) * fix(analyze): give a SQLite-store session a raw transcript of its own The distilled trace ends with the raw transcript the analysis agent may open when a claim needs the full text. For a file-backed store that is the session's own file, and a session fetched over ssh already reads from a cached file of its own events. For a local SQLite store (opencode, hermes, cursor IDE) it was the store's path: one database holding every session of every repository. On a real run with an effortful model the analysis agent followed that pointer and wrote SQL against a 560 MB OpenCode store to find its session, turning minute-long calls into ones that hit the timeout - and the database it was handed let it read sessions this repository never associated. For the length of the call, a local SQLite session now gets a file of its own normalized events, one per line, under `.backpass/raw/` (mode 0600), and that is what the trace footer names. The file is removed when the call returns, whatever the outcome. The new CLI test follows the footer from inside a fake agent: it finds only that session's events, never the database or another session, and the file is gone afterwards. * no-mistakes(review): Fix SQLite raw-file lifecycle and adapter documentation * no-mistakes(review): Reclaim orphaned raw transcripts without deleting live analysis files * no-mistakes(review): Reclaim reused-PID raw files while preserving active analysis files * no-mistakes(document): Clarify raw transcript scope and documentation ownership * no-mistakes(ci): Fixed ci-1 by removing unsafe PID-based cross-run pruning from all analysis paths. Per-call and catchable-exit cleanup remain intact; SIGKILL leftovers now require manual removal, documented in README.md. Reproduced the same-PID deletion through the CLI before fixing it. All 100 relevant tests pass, along with targeted ESLint, Prettier, TypeScript, and git diff checks * fix(analyze): reclaim a SQLite raw file once its lease runs out A raw file left by an uncatchable exit such as SIGKILL was never removed, leaving an unredacted session on disk. While its call runs, analysis now renews the file's modification time every minute, and every analysis run removes raw files untouched for 15 minutes from the root and nested state directories. Liveness comes from the lease, never from a PID, so a live analysis in another PID namespace keeps its file. * no-mistakes(review): Remove redundant worker-level raw transcript reclamation * no-mistakes(review): Simplify raw-file identity and restore reclamation test coverage * no-mistakes(ci): Fixed both findings. Raised raw-file reclamation to 24 hours while preserving one-minute renewal. Directory scan failures now emit one warning and skip the affected directory without aborting analysis or healthy sibling cleanup. Updated README and comments. Reproduced failures through the CLI and added regressions covering clock skew, expired leases, and directory failures across root/nested, empty/cached runs. All 47 analysis tests passed, along with targeted ESLint, Prettier, typecheck, and git diff checks * feat: support explicit per-edit decisions in backpass apply (kunchenguid#182) * feat(apply): take a decision vector with --decisions A reviewer who decided somewhere else, or a script someone chose to trust with their own repo, had no way to hand apply its decisions: the review surface needs a browser and --no-ui needs a terminal. --decisions takes the vector the surface sends, e1=accepted e2=rejected:too-narrow, parsed strictly so a typo writes nothing, and leaves unnamed edits undecided. It is never a default, and every apply gate still runs. * no-mistakes(ci): Fixed ci-1 by retaining every --decisions occurrence and validating them together through the existing strict parser. Earlier typos now stop all writes, and duplicate edit decisions across flags are refused. Updated help and README while preserving existing error messages. Added CLI regressions for invalid repeated flags, duplicate decisions, unchanged proposal/rejection state on failure, and successful combined decisions with rejection reasons. Reproduced the reported failure before the fix; afterward, all 144 relevant CLI, review-surface, scope, and writer tests passed. git diff --check passed * fix(apply): refuse a blank --decisions vector among several Joining repeated --decisions values let a blank one vanish next to a valid one, so `--decisions " " --decisions "e1=accepted"` wrote e1 while a blank vector alone is refused. Each supplied vector must now name an edit on its own before the vectors are checked together. * no-mistakes(document): Clarify scripted apply decisions and review defaults * fix(state): skip unverifiable POSIX mode check for Windows user-profile state dirs (kunchenguid#195) * fix: skip the POSIX mode read-back of the user state dir on Windows On Windows, chmod only toggles the read-only attribute and stat always reports 0o666, so State.ensure() could never verify 0o700 and every user-scope command failed with "could not secure state directory ... as mode 700 (got 666)". There, the directory's privacy comes from the NTFS ACL it inherits from the user profile (SYSTEM, Administrators, the user), so the read-back is skipped on win32 and kept everywhere else. test/state-mode.test.js simulates Windows' stat and pins both sides: the directory is accepted on win32 and still refused on other platforms; each test goes red under the matching mutation of the guard. Verified on Windows 11 / Node 26.7: `backpass scan --scope user`, `status`, `analyze`, and `propose` now run end to end. Fixes kunchenguid#115 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * no-mistakes(review): {"summary": "Narrow win32 mode-check skip to in-profile state dirs, warn otherwise"} * no-mistakes(document): docs: reflect Windows --scope user state-dir support in README --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * feat(discovery): support additional OpenCode stores and 2.x transcripts (kunchenguid#181) * fix(opencode): drop backpass's own OpenCode sessions, and only those acpx drives opencode, and opencode is on both default ladders, so every analysis and synthesis call backpass makes through it is filed in the opencode store under the repo's cwd - a tier-1 exact match on the next run. Self-session detection only reads transcript files, and an opencode store is one SQLite database, so three things went wrong: - The file-head check read the database's first 256 KiB. Its pages hold every session's text, so a backpass prompt stored near the start of the file marked every session in the store as backpass's own, and a prompt stored further in was missed. - With the head check unable to see them, backpass's own opencode sessions were analyzed as corpus - backpass auditing itself, which the self-session sentinel exists to prevent. - Each agent probe (`acpx opencode sessions new`) leaves an empty session under the repo's cwd, which was listed and matched at tier 1. The opencode listing query now reads each session's first user text part, the part an acpx prompt lands in, and marks the row `self` when it opens with the sentinel; discovery drops those rows and counts them in SELF. A session with no user text at all recorded nothing and is not listed. Discovery never reads a SQLite database as a transcript head. The new cases in `test/self-session.test.js` put a genuine session, a self session and a probe's empty session in one small opencode store; they fail on all three counts before this change. * no-mistakes(review): Keep OpenCode discovery fail-soft on malformed JSON * no-mistakes(review): Exclude descendants of OpenCode self sessions locally and remotely * no-mistakes(test): Preserve attachment-only OpenCode sessions while excluding empty probes * no-mistakes(document): Clarify OpenCode session exclusions and discovery safety documentation * no-mistakes(lint): Fix self-session assertion formatting * no-mistakes(ci): Fixed both findings. OpenCode self detection now checks the first user message, preserving attachment-opening conversations and their descendants when later messages quote backpass prompts. Remote probes respect the adapter's explicit classification. Self ancestry is computed once per discovery instead of querying ancestors per child. Both regressions failed before the fixes and pass afterward. Verification passed: 103 relevant tests, targeted ESLint and Prettier checks, TypeScript checking, and git diff --check. The hosted Greptile check was not rerun in this phase * feat(opencode): read OpenCode 2 stores (session_v2 and session_message) OpenCode 2 no longer writes `session`, `message` and `part`. Its store keeps each session in `session_v2` and the whole history as one typed row per message in `session_message`. On a 2.x-only store the adapter's listing query failed with `no such table: session`, so the harness was skipped with a warning and none of those sessions could be analyzed. The adapter now reads both layouts from the one database: - Listing reads `session_v2`, and dates a session by its newest message: `session_v2.time_updated` does not move as messages arrive, so a session resumed today was otherwise outside every window. - An in-place upgrade copies each 1.x session into `session_v2` under the same id and leaves the 1.x tables behind; a session in both is listed once and read from `session_v2`, where it continues. A store with neither table is reported as drifted instead of read as empty. - Reading maps each message type deliberately. User and assistant turns keep their text, and tool calls stay in the order the model made them, with their text output or error message as the result. Text the harness injected - instruction files (the memory file itself), continue notices, system notices, and compaction summaries of turns still stored above them - never becomes a turn. A background subagent or shell reports back in an injected message; that completion becomes the result of the call that started the job. A shell command or skill the person ran from the prompt is kept as a call. - A 2.x session follows the same rules as a 1.x one: it is backpass's own when its first user message opens with the self-session sentinel or it descends from such a session, and it is not listed when it has no messages at all. Golden fixtures pin both layouts: `test/fixtures/opencode-v2-store.json` and `opencode-v1-store.json` carry the DDL of real 2.0.18 and 1.18.32 stores and rows modeled field-for-field on real ones. * no-mistakes(review): Simplify OpenCode recording detection and clean temporary test homes * no-mistakes(ci): Fixed ci-1 in src/tui/render.js by replacing the unmeasured "1 sqlite query" claim with "sqlite store" at the shared OpenCode/Hermes rendering boundary. Reproduced the incorrect rendered output before fixing it. Updated rendering tests to cover both harnesses at three terminal widths while preserving session counts. All 23 rendering tests, targeted ESLint and Prettier checks, and git diff --check pass. Discovery behavior is unchanged * feat(opencode): read more OpenCode stores named in personal config A person's OpenCode sessions do not always live in the one store backpass reads. The Windows OpenCode app, for one, keeps its store on the Windows side, so a backpass running under WSL beside it never sees the sessions that did the work in this distro's checkouts. `discovery.opencodeStores` names more stores to read beside the default one: an OpenCode data directory (holding `opencode.db`) or a database file, such as a copy of the Windows app's store. Why a config list, when Claude, Codex, Hermes and Pi stores are relocated through the environment (`CLAUDE_CONFIG_DIR`, `CODEX_HOME`, ...): OpenCode's own relocation variables, `XDG_DATA_HOME` and `OPENCODE_DB`, would reach the OpenCode that backpass runs for analysis through acpx, which passes backpass's environment on. That OpenCode must keep its own store and login, or its sessions would land in, and its credentials be looked up in, the store being read. A list read only by the adapter changes what backpass reads and nothing else, the way `cloneRoots` and `skillSearchPaths` add places to look without changing anything they name. - Like `discovery.hosts`, the list is personal configuration: a checked-in `.backpassrc.json` that sets it is refused by name, since it would point every contributor's backpass at a transcript store. In user scope it defaults to the global file's top-level list. - Entries are absolute (`~/` is expanded); a relative entry is refused, because a transcript store is not a repository path. - Each session is read from the store that listed it. A store named twice (the default one again, or through a link) is read once, and a session id already listed from an earlier store is skipped, so a copied session never counts twice toward `minGapEvidence`. - A configured store that is missing or unreadable is named in a warning and skipped, and the rest of the run continues. The default store's failure stays the harness's failure, as before. - Remote hosts are unaffected: the probe reads each host's default store. * no-mistakes(review): Restore test environment and clean up OpenCode store fixtures * no-mistakes(review): Remove personal-only settings from project configuration example * no-mistakes(document): Clarify OpenCode store discovery documentation * no-mistakes(ci): Fixed all four Greptile findings: missing SQLite stores now raise named errors, notice-only 2.x sessions are excluded, attachment-only user turns survive reading and distillation, and bounded discovery filters old sessions in SQLite while preserving resumed sessions and self ancestry. Reproduced nine failing regression cases before fixing. All 113 targeted tests pass, including CLI and remote-probe coverage; ESLint, formatting, TypeScript, and git diff checks also pass * fix: stop scheduling analysis after a fatal worker error (kunchenguid#180) * fix(analyze): stop starting model calls once a run has failed Per-transcript failures are recorded and the run goes on; an error that fails the run - a pinned agent failing in a way nothing can classify, say - propagated from one analysis worker and stopped only that one. `Promise.all` reported the failure at once while the other workers kept taking transcripts and making model calls in the background, and the process only exited when the whole queue was done. On a real run with a pinned OpenCode agent the error was printed within minutes and the process kept analyzing for over an hour, starting a new max-effort call every time one finished. The pool now stops handing out transcripts after the first fatal error. Calls already in flight finish and keep their evidence, and the first error is rethrown once every worker has stopped, so nothing is still running when it surfaces. The new CLI test runs two jobs over five sessions with a pinned agent whose first call fails: before this change all five calls ran, now only the two in flight do. * no-mistakes(document): Document fatal analysis shutdown and evidence retention * no-mistakes(ci): Addressed ci-1 in test/analyze-stop-on-fatal.test.js. The CLI regression now returns non-empty, trace-backed evidence and verifies after exit that the second session's persisted record has status "ok" and retains the complete evidence payload. Existing assertions still verify fatal error reporting and no queued model calls. No production changes were needed. Verification passed: 6 relevant tests, targeted ESLint and Prettier checks, and git diff --check * chore(main): release backpass 0.1.31 (kunchenguid#186) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix: recognize acpx exit code 3 as a timeout (kunchenguid#177) * fix(acpx): name acpx's timeout exit (3) as a timeout acpx 0.19 ends a model turn at its `--timeout` budget itself and exits with its TIMEOUT code, 3 (`EXIT_CODES.TIMEOUT`), with only a zero-token accounting line on stderr. backpass named a timeout only from its own outer kill (`result.timedOut`, budget + 30s), which never fires once acpx has exited, so the turn fell through to generic exit handling: error pinned analysis agent opencode (github-copilot/claude-opus-5.5) failed unexpectedly (acpx opencode session prompt failed (exit 3): [acpx] tokens: input=0 output=0 total=0) With a pinned agent that stops the whole run after one long prompt. Named a timeout, it is what the design already says it is: that transcript is recorded as failed and retried next run, and the ladder never falls through because a prompt ran long. `ACPX_EXIT_TIMEOUT` is checked wherever `result.timedOut` is: the exec one-shot, the session prompt, session create (so an adapter acpx gave up starting is not reported as lacking session support), and the probe. * no-mistakes(review): Distinguish acpx-owned timeout diagnostics from backpass budgets * no-mistakes(review): Preserve timeout context and filter acpx accounting noise * no-mistakes(review): Classify setup timeouts and preserve acpx error diagnostics * no-mistakes(document): Clarify acpx timeout handling and retry documentation * fix: prevent false session matches from Windows paths on POSIX (kunchenguid#173) * fix(discovery): never resolve a Windows path against the POSIX cwd A harness on Windows records `C:\work\repo` or a UNC path such as `\\server\share\repo` (Windows tools also write `//server/share/repo`). On macOS or Linux none of these is absolute, so `path.resolve` turned them into a location under the process cwd - inside the checkout backpass was started from - and every such session became a tier-1 match for whichever repo ran the scan (kunchenguid#164). The same resolution also made a dead `C:/work/<repo-name>` a best-effort match, keyed user-scope projects by the directory backpass ran in, and counted Windows tool paths as in-repo work for nested memory files. `src/discovery/paths.js` decides once whether a recorded path names a place on this machine. Association, user-scope project keys and nested attribution now refuse a Windows path on a POSIX host instead of resolving it; a recorded remote still associates the session at tier 2. On Windows the recorded spelling is already local, so nothing changes there. The nested attribution cache version is bumped so cached placements recompute. Fixes kunchenguid#164 * no-mistakes(document): Clarify foreign-path handling and correct UNC safety rationale * chore(main): release backpass 0.1.32 (kunchenguid#198) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * feat(discovery): add opt-in OMP session discovery to the Pi adapter (kunchenguid#151) * feat(discovery): discover omp session transcripts in the pi adapter omp (Oh My Pi) writes the same version:3 JSONL session format as pi under ~/.omp/agent/sessions/, but prepends a fixed-width {type:"title"} record so the {type:"session", cwd} entry is line 2, and nests subagent transcripts one level deeper at <escaped-cwd>/<session-id>/<Name>.jsonl. - Add ~/.omp/agent/sessions as a default nested store root (omp honors PI_CODING_AGENT_DIR, so an env redirect still dedupes against it). - classify() scans the first head lines for the session entry instead of requiring it on line 1. - enumerate() descends one extra level inside nested roots. - read() accepts model_change.model as a fallback for modelId. * fix(discovery): share OMP corroboration across subagents * no-mistakes(review): Guard ledger id migration, narrow fold overlay, nest OMP subagents * no-mistakes(review): Drop graft cache files, guard ledger recording aliases * no-mistakes(review): Make shared OMP domain vote order-independent * no-mistakes(review): Link OMP subagents by nested path, share ledger prior merge * no-mistakes(document): Sync OMP interaction and scan-cache doc comments * chore: ignore local Graft cache * no-mistakes(document): Sync OMP identity docs and rewrap long comments * feat(discovery): make OMP session collection opt-in * no-mistakes(review): Fix OMP observer deduplication, native ownership, and descendant classification * no-mistakes(review): Correct observer canonicalization, native attribution, and selected provenance migration * no-mistakes(review): Fix conflicting cross-host descendant family corroboration * no-mistakes(review): Fix copied-descendant corroboration and historical ledger provenance * no-mistakes(review): Reconcile copied families and preserve validated evidence provenance * no-mistakes(document): Correct observer documentation and format changed sources * no-mistakes(lint): Fix regression fixture types and format affected tests * no-mistakes(ci): Fixed ci-macos-1 in test/gap-ledger.test.js:52 by realpath-normalizing the temporary root once in harness(), matching production checkoutRoots behavior. This shared correction covers all four sibling routing consumers and keeps State paths, transcript cwd, and checkout roots consistent across macOS symlinked temporary directories. Product code, evidence semantics, and assertions are unchanged. Re-traced the failing and ordinary paths before verification. Ran node --test test/gap-ledger.test.js with TMPDIR set to the value returned by getconf DARWIN_USER_TEMP_DIR: all 49 tests passed, including both reported failures and sibling routing regressions; zero failures or skips. No pipeline-control or publication actions were performed; current-head forge verification remains with the outer executor * refactor(proposal): leave nested-session root fallback to a separate change Keep this branch to opt-in OMP discovery: an edit whose evidence lacks a native session is routed as on main (the unattributed evidence is left out of ownerOf), instead of falling back to the root memory file. The fallback moves to its own PR. * no-mistakes(review): Refresh cached proposal interaction classification from discovery * no-mistakes(document): Clarify OMP observer counting and cache documentation * no-mistakes(lint): Format interaction regression test * fix(discovery): confine OMP handling to the opt-in store and leave routing to main With includeOmp unset, plain Pi stores now list and read exactly as on main: the two-level walk, subagent tagging, ancestor lookup, and title-header parsing apply only to the ~/.omp store when discovery.includeOmp is on. scan --json omits the observer fields unless a transcript shares an observer with a parent. Fold routing goes back to main's route.ownerOf over cluster sessions; the incomplete-attribution root fallback and its native-ownership tests move to the separate routing change. * no-mistakes(review): Keep plain Pi ledger slots and main routing, drop leftovers * no-mistakes(review): Revert unrelated acpx and gitignore hunks to main * no-mistakes(review): Restore main's gapSource body in gap ledger --------- Co-authored-by: mdc2122 <mdc2122@users.noreply.github.com> * chore(main): release backpass 0.1.33 (kunchenguid#207) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix(discovery): associate sessions in repos with separate git directories (kunchenguid#206) * fix: associate sessions in repos with separate git directories listWorktrees() now seeds its candidates with the normalized checkout root before adding Git's reported paths, retaining the existing deduplication. Regression tests cover exact and nested tier-1 association, strict-mode acceptance, exclusion of unrelated directories, ordinary and linked checkout deduplication, and fallback outside a Git repository. Fixes kunchenguid#127 * fix: don't count a separate git dir as a worktree --------- Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> * chore(main): release backpass 0.1.34 (kunchenguid#208) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix(memory): stop treating thematic breaks as instruction units (kunchenguid#213) * fix(memory): skip thematic breaks when parsing instruction units A break-only line (`---`, `***`, `___` and CommonMark variants) outside a fence was parsed as its own instruction unit, inflating the status count, taking an AG id, and matching any skill body break as a 1.00 overlap. parseMemoryUnits now drops such lines and flushes the current unit. A dash run directly under a plain paragraph is treated as a setext H2 heading, as in CommonMark; under a list item, quote, or fence it stays a break. Positional AG ids shift for unchanged memory text, so cached evidence would point at the wrong units: bump ANALYSIS_INDEX_VERSION to 4. Fixes kunchenguid#192 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * no-mistakes(review): Keep setext headings with their content when splitting removals * no-mistakes(review): Limit split guard to ATX and setext headings * no-mistakes(review): Skip thematic breaks when matching a heading to its content * no-mistakes(ci): Fixed Greptile finding ci-1, as you asked. In `parseMemoryUnits` (src/memory.js), indented code was treated as a setext heading title. Because of that, ` npm test\n---\nNext.\n` dropped the command and used it as the section name for `Next.`. Rule that must hold: a line can only be a setext title if it has at most 3 leading spaces (CommonMark). A line indented 4+ spaces or with a tab is indented code; it stays a unit, and the `---` after it is a plain thematic break. Fix: one extra condition on the setext check, `/^ {0,3}\S/.test(buffer[0])`. Checking only `buffer[0]` is enough: indented code cannot interrupt a paragraph, so if the first line is indented, the whole buffer is code. The only other place that decides what a setext title is, `isSetextTitle` in `splitRemovalHunk` (src/workspace.js), already skips any line that belongs to a unit. The indented line is now a unit, so that function picks up the fix without a separate change. I added both the space-indented example from the finding and a tab-indented one to the existing "dash run under a list item, quote, indented code, or fence is a break" test in `test/memory-units.test.js`. That test fails on the original code (7 pass, 1 fail) and passes with the fix. `pnpm run check` (lint, format, typecheck, all tests) passes: 940/940 --------- Co-authored-by: Zexuan Liu <zxliu@scs336.sim> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * fix(apply): refuse a proposal made under a different budget (kunchenguid#210) * fix(apply): refuse a proposal made under a different budget Apply gated the accepted subset against the budget in the current config, not the cap the proposal was measured and gated under. A proposal made with --budget 30000 and applied without it was judged "already over" a 10,000 cap and every addition refused; the reverse skipped the zero-sum the proposal was held to. Apply now compares each file an edit lands in (root and every nested file) against the cap recorded in the proposal and, on a mismatch, refuses before the review, naming both numbers and the remedy (re-run apply with --budget N, or nestedBudgetTokens when it is set, or propose again). The writer repeats the check for the accepted subset and writes nothing. A proposal that recorded no cap is gated at the current config, as before. The writer's nested cap now resolves through nestedBudget(), the same helper propose uses. Fixes kunchenguid#188 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * no-mistakes(ci): I added the test Greptile asked for; no source code changed. The bot was right that the writer's own root-budget check had no coverage. The existing root-mismatch tests in `test/apply-cli.test.js` all run the CLI, and `cmdApply` refuses before `applyDecisions` is ever called, so removing the writer's check would have left every test passing. **Invariant:** accepted edits to a file must never be gated or written under a budget different from the one the proposal was made under, and the writer (`applyDecisions`) has to enforce this by itself, not just `cmdApply`. Both files that can mismatch are now tested against the writer directly: nested files already had direct tests in `test/nested.test.js`, and the root file now has one too. **The new test** is "the writer itself refuses accepted root edits made under a different budget", in `test/apply-cli.test.js`. It builds a proposal at a 30,000-token budget, then calls `applyDecisions` directly with one edit accepted, one rejected, and the config set to 10,000. It checks that: - nothing is written, `AGENTS.md` is unchanged, and no skill directory is created; - the single failure message names the file, both numbers, and the `--budget 30000` remedy; - `rejectionsRecorded` is false and `.backpass/rejections.json` holds no entries. **Verification:** I temporarily turned the writer's check off and the new test failed; with the check back in place it passes. `pnpm run check` (lint, format, typecheck and tests) passes: 934 tests, 0 failures --------- Co-authored-by: Zexuan Liu <zxliu@scs336.sim> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * feat(status): show each nested memory file's sampled-session reach (kunchenguid#209) A nested file trains only on sessions whose every in-repo work path stays under its directory, so in repos where sessions cross directories it may never reach minGapEvidence, and a run that proposes nothing there looked the same as a file with no gaps. Each attribution now records, per nested file, how many sampled sessions worked only under its directory (.backpass/nested/reach.json). The run summary and `backpass status` print that count and warn below minGapEvidence, when no add, rewrite, or remove edit can reach the file. `status --json` reports it as nestedAttribution, and the proposal's nested entries carry sampledSessions, minGapEvidence, and belowMinGapEvidence. The count comes from deterministic attribution and is report-only. Refs kunchenguid#191 Co-authored-by: Zexuan Liu <zxliu@scs336.sim> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * chore(main): release backpass 0.1.35 (kunchenguid#215) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * docs: clarify apply UI dependency (kunchenguid#216) * fix(memory): recognize CLAUDE.md symlinks as pointers (kunchenguid#217) * fix(memory): recognize Claude memory symlinks * no-mistakes(document): Document canonical memory symlink resolution * chore(main): release backpass 0.1.36 (kunchenguid#218) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * feat(omp): accept omp as an analysis and synthesis runner omp (Oh My Pi) is an acpx custom agent. Its model and reasoning level now travel over acpx: --model at session create, and the ACP `thinking` session option. - harness-invoke: omp carries model and effort through the session path; a level omp does not advertise (off, auto, low, high, max) is refused before any call, so a level is never silently downgraded. omp is not a built-in adapter, so the agents.<name> replacement guard does not apply to it. - agents: resolvedEffort gives omp no default that it cannot carry (analysis medium). A configured level is kept as written. - acpx: omp's session effort key is `thinking`, so an exec fallback fails loudly. - README: one runner line for omp. Tests cover the transport, the refusal, the loud failure, the configured-agent acceptance, the effort default, and the probe's openai-codex route mapping. * no-mistakes(review): Qualify omp README ids, add omp to hints, test routes * no-mistakes(document): Update stale effort-default comment for omp * test(agents): use neutral providers in colliding omp ladder test Replace literal openai/ and openrouter/ ids with neutral provider names. The test still proves the qualified ladder id resolves to itself when the same bare model is advertised by other providers. --------- Co-authored-by: TNTHNGVDYNND <161745519+TNTHNGVDYNND@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Andrew Sweet <andrew.sweet@cantab.net> Co-authored-by: firstmate <firstmate@local> Co-authored-by: Kun Chen <3233006+kunchenguid@users.noreply.github.com> Co-authored-by: Admin Athletics mind <dev@athleticsmind.com> Co-authored-by: Rodrigo Díaz Jonguitud <dijongui@gmail.com> Co-authored-by: Matt Van Horn <mvanhorn@users.noreply.github.com> Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Kun Chen <kunchenguid@users.noreply.github.com> Co-authored-by: Kenmege <205099287+Kenmege@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Pantoria <37699442+Pantoria@users.noreply.github.com> Co-authored-by: zxliu <zxliu@scientechresearch.io> Co-authored-by: Pawan <pawan161096@gmail.com> Co-authored-by: Daniel Martinez Morales <dmmdea@hotmail.com> Co-authored-by: mdc2122 <mdc2122@users.noreply.github.com> Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Co-authored-by: Zexuan Liu <zxliu@scs336.sim> Co-authored-by: Som Samantray <92726151+SomSamantray@users.noreply.github.com>
Intent
Update upstream PR 151 (opt-in OMP session discovery in the Pi adapter, discovery.includeOmp default false) to answer the maintainer's 2026-10-09 change request. (1) In src/discovery/adapters/pi.js the nested two-level walk, subagent tagging, ancestor-header linkage and title-header parsing must apply only to the ~/.omp store when includeOmp is on; the default Pi store, PI_CODING_AGENT_DIR (unless it is the same dir as the OMP store) and bridge dirs must list and read exactly as on main. Decision recorded: a PI_CODING_AGENT_DIR pointing at a different omp dir gets no nested walk; do not add another opt-in. (2) The fold-side root fallback (gapOwnerOf) and native sightingIds ownership routing are reverted to main's route.ownerOf over cluster sessions; that routing, the unattributed-to-root rule and their tests belong to the separate upstream PR 205 and were deliberately removed from this PR, so do not re-add them. (3) scan --json on a plain Pi store with includeOmp unset must be identical to main (observer fields omitted unless a transcript shares an observer). Greptile findings on the earlier head were skipped on purpose: OMP-off-by-default is the approved design, AGENTS.md is untouched, and the proposal.js misroute is main behavior fixed by PR 205.
What Changed
discovery.includeOmp. It defaults tofalse, and setting it to a non-boolean value is an error. When it istrue, the Pi adapter (src/discovery/adapters/pi.js) also reads~/.omp/agent/sessions/, on the local machine and on SSH hosts (the flag is passed throughhosts.jsandremote/probe.js). In the OMP store only, the adapter accepts atitleline before the session header, walks nested subagent files up to two levels deep, links each subagent to the headers of its parent sessions, tags it as asubagentsource, and readsmodelas well asmodelId. Each OMP file in the scan cache also stores a fingerprint of its parent sessions (cacheDependency), so a change to a parent file makes the scan read that file again. The default Pi store, aPI_CODING_AGENT_DIRthat points at a different directory, and bridge directories are listed and read the same way as on main.corroborationIdentityOfinsrc/transcript.js). An OMP subagent shares one observer with its parent session, and matching copies on synced SSH hosts share one too. The gap ledger, the fold, and the proposal evidence floors now count distinct observers, not separate files, so linked files cannot add extra votes. Old ledger entries move to the new keys only when they match the selected sample. Ownership routing stays on main'sroute.ownerOf. OMP subagents always count as non-interactive. Standaloneproposenow uses the interaction signals from the current scan for cached evidence.scan --jsonleaves out the observer fields when a transcript's observer is its own identity, so a plain Pi store prints the same output as on main. The README documents the opt-in, the nested OMP layout, and the switch to counting observers. New tests and anomp-session.jsonlfixture cover the adapter, the ledger, the fold, the proposal, interaction, and remote discovery.Risk Assessment
Testing
I ran the real backpass CLI from this branch and from a main snapshot. Both ran against disposable fake HOME stores. These were a plain Pi store, an OMP store with root, child, grandchild and a too-deep file, and an alternate OMP-shaped PI_CODING_AGENT_DIR. A fake-ssh remote ran the real probe. A fake acpx stood in for model calls. Every scenario passed: 27/27 scan checks, plus the analyze-model, ledger-upgrade and observer-counting checks. The 109 targeted tests also passed, including the nested-routing CLI test. A first analyze attempt was polluted by a personal config left behind by the SSH step. That config named host
mac-home, so that one run tried a real BatchMode ssh tomac-home. Nothing came back from it. I fixed the driver to clear that config and re-ran everything on a fresh temp root. I removed the temp roots. The worktree is clean. This is a CLI-only change, so there is no visual artifact. The evidence is JSON and text CLI output.scan --jsonand humanscanoutput are byte-identical to main, with no corroboration*/parentSession* fieldsmodelreports no model, as on main. The OMP title-led root reports itsmodelEvidence: Scan driver log (27/27 checks)
Evidence: Plain Pi scan --json, main
Evidence: Plain Pi scan --json, branch (byte-identical)
Evidence: Human scan output main vs branch
Evidence: Cache parity after upgrade
Evidence: includeOmp:true scan --json (root/child/grandchild, shared observer)
Evidence: includeOmp toggle cache transitions
Evidence: Alternate PI_CODING_AGENT_DIR scan, main vs branch
Evidence: Invalid includeOmp refusal
~/.no-mistakes/evidence/01M4KHZCZW6D1F6D0NQV1HDG14/s8-branch-ssh-on.json)Evidence: SSH host scan includeOmp off, branch vs main
Evidence: Analyze model-field capture (main vs branch)
~/.no-mistakes/evidence/01M4KHZCZW6D1F6D0NQV1HDG14/s10-ledger-branch-rerun.json)~/.no-mistakes/evidence/01M4KHZCZW6D1F6D0NQV1HDG14/s11-observer-counting.json)~/.no-mistakes/evidence/01M4KHZCZW6D1F6D0NQV1HDG14/targeted-tests.txt)~/.no-mistakes/evidence/01M4KHZCZW6D1F6D0NQV1HDG14/drive.mjs)Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
src/gap-ledger.js:219- Default (non-OMP) Pi sessions no longer replace their own main-era ledger sighting. destinationAcceptsObservation only accepts a provenance-free prior whentranscript.harness !== "pi". Every ledger observation written on main has nosourceSessionId. Concrete path, includeOmp off: day 0 on main, plain Pi session S records gap G atsessions[S.identity]with firstObservedAt=day0. After upgrade, on day 50 S is re-analyzed (for example after an apply changes the memory hash) and reports G again. Line 219 rejects the identity slot, line ~226 rejects it again, and recordGapObservations writes a new keyJSON.stringify([S,S])with firstObservedAt=day50 and no priors. normalizeGapLedgerSessions (line 427,ordinaryNativealso excludes pi) never migrates the old record. Result: the day-0 key retires at day 90, but the new key keeps S corroborating G until day 140. This breaks the documented rule that re-analysis keeps the first-seen time (the 'does not restart its expiry clock' test only covers claude). The new key also drops the old record's phrasings and coveredBySkill citation, and the ledger gains duplicate keys. Sibling sites with the same Pi exclusion: src/gap-ledger.js:235 (takePriorObservations provenance backfill) and src/gap-ledger.js:427 (normalizeGapLedgerSessions ordinaryNative). Remedy: replaceharness !== "pi"at all three sites with a signal that excludes only OMP descendants, for exampleinteractionSignals?.source !== "subagent", on top of the existing!parentSessionId. Add a Pi variant of the expiry-clock regression.src/proposal.js:650- Intent conformance: the intent says routing is 'reverted to main's route.ownerOf over cluster sessions; that routing, the unattributed-to-root rule and their tests belong to the separate upstream PR 205 ... do not re-add them.' The diff addsrootOwnsGap(sightings, routing.rootOwnedGaps ?? summary?.rootOwnedGaps). The fallback was added in 0e7fd41 and is not in main or in PR 205. In production the root pass (rootRoutingin src/commands/propose.js:188) carries no rootOwnedGaps, so it now uses the root summary's list. This changes routing for every harness whenever nested memory files exist, with or without OMP. Example: a root cluster has sessions A and B (worked under apps/api) and C (apps/web), so it is root-owned. The model's root edit cites only the quotes from A and B. Main computes ownerOf([A,B]) = apps/api/AGENTS.md and refuses the edit in the root pass. This head treats it as root-owned and accepts it in AGENTS.md. Decide whether to drop?? summary?.rootOwnedGaps(main behavior) or keep it, which goes beyond the stated scope.src/discovery/adapters/pi.js:236- Intent conformance: the intent says 'the default Pi store, PI_CODING_AGENT_DIR ... and bridge dirs must list and read exactly as on main.'read()now usesentry.modelId || entry.model || modelfor every Pi store, not only the OMP store. A plain Pimodel_changerecord that hasmodelbut nomodelIdnow reports a model, where main ignored it. Pi writesmodelId, so the practical effect is likely nil. It is still OMP read logic applied outside the opt-in store. Decide whether to accept this or gate the fallback to OMP transcripts.src/discovery/adapters/pi.js:38- Simplification: the new genericcacheVersionmechanism (pi.js:38, checked at src/discovery/index.js:398, stored at :409, documented at :43) is not needed by the intent. ThecacheDependencymarker already forces reclassification in both directions: an OMP candidate yields "[]" or ancestor fingerprints against a cachedundefined, and a plain candidate yieldsundefinedagainst a cached OMP marker. Plain Pi classification is unchanged from main. SocacheVersion = 5only invalidates every plain Pi cache entry once after upgrade. On that first runscan --jsonreportsperHarness.pi.cached: 0where main reports N, which goes against the 'identical to main' criterion for that run. Remedy: removecacheVersionand its check, store and doc lines.src/fold.js:444- Simplification: some fields are left over from the removed native sightingIds ownership routing and nothing reads them. In clusterGapObservations, cluster items now carrysightingQuotes,sightingIdsandunattributedSightings(fold.js:444-469). No code reads them after clustering, because routing uses only item.sessionId/quote and route.ownerOf over cluster.sessions. The ledger also persistssightingQuotes(src/gap-ledger.js:266 sightingQuotesOf, :394, :488, :585, :652), and no logic consumes it. No intent requirement needs these fields, since the intent removes that routing. Remedy: remove the cluster-item copies and the ledgersightingQuotesfield. Keep the ledgersightingIds/unattributedSightings, which resolveGapObservationObserver uses.src/fold.js:356-summary.sourceObservers(fold.js:356) andsummary.sourceSessions(fold.js:373) use the samesourceIdentitiesOf(...)expression with identical inputs. The?? summary?.sourceSessions?.[label]fallback in src/proposal.js:647 is therefore redundant. Compute the map once and reuse it.test/adapters.test.js:243- The test 'pi discovery checks a missing parent path once per scan' always passes. It classifies plain (non-OMP) candidates, and since this change those never look up a parent, soparentProbesis always 0. Point it at OMP subagent candidates (omp: true, subagent: true) that share a missing parent, so it exercises the scanContext cache. Otherwise remove it.🔧 Fix applied.
2 warnings still open:
src/acpx.js:909- Simplification: recoverPiUsage now creates a scan context with piStore.createScanContext() and passes it to classify. The context is never used. piStore.enumerate() is called with no config, so includeOmp is unset and every candidate has omp: false and subagent: false. classify only reads scanContext in the subagent ancestor loop, which these candidates never enter. No intent requirement needs this. Pi usage recovery is not OMP discovery, and intent (1) says plain Pi stores read exactly as on main. Recommend reverting this hunk so the code matches main:piStore.classify(candidate)..gitignore:7- Simplification: commit 4809bae addsgraft/.cache/to .gitignore. This ignores a local Graft tool cache that has nothing to do with OMP discovery, the includeOmp opt-in, routing, or scan --json parity. No intent requirement needs it, and it would ship in upstream PR 151 as an unrelated change. Recommend removing the line from this PR. A personal ignore can live in .git/info/exclude.🔧 Fix applied.
3 issues (2 warnings, 1 info) still open:
src/acpx.js:909- Simplification: recoverPiUsage now creates a scan context with piStore.createScanContext() and passes it to classify. The context is never used. piStore.enumerate() is called with no config, so includeOmp is unset and every candidate has omp: false and subagent: false. classify only reads scanContext in the subagent ancestor loop, which these candidates never enter. No intent requirement needs this. Pi usage recovery is not OMP discovery, and intent (1) says plain Pi stores read exactly as on main. Recommend reverting this hunk so the code matches main:piStore.classify(candidate)..gitignore:7- Simplification: commit 4809bae addsgraft/.cache/to .gitignore. This ignores a local Graft tool cache that has nothing to do with OMP discovery, the includeOmp opt-in, routing, or scan --json parity. No intent requirement needs it, and it would ship in upstream PR 151 as an unrelated change. Recommend removing the line from this PR. A personal ignore can live in .git/info/exclude.src/gap-ledger.js:77- Simplification: thegapSourcehunk is a leftover no-op restructure. It adds localstartedAtandsourceIdvariables, and the output is the same as main's two-line body. No intent requirement needs this hunk, and it adds noise to the upstream PR diff. RevertgapSourceto main's body.🔧 Fix applied.
2 warnings still open:
src/acpx.js:909- Simplification: recoverPiUsage now creates a scan context with piStore.createScanContext() and passes it to classify. The context is never used. piStore.enumerate() is called with no config, so includeOmp is unset and every candidate has omp: false and subagent: false. classify only reads scanContext in the subagent ancestor loop, which these candidates never enter. No intent requirement needs this. Pi usage recovery is not OMP discovery, and intent (1) says plain Pi stores read exactly as on main. Recommend reverting this hunk so the code matches main:piStore.classify(candidate)..gitignore:7- Simplification: commit 4809bae addsgraft/.cache/to .gitignore. This ignores a local Graft tool cache that has nothing to do with OMP discovery, the includeOmp opt-in, routing, or scan --json parity. No intent requirement needs it, and it would ship in upstream PR 151 as an unrelated change. Recommend removing the line from this PR. A personal ignore can live in .git/info/exclude.✅ **Test** - passed
✅ No issues found.
scan --jsonand humanscanoutput are byte-identical to main, with no corroboration*/parentSession* fieldsmodelreports no model, as on main. The OMP title-led root reports itsmodelnode drive.mjs <tmp> <worktree> <evidence>: realbackpass scan --harness pi --since all [--json]on the branch and on agit archive 0268201cmain snapshot, against a fake HOME (plain Pi store, OMP store, alternate OMP-shaped PI_CODING_AGENT_DIR, fake-ssh remote home); 27/27 checks passednode drive-analyze.mjs: realbackpass analyze --analysis-agent piwith a fake acpx that records themodel:line from the trace prompt; main vs branch, includeOmp off and onnode drive-ledger.mjs: mainanalyze+proposewrites gap-ledger.json; then branchanalyze --force+proposere-reports on that ledger. Compared with a second main runnode drive-observers.mjs: branchanalyze+propose --min-gap-evidence 2with includeOmp on; gap quoted by OMP root+child vs by OMP root+plain Pi sessionTMPDIR=$(getconf DARWIN_USER_TEMP_DIR) node --import ./test/helpers/hermetic-config.js --test test/nested-cli.test.js test/nested.test.js test/adapters.test.js test/remote-discovery.test.js(109/109 pass; nested-cli drives the real CLI for nested routing)AGENTS.md:32- AGENTS.md still says edits needminGapEvidencedistinct sessions and that the ledger holds one sighting per (gap, transcript). The code now counts distinct corroborating observers, and linked OMP subagents share one observer. For plain Pi and all other harnesses an observer equals a session, so the text stays true there. I did not edit it because the recorded intent keeps AGENTS.md untouched in this PR. README.md and the src/gap-ledger.js and src/fold.js headers already state the observer rule.✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.