Commit Graph

1116 Commits

Author SHA1 Message Date
Christopher Beaulieu 5c41bdf606 fix(db): recover secondary indexes off-thread (#1887) 2026-09-23 14:42:42 +00:00
danusha2345 a36a9e1013 refactor(extraction): one-purpose size-stamp reader, comments in operation order
`readSourceOrStamp` took a `stats` argument no caller passed and returned
stats no caller read; it now returns the text or stamp change detection
hashes. The batch reader's two comments are back in the order its code runs:
the size gate, then the MPEG-TS head check. No behaviour change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-23 14:42:06 +00:00
danusha2345 cf66c2148f fix(extraction): a file over the size limit is never read (#1910)
The size gate ran after `readFile`, so a committed video or blob fixture was
decoded in full — 3.4 GB of RSS for a 400 MB file, `Invalid string length`
past ~512 MB — only to be stored as skipped. It was then read again by every
pass that scans files by name: the framework detectors' `readFile` and the
resolver's cached reader, three full passes on the reporter's fixtures.

Stat first, everywhere a source file is read by path: the batch reader and
`extractFile` store an oversize file with a size stamp in place of its
content, change detection hashes the same stamp (so a same-size rewrite of a
file nothing is indexed from is not a change, while crossing the limit in
either direction is), and both by-name readers return null above the limit.
The limit moves to `src/file-limits.ts` so the three sites share one number.

strace on a sparse 400 MB `.ts`: 153 603 reads before, 0 after; indexing it
next to a real file costs no measurable RSS. Stacked on #1914, which shares
the batch-reader hunk.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-23 14:42:06 +00:00
danusha2345 3111045f6e fix(extraction): a video .ts is never pending on the git path or a scoped sync
Review found two places that decide "is this a source file" without the
MPEG-TS check the scan applies: the git fast path's candidate loop in
getChangedFiles and the scoped-sync path filter (watcher events). An
untracked clip in a git repo was reported as `added`, skipped by sync
without a record, and reported as `added` again on every status; a tracked
.ts that became a clip stayed `modified` with its stale nodes. Both now
treat the clip as non-source: removed when tracked, ignored otherwise.

Regression tests fail without this change and pass with it, on both arms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-23 14:42:06 +00:00
danusha2345 1dbb3d90f1 fix(extraction): an MPEG-TS video named .ts is not TypeScript (#1910)
`.ts` mapped to TypeScript by extension alone, so MPEG transport-stream
fixtures (`testdata/*.ts`) were parsed by tree-sitter: ~28 s of CPU for a
900 KB clip, minutes for a directory of them, for zero symbols.

Recognise the stream from the head of the file — the 0x47 sync byte at
offsets 0, 188, 376 and 564 plus a NUL byte, which every stream carries in
its first packets and UTF-8 source never does — and drop it at discovery:
not indexed, not parsed, not counted, not tallied as an unsupported
language. The check reads under 1 KB and only for `.ts` files; the batch
reader sniffs the bytes it already read, and the single-file path (sync,
watcher) does the same head read, so a clip handed in by name is skipped
too. The skip happens before parse dispatch, so no kernel mirror is needed.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-23 14:42:05 +00:00
danusha2345 1547f9332a fix(init): refuse a codegraph.db that is not SQLite instead of promising a rebuild
Review found that a `.codegraph/codegraph.db` holding bytes that are not
SQLite at all counted as "schema-less", so `init` printed "rebuilding it"
and then failed with SQLite's "file is not a database". Only an empty file
or a SQLite database without the codegraph tables can be rebuilt in place;
`hasSchemalessDb` now means exactly that, and the new `hasForeignDbFile`
names the other case. `init` stops on it with exit 1, says which file it
is and to move or delete it, and never touches it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-23 14:41:33 +00:00
danusha2345 24041f38b9 fix(directory): a database we cannot open read-only still counts as initialized
The schema probe failed CLOSED: a real WAL codegraph.db in a directory the
process cannot write (a read-only checkout, a mount, another user's tree)
made the read-only node:sqlite open throw — SQLite must create `-shm` to
open a WAL database — and isInitialized() reported the project as not
initialized, where main's file-exists check had been right.

The probe now fails OPEN. Once the size gate and the `SQLite format 3\0`
header have passed, the file is a SQLite database; only a SUCCESSFUL
sqlite_master query proving the `nodes` table absent may return false. Any
open/prepare error (locked, busy, cantopen, readonly, disk I/O) returns
true, the pre-existing behaviour for a database we cannot inspect. No error
strings are matched. The per path + mtime + size memo is unchanged, and
schema-less/empty files still return false, so `codegraph init` still
repairs them and never touches a real db.

Test: a WAL db copied into a `.codegraph/` made read-only with chmod stays
initialized — skipped on win32 and when running as root (root ignores mode
bits).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-23 14:41:33 +00:00
danusha2345 986005228b fix(directory): a schema-less codegraph.db does not make a project initialized (#1895)
isInitialized() accepted any existing .codegraph/codegraph.db, so an empty or
table-less file in an ancestor directory (an interrupted init, a stray touch,
a never-populated ~/.codegraph/) captured the upward walk of
findNearestCodeGraphRoot / resolveProjectPath / resolveServerRoot for every
project beneath it: the real index of a sub-project became unreachable, the
sub-project down-scan never ran, and commands either operated on the broken
file or failed opening it instead of showing the not-initialized guidance.

An initialized project is now one whose db carries the schema: the probe is
gated by file size (>= the 100-byte SQLite header), then the header magic,
then a read-only node:sqlite open with a single sqlite_master lookup for the
`nodes` table, memoized per path + mtime + size so hot callers (the prompt
hook, MCP root resolution on every call) never reopen an unchanged db. The
handle is closed immediately so the probe never holds the db on Windows; a
locked/busy db counts as live.

createDirectory() uses the same predicate, so `codegraph init` in the
directory with the broken file repairs it in place (the schema is applied
with CREATE ... IF NOT EXISTS) instead of refusing with "Already
initialized"; the CLI says what it found. Nothing is deleted automatically.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-23 14:41:33 +00:00
Forge 16d7b9a1a9 test: add bounded release issue reproduction probes 2026-09-23 14:40:17 +00:00
Forge 59009c5c6c docs: record checked marketplace theme and UI-only deployment [skip ci] 2026-09-23 05:01:26 +00:00
Forge b4dcb40d92 feat(marketplace): match CodeGraph theme with local Lucide assets [skip ci] 2026-09-23 04:50:13 +00:00
Forge 7bbce09f4b docs: record source inspection acceptance and conditional budget fit [skip ci] 2026-09-23 04:18:55 +00:00
Forge 9f18692f07 docs: prepare UI-only preview rollout and shared-account budget controls [skip ci] 2026-09-23 04:10:07 +00:00
Forge ca6c375993 feat: inspect immutable extension source and gate hosted publication [skip ci] 2026-09-23 04:05:48 +00:00
Forge d971e06fad docs: record Cloudflare HTTPS and provider persistence acceptance [skip ci] 2026-09-22 21:37:08 +00:00
Forge ad09aa586b test: verify provider object inventories independently of analytics [skip ci] 2026-09-22 21:32:05 +00:00
Forge c9b63f5610 fix: verify latest deployed bindings before hosted operator writes [skip ci] 2026-09-22 21:24:42 +00:00
Forge 2b9ec85df6 test: isolate hosted catalog selection and persistence readback [skip ci] 2026-09-22 21:20:29 +00:00
Forge 384daf329f feat: bound hosted publication windows and add HTTPS acceptance [skip ci] 2026-09-22 21:15:03 +00:00
Forge 89d6996123 feat: support reviewed hosted operators through Wrangler OAuth [skip ci] 2026-09-22 21:05:56 +00:00
Forge eee4e0696c docs: record integrated shadow results and reuse blockers 2026-09-22 17:15:46 +00:00
Forge 58b04f685a test: retain auditable shadow identity and query observations 2026-09-22 17:11:21 +00:00
Forge fa2c839833 test: observe audited semantic adapter in managed candidate path 2026-09-22 17:07:05 +00:00
Forge 415291abea docs: record dependency review proof and decision limits 2026-09-22 16:45:39 +00:00
Forge 57f332dbb7 docs: review opt-in semantic read sets with executable counterexamples 2026-09-22 16:41:59 +00:00
Forge b04cf47937 Record semantic update latency, recovery and integrated regression evidence 2026-09-22 16:15:31 +00:00
Forge e0885ee750 Run fixture assertions only in the benchmark coordinator 2026-09-22 15:02:40 +00:00
Forge 7575dcc71e Bulk rebuild candidate indexes and retain concurrent config edits 2026-09-22 15:00:18 +00:00
Forge f7793a836b Record exact route assertions for semantic update measurements 2026-09-22 14:50:16 +00:00
Forge 018b840a3e Replace candidate text search atomically in bulk 2026-09-22 14:44:46 +00:00
Forge 5c27e4ffd2 Reuse pure core parses across atomic semantic updates 2026-09-22 14:34:14 +00:00
Forge 4e54a29321 docs: record Drupal accuracy, performance and integrated regression [skip ci] 2026-09-22 14:03:01 +00:00
Forge 8936a3dc43 fix: reconcile global extension links atomically after source changes 2026-09-22 13:37:42 +00:00
Forge 2bc4029bf4 test: record Drupal profile and convergence methodology 2026-09-22 13:20:29 +00:00
Forge e72c064546 test: expand Drupal corpus proofs and native package regression 2026-09-22 13:15:58 +00:00
Forge 7e674aa0fa feat: pin reviewed Drupal 0.1.1 while retaining immutable 0.1.0 2026-09-22 13:08:13 +00:00
Forge b27bf875c9 fix: tighten Drupal wiring evidence and pending release metadata 2026-09-22 13:06:43 +00:00
Forge 1209454f3b test: add Drupal accuracy negatives and measured corpus samples 2026-09-22 12:59:47 +00:00
Forge c69ae3f2f1 docs: record official Drupal import and graph acceptance 2026-09-22 12:43:17 +00:00
Forge 6272db657e docs: explain reviewed official Drupal operator workflow 2026-09-22 12:33:55 +00:00
Forge 5d40696905 feat: add reviewed official Drupal registry operator 2026-09-22 12:29:38 +00:00
Forge 55fb9796f9 docs: record Cloudflare runtime validation and hosting gates 2026-09-22 12:12:28 +00:00
Forge e77f011ec3 fix: refuse uninitialized Cloudflare backup sources 2026-09-22 07:07:06 +00:00
Forge 52c1b38644 test(marketplace): validate Cloudflare persistence and package boundaries 2026-09-22 07:00:25 +00:00
Forge 44aaa721b2 feat(marketplace): checkpoint Worker D1 and R2 adapter 2026-09-22 06:53:02 +00:00
Forge 160f4685ea docs(validation): record registry persistence and HTTPS hosting limits 2026-09-22 06:29:05 +00:00
Forge ebf32f8fb0 fix(marketplace): preserve author input when catalog loads late 2026-09-22 06:15:21 +00:00
Forge f00b77b3dc test(marketplace): verify HTTPS browser flows on included Linux runner 2026-09-22 06:11:16 +00:00
Forge 63de525482 fix(marketplace): flush registry files with Windows-compatible handles 2026-09-22 06:08:03 +00:00
Forge 35d7d8c100 feat(marketplace): add persistent registry operations and verified backups 2026-09-22 05:39:24 +00:00