Attempt 10

Back to durable goal · Attempt history

Trigger

Independent review of Attempt 9 reproduced a lost update in pinned @deepseek-ai/cordis-plugin-hmr 1.0.16. A slow top-level-await replacement followed by a second source write left the latest bytes on disk while the earlier generation remained live. The public HMR surface has no module-failure event, so a wrapper-side single-flight gate cannot be both safe and recoverable.

Hypothesis

The narrowest robust correction belongs in HMR’s own reload scheduler. A standard pnpm dependency patch can serialize partialReload() calls, snapshot each observed change set, and drain changes arriving during an in-flight reload. mcp_cordis then remains a thin persistence and invocation gateway without source markers, Loader-cache inspection, polling, or acknowledgement state.

Frozen plan

  1. Keep the standard Cordis Loader, Include, Timer, and HMR services and normal cordis.yaml plus ESM plugin files.
  2. Patch the exact HMR 1.0.16 artifact through pnpm patchedDependencies. Track one module-refresh task, snapshot its stashed URLs before each reload, and drain any URLs observed while that reload is running.
  3. Patch both the published JavaScript and TypeScript source shipped in the package; bind the patch through the generated lockfile and Bazel module extension data.
  4. Add explicit release-gated overlapping-update regressions for slow top-level module evaluation and slow asynchronous apply() activation.
  5. Refresh a disabled entry’s exact cached module through HMR before enabling it, so activation returns only after the latest persisted source is live.
  6. Adopt the fetched base’s role-based layout: command files under cmd/mcp_cordis, private implementation under internal, and the separate suite under test.
  7. Preserve the two accepted repo_context review corrections and the worktree-local launcher.
  8. Stop before Git history mutation until the delivery adapter has an authorized, guarded path for the nine-commit feature range.

Current evidence

  • The package registry and upstream repository both expose 1.0.16 as the latest official HMR release; its source still invokes untracked concurrent partialReload() work and clears the shared stash after one successful run.
  • git apply --check accepts patches/hmr@1.0.16.patch against the exact resolved package bytes. Its SHA-256 and lockfile patch hash are both ec800d86298faacc86c7717ffa1dce7c28116ab1393b8abc198be6ac02c38489.
  • The patch serializes module reloads through complete Cordis Fiber cleanup and activation, drains newly stashed URLs, preserves and retries changes after unexpected scheduler failures, and declares its public refresh API in the shipped TypeScript declarations.
  • Bazel invocation ac79a8e4-f5d9-4dd7-a821-29bce3d8ece6 passes the focused runtime suite with explicit top-level-evaluation and asynchronous-apply overlap gates, failed-apply rollback and recovery, manual-edit, and disabled activation regressions.
  • Bazel invocation 65c1932a-896b-470d-9462-086dd93beaff passes ten runs each of runtime_test and starter_packages_test.
  • Bazel invocations 6490dd57-49e0-4558-b280-f5625db07208, 218e5797-b2d7-44bc-aded-f5df8139ca1c, and 09d4ec2c-aac1-4509-8579-5ef8c5eebe39 pass the complete project tests, complete project build, and root Buildifier check respectively.
  • Final independent HMR review accepts the patch identity, stashed-change draining, complete Fiber cleanup join, public declarations, causal overlap tests, rollback and recovery, and disabled-entry activation behavior. Its sole remaining finding was the corrected README publication-order wording.
  • The checked-in workspace launcher completed MCP initialization and returned all ten gateway tools while concurrent Bazel query invocation 7739c14e-1b22-40c7-94af-b81143e84d4a completed successfully; SIGINT then produced a clean server shutdown.
  • Preliminary current-tree Bazel invocations 95d37231-63f9-44f6-9eee-3f0fe8fb4107, d70f61a2-57e5-4ce9-b8fd-27b06bd02a6d, and 1e186c82-3bcd-4048-a534-fe747e1cf79c pass the complete affected test packet (10/10), affected build packet, and root Buildifier check.
  • Guarded delivery inspection found local and remote feature OID bc4e5ae97ef9ea968c01b1b2a55403ae032a6a8d, base OID d29f9d471ea467e8dfc75db4eedeedbbae43dc2d, same-repository PR 32, SSH transport, and nine linear commits all authored and committed by the task bot. Its sole refusal is version 1’s unconditional multi-commit range refusal; the fetched base contains the same limitation and no explicit consolidation authorization.
  • The user then explicitly authorized extending the adapter. The new prepare --consolidate <exact-head> path retains every other refusal and requires a single-parent chain, identical author and committer identities, the oldest commit’s ownership marker, unchanged pull-request projection, and signature preservation. It creates one aggregate commit while binding the original remote head into the normal publication receipt.
  • Bazel invocations 574dadd5-51b1-443e-b8c2-50ca5d257eb2 and 030a8bb4-2a22-4ece-b632-b3c75572bcee pass the complete adapter suite once, then its Go, skill-validation, and root Buildifier targets three times.
  • Independent adapter review found that the first implementation required an extra staged edit and therefore could not consolidate an already-clean range. The corrected gate permits an unchanged index only after exact consolidation evidence; parent-to-tree scope validation still rejects an empty aggregate. A clean --path integration case proves tree preservation and one final commit. Bazel invocation 0d715375-6a8d-4269-ad3e-f8a002888808 passes the corrected suite, and the independent re-review accepts it with no remaining findings.
  • Upstream incorporation review preserves the new projects/goal project, drops the deleted predecessor skill under projects/agents, adopts the role-based MCP layout, and adds root-consumer visibility to the branch-owned decision-review skill. The root discovery-link entry must be added after the new base is applied.
  • After that visibility correction, Bazel invocations 6099d90d-0ade-43b2-b50b-8f7050c26c32 and 7f4b37a4-b970-46ea-bc76-b4a60aeeab59 pass the focused skill validation and root Buildifier check; git diff --check also passes.

Current verdict

Proceed. The dependency-layer correction addresses the reproduced race and failure recovery at Cordis’s owning lifecycle boundary while the MCP wrapper remains a thin persistence and invocation gateway. The complete local project packet and focused independent review pass. Exact-candidate validation, rebase, publication, and hosted-thread reconciliation remain open.