Repository navigation
feat: one hook process, leaner rules, companion hardening (0.0.65) - #77
Merged
Merged
Conversation
grok and cursor kept raw kill(-pid, 0) group probes beside the shared zombie-aware identity, so on linux an unreaped zombie read as an unverified live group and cancel reported incomplete cleanup. every group probe in both companions now goes through the shared processGroupAlive.
reviews take the ingress deadline like tasks, the ten minute orphan release now requires a dead leader, and a child that exited while an escaped helper still holds its output is closed at the deadline and settles on its exit status. the uncooperative child timeout test gets a 3 s budget so a loaded runner can start the fake codex before the deadline.
a cancel request no longer drops modelDrift from the finished cursor record, and the codex monitor and engine observer reparse a record replaced by rename even when its size and mtime match.
the one hour cooldown now needs payment evidence instead of the bare word quota, a missing binary stays missing_cli through capability preflight, a stale token refresh that exhausts the deadline still records its attempt, and the jobs monitor keys its cache by inode.
the record lock and raw-args transport are module level functions configured once by each companion instead of closure factories, the process identity module exports its liveness check directly, and the plain directory lock reclaim for companions older than 0.0.23 is gone.
job records must carry the current schema or take the unreadable path, read-time defaults and aliases for older records are gone, the group liveness wrappers call the shared probe directly, and helpers nested in the exec, home, and model modules move to module scope.
the legacy process state folds into unverified, incomplete records take the unreadable path instead of being normalized or narrowed, stats stop reconstructing older record shapes, failure footers render the record's own delivery and semantic status, and nested helpers in grok-exec and the jobs monitor move to module scope.
the retired allow subcommand, the terminal ledger migration, old observer and worker record normalization, the pre-tracking cohort with its acceptance epoch, and the legacy async delivery inference are gone; pass-through wrappers are inlined and nested helpers in the monitors, stats, lifecycle, breaker check, and bench move to module scope.
records lose the sessionId alias and read-time defaults, retired internal option names and alias mapping are gone, the hasOwn and termination pass-throughs are inlined, and nested run output and supervisor helpers move to module scope.
runGrok, runCursor, and the codex supervisor and event parser hold their shared run state in one context object passed to module level functions instead of closures defined inside the run; the only functions left inside another are inline API callbacks and one line listener arrows kept for removal. the fleet ledger's window helpers move to module scope the same way.
the troubleshooting reference drops the sentence about compatibility shims expiring on the retention horizon, since none remain, and the FUSION_ACCEPTANCE_EPOCH knob that was removed.
parseCodexEventStream is the implementation again instead of a wrapper that rebuilt its argument for consumeCodexEventStream.
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.
summary
orchestration.mddrops from 76.8 kb to 43.9 kb: engine internals, the full routing notes, and lifecycle detail move verbatim into an orchestration reference section oftroubleshooting.md, the remaining core is condensed without dropping a rule, the rendered routing table drops its notes column, and four contradictions are resolved; the five transport agents setomitClaudeMd: trueandeffort: lowadditionalContext(2,058 of them never had) and no longer auto-approve the write they annotate;fusion-hook.mjsruns the lifecycle and guard handlers in one process (a PreToolUse Edit measured 36 ms against 64 ms); worker budgets follow observed p95 usage and record alimitKind; the stop gate releases after three identical blocks; the retention sweep runs every six hours and keeps monthly rollupswind-down --job <id>replaces the resume command the wrapper used to copy out of output, records and briefs keep 5,000 jobs or 90 days while heavy artifacts keep the old caps, writes are batched, and a process group that outlives its dead leader stops blocking the workspace after ten minutes. grok: a quota failure with payment evidence opens a one hour cooldown, footers follow the contract, capability probes are cached, one deadline covers preflight through cleanup, and the sandbox handshake reads incrementally. cursor: a finished run's private home shrinks to its resume chat (56 kb instead of about 6.4 mb) with a shared npm cache, and failure classification keeps quota and rate limits pool scopedsessionIdalias, grok's legacy process state, the codex monitor's terminal ledger migration, the plain directory lock reclaim for companions older than 0.0.23, the retired guardallowsubcommand, the acceptance epoch and its pre-tracking cohort)shared/companion/is the single source for process identity, argument parsing, the record lock, and the raw-args transport, now module level functions configured once per companion instead of closure factories; the codex, grok, and cursor run supervisors keep their run state in one context object passed to module level functions; pass-through wrappers are inlined.fusion-stats,worker-lifecycle, the inline guard, codexrunCodex, andgrok-companionare split behind their existing entry points and exportsquotaword opening the grok cooldown, a missing grok binary classified as setup, a refresh backoff that never started when the refresh exhausted the deadline, a droppedmodelDrifton cursor cancel, and monitor caches that could miss a same size rewritetest plan
already verified
npm test-> 1619 tests, 1616 pass, 0 fail, 3 skipped (linux only); the same suite on main was 1438 tests with 5 failing (four jev calibration tests that read the host's ledgers, one load flake)node:22linux container: everything passes except 11 tests that need git 2.42worktree add --orphanor a repository whose.gitresolves inside the container; the grok cancel suite also passes with a non reaping pid 1, where it failed before the group probe fixclaude plugin validateonplugins/codex,plugins/grok,plugins/cursor, andplugins/fusion, plusclaude plugin validate . --strict-> all passed;node bench/manifest.mjs --checkandnode shared/sync.mjs --check-> cleandonewithOK; grok 1.0.52 consult twice ->done, the footer carriesdeliveryandsemantic, andcapabilities.jsonis cached; cursor composer-2.5 consult ->done, the language server landed in the shared npm cache, and the finished run home pruned to 56 kbfusion-stats.mjs --allon the real ledgers renders the compact report, andtests/fusion-stats-modules.test.mjschecks the split renderer byte for bytereviewer should verify
claude plugin marketplace update claude-code-fusionand a new session, a Read tool call still runsworker-lifecycle.mjs: hooks.json now uses negative lookahead matchers such as^(?!(?:Edit|Write|NotebookEdit|MultiEdit|Bash|Agent|Task|SendMessage|TaskOutput|TaskStop)$).*$, which claude code documents as JavaScript regex without naming lookaheadcodex:codex-rescuesubagent transcript in that session no longer contains# Orchestration policy(omitClaudeMd: true)/fusion:smokepasses on the new versionstatus,result, orhistoryafter the upgrade; that is the intended effect of dropping backward compatibilitynotes
[1.0.14, 1.0.42): the consult path passes on 1.0.52, but OrbStack's~/.orbstack/run/docker.sockstill makes the companion refuse grok write runs on this host, so the write path stays unverified (live pass for grok 1.0.52 and the grok burst arm of the lane snapshot #75)omitClaudeMdpluseffort: lowcover most of the measured wrapper cost) and a singleton monitor (claude code offers no shared monitor process, so each session's monitor now scans incrementally instead)FUSION_ACCEPTANCE_EPOCH(removed with the epoch);rules-manifest.jsonis regenerated, the moved assertions intests/rules-sync.test.mjsreadtroubleshooting.md, and the collector enum pin includes cursor