Skip to content

Fix the open review findings of the fast toggles and the OpenCode pruning notes - #299

Merged
DocksDocks merged 7 commits into
mainfrom
293-fix-the-open-review-findings-of-the-fast-toggles-and-the-opencode-pruning-notes
Dec 1, 2026
Merged

DocksDocks merged 7 commits into
mainfrom
293-fix-the-open-review-findings-of-the-fast-toggles-and-the-opencode-pruning-notes

Conversation

@DocksDocks

@DocksDocks DocksDocks commented Dec 1, 2026 •

Copy link
Copy Markdown
Owner

Plan run: #293 Fix the open review findings of the fast toggles and the OpenCode pruning notes

Pull request: #299. Checks: Full CI passed (run 46758718180, attempt 1, head 999a5aa1). Reviewed head: 999a5aa1.

What changed

  • The fast toggles (docks-kit --fast, --ultrafast) check config.yml in a stronger way (cli/src/engine-native/ompFastMode.ts toggleDeployedOpenAiTier). Each identity check runs realPath, then lstat of the target, then stat through config.yml, then realPath again. The toggle refuses with ConfigChanged when the checks see a retarget of the link (also to a hard link of the same file) or a save as a new file. This also holds in the first check, before it parses anything.
  • A folder of the path that is not a folder (ENOTDIR) is a refusal (exit 2), also in the check before the locks (requireDeployedConfig).
  • cli/docs/omp-context.md: sync does not follow a YAML merge key (<<) to find a retired setting. A merge can still supply the value after a prune, and a prune of an anchor in use can fail to write.
  • Version 0.32.2, changelog, payload, talk bundle, and mutation golden digests.

Decisions and corrections

  • Code-review round 1 and plan round 5: the identity check was redesigned twice. The first form compared the two realPath results only. The current form also compares the lstat and stat identity and time, and ends with realPath.
  • Unchanged: the merge-key limit in the pruning logic of ompRemovals.ts. Only the docs changed.

Delegated decisions

  • Worktree while the checkout was clean: a worktree under the agent worktree folder, because Move the engine-native layer to Effect #290 ran in the same session. Rejected: the main checkout. Reversibility: remove the worktree. Record: none.
  • Merge keys: document the limit, and do not prune through a merge. Rejected: expanding merges in ompRemovals.ts, which would edit an anchored mapping that other keys share. Reversibility: one commit. Record: Research decision "Merge keys in the retired values".
  • Residual windows: accept the two windows of the last check (a save after its stat, a retarget after its last realPath). Rejected: a lock shared with omp, which omp does not offer. Reversibility: one commit. Record: Research decision "Retarget", and code-review round 2 rejection.
  • Version: patch bump to 0.32.2, because the exit code of a rare refusal changes. Record: Research decision "Version".

Reviews

Plan review passed in round 8. Code review passed in round 3.
Open findings: none.

Verification

  • red: before the fix, the retarget case and the ENOTDIR case failed on their _tag assertions, and the second-read case passed. Each later repair case failed on the candidate before it.
  • fast (bun x --no-install vitest run --reporter=verbose cli/test/unit/ompFastMode.test.ts cli/test/unit/rootFlags.test.ts): exit 0, 91 passed.
  • docs (./docks-kit docs omp-context): exit 0, all three statements present.
  • gen (bun run check:generated): exit 0. dry (./docks-kit sync --dry-run): exit 0.
  • smoke (bun run smoke:package): exit 0. talk (omp-smoke.ts): talk tool: offered, warnings: 0.
  • gate (bun run check): exit 0, 6465 passed, 12 skipped, both golden suites OK.

Limits and failures

  • Local checks ran on Linux x64 only; Full CI covers Ubuntu, macOS, and Windows.
  • One gate run failed because a docs edit landed during the run (the root guard saw a working tree change). All tests had passed. The rerun after the commit passed.

Kept resources

  • After Merge now: none.
  • After Leave pull request open: the worktree issue-293 and the local and remote branch 293-fix-the-open-review-findings-of-the-fast-toggles-and-the-opencode-pruning-notes.

After merge

  • none

Checklist

  • bun run check passes
  • Tested locally end to end (fast, docs, gen, dry, smoke, talk, gate)
  • Code review passed

Closes #293

…oggles

- Each identity check resolves the config.yml link again after its lstat, so a link that moves
  to another file between the two calls refuses with ConfigChanged instead of writing the old target.
- An ENOTDIR failure (a folder of the path that is no longer a folder) is ConfigMissing at each
  identity step, so it exits 2 as a refusal.
- Tests wrap the Bun file system to act at exact steps: the retarget, the ENOTDIR case, and the
  existing handler for a file that becomes a folder at the second read.

Verified: bun x --no-install vitest run --reporter=verbose cli/test/unit/ompFastMode.test.ts cli/test/unit/rootFlags.test.ts; ./docks-kit docs omp-context; bun run check:generated; ./docks-kit sync --dry-run; bun run smoke:package; bun run check
- cli/docs/omp-context.md: the pruner finds a retired key only where config.yml sets it directly;
  a retired value that only a merge key (<<) supplies is not pruned, while omp still reads it.

Verified: bun x --no-install vitest run --reporter=verbose cli/test/unit/ompFastMode.test.ts cli/test/unit/rootFlags.test.ts; ./docks-kit docs omp-context; bun run check:generated; ./docks-kit sync --dry-run; bun run smoke:package; bun run check
- Bump the version, add the changelog entry, and regenerate the payload, the talk bundle, and
  the mutation golden digests that embed the version.

Verified: bun x --no-install vitest run --reporter=verbose cli/test/unit/ompFastMode.test.ts cli/test/unit/rootFlags.test.ts; ./docks-kit docs omp-context; bun run check:generated; ./docks-kit sync --dry-run; bun run smoke:package; bun run check
…y notes

Repairs of code-review round 1 of #293:
- Each identity check runs realPath, lstat of the target, then stat through config.yml, and
  refuses with ConfigChanged when the two reads differ, also in the first check before parsing.
  A replace or a retarget after the lstat of the last check now refuses.
- A file that goes away after realPath succeeded is ConfigChanged; requireDeployedConfig maps
  ENOTDIR to ConfigMissing, so the check before the locks exits 2 too.
- The doc comment names the residual window after the last stat; the tests name their exact steps.
- omp-context.md and the changelog make no claim about merged values that omp reads after sync.

Verified: bun x --no-install vitest run --reporter=verbose cli/test/unit/ompFastMode.test.ts cli/test/unit/rootFlags.test.ts; bun run check:generated
Repairs of plan review round 5 of #293:
- Each identity check ends with a second realPath, so a move of config.yml to a hard link of the
  same file, which keeps the device, inode, time, and bytes, refuses with ConfigChanged.
- identityFields takes a structural stat type, so the code names no unstable FileSystem type.
- omp-context.md: removing the key removes the contribution of config.yml; omp applies its other
  settings layers in their usual order.

Verified: bun x --no-install vitest run --reporter=verbose cli/test/unit/ompFastMode.test.ts cli/test/unit/rootFlags.test.ts; bun run check:types
Repairs of plan review rounds 6 and 7 of #293:
- A merge left in config.yml can still supply the value after a prune of the direct entry.
- A prune that removes an anchor that a merge still uses can fail to write.
- After a prune, omp reads the key from its other layers in their usual order.

Verified: ./docks-kit docs omp-context
Repairs of code-review round 2 of #293:
- The doc comment and the changelog say that the toggle refuses each change that its checks
  detect, and limit the exit-2 note to a non-folder found by the config checks.
- The ENOTDIR cases cover each call of the second check: both realPath calls, lstat, and stat.

Verified: bun x --no-install vitest run --reporter=verbose cli/test/unit/ompFastMode.test.ts cli/test/unit/rootFlags.test.ts
@DocksDocks
DocksDocks marked this pull request as ready for review December 1, 2026 22:20
@DocksDocks
DocksDocks merged commit 1c635d9 into main Dec 1, 2026
10 checks passed
@DocksDocks
DocksDocks deleted the 293-fix-the-open-review-findings-of-the-fast-toggles-and-the-opencode-pruning-notes branch December 1, 2026 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix the open review findings of the fast toggles and the OpenCode pruning notes

1 participant