Repository navigation
Fix Windows managed publication and CRLF overlay memory accounting - #205
Merged
Shengyu Fu (shengyfu) merged 5 commits intoOct 15, 2026
Merged
Conversation
Reverify closed managed members against their original bounded block proofs under native write/delete exclusion. Keep the original seal, identity and ownership checks, and charge generation verification to its existing work permit. Reject timestamp-restored rewrites and unverified reobservations; add native metadata-only and protection regressions. Co-authored-by: Copilot App <[email protected]> Copilot-Session: cff18193-91c7-4186-9e2d-7dfa8433e29d
Reuse the existing WorkPermit deadline and checks for admitted Windows verification. Bound only unreserved observations with current policy, and cover a policy timeout reduction after admission. Co-authored-by: Copilot App <[email protected]> Copilot-Session: cff18193-91c7-4186-9e2d-7dfa8433e29d
Release extraction headroom and consumed input tables instead of retaining cumulative per-posting estimates. Admit hash-table growth with old and replacement capacity both charged, preserve content and mask semantics, and cover CRLF checkpoint/refresh under the existing budget. Co-authored-by: Copilot App <[email protected]> Copilot-Session: cff18193-91c7-4186-9e2d-7dfa8433e29d
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Windows publication protections and memory-admission changes need final human review, with a replacement-capacity issue still unresolved.
1 open finding
What changed in this PR
Addresses managed generation publication on Windows and CRLF overlay memory accounting without changing budgets or timeouts.
Changes:
- Authenticates closed Windows producer files against original proofs using admitted deadlines.
- Tracks overlay table capacity and allocation lifetimes.
- Adds regressions and updates lifecycle documentation.
| File | Description |
|---|---|
| tgrep-core/src/worktrees/tests.rs | Adds CRLF budget regression. |
| tgrep-core/src/worktrees.rs | Tracks prepared-map allocation lifetimes. |
| tgrep-core/src/trigram.rs | Releases extraction growth headroom. |
| tgrep-core/src/managed/work.rs | Adds charge accessor and admission regressions. |
| tgrep-core/src/managed/verification.rs | Authenticates complete producer proofs. |
| tgrep-core/src/managed/memory.rs | Adds capacity-based table admission. |
| tgrep-core/src/managed/generations.rs | Passes publication work permits. |
| tgrep-core/src/managed/collection.rs | Tests Windows publication protections. |
| tgrep-core/src/managed/catalog.rs | Authenticates closed-member re-observation. |
| tgrep-core/src/live.rs | Controls overlay growth and cloning. |
| SHARED_WORKTREE_INDEXES.md | Documents authentication and memory accounting. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Update both first-party lockfiles and release instructions; preserve historical v1.2.1 deprecation and candidate evidence. Co-authored-by: Copilot App <[email protected]> Copilot-Session: cff18193-91c7-4186-9e2d-7dfa8433e29d
Size replacement growth after removing old entries from the unpublished clone. Track backing-capacity watermarks for retained maps, posting sets, and bookkeeping instead of releasing tombstone storage. Add deterministic red/green replacement and deletion regressions, rehash/pressure coverage, and changed-CRLF checkpoint parity. Co-authored-by: Copilot App <[email protected]> Copilot-Session: cff18193-91c7-4186-9e2d-7dfa8433e29d
Shengyu Fu (shengyfu)
deleted the
shengyfu-windows-publication-metadata
branch
October 15, 2026 05:36
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.


Summary
Fix two independent managed-publication/readiness blockers encountered while qualifying v1.2.1:
WorkPermitchecks and captured deadline when one is supplied. Only the no-permit path derives a new bounded deadline from current policy.Update the managed-lifecycle documentation. The user-requested version-only follow-up,
2f9d21fb964c5816fb4461ace812c7661a856d09, bumps the workspace crates, root/fuzz lock records, and release instructions to 1.2.2. Historical v1.2.1 deprecation references and immutable candidate evidence are preserved. No budget, timeout, watcher-freshness, or host security-policy changes.Regression evidence
The ordinary-user-EA regression fails against
c7b2ab8withstale-identity / producer-member-modified. It passes with authentication against the original producer seal; no protected kernel EA is set or modified. The kernel component responsible for the observed metadata drift remains unidentified.The policy-reduction-after-admission regression fails against
2055b93and passes with the captured permit deadline. Negative coverage remains for same-length tampering with restored timestamps, ownership/identity changes, incomplete/corrupt producer proofs, conflicting native opens/writable mappings, memory pressure, and cancellation.The new eight-file CRLF regression fails against
0b6e28awithreserved-private-memory-exhaustedunder the existing 32-MiB test reservation. It now passes through initial readiness, checkpoint capture, and unchanged full refresh. A separate table-growth test covers overlapping allocation charges, genuine admission failure without mutation, overflow, cancellation, and released headroom.Original generated case: resolved without budget changes
Release/no-test-hooks executable from
0143cc4b7e59e7aa97759c59e1fd98e9b8b238bf; owned synthetic repositories only, 4,096 files of 8,192 bytes each. The original ReFS-backed CRLF fixture and its content inventory were preserved; a separately labeled LF/NTFS-cache control was not substituted for it. These measurements predate the version-only bump and remain attributed to the unchanged candidate.Both retain the original 32-GiB allocation, 8-GiB private and staging limits, one operation worker/slot, 16-MiB sort buffer, and 10,800,000-ms operation timeout. Effective policy and allocation were checked directly.
CRLF cold and warm attachments fully verified and extracted all 4,097 paths, including the linked-worktree gitfile. Warm attachment reused the published generation with zero Git blob reads. Managed/standalone membership matched all 4,097 paths; managed/local-index/filesystem content results matched for the shared anchor (4,096 paths), a 32-byte substring after the CRLF prefix (one path), and an absent pattern (zero paths). LF preserved 4,096 base reuses with only the gitfile extracted.
The original-case daemon's separately observed native peak private/commit memory was 2,200,727,552 bytes. Namespace admission estimates are not an RSS cap. These are single readiness observations, not a speedup claim: full transformed overlays remain expensive, particularly checkpoint/catalog work.
Both daemon/owner pairs exited normally, leases and root handles drained, and all four disposable worktrees were removed. Generated sources, caches, original failure reports, and new qualification evidence remain available locally.
Qualification scope: full watched real-repository qualification has not passed. The separate watcher-budget/polling-fallback issue is being handled independently and is not fixed by this PR. Successful generated publication/CRLF readiness does not establish full release readiness.
Validation
Correction candidate at
0143cc4, Windows / Rust 1.88: 228 selected tests passed (161 core unit, 24 generation integration, 3 native WAL, 37 lifecycle, 3 real CLI). Native Linux: 225 selected tests passed (165 core unit, 24 generation integration, 36 lifecycle); the ignored subprocess entry point was exercised by its supervisor. Formatting passed. Default Clippy completed with the same 10 pre-existing warnings in untouched files; strict-D warningsremains baseline-blocked.Windows commands (
CARGO_BUILD_JOBS=2, test-build Rust flags unset, MSVC environment initialized):Native Linux ran the same core selectors and the
generations/managed_lifecycleintegration targets in a native Linux directory, with two build/test threads.Version-only follow-up at
2f9d21f: both locked graphs resolvetgrep-core/tgrep-clito 1.2.2 without dependency upgrades. A fresh hardened Windows release build without test-hook features passed;--version,-V, and Windows FileVersion/ProductVersion all report 1.2.2. The 17 existing isolated release-script tests, formatting, and diff checks passed. The earlier generated campaign was not rerun or relabeled for this metadata-only change.Review corrections at
6627cefa439f3b0fed1d07aa8814b9c9b53fda52Both review findings have deterministic red/green coverage against
2f9d21f:reserved-private-memory-exhausted. Removing its old entries before sizing growth lets the same-size replacement fit. A truly oversized replacement still fails without changing the published view.The CRLF regression additionally covers an equal-length content edit, refresh, result parity, and another checkpoint under the original 32-MiB test reservation.
Windows: 261 selected tests passed (164 core unit, 24 generation, 3 native WAL, 37 lifecycle, 30 shared-worktree, 3 real CLI). Native Linux: 257 selected tests passed (168 core unit, 24 generation, 36 lifecycle, 29 shared-worktree); the supervised subprocess entry point is not double-counted. Formatting and a hardened release build pass. Default Clippy still reports only the same 10 pre-existing warnings; strict lint is not claimed to pass.
The review follow-up extends the earlier commands with these core/integration selectors; the three real CLI selectors and Clippy command above were also rerun:
Native Linux uses the same core selectors and
generations,shared_worktrees, andmanaged_lifecycleintegration targets. Its archived source tree is exactly the committed tree5fe12555fba5e141c57683ef4fa1f52ac9eb3e89.A fresh local 1.2.2 release/no-hooks validation build also passed the original CRLF/ReFS cold/warm readiness and exact membership/content parity, without changing policy or allocation: 456.042 s cold, 409.739 s warm, 7,645,982,280 bytes peak private-work admission. Both passes fully read/extracted 4,097 paths; warm reused the generation with zero Git blob reads. Its SHA256 is
ee70cf0c948009d49fb26d5bb9610ec05e650d6275635d5b2746822711613c7a.Teardown caveat: after successful readiness/parity and both lease/root-handle drains, the benchmark harness hit
operation-token-conflictwhile changing stop tokens without advancing the sequence, then forcibly terminated its own daemon. The failure report is preserved. The same executable subsequently recovered the retained cache and completed an atomic idle stop normally. The two new disposable worktrees and native Linux build directories were removed; the source inventory, caches, and evidence remain. This is not an all-clean first-run teardown or watched real-repository qualification. No existing immutable candidate was replaced.Separately identified candidate
The retained read-only local candidate is not the official v1.2.1 artifact and was not replaced or relabeled by the 1.2.2 source bump or review corrections. Its CLI version remains
tgrep 1.2.1; Cargo records show emptytgrep-core/tgrep-clifeature sets and a release, non-test profile. Both generated runs verified thattesting.statusis unavailable. No executable is committed or attached here.Source diff and build provenance are retained beside the immutable candidate. Earlier candidates and the independent runtime qualification were not changed. This PR does not create a release/tag or merge either change.