Commit Graph
14 Commits
Author SHA1 Message Date
Ilya Brykau a874b6bc95 test(ci): make the Windows path guard fixture polyglot so CI indexes Go end to end
The only CI venue that drives a repository through the shipped binary
(MCP stdio -> supervisor -> pipeline -> SQLite) is the Windows guards
harness, and every fixture it indexed was TypeScript-only. The Go/cgo
extraction defect family (#1932: build-tag twins #1911, struct fields
#1935, cgo #1929, channels #1930, cross-language bleed #1928) was
invisible to that venue by construction.

Add a dummy Go package to the test_non_ascii_path fixture covering those
shapes: a struct with fields and a method, a //go:build linux/windows
twin pair sharing one function name, a cgo file (C preamble, C. call,
//export directive), and a channel producer/consumer pair. Count Go-file
definitions per variant (Function/Method where file_path CONTAINS '.go'),
require at least one in the ASCII baseline, and include the count in the
cross-variant equality check - Go qualified names embed the containing
directory, so non-ASCII paths reach the Go passes on their own route.

Measured with the harness functions against a current binary: baseline
nodes=28 edges=46 definitions=12 go=7, identical for the Latin-1 and
Cyrillic variants. The go=7 includes exactly one FlushDisk - the twin
collision on main is deterministic, and this guard will observe the
second twin appear when the build-tag fix lands.

Signed-off-by: Ilya Brykau <ilya.brykau@orca.security>
2026-08-31 12:13:24 +02:00
Ilya Brykau 947e52d944 fix(ci): gate Windows guard setups on the index response, not list_projects stats
The guards read node/edge counts exclusively from list_projects, but that
tool publishes its stats columns asynchronously — on some venues never
within a one-shot MCP session. index_repository's own response carries the
synchronous, authoritative counts, so a healthy index was misread as
'SETUP FAIL: ASCII baseline did not index ... nodes: None' (issue #1952
carries five such runs; reproduced deterministically on macOS where
list_projects returns the project row with no stats fields at all while
the index response reports nodes=12/edges=21 and definition queries work).

- test_non_ascii_path: take counts from the index_repository summary;
  keep list_projects only as a polled fallback (wait_projects_with_stats
  in mcp_stdio) and for the no-project diagnostics, now in a helper.
- Retry setup steps once (fresh cache) before declaring a precondition
  skip: the ASCII baseline, the CLI ASCII control (test_cli_non_ascii_arg),
  the hook-augment index and its permanent-daemon start — these are setup,
  not the surfaces under test, and a cold runner's daemon startup latency
  must not red the job through the all-skip gate.

Signed-off-by: Ilya Brykau <ilya.brykau@orca.security>
2026-08-31 12:09:08 +02:00
Martin Vogel aac3616962 test(windows): keep and dump the worker log for the failing CLI probe
The CLI probe reproduces the empty pipeline (rc=1, same one-line hint), so the
remaining record is the worker's own log -- which the supervisor unlinks on a
clean exit. CBM_PROFILE=1 flips that exact branch to retention
(index.supervisor.profile_log) with no product change, and the probe now prints
every retained log tail from its isolated cache.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-08-10 02:12:48 +02:00
Martin Vogel 591155d33e test(windows): probe the failing case through the CLI, which prints diagnostics
The retry with a fresh cache fails identically, so this is path-dependent, not
order-dependent — the daemon-lifetime theory is dead. The MCP result compresses
the pipeline's own diagnostics into one hint string; the documented CLI
entrypoint prints them. Third fresh cache, same repo, output verbatim.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-08-10 01:44:14 +02:00
Martin Vogel b1526d26e7 test(windows): retry a failed non-ASCII case with a fresh cache
The worker log shows the discriminating shape: the supervisor reaps the worker
CLEAN (exit 0, 2.3s) yet index_repository reports an empty pipeline -- and the
test daemon now serves the UI on fixed port 9749, which main's build does not
do here (no pack beside the test binary keeps its UI off, while the embedded
build auto-enables). Sequential per-case daemons therefore contend on one port,
and Cyrillic is simply the SECOND case in the run order.

An in-process retry against the same repo with a fresh cache separates the two
remaining explanations: a passing retry convicts the previous case's daemon
lifetime (order), a failing retry convicts the path itself.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-08-10 01:13:21 +02:00
Martin Vogel 926b7bc005 test(windows): read the worker logs when the pipeline fails a non-ASCII case
The previous round narrowed Cyrillic-on-x64 to: correct project name derived,
server responsive, but the pipeline reports 'Check repo_path exists and
contains source files' and only _config.db + logs/ land in the cache. The
supervisor wrote worker logs, so the actual error is already on disk in the
failing job -- print their tails plus the repo listing instead of guessing
across another cycle.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-08-10 00:44:09 +02:00
Martin Vogel 09c91df36e test(windows): carry the index response and cache listing into the failure
Cyrillic fails deterministically on the x64 runner and passes on the arm64 VM
and on the main-based sibling PR at identical path depth, so neither script nor
path length explains it. The remaining unknown is what index_repository
actually said and whether anything landed in the isolated cache; print both.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-08-10 00:16:33 +02:00
Martin Vogel 79a0ba928e test(windows): print the captured index error when a non-ASCII case fails
The Cyrillic case fails deterministically on the GitHub runner (two genuine
attempts, fresh temp roots each time) while latin1/CJK/Greek pass around it and
the SAME commit passes all cases on the real-Windows VM. The guard records an
'error' field for exactly this situation and then never prints it, so the CI log
shows nodes=None and nothing else. Surface it verbatim; the next run carries the
diagnosis instead of a guess.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-08-09 22:08:02 +02:00
Martin Vogel 045e1aa688 test(windows): keep the extended-path machinery in the non-ASCII guard
pr-smoke was green but test-windows-guards failed, and the shape of the failure
named the cause:

  [PASS] non-ascii/latin1_accents  nodes=12 edges=21 definitions=5
  [FAIL] non-ascii/cyrillic        nodes=None edges=None definitions=None

ASCII and latin1 pass, Cyrillic does not -- latin1 survives a Western ANSI code
page and Cyrillic does not. But the product code was never the problem: the
wide-path helpers (win_utf8.h, runtime.c extended paths) were KEPT. I had
reverted this test to a base that predates them, so it lost windows_extended_path()
and the explicit `executable=` argument to subprocess.run. With
lpApplicationName NULL, CreateProcess applies the legacy MAX_PATH limit while
deriving the module name from the command line, so on CI's long guard-bundle
path the process never started and every count came back None.

Same mismatched-base class as the package wrappers: production kept the fix, its
test was reverted past it.

Restored from main and adapted rather than dropped -- it still covers
extended-length publication AND non-ASCII indexing. Only the sidecar
assertions are gone (one self-contained file to publish now), and the probe
uses --version instead of the removed --verify-runtime-assets.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-08-09 18:46:05 +02:00
Martin Vogel d58afe562d revert(release): re-embed runtime assets into the single shipped binary
Externalizing the integration templates (#1492/#1493) and the UI bundle
(#1501/#1503) was done to reduce the Microsoft `Wacatac.B!ml` surface. It did
not work: across dry runs the flagged artifact count stayed at ~3 and the
detections merely moved between artifacts.

Dissection of run 31286803592 shows there is no structural cause to fix. The
verdicts split across every axis at once — linux-amd64 (dynamic) flagged while
linux-amd64-portable (static) is clean, but linux-arm64 (dynamic) clean while
linux-arm64-portable (static) is flagged. The two macOS binaries have identical
segment structure and split clean/flagged. Siblings from one build landed in
different variant buckets (.B vs .C). Entropy is low everywhere
(code_vectors.bin 4.166, grammar tables 3.464 bits/byte, against 7.5-8.0 for
packed payloads), so the packed-payload hypothesis is excluded too.

So the complexity bought nothing, and installation goes back to being
self-contained: one binary that carries its own UI and agent integration
templates, with no adjacent data file that has to resolve before `install`
works. Only the UI-capable composition ships from now on, under the historical
unsuffixed archive name.

Removed: src/ui/asset_pack.{c,h}, asset_pack_stub.c, asset_manifest_stub.c,
scripts/pack-ui-assets.mjs, src/cli/integration_assets.{c,h},
assets/cbm-integrations.json, scripts/gen-integrations-hash.sh, the
--verify-runtime-assets probe (nothing adjacent left to verify), and the
composition gates A6/A7 whose property is now deliberately inverted.

Restored: scripts/embed-frontend.sh, src/ui/embedded_{assets.h,stub.c}, the
compiled-in hook/adapter template bodies, and the embed/EMBED_OBJS build path.

Kept from the reverted commits, re-applied by hand where a wholesale file
restore would have dropped them:
  - cbm_module_path_utf8() in both self-path sites. GetModuleFileNameA renders
    through the ANSI code page and mangles non-ASCII install paths.
  - the /__cbm/ui-readiness HMAC proof, secure_random and cbm_hmac_sha256, so
    `daemon start --open` still waits for a genuine CBM listener.
  - X-Content-Type-Options: nosniff on served assets.
  - the MinGW noexecstack gate, -lbcrypt, and the cppcheck/zip CI fixes.

Archives are now codebase-memory-mcp-<os>-<arch>[-portable] with exactly four
members (binary, LICENSE, installer, THIRD_PARTY_NOTICES.md). That restores the
names every static package manifest already points at — aur, chocolatey,
homebrew, scoop, winget and glama were all broken by the -ui- rename.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-08-09 13:06:42 +02:00
Martin Vogel 8018561cfe fix(release): externalize runtime assets and harden VT verification
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-08-08 17:35:05 +02:00
Martin Vogel bbeedf3775 test(windows): request format=json in the non-ascii guard's query_graph calls
query_graph now defaults to TOON text; the guard's definition-count
probe parsed it as JSON, swallowed the parse failure, and reported the
ASCII baseline as having zero definitions (SETUP FAIL on the
test-windows-guards leg). Scripted consumers use the format="json"
escape hatch.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-07-10 22:53:44 +02:00
FlipperandClaude Opus 4.8 0eb2c58913 test(windows): convert fixed reds to green guards, wire CI, rewrite drive test
Rebased onto current main and reworked in response to review. Three of the four
Windows reds were fixed upstream since the branch was cut at b075f05, so they are
now green regression guards; the fourth stays a genuine known-red.

- test_non_ascii_path.py (#636/#357): green guard - fixed by #700 (per-pass
  readers now route through cbm_fopen -> _wfopen). Re-verified green on main.
- test_hook_augment.py (#618): green guard - fixed by #619 (cbm_is_walkable_abs_path
  accepts drive-letter X:/ cwd). Re-verified green on main.
- test_ui_drive_listing.py (#548): rewritten. The fix exposes drives via a new
  roots[] field, not the dirs[] array the old test asserted (which would stay red
  against fixed code). Now asserts every fixed drive is in roots and browsable.
  Re-verified green on main (drives C:/D:/E:).
- test_cli_non_ascii_arg.py (#423/#20): unchanged - main() is still narrow-argv
  with no wide command line, so this remains genuinely red (the keeper).

- scripts/test-windows.ps1: split green guards (gate CI) from opt-in known-reds;
  add -GuardsOnly; run indexing in-process (CBM_INDEX_SUPERVISOR=0) so a guard
  reflects the path/hook/drive fix under test, not the index-worker spawn path.
- .github/workflows/_test.yml: new test-windows-guards job builds the product+UI
  binary (scripts/build.sh --with-ui) and runs the guards with -GuardsOnly so
  #700/#619/#548 stay enforced on Windows CI.
- RED_TEST_ANALYSIS.md: refreshed to record the landed fixes and current status.

Signed-off-by: Flipper <jacobphilipp@ymail.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-04 13:22:41 +02:00
Flipper 0d3d0fb553 test(windows): add red regressions for platform-specific failures
Adds Windows-only red tests and analysis for native Windows failures found
during a Windows red-test campaign. This change contains no production fixes.

- windows_non_ascii_repo_path_preserves_definitions (integration): byte-identical
  TypeScript fixtures indexed under non-ASCII parent paths (Latin-1 accents,
  Cyrillic, CJK, Greek) extract zero definitions and only File/Folder nodes
  (5 nodes / 4 edges) versus the ASCII baseline (12 nodes / 20 edges / 5
  definitions). The pipeline source readers open files with fopen() on a UTF-8
  path, which the Windows CRT interprets in the active ANSI code page; directory
  discovery already uses the wide API, so files are listed but never parsed.

- windows_cli_non_ascii_repo_path_is_honored (integration): the documented
  `cli index_repository` entrypoint rejects a non-ASCII repo_path because main()
  does not read the wide command line, so argv arrives in the ANSI code page.

Both reproduce at the product surface (real MCP process, real stdio, real SQLite
DB), are deterministic, and pass on Linux/macOS. A PowerShell runner builds the
binary and runs the suite; standard-library Python only. See
tests/windows/RED_TEST_ANALYSIS.md for environment, commands, ruled-out seed
areas, and suspected fix locations.

Signed-off-by: Flipper <jacobphilipp@ymail.com>
2026-07-04 12:59:30 +02:00