Skip to content

fix(go): wait for binary verification instead of a deadline - #2946

Open
DavidHLP wants to merge 5 commits into
DeusData:mainfrom
DavidHLP:fix/issue-2877-go-verification
Open

DavidHLP wants to merge 5 commits into
DeusData:mainfrom
DavidHLP:fix/issue-2877-go-verification

Conversation

@DavidHLP

@DavidHLP DavidHLP commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes #2877.

The Go wrapper currently runs each candidate's --version under a 15-second context deadline. A correctly functioning candidate can therefore fail verification on a slow runner. Verification now waits for the actual process result and preserves executable-start and nonzero-exit errors.

Add a command-construction seam and real Go helper-process regression coverage. A handshake holds the candidate until explicitly released; the test also rejects a verification context with a deadline, so the old 15-second implementation fails immediately without sleeping past that deadline. Both successful and nonzero child exits, plus a missing executable, are covered.

The existing Go wrapper smoke invocation runs under a separate ten-minute guard. Exceeding that outer bound reports a HANG in the download/verification/execution path, kills the process tree, reaps the wrapper, and returns 124; it does not assert a verifier performance threshold. The existing smoke result assertion is unchanged. Guard tests cover real exit codes, startup failure, deterministic injected expiry after a real child handshake, and Unix/Windows cleanup dispatch; they run through the existing package-wrapper CI entry point.

No cache format, checksum validation, publication/recovery logic, or lock-owner reclamation rules change. Standalone wrapper invocations intentionally wait for the verifier's result; an actually stuck candidate needs caller supervision/interruption. The existing 45-second concurrent lock wait can still expire while another process verifies a slow candidate.

Validation

  • PASS: Go 1.26.1, bash scripts/ci/test-package-wrappers.sh: Go suite; watchdog 4 tests; npm 20 passed / 3 Windows-only PowerShell tests skipped on Linux; PyPI 45 passed.
  • PASS: go test -race ./... and go vet ./... in pkg/go.
  • PASS: Windows amd64 test-binary cross-compilation; this is build evidence, not native Windows execution.
  • PASS: shell syntax and git diff --check.
  • PASS: Linux scripts/smoke-wrappers.sh ... go with a synthetic C executable/archive, required sidecars and checksum manifest served on loopback. This nested checkout required process-local GOFLAGS=-buildvcs=false because Go attempted VCS stamping from the parent Projects directory; no repository setting changed. This is not a real release-artifact smoke.
  • NOT COMPLETE: scripts/test.sh reached the existing venue-parity contract, which invokes bash scripts/ci/generate-sbom.py --help; Python's import datetime launched ImageMagick import and blocked. Terminated only this test's isolated process group. The full C suite did not run.
  • NOT PASSING locally: scripts/lint.sh; cppcheck is missing, and clang-tidy reports diagnostics in untouched C sources.
  • PASS on head 1b7926d: native Windows and Ubuntu package-wrapper jobs; Windows, Linux and macOS PR smoke jobs. The Windows watchdog test now reads the handshake with universal-newline handling and emits raw CRLF on every host; this reproduces the initial Windows failure on Linux before the reader fix. The Windows guards failure on 1b7926d was reproduced locally by injecting the logged Win32 access-denied error into the actual trace reader. Follow-up a9f98cfc makes polling preserve the last readable worker trace and retry Win32 deletion/sharing errors (5/32), with the error retained in diagnostics. CLI stderr failures and other permission errors still propagate. Two focused regression tests are wired into the existing Windows guards entry point and pass locally. The native Windows guards job now passes on a9f98cfc: https://github.com/DeusData/codebase-memory-mcp/actions/runs/42830764926/job/129887639759 . The Windows full C test job also failed: extraction_inheritance, java_lsp_coverage, and doc_links_md exited with 3221225477 (0xC0000005, access violation), without completion summaries. Failing full-test job. The failing C tests, C sources and their workflow are unchanged in this PR; base-revision failure has not been independently reproduced. Local investigation: the three C suites pass under Linux ASan/UBSan (321 tests). Their three original crash-site cases also pass as separate parallel processes in full Windows-target ASan/UBSan test runners under Wine, using both LLVM 23 and CI-matching LLVM 22.1.8. Wine reports sanitizer interception warnings and is diagnostic evidence only. No C fix is claimed without a local reproduction. The full native Windows job on a9f98cfc is still running: https://github.com/DeusData/codebase-memory-mcp/actions/runs/42830764926/job/129887704227 . A native crash-diagnostic workflow was prepared only on the personal fork branch debug/pr-2946-windows-crash, but GitHub rejects dispatch with HTTP 422, Actions disabled, despite permissions reporting enabled. Full CI and maintainer review remain pending.

Checklist

  • Every commit is signed off (git commit -s)
  • Tests pass locally (make -f Makefile.cbm test) — full C suite not completed; focused wrapper entry passed
  • Lint passes (make -f Makefile.cbm lint-ci) — environment/tooling limitations above
  • New behavior is covered by a test (reproduce-first for bug fixes)

Signed-off-by: DavidHLP <lysf15520112973@163.com>
@github-actions

Copy link
Copy Markdown

Thanks for opening this — it has been seen, and it is queued.

This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence.

Current review status: working through a backlog. 0.9.1-rc.1 is out, so the release freeze that held reviews is over — but it left a large queue of open pull requests behind it, and we are reading through them oldest-first. The background is in discussion #1144.

What that means for this PR, concretely:

  • It will not be closed for inactivity. No stale bot touches pull requests here.
  • It may still sit a while before a human reads it. That is on us, not on you.
  • Older PRs are read first, so a recent one is not being skipped — it is behind a queue.

Things that will genuinely speed it up whenever review does happen:

  • Keep it rebased on main — the tree is moving quickly right now, and a conflicting branch cannot be reviewed as the diff you intended.
  • Get CI green, or say which failures you believe are pre-existing.
  • Keep the change to one claim. Bundled features and refactors get split before they get merged, which costs you a round trip.
  • Every commit needs a sign-off (git commit -s) — CI enforces DCO.

If this fixes a bug, a reproduction we can run is worth more than a description of the symptom.

Thanks for contributing, and sorry in advance for the wait.

Signed-off-by: DavidHLP <lysf15520112973@163.com>
Signed-off-by: DavidHLP <lysf15520112973@163.com>
@DavidHLP

Copy link
Copy Markdown
Contributor Author

I wanted to leave a consolidated validation note for the maintainers at head a9f98cfca81e289347504f6a143828ce22d2de48.

The latest PR workflow completed successfully: 34 jobs passed and 5 were skipped by the workflow. DCO also passed. This includes native Windows package-wrapper tests, Windows regression guards, the full Windows CLANG64 C test job, all three platform smoke jobs, and the remaining macOS Intel test job. Skipped jobs are not counted as successful validation.

For #2877, the Go verifier now waits for the actual --version process result instead of imposing the fixed 15-second deadline. Startup failures and nonzero exits remain errors. The regression test uses a real helper process and a handshake, and rejects a verification context with a deadline without sleeping past the old timeout. The wrapper smoke invocation has a separate ten-minute process-tree hang guard.

Two follow-up CI failures led to focused fixes: the watchdog test handles Windows CRLF correctly, and Windows worker-log polling preserves the last readable trace and retries access/sharing errors (Win32 5/32), retaining the error in diagnostics. Other permission errors and CLI stderr failures still propagate. Both failures were reproduced locally before their fixes; the current native Windows wrapper and guard jobs pass.

An earlier full Windows C run exited with 0xC0000005 in extraction_inheritance, java_lsp_coverage, and doc_links_md, without a useful crash stack. The current full Windows job passes. Locally, those three suites passed under Linux ASan/UBSan (321 tests), and the three original crash-site cases passed in Windows-target sanitizer builds under Wine with LLVM 22.1.8 and LLVM 23. Wine is supplementary evidence only. I have not reproduced or established the cause of that earlier native crash, so I am not claiming this PR fixes it or that it is proven unrelated. I have stopped the planned local Windows VM setup.

There are deliberate behavior limits to consider during review: standalone wrapper invocations need caller supervision if a verifier actually hangs, and another wrapper can exhaust the existing 45-second publication-lock wait while verification is still running. Lock policy and cache/publication/recovery semantics are unchanged. My full local C/lint runs had the environment/tooling limitations recorded in the PR description; the successful remote workflow is separate evidence. I am leaving the PR as a draft for maintainer judgment on the scope and these tradeoffs.

@DavidHLP
DavidHLP marked this pull request as ready for review November 16, 2026 06:35
@DavidHLP
DavidHLP requested a review from DeusData as a code owner November 16, 2026 06:35
Signed-off-by: DavidHLP <lysf15520112973@163.com>

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Smoke 13w: go package wrapper binary verification is decided by a deadline

1 participant