Repository navigation
Handle empty omp tier sections in the fast toggles - #291
Merged
DocksDocks merged 10 commits intoDec 1, 2026
Merged
Conversation
- Treat `tier:`, `tier: null`, and `tier: ~` as an empty mapping and keep the comment of the old value. - Refuse a null tier that carries a YAML anchor, with no write, because omp reads config.yml with Bun's YAML parser, which binds repeated anchor names differently. - Bump to 0.31.4; rebuild the talk bundle, the payload, and the mutation golden. Refs #284 Verified: bunx vitest run --reporter=verbose cli/test/unit/ompFastMode.test.ts; bun run check:generated; bun run golden:mutation; bun .agents/skills/verify/scripts/omp-smoke.ts; ./docks-kit sync --dry-run; bun run smoke:package; bun run check
- Treat only an untagged null tier as empty: Bun's YAML reader, which omp uses, reads `!<tag:yaml.org,2002:null> null` as a string. - Escape control characters and line separators of an anchor name in the anchored-null refusal. - Test the refusals through the omp command with an unchanged config.yml, and keep the value comment through both toggles of each null form. Refs #284 Verified: bunx vitest run cli/test/unit/ompFastMode.test.ts; bun run check:types; bun run lint; bun run format
- Classify tier and take the previous tier from omp's reading (Bun's YAML parser), so every tier that omp reads as null toggles. - Re-read the rewrite and refuse it with no write when omp would read any other setting differently: values compared exactly, mapping keys in order, and object sharing kept. - Refuse a legacy serviceTier that sets omp's OpenAI tier. - Drop the anchor and tag special cases and the anchor display. Refs #284 Verified: bunx vitest run --reporter=verbose cli/test/unit/ompFastMode.test.ts; bun run check:generated; bun run golden:mutation; bun run check
- Resolve the version to 0.32.1, the next patch over 0.32.0. - Move the toggle tests from the removed `docks-kit omp` command to the root `--fast` flag; rebuild the talk bundle, the payload, and the mutation golden. Refs #284 Verified: bunx vitest run cli/test/unit/ompFastMode.test.ts cli/test/unit/rootFlags.test.ts; bun run check:generated; bun run golden:mutation; bun run check:types
- Report each refusal as a TierToggleError with a tagged reason; read config.yml through FileSystem and omp's reader through the OmpYamlReader service, which main.ts provides. - Hold the home and folder locks as scoped Effects: each try and its release run without interruption, only the sleep between tries can be interrupted, and each taken lock goes on a held lock, a failure, or an interrupt. - Exit 2 for a refusal or an invalid lock wait, and 1 for a held lock, a lock that cannot be opened, or a failed read or write. - Cover each reason, the write failure, the lock lifetime, and a spawned tidy --apply under a held lock. Refs #284 Verified: bunx vitest run --reporter=verbose cli/test/unit/ompFastMode.test.ts cli/test/unit/rootFlags.test.ts cli/test/unit/tidy.test.ts cli/test/unit/folderLockCreate.test.ts; bun cli/scripts/verify-ci-tools.ts; bun run check:generated; bun run golden:mutation; ./docks-kit sync --dry-run; bun run smoke:package; bun .agents/skills/verify/scripts/omp-smoke.ts; bun run check
- Bound the lock wait on the monotonic clock, try no lock after the bound, and prepare each lock folder once. - Name the lock and keep its cause on a lock failure; add the native cause to a failed read. - Keep the comments of an aliased null tier; show an undocumented previous tier as `another value`. - Move errorMessage to errorText.ts. - Test the CLI boundary (invalid wait, folder at the lock path, config.yml as a folder), the interrupt with a held-lock precondition, the aged tidy fixture, the symlink after a failed write, and the ConfigMissing tag. - Correct the docs, changelog, and the tidy-context source range. Refs #284 Verified: bunx vitest run --reporter=verbose cli/test/unit/ompFastMode.test.ts cli/test/unit/rootFlags.test.ts cli/test/unit/tidy.test.ts cli/test/unit/folderLockCreate.test.ts; bun cli/scripts/verify-ci-tools.ts; bun run check:generated; bun run golden:mutation; ./docks-kit sync --dry-run; bun run smoke:package; bun run check
- Resolve a linked config.yml once, read it and its link again before the write, and refuse with ConfigChanged when another writer changed either; a file that goes away under the locks is ConfigMissing. - End the lock wait on the monotonic deadline in nanoseconds, with no try after it. - Compare the two readings with an explicit work list, so a long alias chain cannot exhaust the stack. - Show controls and bidirectional marks in diagnostics and paths as escapes; use Predicate.isError in errorMessage. - Tighten the interrupt, read-failure, unresolved-alias, and cleanup tests; correct the docs and comments. Refs #284 Verified: bunx vitest run cli/test/unit/ompFastMode.test.ts cli/test/unit/folderLockCreate.test.ts cli/test/unit/rootFlags.test.ts cli/test/unit/tidy.test.ts; bun run check; bun run smoke:package; bun cli/scripts/verify-ci-tools.ts
- Refuse at once when the link names another file; else compare the file type, device, inode, time, and raw bytes, so an atomic replace or a byte order mark during the check refuses with ConfigChanged. - Drop the second existence probe under the locks; compare scalar children inline in the reading walk. - Assert the ConfigChanged reason and the lock failure cause; register test folders before resolving them. Refs #284 Verified: bunx vitest run cli/test/unit/ompFastMode.test.ts cli/test/unit/folderLockCreate.test.ts cli/test/unit/rootFlags.test.ts; bun run check; bun run smoke:package
- Refuse a changed link or file identity before the second read, read, then check the identity once more, so a replace or a retarget during that read refuses with ConfigChanged. - Keep the inode and time in the byte order mark test, so only the byte comparison can catch it; assert SQLite's cause on a lock failure. Refs #284 Verified: bunx vitest run cli/test/unit/ompFastMode.test.ts cli/test/unit/folderLockCreate.test.ts cli/test/unit/rootFlags.test.ts; bun run check
- A second read that fails checks the identity: a file that became a folder is ConfigChanged (exit 2), else the read error stands. - Compare the identity and the bytes separately, the bytes once. - Pin a whole-second time and a same-length edit in the change tests, so only the byte comparison can catch them. Refs #284 Verified: bunx vitest run cli/test/unit/ompFastMode.test.ts cli/test/unit/folderLockCreate.test.ts cli/test/unit/rootFlags.test.ts; bun run check
DocksDocks
marked this pull request as ready for review
December 1, 2026 20:23
DocksDocks
deleted the
284-handle-empty-omp-tier-sections-in-the-fast-toggles
branch
December 1, 2026 20:40
This was referenced Dec 1, 2026
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.
Plan run: #284 Handle empty omp tier sections in the fast toggles
Pull request: #291. Checks: Full CI passed (run 46737133961, attempt 1, head
24e1320f). Reviewed head:24e1320f.What changed
docks-kit --fastand--ultrafasttoggle atierthat omp reads as null (tier:,tier: null,tier: ~,tier: !!null, an alias of a null) and keep the comments (cli/src/engine-native/ompFastMode.ts).config.ymlwith omp's reader (Bun.YAML.parse) before and after the rewrite, and refuses with no write when another setting would change as omp reads it: exact values, key order, and object sharing (ompFastMode.ts).serviceTierthat sets omp's OpenAI tier refuses, with the migration steps.TierToggleErrorwith a tagged reason, anOmpYamlReaderservice,FileSystemreads, and scoped home and folder locks (cli/src/engine-native/syncDispatch.ts homeAndFolderLocks,cli/src/commands/root.ts).ConfigChanged. A lock that cannot be opened or a failed read or write exits 1 with its error. Diagnostics show terminal controls as escapes.cli/docs/flags.md, three skill notes, talk bundle, payload, mutation golden.Decisions and corrections
engine-nativelater (plan Move the engine-native layer to Effect #290).DOCKS_KIT_SYNC_LOCK_WAIT_MSexit 2; a held lock, a lock that cannot be opened, and a failed read or write exit 1 (before, the last three exited 2).Delegated decisions
serviceTier: refuse while it sets the OpenAI tier. Rejected: copying omp's migration rules, which can change in any omp release. Reversibility: one commit. Record: Research decision "Choice: (a)".Reviews
Plan review passed in round 14. Code review passed in round 8.
Open findings, round 8 (pass), not repaired:
realPathand itslstat: the same check-then-act class as the rejections of rounds 4 to 7; it closes only with a lock shared with omp.ENOTDIRwhen a parent folder is replaced during the second read: the run exits 1 instead of 2; it needs that race, and the file is untouched.Verification
fast(bunx vitest run --reporter=verbose cli/test/unit/ompFastMode.test.ts cli/test/unit/rootFlags.test.ts): exit 0, 80 passed.tidy(tidy.test.ts,folderLockCreate.test.ts): exit 0, 55 passed.ci-tools(bun cli/scripts/verify-ci-tools.ts): exit 0.gen(bun run check:generated): exit 0.golden(bun run golden:mutation): OK, 13 cases.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, 6450 passed, 12 skipped; both golden suites OK.Limits and failures
Full CIcovers Ubuntu, macOS, and Windows. The write-failure test is skipped on Windows and as root.ompTriggerBackstop.test.tswhile the machine was loaded; this change touches no trigger rule, the file alone passed, and the next gate passed.Kept resources
Merge now: none.Leave pull request open: the worktreeissue-284and the local and remote branch284-handle-empty-omp-tier-sections-in-the-fast-toggles.After merge
main, gets its own code-review round, and lands next.engine-nativeto Effect; it carries the bounded-runner note from its first comment.Checklist
bun run checkpassesCloses #284