Commit Graph

1122 Commits

Author SHA1 Message Date
Forge 36726ada75 test(release): validate Linux candidate and packages on isolated runner 2026-09-23 20:34:08 +00:00
Forge 61e668e613 fix(release): make native checksum verification portable and race probes deterministic 2026-09-23 19:54:49 +00:00
Forge 90516f8b9a fix: harden the extension release candidate and withhold viewer commands 2026-09-23 15:20:04 +00:00
danusha2345 34c9055a0c perf(context): compute the dominant file once per index state (#1864)
getDominantFile() backs context ranking's core-directory boost. Its answer
depends only on the graph, but the whole-graph aggregation behind it
(edges joined to both endpoints' nodes, grouped by file) ran on every
generic codegraph_explore - seconds per call on a large index.

Memoize it in QueryBuilder against a database change stamp:
total_changes() (rows this connection wrote) plus PRAGMA data_version
(commits by any other connection or process). Both are O(1), so no write
path has to remember to invalidate, and a sync made by another process is
seen on the next call. Any write forces a recompute; the heuristic's
result is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-23 14:44:08 +00:00
danusha2345 5570e5d0b7 fix(sync): step aside for a rebuild that has recreated the file but not locked it yet
`codegraph index` recreates the database, then takes the write lock inside
indexAll. With the watcher now following a replaced file, a sync landing in
that gap reopened the empty file and started a full reconcile, holding the
lock the rebuild was about to request — `codegraph index` could then fail
with "another process may be indexing". Review flagged the gap; this closes
it. After following a replaced file, a sync that finds no index_state yet
(the rebuild has not started indexing) and a file written within the last
two minutes returns the lock-busy shape so the watcher retries; the first
sync after that reconciles the whole tree once, then syncs go back to scoped.
The time bound keeps a rebuild that died before indexing from parking the
watcher forever.

New test: fails without the guard, passes with it; 136 related tests pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-23 14:43:35 +00:00
danusha2345 d575529171 fix(watcher): follow a rebuilt index instead of syncing into the replaced file (#1902)
`codegraph index` rebuilds through `CodeGraph.recreate()`, which unlinks
`.codegraph/codegraph.db` and creates a new file at the same path. A running
MCP daemon kept its handle on the unlinked inode and its watcher kept
"auto-syncing" into it, so no edit reached the on-disk index. The #925
self-heal only ran on the tool-call path and ran no catch-up after reopening.

- `sync()` now checks, once it holds the index mutex and the write lock,
  whether the database was replaced on disk (one stat, the same inode check
  `reopenIfReplaced` uses). If so it reopens the live file in place and widens
  a scoped sync to a full reconcile. A failed reopen (rebuild mid-way) returns
  the lock-busy shape so the watcher keeps its pending files and retries.
- `reopenIfReplaced()` refuses while an index/sync holds the mutex, so the
  tool-call path never closes the handle an in-flight sync writes through.
- When a tool call's `freshen()` does reopen, the engine runs its existing
  catch-up sync (serialized on the same mutex), but only for its own watched
  instance, so an engine that is not the project's writer never writes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-23 14:43:20 +00:00
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