Skip to content

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

Done

Description

@DocksDocks

Goal

Fix the review findings that stayed open when #291 (plan #284) and #292 (plan #285) merged, so that each one is repaired, not only recorded:

Scope: cli/src/engine-native/ompFastMode.ts, its tests, cli/docs/omp-context.md, and the release notes. User request: "also fix open findings in a follow up".

Yolo: the user delegated every decision except the merge to the agent.

Mode: plan-and-implement

Research

Repository facts (base b53f04d6):

  • cli/src/engine-native/ompFastMode.ts toggleDeployedOpenAiTier builds identityOf from fs.realPath(configPath) and then fs.lstat(target). When the config.yml link moves to another file between those two calls, lstat still reads the old target, the identity matches, and replaceFile(identity.target, …) writes the old target. omp then reads the new target, which the toggle did not change, and the toggle reports success. This is the round-8 MEDIUM of Handle empty OMP tier sections in the fast toggles #284.
  • missingAsRefusal maps only reason._tag === "NotFound" to ConfigMissing. The Effect Node file system (node_modules/@effect/platform-node-shared/src/internal/utils.ts handleErrnoException, used by realPath and lstat in NodeFileSystem.ts) maps ENOTDIR to BadResource, so a parent folder that became a file exits 1 through the error path of cli/src/commands/root.ts. PlatformError keeps syscall and the original error as cause (node_modules/effect/src/PlatformError.ts).
  • The handler on the second fs.readFile (a failed read that the identity check turns into ConfigChanged) has no test: the tests in cli/test/unit/ompFastMode.test.ts toggleDeployedOpenAiTier provide BunServices.layer, and no fixture changes the file at that read.
  • cli/docs/omp-context.md (retired values, OpenCode paragraph) says that sync prunes the retired values at their old kit value. cli/src/engine-native/ompRemovals.ts reads the direct YAML entries only, and the yaml library keeps a merge key (<<) as an entry without expanding it, so the pruner does not find a retired value that only a merge supplies, while omp, which reads config.yml with Bun.YAML.parse, expands the merge and reads that value. This is the round-4 LOW of Remove the kit-owned OpenCode integration from the OMP-only surface #285.

Decisions:

  • Retarget (redesigned in code-review round 1): each identity check runs realPath, then lstat of the target, then stat through config.yml, which follows the link as omp does, then realPath again, and requires the same device, inode, and time from both reads and the same path from both resolutions. The second realPath also sees a move to a hard link of the same file, which keeps the device, inode, time, and bytes (Node fs.realpath: hard links can give the same file different canonical paths). A retarget of the link or a replace of the file between the two reads refuses with ConfigChanged, also in the first check, before the toggle parses anything. A file that goes away after realPath succeeded is ConfigChanged; a path that names no file at realPath is ConfigMissing. Rejected: opening the file and checking the descriptor, because replaceFile writes by path through a rename and cannot use the descriptor. Residual, in the last check: a save of the file after its stat, and a retarget of the link after its last realPath, before the rename; omp shares no lock with the kit (cli/src/engine-native/ompFastMode.ts doc comment).
  • ENOTDIR: a BadResource failure whose cause has the code ENOTDIR is a path that names no file, like NotFound: ConfigMissing in requireDeployedConfig (the check before the locks) and at realPath, and ConfigChanged later in a check. Both refuse with exit 2. Rejected: ConfigChanged for every failure of the second check, because a missing file at the first read is not a change.
  • Merge keys in the retired values: document that the pruner does not follow a merge key (<<) to find a retired value, and leave the pruning logic unchanged. A merge source is an inline mapping or an alias of an anchor (YAML library, merge keys); pruning through an alias would edit the anchored mapping, which other keys can share. Rejected: expanding merges in ompRemovals.ts. The docs make no promise that sync keeps every merged value: when the pruner removes a direct key that holds an anchor that a merge uses, the alias has no target (cli/src/engine-native/ompRemovals.ts, node_modules/yaml/dist/nodes/Alias.js).
  • Version: patch bump to 0.32.2, because the exit code of a rare refusal changes (AGENTS.md, Version bumps).

Tool facts: Bun 1.4.5 (bun --version, 2026-12-01), Node v26.13.0 (node --version, 2026-12-01; Vitest starts through its Node shebang), Vitest 5.1.2 and effect 4.1.7 (bun.lock), GNU tar 1.35 and gzip 1.14 (tar --version, gzip --version, 2026-12-01; bun run smoke:package lists the packed tarball with tar -tzf), omp 19.2.1 (SoT/toolchain.json verified pin).

Steps

# Id Task Files Depends Effect Status Done when
1 identity_fix First add tests with a FileSystem layer that wraps the Bun one, and run red with them uncommitted: a retarget between realPath and lstat of the last check refuses with ConfigChanged and keeps the bytes of both targets; a parent folder that becomes a file before the second check refuses with ConfigMissing; a file that becomes a folder at the second read refuses with ConfigChanged (coverage of the existing handler). Then make the identity check of toggleDeployedOpenAiTier as the Retarget and ENOTDIR decisions say, also in requireDeployedConfig, and update the doc comment. Commit the tests and the fix together after fast passes cli/test/unit/ompFastMode.test.ts, cli/src/engine-native/ompFastMode.ts - local done red shows the retarget and ENOTDIR cases failing on their behavior assertions and the second-read case passing, then fast passes
2 merge_key_docs State in cli/docs/omp-context.md that the pruner does not follow a YAML merge key (<<) to find a retired value, so it does not prune a retired value that a merge supplies; make no claim that sync keeps every merged value, say that after a prune of a direct entry a merge left in config.yml can still supply the value, and that a prune that removes an anchor that a merge still uses can fail to write; and say that after a prune omp reads the key from its other settings layers, a merge left in config.yml included, in their usual order, or else uses its default cli/docs/omp-context.md - local done docs passes
3 release_notes Bump to 0.32.2, add the changelog entry, regenerate the payload, the talk bundle, and the mutation golden digests, which embed the version, then run bun run format after the golden update package.json, CHANGELOG.md, cli/src/generated/sotPayload.ts, SoT/.omp/plugin/extensions/talk.js, cli/test/goldens/mutation.json 1, 2 local done gen passes

Acceptance

ID Command Expected
deps bun install --frozen-lockfile in the linked worktree Exit 0; node_modules/vitest/package.json reads 5.1.2
red bun x --no-install vitest run --reporter=verbose cli/test/unit/ompFastMode.test.ts -t "toggleDeployedOpenAiTier" with the step 1 tests in the worktree and its ompFastMode.ts change not yet made Exit 1; the retarget and ENOTDIR cases fail on their _tag assertions; the second-read case passes
fast bun x --no-install vitest run --reporter=verbose cli/test/unit/ompFastMode.test.ts cli/test/unit/rootFlags.test.ts Exit 0; the step 1 cases pass
docs ./docks-kit docs omp-context Exit 0; the output names the merge key limit, says that a merge left in config.yml can still supply the value after a prune, and says that a prune that removes an anchor in use can fail to write
gen bun run check:generated Exit 0
dry ./docks-kit sync --dry-run Exit 0
smoke bun run smoke:package Exit 0; [package-smoke] clean-room consumer install passed, with the installed CLI at 0.32.2 and its --fast toggle of tier.openai
talk PATH="$PWD:$PATH" bun .agents/skills/verify/scripts/omp-smoke.ts, from the linked worktree Exit 0; prints talk tool: offered and warnings: 0, so omp loads the rebuilt talk.js
gate bun run check Exit 0

Do not touch

  • cli/src/engine-native/atomicWrite.ts: replaceFile stays the one atomic writer.
  • The pruning logic of cli/src/engine-native/ompRemovals.ts.

Open questions

Verification Results

Candidate 40a1f072 on Linux x64, 2026-12-01:

  • deps: bun install --frozen-lockfile exit 0; node_modules/vitest/package.json reads 5.1.2.
  • red (step 1 tests in the worktree, ompFastMode.ts at base): exit 1. The retarget case failed on its _tag assertion (received the toggle result, previous: "none"); the ENOTDIR case failed on its _tag assertion (received PlatformError with reason BadResource); the second-read case passed.
  • fast: exit 0, 83 passed.
  • docs: exit 0; the output names the merge key (<<) limit.
  • gen: exit 0 after bun cli/scripts/build-talk.ts, bun cli/scripts/generate-sot-payload.ts, and bun run golden:mutation --update-goldens, because the talk bundle and the mutation golden digests embed the package version. These two paths (SoT/.omp/plugin/extensions/talk.js, cli/test/goldens/mutation.json) are outside the Files cells of step 3.
  • dry: exit 0. smoke: exit 0, [package-smoke] tarball: docks-kit-0.32.2.tgz, clean-room consumer install passed.
  • gate: bun run check exit 0; 6457 unit tests passed, 12 skipped; golden-dryrun: OK (12 case(s)); golden-mutation: OK (13 case(s)).

Candidate 999a5aa1 (code-review rounds 1 and 2 and plan rounds 5 to 7 repaired) on Linux x64, 2026-12-01:

  • red for the repairs: the new cases failed on the previous candidates and pass now: the save after the lstat, the retarget after the lstat, the first-check retarget before parsing, and the ENOTDIR cases failed on 7aa4cda3's predecessor 40a1f072; the hard-link move failed on 7aa4cda3.
  • fast: exit 0, 91 passed.
  • docs: exit 0; the output names the merge key limit, a merge that can still supply the value after a prune, and a prune of an anchor in use that can fail to write.
  • gen: exit 0. dry: exit 0. smoke: exit 0, clean-room consumer install passed. talk: exit 0, talk tool: offered, warnings: 0.
  • gate: bun run check exit 0; 6465 unit tests passed, 12 skipped; both golden suites OK.

Activity

  1. self-assigned this
    on Dec 1, 2026
  2. DocksDocks commented on Dec 1, 2026

    @DocksDocks
    OwnerAuthor

    Delegation grant: yolo: "now start #290 please, use yolo, also fix open findings in a follow up"

  3. DocksDocks commented on Dec 1, 2026

    @DocksDocks
    OwnerAuthor

    Plan review round 1

    Plan-review: repair

    • goal_fit - Steps identity_recheck and race_tests, Depends and Done when - The plan puts the production fix before the tests, but SoT/.omp/plugin/skills/plan-manager/references/practices.md:209-224 requires the red baseline first. It also expects all three cases to fail without step 1. The directory-at-second-read case already returns ConfigChanged through the handler at cli/src/engine-native/ompFastMode.ts:375-382, so that case should pass on the base. - Run the retarget and ENOTDIR cases before changing production code and require them to fail on their behavior assertions. Keep the second-read case as a coverage check that passes on both versions. - class: incorrect red baseline for mixed behavior and coverage tests
    • goal_fit - Acceptance, missing package smoke - AGENTS.md:71 requires bun run smoke:package for user-facing changes. The listed gate does not invoke it (package.json:33-48), so every row can pass without checking the installed package's version or root toggle (cli/scripts/package-smoke.ts:459-468). - Add the required smoke row and expect the installed CLI to report the package version and toggle tier.openai. - class: missing required repository acceptance check
    • research_gap - Research, fourth repository fact; Steps merge_key_docs - Not following << is not a guarantee that an inherited value survives sync. Inference: if commands merges a map whose enableOpencodeProject references an anchor on omitThinking: false, the pruner deletes the anchor (cli/src/engine-native/ompRemovals.ts:58,318) and serialization rejects the unresolved alias (cli/src/engine-native/ompRemovals.ts:409, node_modules/yaml/dist/nodes/Alias.js:83-90). - Say that the pruner does not follow merge keys to find retired switches. Do not promise that sync preserves every value supplied by a merge. Leave pruning logic unchanged. - class: unconditional preservation claim for YAML merges
    • research_gap - Research, Tool facts; Acceptance fast and gate - Vitest's pinned entry point uses a Node shebang, and its manifest restricts the supported Node versions (node_modules/vitest/vitest.mjs:1, node_modules/vitest/package.json:114-116). Bun respects that shebang. A Bun-only checkout meets the recorded runtime facts but cannot start the planned Vitest command. - Record the supported Node version used for verification and its version source. - class: required test runtime missing from tool facts
    • security_risk - Acceptance fast, bunx vitest - On a fresh linked worktree without local Vitest, Bun falls back to installing and running the unversioned npm package rather than using the checkout's 5.1.2 pin. That conflicts with AGENTS.md:67. The frozen-lockfile bootstrap in docks-kit:85-97 does not run when bunx is called directly. - Provision the worktree dependencies from the frozen lockfile before testing, and run the local Vitest through bun run test:unit with the existing filters or use bun x --no-install. - class: unpinned package execution fallback in acceptance
  4. DocksDocks commented on Dec 1, 2026

    @DocksDocks
    OwnerAuthor

    Plan review round 2, delta

    Plan-review: repair

    • goal_fit - Steps race_tests and identity_recheck; Acceptance red - The plan requires a step 1 commit on which two focused tests fail. SoT/.omp/plugin/skills/plan-manager/references/practices.md:219-225,239-242 requires staging the red tests before implementation and passing focused tests on every commit. The planned commit cannot satisfy both rules. - Run red with the tests staged before changing production code. Commit the tests and fix together after fast passes. - class: red baseline required on a commit that must pass
    • research_gap - Research, fourth repository fact - The claim that a value supplied by a merge key “stays” still contradicts the new decision. Inference: if a merged OpenCode switch refers to an anchor on omitThinking: false, pruning removes that anchor and serialization rejects the unresolved alias rather than completing sync (cli/src/engine-native/ompRemovals.ts:58,318,409; node_modules/yaml/dist/nodes/Alias.js:83-90). - Say that the pruner does not follow merge keys to find retired switches, without promising that sync preserves inherited values. - class: unconditional preservation claim for YAML merges
    • research_gap - Research, merge-key decision - The plan says pruning through a merge would edit the user's anchor. The official YAML library docs allow an inline mapping as the merge source. In commands: {<<: {enableOpencodeProject: false}}, there is no anchor to edit. - Keep the docs-only decision and state that editing an aliased merge source can affect other keys that share it. - class: false premise that merge sources are always anchored
    • research_gap - Research, Tool facts; Acceptance smoke - cli/scripts/package-smoke.ts:260-262,465-467 runs tar -tzf before checking the installed CLI. A worktree with the listed tools but no compatible tar fails before checking the version or toggle. The plan contract's Tool facts rule requires the executable's version and source. - Record the tar version and source for the smoke environment. - class: required smoke executable missing from tool facts

    Previous findings:

    • Round-1 finding on Steps identity_recheck and race_tests, Depends and Done when: resolved - race_tests now precedes the fix, and red expects the two behavior tests to fail while the existing second-read behavior passes.
    • Round-1 finding on Acceptance, missing package smoke: resolved - smoke now runs bun run smoke:package and names the installed version and --fast toggle.
    • Round-1 finding on Research, fourth repository fact; Steps merge_key_docs: open - repeated above.
    • Round-1 finding on Research, Tool facts; Acceptance fast and gate: resolved - Tool facts now record Node v26.13.0 and its dated version source, and identify the Vitest shebang.
    • Round-1 finding on Acceptance fast, bunx vitest: resolved - deps installs from the frozen lockfile, and both focused commands use bun x --no-install vitest.

    Manager response to round 1

    Repaired:

    • Red baseline order: the tests are now step 1 (race_tests) and the fix step 2; the new red row requires the retarget and ENOTDIR cases to fail on their _tag assertions and the second-read case to pass, as coverage of the existing handler.
    • Package smoke: added the smoke row (bun run smoke:package).
    • Merge-key claim: the docs step and the Research decision now say only that the pruner does not follow a merge key, and make no claim that sync keeps every merged value; the alias case is recorded.
    • Node: Tool facts record Node v26.13.0, inside the Vitest engines range ^22.12.0 || ^24.0.0 || >=26.0.0.
    • Unpinned fallback: the new deps row installs from the frozen lockfile, and the test rows use bun x --no-install vitest.

    Rejected: none.

    Redesigned: none.

  5. DocksDocks commented on Dec 1, 2026

    @DocksDocks
    OwnerAuthor

    Plan review round 3, delta

    Plan-review: repair

    • goal_fit - Steps race_tests and identity_recheck - race_tests now includes committing the tests after step 2 passes fast, but identity_recheck depends on race_tests. The plan contract requires dependencies to finish before dependent work starts, and the practices require each step’s commit to pass focused tests (SoT/.omp/plugin/skills/plan-manager/references/plan-contract.md:134; SoT/.omp/plugin/skills/plan-manager/references/practices.md:240-242). After red, step 1 cannot finish as written until step 2 runs, and committing step 1 alone would leave two failing tests. - Put the tests and fix in one step. Keep red before the production change, stage the tests, then commit both after fast passes. Update the release step’s dependency and the Acceptance references. - class: prerequisite step cannot finish before dependent work starts

    Previous findings:

    • Round-2 finding on Steps race_tests and identity_recheck; Acceptance red: resolved - red now runs against uncommitted tests before the fix. No commit is required to contain failing tests.
    • Round-2 finding on Research, fourth repository fact: resolved - The fact now says the pruner does not find merge-only values; it no longer promises that sync preserves them.
    • Round-2 finding on Research, merge-key decision: resolved - The decision distinguishes inline mappings from aliases and limits the shared-anchor concern to aliases.
    • Round-2 finding on Research, Tool facts; Acceptance smoke: resolved - Tool facts now record GNU tar 1.35 and gzip 1.14 with dated --version sources.

    Manager response to round 2

    Repaired:

    • Red baseline on a commit: red now runs with the step 1 tests in the worktree before the step 2 change; step 1 commits the tests together with step 2 after fast passes, so each commit passes its focused tests.
    • Merge-key claim: the fourth repository fact now says only that the pruner does not find a retired value that only a merge supplies; it makes no claim that sync keeps the value.
    • Inline merge sources: the decision now names both merge source forms, an inline mapping and an alias, and says that pruning through an alias would edit a mapping that other keys can share.
    • tar: Tool facts record GNU tar 1.35 and gzip 1.14 with their dated --version source.

    Rejected: none.

    Redesigned: none.

  6. DocksDocks commented on Dec 1, 2026

    @DocksDocks
    OwnerAuthor

    Plan review round 4, delta

    Plan-review: pass

    None.

    Previous findings:

    • Round-3 finding on Steps race_tests and identity_recheck: resolved - identity_fix runs red before the production edit and commits the tests and fix together after fast passes. red now points to step 1, and release_notes depends on the combined step and merge_key_docs.

    Manager response to round 3

    Repaired:

    • Steps race_tests and identity_recheck are now one step, identity_fix: it adds the tests, runs red with them uncommitted, makes the fix, and commits both after fast passes. release_notes depends on steps 1 and 2, and red names the step 1 change.

    Rejected: none.

    Redesigned: none.

  7. DocksDocks commented on Dec 1, 2026

    @DocksDocks
    OwnerAuthor

    Self-review

    correctness

    No findings. Checked: a retarget during the first identity check makes type Retargeted, the first read then reads the old target, and the second check sees the new realPath and refuses with ConfigChanged; ENOTDIR at the first read and at the second read goes through missingAsRefusal to ConfigMissing before the second-read handler runs.

    spec-and-tests

    No findings. Checked: the hooks count calls per name, so the retarget case acts before the third lstat (the last check) and the ENOTDIR case before the second lstat (the check before the second read), in both the base and the fixed call order. On Windows, a path under a file gives ENOENT, which also maps to ConfigMissing.

    text-and-safety

    No findings. Checked: the changelog entry names the two behavior changes and the exit code change; the docs sentence makes no claim about merged values that sync keeps.

  8. DocksDocks commented on Dec 1, 2026

    @DocksDocks
    OwnerAuthor

    Code review round 1, lens correctness

    Code-review: pass

    Standards

    • [MEDIUM] Bug - cli/src/engine-native/ompFastMode.ts:372-379, cli/src/engine-native/ompFastMode.ts:406-409 - If an editor atomically saves new config bytes at the same path while the final realPath is pending, the toggle can overwrite the save and report success. The new call checks the path string but reuses metadata and bytes read before the save. Inference: a replacement with a new inode passes this check if it keeps the same canonical path. - Keep the path comparison, then verify the file metadata through configPath as the last check before replaceFile. - class: stale metadata after path revalidation
    • [LOW] Bug - cli/src/engine-native/ompFastMode.ts:370-392 - If the first identity check observes a retarget, the toggle still reads and parses the old file. Inference: if that file contains invalid YAML, the CLI reports invalid config instead of asking the user to retry. If the old target disappears before lstat, the check instead reports ConfigMissing without checking whether the link now resolves to a valid file. - Return ConfigChanged as soon as the second resolution proves a retarget. If lstat reports the old target missing, recheck the live path before classifying the config as missing. - class: retarget refusal bypassed by stale target
    • [LOW] Bug - cli/src/engine-native/ompFastMode.ts:291-295, cli/src/engine-native/ompFastMode.ts:357-365, cli/src/commands/root.ts:95-99, CHANGELOG.md:8-10 - If an agent directory is already a regular file when either toggle starts on Linux, the pre-lock existence check can return ENOTDIR. Inference: Effect propagates it as BadResource, so the CLI exits 1 before reaching the new mapping. The changelog promises exit 2 for this condition. - Reuse the missing-config error mapping in the pre-lock check without moving that check under the locks. - class: inconsistent missing-path classification

    Spec

    None.

    Code review round 1, lens spec-and-tests

    Code-review: pass

    Standards

    • [LOW] Bug - cli/test/unit/ompFastMode.test.ts:441-448 - On Windows without permission to create file symlinks, the new regression test fails in symlinkSync before it reaches the toggle. - Gate the two file-symlink fixtures in this suite on symlink creation support. Keep the race assertions on hosts that support it. - class: test requires undeclared filesystem privilege
    • [LOW] Maintainability - cli/test/unit/ompFastMode.test.ts:458-475 - The test says the parent becomes a file before the second check, but it changes the parent after that check's first realPath has succeeded. The test would still pass if either realPath stopped mapping ENOTDIR to ConfigMissing. - Keep the lstat case and use the existing realPath hook to cover the other two calls in the second check. - class: incomplete error-path coverage

    Spec

    • [MEDIUM] Spec - cli/src/engine-native/ompFastMode.ts:370-392 - When the first identity check sees the link move, it records Retargeted but still reads and parses the old target. If the old target contains invalid YAML, the command reports that error instead of ConfigChanged. If the link moves back before the next check, the command can write despite having observed the retarget. plan-293.md:29,40 requires the toggle to “refuse with ConfigChanged when it differs.” - Return ConfigChanged from the identity check as soon as the resolved paths differ. Add a first-check case with invalid YAML in the old target so a later refusal cannot mask the defect. - class: detected retarget not enforced
    • [LOW] Spec - cli/docs/omp-context.md:177-179 - The phrase “while omp still reads it” promises more than plan-293.md:41 allows: “make no claim that sync keeps every merged value.” For example, if github merges an anchored advisor mapping with enabled: true and another key, the pruner removes advisor.enabled directly and keeps the anchor. Inference: omp can no longer obtain github.enabled: true from that merge. - State that the pruner does not follow merge keys. Remove the promise about what omp reads after sync. - class: unsupported preservation guarantee
    • [LOW] Spec - SoT/.omp/plugin/extensions/talk.js:80, cli/test/goldens/mutation.json:26-29 - The version bump requires both generated updates, but plan-293.md:42 lists only package.json, CHANGELOG.md, and cli/src/generated/sotPayload.ts in the release step. The verification note at plan-293.md:72 records the extra writes, but plan-contract.md:96-97 says “Files defines scope.” - Add both generated paths to the release step. Keep the version-only regeneration. - class: required generated changes missing from step scope

    Code review round 1, lens text-and-safety

    Code-review: pass

    Standards

    • [LOW] Bug - CHANGELOG.md:8-10, cli/src/engine-native/ompFastMode.ts:290-296, cli/src/commands/root.ts:95-99, cli/src/commands/root.ts:130-141 - On Linux, if an ancestor of config.yml is already a regular file when the toggle starts, the preflight fs.exists propagates ENOTDIR as BadResource. The CLI still exits 1. The changelog promises exit 2 without limiting the claim to the checks after lock acquisition. - Limit the release note to ENOTDIR detected during the deployed-config checks after the locks are acquired. - class: overstated exit-code coverage
    • [LOW] Bug - cli/docs/omp-context.md:177-189, cli/src/engine-native/ompRemovals.ts:293-318 - When commands sets enableOpencodeProject: false directly and its merge source also supplies false, sync removes the direct entry but leaves the merge. Inference: because omp expands the merge, it can still read false from the same file. The next paragraph incorrectly says omp then uses another layer or its default. - State that another layer or the default applies only when the deployed config no longer supplies the key, and describe the merge limitation without promising that all merge sources survive sync. - class: incorrect settings fallback documentation
    • [LOW] Bug - cli/src/engine-native/ompFastMode.ts:309-316, cli/src/engine-native/ompFastMode.ts:344-346, cli/src/engine-native/ompFastMode.ts:370-396 - When the initial identity check detects a retarget, it returns a Retargeted marker but still reads and parses the old target. If that target contains invalid YAML, the user gets a YAML refusal instead of ConfigChanged, despite the comment saying a detected retarget refuses. - Return ConfigChanged directly when the two resolutions disagree, before returning an identity. - class: detected change carried as usable state
    • [LOW] Bug - cli/src/engine-native/ompFastMode.ts:345-350, cli/src/engine-native/ompFastMode.ts:370-379, cli/src/engine-native/ompFastMode.ts:406-409 - A concurrent replacement at the same target path can be missed after the final lstat, even before the final realPath returns. The comment puts the remaining window after the whole check. It also says a later link retarget is lost, but inference: if only config.yml is retargeted and its old target remains, the toggle can write the old target without undoing the link change. - Document separate cutoffs for file identity and link destination, and distinguish an overwritten edit from a write to the old target. - class: inaccurate race-window documentation
    • [LOW] Bug - cli/test/unit/ompFastMode.test.ts:432-449, cli/test/unit/ompFastMode.test.ts:458-472 - The race tests misname their injection points. The retarget runs before the final lstat and before the last realPath, while the folder replacement runs during the second check, after its first resolution. Those distinctions matter when maintaining tests for these exact windows. - Name the first resolution and lstat of the relevant identity check in each test. - class: test name misstates race timing
    • [LOW] Maintainability - cli/test/unit/ompFastMode.test.ts:71-94 - Unreached: the realPath hook adds a counter and wrapper, but all three deployedOutcome fixtures use only lstat or readFile. The helper is file-local and has no other callers or documented inputs. - Remove the unused hook, counter, and override. - class: unused test seam

    Spec

    None.

  9. DocksDocks commented on Dec 1, 2026

    @DocksDocks
    OwnerAuthor

    Plan review round 5, delta

    Plan-review: repair

    • goal_fit - Research, Retarget; Steps identity_fix - The plan checks file identity but renames a pathname. Node documents that hard links can give the same file different canonical paths. Inference: if config.yml moves from old.yml to a hard link new.yml between the final realPath and lstat, the device, inode, time, and bytes still match. toggleDeployedOpenAiTier then calls replaceFile on old.yml, and the rename replaces only that directory entry (cli/src/engine-native/atomicWrite.ts:188-201). The toggle reports success while omp still reads the unchanged new.yml, instead of refusing with ConfigChanged. - Revalidate the resolved pathname as well as the live file metadata. Keep the same-path replacement check and document the remaining race window for each check. - class: inode identity mistaken for pathname identity
    • goal_fit - Steps merge_key_docs, “only when config.yml no longer supplies the key” - omp 19.2.1 merges project settings and config overlays over global settings. If the deployed file supplies commands.enableOpencodeProject: false through a merge and a project sets it to true, omp uses true. The planned wording says the project value cannot apply while the deployed file still supplies the key. - Say that removing the deployed key removes that layer’s contribution, and that other layers still apply in their normal precedence order. - class: fallback wording reverses settings precedence
    • goal_fit - Steps release_notes, Files; Acceptance gen, smoke, and gate - SoT/.omp/plugin/package.json tells omp to load extensions/talk.js, and the regenerated version is used in the extension’s singleton check (cli/talk/extension.ts:409-425). The listed checks can rebuild the bundle, verify its deployed bytes, and run the packaged CLI without having omp load the extension and offer talk. The plan contract requires that end-to-end check for the newly listed executable bundle. - Add the existing isolated omp load smoke, bun .agents/skills/verify/scripts/omp-smoke.ts, and expect exit 0 and talk tool: offered. - class: changed executable bundle lacks end-to-end acceptance
    • goal_fit - Steps release_notes; Acceptance gen and gate - AGENTS.md:71 requires bun run format after --update-goldens. Step 3 now regenerates the mutation goldens, but gen checks only the payload and talk bundle, and gate invokes format:check, not the required formatter (package.json:34,46-48). The plan can mark regeneration done without running the required command. - Include bun run format immediately after the golden update in the regeneration sequence, before the existing checks. - class: required post-regeneration command omitted

    Previous findings:

    None in round 4.

    Manager response to round 4

    Repaired:

    • Research, Retarget: redesigned. Each identity check runs realPath, lstat of the target, then stat through config.yml, and requires the same device, inode, and time from both reads; a detected retarget or replace refuses at once, also in the first check, before parsing. The residual window starts after the last stat.
    • Research, ENOTDIR: requireDeployedConfig and realPath give ConfigMissing; a failure later in a check gives ConfigChanged; both exit 2.
    • Step 1 task: points to these decisions and names requireDeployedConfig.
    • Step 2 task: the docs make no claim about what omp reads after sync, and say that omp uses another layer only when config.yml no longer supplies the key.
    • Step 3 Files: adds SoT/.omp/plugin/extensions/talk.js and cli/test/goldens/mutation.json, which the version regeneration writes.

    Rejected: none.

    Redesigned: none.

  10. DocksDocks commented on Dec 1, 2026

    @DocksDocks
    OwnerAuthor

    Plan review round 6, delta

    Plan-review: repair

    • goal_fit - Steps merge_key_docs, “once sync removes the key, config.yml adds no value for it” - Inference: if commands sets enableOpencodeProject: false directly and also inherits that key as true through <<, sync deletes only the direct entry and leaves the merge (cli/src/engine-native/ompRemovals.ts:304-341). omp still gets true from config.yml through Bun’s YAML merge handling, contrary to the planned wording and cli/docs/omp-context.md:185-187. - Say that sync removes the direct entry and that other settings layers and defaults apply in their usual order; do not say the file stops supplying the key. - class: direct YAML deletion mistaken for removal of the effective value
    • goal_fit - Acceptance talk - The smoke requires docks-kit on PATH (.agents/skills/verify/SKILL.md:21) and invokes it to create scratch before starting omp (.agents/skills/verify/scripts/omp-smoke.ts:322-328,1356-1358). In a linked worktree with the listed tools and dependencies but no globally installed docks-kit, the row exits before loading talk.js instead of printing talk tool: offered. - Run the row with PATH="$PWD:$PATH" so the smoke can use the checkout launcher. - class: acceptance command relies on an unstated executable prerequisite

    Previous findings:

    • Round-5 finding on Research, Retarget; Steps identity_fix: resolved - Research now requires the two resolved paths to match as well as the live file metadata, and states the remaining race windows.
    • Round-5 finding on Steps merge_key_docs, “only when config.yml no longer supplies the key”: resolved - Step 2 no longer makes higher-priority layers conditional on the deployed file omitting the key. The new claim about what the deployed file supplies is reported above.
    • Round-5 finding on Steps release_notes, Files; Acceptance gen, smoke, and gate: resolved - The new talk row loads the checkout bundle in real omp and checks that it offers talk without warnings. Its missing prerequisite is reported above.
    • Round-5 finding on Steps release_notes; Acceptance gen and gate: resolved - Step 3 now runs bun run format after updating the mutation goldens.

    Manager response to round 5

    Repaired:

    • Hard links: each identity check now ends with a second realPath and requires the same path, so a move to a hard link of the same file refuses; Research names both residual windows of the last check. The code (commit 3a363d9c) and a test for the hard-link move are in place; the test fails on the previous candidate 7aa4cda3.
    • Settings precedence: the docs step and cli/docs/omp-context.md now say that once sync removes the key, config.yml adds no value for it and omp applies its other layers in their usual order.
    • Talk bundle: the new talk row runs bun .agents/skills/verify/scripts/omp-smoke.ts and expects talk tool: offered.
    • Format: step 3 runs bun run format after the golden update.

    Rejected: none.

    Redesigned: none.

  11. DocksDocks commented on Dec 1, 2026

    @DocksDocks
    OwnerAuthor

    Plan review round 7, delta

    Plan-review: repair

    • goal_fit - Steps merge_key_docs, “sync removes the direct entry”; cli/docs/omp-context.md:173-188 - Inference: if commands contains only enableOpencodeProject: false and another mapping merges from its anchor, pruning removes the now-empty commands mapping and its anchor. cli/src/engine-native/ompRemovals.ts:318-341,405-409 then tries to serialize the result. The YAML library rejects the unresolved alias, so sync never writes the deletion and the direct false remains. The new wording instead promises deletion followed by normal settings resolution. - Describe what omp reads after a successful prune and note that removing an anchor still used by a merge can prevent the prune from being written. Leave the pruning logic unchanged. - class: documentation treats an in-memory deletion as a guaranteed write
    • goal_fit - Acceptance docs; Steps merge_key_docs, Done when - Inference: a partial repair can print the merge-key limit at cli/docs/omp-context.md:177-179 while still claiming that config.yml cannot supply the value after direct pruning. cli/src/commands/docs.ts:77-81 prints the topic verbatim, so that output exits 0 and meets the current expectation even though the contradiction remains. - Update the existing row to require that the output also explain that a surviving merge can still supply the value after a successful direct prune. - class: acceptance passes with contradictory documentation

    Previous findings:

    • Round-6 finding on Steps merge_key_docs, “once sync removes the key, config.yml adds no value for it”: resolved - Step 2 now explicitly includes a surviving merge in config.yml among the sources omp can read.
    • Round-6 finding on Acceptance talk: resolved - The row prepends the linked worktree root to PATH, so createScratch can find the checkout launcher without a global docks-kit install.

    Manager response to round 6

    Repaired:

    • Direct entry: the docs step and cli/docs/omp-context.md now say that sync removes the direct entry, and that omp then reads the key from its other layers, a merge key left in config.yml included, in their usual order, or else uses its default.
    • talk prerequisite: the row runs PATH="$PWD:$PATH" bun .agents/skills/verify/scripts/omp-smoke.ts from the linked worktree, so the smoke uses the checkout launcher.

    Rejected: none.

    Redesigned: none.

  12. DocksDocks commented on Dec 1, 2026

    @DocksDocks
    OwnerAuthor

    Plan review round 8, delta

    Plan-review: pass

    None.

    Previous findings:

    • Round-7 finding on Steps merge_key_docs, “sync removes the direct entry”: resolved - Step 2 now describes settings resolution after a successful prune and says that removing an anchor still used by a merge can prevent the prune from being written.
    • Round-7 finding on Acceptance docs; Steps merge_key_docs, Done when: resolved - The docs row now requires the CLI output to explain both that a surviving merge can still supply the value after a prune and that removing an anchor in use can prevent the write.

    Manager response to round 7

    Repaired:

    • Prune of an anchor in use: the docs step and cli/docs/omp-context.md now say that a prune that removes an anchor that a merge still uses can fail to write, so the entry stays, and the OpenCode paragraph says what omp reads after a prune.
    • docs row: it now requires both statements: a merge left in config.yml can still supply the value after a prune, and a prune of an anchor in use can fail to write.

    Rejected: none.

    Redesigned: none.

  13. DocksDocks commented on Dec 1, 2026

    @DocksDocks
    OwnerAuthor

    Code review round 2, delta

    Code-review: pass

    Previous findings

    • Round-1 finding on cli/src/engine-native/ompFastMode.ts:372-379,406-409: open - The final realPath still runs after the last metadata read. The plan records this as a residual race, but the round-1 repair record says it was fixed. Repeated under Standards.
    • Round-1 finding on cli/src/engine-native/ompFastMode.ts:370-392 (correctness): fixed - The identity check refuses before reading the old target. If the old target disappears after resolution, lstat returns ConfigChanged through goneAsChange at cli/src/engine-native/ompFastMode.ts:402-434.
    • Round-1 finding on cli/src/engine-native/ompFastMode.ts:291-295,357-365: fixed - The pre-lock check maps ENOTDIR to ConfigMissing. See cli/src/engine-native/ompFastMode.ts:311-324 and cli/test/unit/ompFastMode.test.ts:570-583.
    • Round-1 finding on cli/test/unit/ompFastMode.test.ts:441-448: rejected - The rejection cites two Windows CI runs that passed the same ungated file-symlink operation in the existing fixture at cli/test/unit/ompFastMode.test.ts:375-384.
    • Round-1 finding on cli/test/unit/ompFastMode.test.ts:458-475: open - The first realPath and lstat have cases, but stat and the trailing realPath do not. Repeated under Standards.
    • Round-1 finding on cli/src/engine-native/ompFastMode.ts:370-392 (Spec): fixed - A detected retarget returns ConfigChanged before parsing. The invalid-old-YAML fixture at cli/test/unit/ompFastMode.test.ts:505-517 checks this.
    • Round-1 finding on cli/docs/omp-context.md:177-179: fixed - cli/docs/omp-context.md:177-182 describes what a surviving merge can supply and what happens if the prune removes an anchor in use. It no longer promises preservation.
    • Round-1 finding on SoT/.omp/plugin/extensions/talk.js:80, cli/test/goldens/mutation.json:26-29: fixed - Step 3 now lists both generated paths at plan-293.md:42.
    • Round-1 finding on CHANGELOG.md:8-10: open - The startup case is fixed, but the blanket exit-2 promise still covers a folder that changes while the command waits for its locks. Repeated under Standards.
    • Round-1 finding on cli/docs/omp-context.md:177-189: fixed - cli/docs/omp-context.md:182-189 now includes a merge left in config.yml among the sources that can supply the key after a prune.
    • Round-1 finding on cli/src/engine-native/ompFastMode.ts:309-316,344-346,370-396: fixed - The identity check fails at cli/src/engine-native/ompFastMode.ts:422-428 instead of returning a usable identity with a retarget marker.
    • Round-1 finding on cli/src/engine-native/ompFastMode.ts:345-350,370-379,406-409: fixed - cli/src/engine-native/ompFastMode.ts:380-382 distinguishes the metadata cutoff from the link cutoff and describes what each race can overwrite.
    • Round-1 finding on cli/test/unit/ompFastMode.test.ts:432-449,458-472: fixed - The labels at cli/test/unit/ompFastMode.test.ts:465-468,555-558 now match the injection points.
    • Round-1 finding on cli/test/unit/ompFastMode.test.ts:71-94: fixed - The case at cli/test/unit/ompFastMode.test.ts:555-565 uses the realPath hook.

    Standards

    • [MEDIUM] Bug - cli/src/engine-native/ompFastMode.ts:417-429,451-454 - An editor can save new bytes at the same path while the last realPath is pending. Inference: if the canonical path stays the same, the toggle accepts metadata and bytes read before the save, then overwrites it. The test at cli/test/unit/ompFastMode.test.ts:519-535 saves before stat and does not cover this window. - Keep the approved check order and record this as an evidence-backed rejection under the residual-window decision at plan-293.md:29, rather than recording the race as fixed. - class: stale metadata after path revalidation
    • [LOW] Bug - CHANGELOG.md:9-12, cli/src/commands/root.ts:95-99,130-134, cli/src/engine-native/syncDispatch.ts:218-224,252-264 - If the agent folder becomes a regular file after preflight while the toggle waits for the home lock, the folder lock cannot open. Inference: this yields LockAcquireError and exit 1, not the promised exit 2. - Limit the exit-2 promise to non-directory ancestors detected by the config checks. - class: overstated exit-code coverage
    • [LOW] Bug - CHANGELOG.md:5-8, cli/src/engine-native/ompFastMode.ts:371-382 - The release note promises refusal when another writer saves a replacement “during a check,” and the doc comment says the toggle “refuses any change.” A same-path save after the final stat but before the last realPath returns is still inside the check. Inference: the toggle can overwrite that save. - Say the toggle refuses when its checks detect a change, and retain the separate cutoffs already documented in the source. - class: overstated concurrent replacement protection
    • [LOW] Maintainability - cli/test/unit/ompFastMode.test.ts:554-567, cli/src/engine-native/ompFastMode.ts:416-419 - The tests change the parent before the first realPath or before lstat. They would still pass if stat or the trailing realPath stopped mapping ENOTDIR to ConfigChanged. - Add rows that replace the parent immediately before the second check’s stat and trailing realPath. Assert ConfigChanged and unchanged bytes. - class: incomplete error-path coverage

    Spec

    None.

    Manager response to round 1

    Repaired:

    • correctness MEDIUM (a save at the same path after the last lstat): each identity check now ends with stat through config.yml and requires the device, inode, and time of the lstat; a replace or a retarget after the lstat refuses with ConfigChanged. Test: the editor-style save before the third stat, and the retarget before the third lstat and before the third stat.
    • correctness LOW, spec-and-tests MEDIUM, text-and-safety LOW (a retarget in the first check still parsed the old target): the identity check now fails with ConfigChanged at once. Test: the first-check retarget with an old target that is not YAML.
    • correctness LOW (an old target missing after realPath): a NotFound or ENOTDIR failure of lstat or stat, after realPath succeeded, is ConfigChanged.
    • correctness LOW, text-and-safety LOW (the check before the locks): requireDeployedConfig maps ENOTDIR to ConfigMissing. Test: a folder of the path that is a file from the start, through requireDeployedConfig and through the toggle. The changelog states both exit-2 outcomes.
    • text-and-safety LOW (fallback docs), spec-and-tests LOW (preservation claim): omp-context.md says that sync does not prune a retired value that a merge supplies, with no claim about what omp reads, and that omp uses another layer only when config.yml no longer supplies the key.
    • text-and-safety LOW (race-window comment): the doc comment names the last stat as the last check, and says that after it a save is overwritten and a retargeted link gets the old target written.
    • text-and-safety LOW (test names), spec-and-tests LOW (realPath coverage): each case names its exact step; the ENOTDIR cases run before the realPath (ConfigMissing) and after it (ConfigChanged) of the second check.
    • text-and-safety LOW (unused realPath hook): the hook now has a caller.
    • spec-and-tests LOW (Files scope of the release step): plan edit, reviewed in plan round 5; step 3 lists SoT/.omp/plugin/extensions/talk.js and cli/test/goldens/mutation.json.

    Rejected:

    • spec-and-tests LOW (Windows without the right to create file links): rejected. The existing ungated case keeps a symlinked config.yml a link in the same suite creates a file link with symlinkSync, and it passed on the portable (windows-2025) unit jobs of Full CI runs 46737133961 and 46741340983. The new cases use the same call on the same runner, and the repository has no symlink gate helper (cli/test/lib/).

    Redesigned:

    • Identity check (from plan review round 5): each check ends with a second realPath, so a move to a hard link of the same file refuses. Record: plan Research, Retarget decision.
  14. DocksDocks commented on Dec 1, 2026

    @DocksDocks
    OwnerAuthor

    Code review round 3, delta

    Code-review: pass

    Previous findings

    • Round-2 finding on cli/src/engine-native/ompFastMode.ts:417-429,451-454: rejected - The final realPath does not reread file metadata, so a same-path save after the final stat remains possible. The plan explicitly accepts that window at plan-293.md:29, and cli/src/engine-native/ompFastMode.ts:381-383 documents it.
    • Round-2 finding on CHANGELOG.md:9-12, cli/src/commands/root.ts:95-99,130-134, cli/src/engine-native/syncDispatch.ts:218-224,252-264: fixed - CHANGELOG.md:9-12 limits the exit-2 claim to non-directory ancestors found by the config checks. Lock acquisition failures still exit 1.
    • Round-2 finding on CHANGELOG.md:5-8, cli/src/engine-native/ompFastMode.ts:371-382: fixed - CHANGELOG.md:5-8 and cli/src/engine-native/ompFastMode.ts:371-383 limit the refusal claim to changes the checks detect. The source comment retains both race windows.
    • Round-2 finding on cli/test/unit/ompFastMode.test.ts:554-567, cli/src/engine-native/ompFastMode.ts:416-419: fixed - cli/test/unit/ompFastMode.test.ts:553-569 now replaces the parent before each of the four calls in the second check. The new cases assert ConfigChanged and verify that the moved config retains its original bytes.

    Standards

    None.

    Spec

    None.

    Manager response to round 2

    Repaired:

    • LOW (exit-2 note): the changelog limits exit 2 to a folder of the path that is not a folder and that the checks of config.yml find; a lock that cannot open keeps its exit 1.
    • LOW (overstated protection): the changelog and the doc comment say that the toggle refuses each change that its checks detect; the doc comment keeps the two windows of the last check.
    • LOW (ENOTDIR coverage): the cases now replace the parent before each call of the second check (both realPath calls, lstat, and stat), with ConfigMissing at the first realPath and ConfigChanged at the others.

    Rejected:

    • MEDIUM (a same-path save while the last realPath of the last check runs): rejected as a fix and kept as the recorded residual window, as the reviewer proposes. Every order of the two final reads leaves one window: a save after the stat, or a retarget after the last realPath. Closing both needs a lock that omp shares with the kit, which omp does not offer; the plan Research (Retarget decision, Residual) and the doc comment of toggleDeployedOpenAiTier record both windows. The round-1 repair record claims the fix only for a save after the lstat, which the stat now sees.

    Redesigned: none.

  15. DocksDocks commented on Dec 1, 2026

    @DocksDocks
    OwnerAuthor

    Archived with landing pull request #299

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions