Skip to content

fix(link): restore guarded stop cleanup with native Windows owner proof - #8933

Draft
luvs01 wants to merge 7 commits into
lidge-jun:devfrom
luvs01:fix/link-stop-native-proof-20261119
Draft

luvs01 wants to merge 7 commits into
lidge-jun:devfrom
luvs01:fix/link-stop-native-proof-20261119

Conversation

@luvs01

@luvs01 luvs01 commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Follow up on the Link stop restoration now merged into dev as #8937. The current diff retains the remaining Windows command-line, native ownership, rollback and recycle corrections. Saved connections and credentials remain intact; conflicting or unverified ownership refuses destructive actions.

  • Read creation time, token SID and stop-owner argv through the same live native handle. Keep the existing .NET tick precision, strict SID/liveness checks, native Windows double-quote/backslash parsing and literal apostrophes. Unavailable native proof refuses without repeated CIM subprocesses.
  • Close an unpublished rollback listener before yielding, retry only proven lifecycle/configuration lock contention within one remaining rebind budget, and recheck ownership on every attempt. Standalone recycle keeps the Link apply exclusion through supervisor/listener drain and cleanup.
  • Preserve dev's Hub incarnation recheck, relay refresh cleanup, volatile lifecycle-lock location and post-setup fixture watchdog. Keep the follow-up's original-timer cancellation and collision-only fixture retry assertions.
  • Retain the 20-minute Ubuntu shard policy, its regression and the release fingerprint from ci: raise the Ubuntu test shard timeout to 20 minutes #8944. The PR diff against dev contains no workflow, timing-table or release-policy changes.

Outstanding Windows gate

Draft. Two native Windows cases called out in #8930 now pass. The wider parent/Link recovery gate still fails on this host. A refused parent stop followed by disconnect and bound restart reached the fixture's 15-second watchdog on this branch and on unmodified dev. Keep the PR in draft until native Windows recovery passes with the real ACL and stop checks enabled.

Verification

Native Windows verification on 8e4d926feff87debfed6e2042154c7d0632cf369

The merge incorporates e6432dbc6e75551c1135b2c80451290cf9d4b19d from dev. git merge-tree also produced clean results against dev 5f80219ff91e273512b2fbb09374205844122777 and #8931 head 9dbc668857eba41cc2b274211a3647c85679b97e. The runtime diff following #8937 still includes the same-handle command-line/owner evidence, rollback lock handling, and recycle exclusion through teardown.

  • Windows x64 with Bun 1.4.4, using scripts/test.ts --no-env-file --no-install --isolate --parallel=1. The Windows stop-owner identity, recycle exclusion, rollback lock and two layout suites passed all 48 tests. The 30 native in-process creation-proof test passed in 2.55 ms.
  • Both Revert "fix(link): restore Child file integrations before shutdown" (#8803) #8930 examples passed in isolation: file-conflict refusal before service stop/signal/kill (13.10 s) and preserving the original refusal when retained-parent-fence finalization fails (10.58 s).
  • The broader native attempt recorded 27 passed, 2 skipped and 26 failed before it was stopped after repeated fixture deadlines. The bound restart recovery case was also isolated. The untouched fixture exited 137 at 15.06 s on this branch and 15.05 s on unmodified dev 5f80219f, with the same host, Bun, dependencies and real ACL operations. In a separate instrumented run, startup finished at 9.35 s, preflight took 1.55 s and disconnect started at 12.47 s before the 15 s parent watchdog terminated the fixture. A diagnostic-only control using the repository's Windows ACL subprocess stubs completed in 3.71 s. The PR keeps real ACL checks and the original deadlines. The isolated comparison covers this case only.
  • bun run typecheck passed for 2,654 files. bun run structure:check, the release-evidence policy check and git diff --check passed. PR CI for this head. The full local suite was omitted during shared Windows validation.

Earlier dev integration and CI job budget — 2026-11-19

Head d04a6d0ed5db477e7e11f56c42b4e325962e0adc, tree 96b3ffdec72d04d036d5503d8195accbd8b943e5, with normal-merge parents 8e8623bb78d041748aca876a26ea55b0fa182437 and dev 676baf650c2d2b020439341f65e1ccc57c5d3e90. GitHub's actual PR merge a69ebd44b1372d0e6aa757aaeb0f93950d713b98 has this same tested tree. The PR-owned runtime and test files (13 files) remain byte-identical to the previous PR head; upstream features and the layout/structure inventories are retained.

The common change from #8940, source 82ee1a5a483c3e4e7756d5cb000f72ab98e376a5, gives the five full Ubuntu shard jobs a bounded 18-minute outer job limit, previously 15 minutes. The prior runs were cancelled near the 15-minute limit while tests were still progressing or finishing. The per-test and per-batch deadlines, five-shard coverage, required jobs, workflow triggers, permissions, trusted-dev/manual-dispatch rules and release identity checks are unchanged. This is an outer CI-job budget change, not a passing result for the earlier cancelled runs.

Current dev's timing table a07f90e6098082e1452ea5cc075c801271321eca is preserved. The release policy retains all 27 prior records and appends one exact workflow snapshot. Reviewed blobs: workflow da0b271b0d8c362a3efe98485ebfc543f64b03a2, strict budget test b8fa9b20e23a0ed571c2ded0b655f22492ad43f6, and policy 7df235ec7904dd19a4b2e588ecfba1da627e9972. Independent source and security review covered the immutable common patch 3e18ab649f9766f74859c7eb9ae2f400f1eddbc8d8c4496f77a22fff5f675f7b.

Validation on this integrated tree, using Bun 1.4.4 on Linux:

  • The normal scripts/test.ts runner with --no-env-file --no-install --isolate --parallel=1 ran windows-stop-owner-identity, client-recycle-exclusion, and client-restart-rollback-lock, together with ci-workflows, both test-layout files, the file-size ratchet and Spanish localization: 245 pass, 1 skip, 0 fail; 5,801 assertions across eight files. The one skipped check requires native Windows. This PR remains draft with the existing Windows acceptance requirement.
  • The five Node test files used by the release gate passed: 69 pass, 0 fail, 0 skip. node .github/scripts/release-evidence.cjs policy-check passed.
  • bun run typecheck: 2,632 files, no errors. bun run structure:check and git diff --cached --check passed.

Exact-head main CI 44472792150 is queued as of 2026-11-19 06:33:30 UTC. It has not established a passing result. No manual workflow dispatch or additional retry was started. The full local suite and documentation build were not repeated for this integration during shared-worktree activity; earlier runtime/docs results below remain evidence for their explicitly named trees. Native Windows acceptance and the existing review requirements remain separate.

Previous release-evidence follow-up — 2026-11-19

Head 8e8623bb78d041748aca876a26ea55b0fa182437, tree 69ae71fcb44374e26f3ac981a71c811515f1c202, direct parent e3c6154dde46ad1f07d0a0af93c4fc4626cc6ff6.

The reviewed timing table from #8940 also needs an exact fingerprint in the release-evidence registry. This follow-up changes only .github/scripts/release-evidence-policy.json: all 26 historical records are preserved, and one snapshot is appended with the existing CI requirements and timing-table blob a07f90e6098082e1452ea5cc075c801271321eca. The approved policy blob is 51c1f898f2bdd69b7a012bd191ac51acb3c1779b; it received independent review. Workflow triggers, required jobs, shard counts, time limits, and test coverage retain their existing values.

Validation on this exact tree:

  • The five Node test files used by the CI release gate passed: 69 passed, 0 failed (release-dispatch-guard, release-evidence, release-history, release-resume, and deploy-docs).
  • node .github/scripts/release-evidence.cjs policy-check passed and confirmed that the registered fingerprints match the working tree.
  • git diff --cached --check passed. Before this snapshot was added, the timing-table fingerprint assertion failed.
  • Earlier runtime, type, structure, and documentation results below remain evidence for their explicitly named earlier trees. This registry-only follow-up does not claim that those suites were rerun on this head.

Historical run 44463011731 for this parent head finished cancelled. Shard 4/5 completed all 63/63 batch summaries, with no failing assertion in its full log, before cancellation. The run was not a passing result.

Previous dev integration — 2026-11-19

Head e3c6154dde46ad1f07d0a0af93c4fc4626cc6ff6, tree 615e902f66b3ba183937a28371e97136812b1119. This is a normal merge of 9914824e9a9b90280f532ee1a5eb7c5a61be78cb and dev 80e8952357d11ccf1421b4aa5620e781625dcdb0, published with an exact-head fast-forward lease. The merge preserves the source changes from both branches; it does not restore the older implementation over the maintainer's changes.

Bun 1.4.4, the normal scripts/test.ts runner/preload, --no-env-file --no-install --isolate --parallel=1 --timeout 30000, and a private test temporary filesystem were used:

  • Seven core files — windows-stop-owner-identity, client-link-stop, client-link-stop-recovery, client-recycle-exclusion, client-restart-rollback-lock, stop-deferred-teardown, and windows-process-evidence: 288 pass, 5 skip, 0 fail; 2,661 assertions. The portable owner-enrichment test was then run with PowerShell 7.7 on PATH: 1 pass, 27 assertions. Four native-Windows tests remain skipped.
  • Four adjacent files — client-hub-relay, client-runtime-restart, client-link-stop-sibling, and route-intent-runtime-stop: 163 pass, 2 macOS skips, 0 fail; 1,337 assertions.
  • Layout, file-size and Spanish documentation gates: 86 pass, 0 fail; 3,982 assertions. Typecheck: 2,626 files, no errors. Structure, privacy and whitespace checks passed.
  • Docs build: 793 pages / 121,114 internal links, passed using isolated build caches.
  • Independent source review of the immutable non-timing patch 5920933f76e412ffa05d3b61d3aa28de21308b72360195e34d752c943700db0d found no remaining implementation blocker. It checked the recycle admission/teardown boundary, listener closure before retry, owner classification, same-handle SID/liveness/creation/argv checks and preservation of Hub refresh cleanup.
  • Common timing data comes from #8940, source e5845320b776a27aa58562f80e8d968140bc9046; table SHA-256 2d56880fe64338d36b424bb73178b025078ca1482da5dd4be6e73c6792759be5. Completed primary-file samples from dev run 44386662799 and Ubuntu PR runs 44448708478/44448420609 are used; the cancelled workflow and unfinished sample are explicitly distinguished. All 20 newer dev rows are preserved. Independent replay of the actual runner retained all 3,358 general files exactly once across five shards. The common candidate's 42 harness tests / 6,670 assertions are scoped data/runner evidence, not this PR's full-suite result.
  • As checked at 04:50 UTC, the branch is mergeable and remains draft. Current-head main CI, merge 460036b66ee9d8eac99af25ced81010fa8c5676f, and Service/Catalog/PR gates are queued. No queued check is described as passing.

The first local run refused the history coordinator because the temporary namespace had the wrong owner/mode. It was stopped; the successful runs above used a private root-owned 1777 temporary namespace without changing host permissions or production ownership guards. Full local repository tests were not repeated during concurrent worktree activity. Native Windows, the two macOS-only handoff cases and full exact-head CI remain outstanding. The earlier results below belong to their earlier tree.

Earlier validation before dev integration

Candidate based on d4a0382ceab624c44a7753d50054379f57933ad4; reviewed tree: 5609284b6df4842fa45f95bf9fced54147524e68.

  • Bun 1.4.4, Linux, isolated writable temporary filesystem: 793 passed, 8 skipped, 0 failed, 6,180 assertions across 26 files (113.47 s). The exact test command is below. Subprocess fixtures, files read as data and generated test-layout membership were explicitly included.
  • The eight skips are four native Windows cases and four macOS-only listener/receipt cases. They remain uncovered by this Linux run.
  • bun run typecheck: passed, 2,592 files.
  • bun run structure:check: passed; bun run privacy:scan: passed; git diff --check: passed.
  • ASTRO_TELEMETRY_DISABLED=1 bun run build in docs-site: passed, 775 pages and 117,969 internal links.
  • Independent read-only review found no blocking defect in the new native identity, argv, recycle exclusion, rollback, fixtures and regression changes. Full candidate patch SHA-256: 4ffd5824e8e0e7e2f1ea6f1c8e3aeed65df16840a997aba5657d78a52c17f80a; the immutable follow-up-only review patch is ff1fb76bc8bca2189992ee23725e87aeb662d1d880f16b428a5c1c159e6c8608.
  • Regression baseline against the pre-revert implementation: the two Windows argv cases and production recycle/apply-exclusion case failed (3 passed, 1 skipped, 3 failed); the candidate passes them. The real Windows timeout evidence remains the failed dev batch cited by Revert "fix(link): restore Child file integrations before shutdown" (#8803) #8930, not a Linux timing substitute.
  • A full local repository suite was not run because concurrent worktrees share the available CPU and dependencies. The focused scope covers changed stop/restart behavior and adjacent port/service/layout paths; remaining cross-platform and full-suite coverage is explicitly outstanding. Required CI must be inspected on the published head, and skipped native checks are not passes.
bun scripts/test.ts \
  tests/cli/cli-client-start-fence.test.ts \
  tests/cli/cli-dispatch.test.ts \
  tests/cli/cli-start-journal-order.test.ts \
  tests/clients/client-link-stop.test.ts \
  tests/clients/client-runtime-restart.test.ts \
  tests/clients/route-intent-runtime-stop.test.ts \
  tests/providers/xai/grok-lifecycle.test.ts \
  tests/service/connected-stop-capability-auth.test.ts \
  tests/service/stop-deferred-teardown.test.ts \
  tests/update/update-teardown-handover.test.ts \
  tests/clients/client-link-stop-recovery.test.ts \
  tests/clients/client-link-stop-sibling.test.ts \
  tests/clients/client-recycle-exclusion.test.ts \
  tests/clients/client-restart-rollback-lock.test.ts \
  tests/windows/windows-stop-owner-identity.test.ts \
  tests/clients/client-runtime.test.ts \
  tests/clients/client-restart-sync-fence.test.ts \
  tests/clients/client-lifecycle-lock.test.ts \
  tests/clients/client-link-runtime.test.ts \
  tests/windows/windows-process-evidence.test.ts \
  tests/server/port-reclaim.test.ts \
  tests/service/service-health-sentinel-linux.test.ts \
  tests/service/systemd-install-cleanup-hardening.test.ts \
  tests/test-layout.test.ts \
  tests/test-layout-tooling.test.ts \
  tests/ci-workflows/file-size-ratchet.test.ts \
  --timeout 30000

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were independently reviewed for secrets, auth, and unsafe defaults.

Review readiness

  • Required local validation passed with its scope documented — the wider native Windows recovery gate remains open.
  • Branch includes dev e6432dbc through a normal merge and a clean merge tree was verified against 5f80219f.
  • All correct Codex and CodeRabbit findings are fixed and verified on this head.
  • Ready for review — held until the Windows gate is satisfied.

Restore the guarded file-route drain and exact stop ownership boundaries
from lidge-jun#8803 after its Windows timeout revert. Replace repeated CIM owner
probes with same-handle native creation/SID evidence, preserve Windows
argv semantics, retain apply exclusion during recycle, and retry only
closed, unpublished rollback listeners within a shared remaining budget.

Native Windows acceptance remains pending; no CI policy or budget changes.
@coderabbitai

coderabbitai Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions github-actions Bot added the bug Something isn't working label Nov 19, 2026
@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

Apply the identical generated timing table from lidge-jun#8940
(d190515).
Completed primary-file samples update scheduling weights only; test coverage,
five-shard execution, time limits, and workflow policy remain unchanged.
Preserve upstream same-handle argv reads, Hub incarnation checks, relay
refresh cleanup, volatile lifecycle locks and fixture phase deadlines.
Keep strict native owner evidence, Windows argv parsing, rollback retry
ownership and Link recycle exclusion from this follow-up.

Use the reviewed upstream-preserving timing table from
lidge-jun#8940 (e584532).
Native Windows acceptance remains outstanding; keep this PR in draft.
Preserve the 26 historical evidence snapshots and append the current CI
fingerprint set with the independently reviewed timing table blob.
Keep every workflow, job requirement, shard count, and timeout unchanged.

Validation: 69 release evidence/history/dispatch/resume/docs tests pass;
release-evidence policy-check passes.
Preserve the existing PR work while merging current dev. Keep five shards, individual test and batch deadlines, required checks, triggers and release identity rules. Append the reviewed workflow fingerprint without changing prior policy records.

Refs lidge-jun#8940

This branch has not been deployed

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant