@functional-systems/srcx 0.1.0-dev.4 → 0.1.0-dev.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,37 @@
1
1
  # Changelog
2
2
 
3
+ ## Unreleased
4
+
5
+ - Internal reproducible lexical chunking evaluation with pinned source labels,
6
+ equal path-only enrichment, isolated live indexes, and token-budget metrics.
7
+
8
+ ## Unreleased
9
+
10
+ ### Added
11
+
12
+ - Persistent one-to-one Git branch / Collection Branch mapping, branch-local
13
+ incremental updates, and branch-selected search, resolve, and read against the
14
+ last published commit Tag.
15
+ - Remote pending import ownership and resumable in-place branch updates, including
16
+ shared commit Tags across branches and non-fast-forward Git branch changes.
17
+ - `test:live:branches` for repeatable synthetic live acceptance with retained
18
+ checkpoint, retry, and resource evidence.
19
+
20
+ ### Changed
21
+
22
+ - Git branch imports update their fixed `git-*` writer; SHA/tag imports retain
23
+ manual workspaces. Existing publications and pending manual journals remain
24
+ usable. See README for migration and artifact behavior.
25
+ - Ambiguous indexed branch/Git tag names require explicit `refs/heads/...` or
26
+ `refs/tags/...` selectors.
27
+
28
+ ### Fixed
29
+
30
+ - Pin branch control before enumerating versions so a concurrent publication
31
+ cannot advance the selector beyond the version list being read.
32
+ - Reject live checkpoint reuse across different code/harness inputs and preserve
33
+ the original validation revision and completion time on same-input reruns.
34
+
3
35
  ## [0.1.0-dev.1] - 2026-09-25
4
36
 
5
37
  ### Added
package/DESIGN.md CHANGED
@@ -18,14 +18,13 @@ supporting each result. The project name is `srcx`.
18
18
  | --- | --- |
19
19
  | Project and display name | `srcx` |
20
20
  | Local directory | `srcx` |
21
- | Intended GitHub repository | `lambdadb/srcx` |
21
+ | GitHub repository | `lambdadb/srcx` |
22
22
  | CLI executable | `srcx` |
23
- | Intended npm package | `@functional-systems/srcx` |
23
+ | npm package | `@functional-systems/srcx` |
24
24
  | Short description | Version-aware code search on LambdaDB |
25
25
 
26
- The name is selected; the GitHub repository and npm package have not been created
27
- or published in this project. The package manifest and executable entry point are
28
- present in the initial CLI. Keep display/configuration naming centralized and
26
+ The public GitHub repository and npm development channel are available. Current
27
+ publication evidence and stable-release status are recorded in RELEASING.md. Keep display/configuration naming centralized and
29
28
  distribution identity in `package.json`. Database IDs and the existing
30
29
  `code-*` Collection naming and `purpose=code-search-v1` protocol marker remain
31
30
  independent of the product name.
@@ -72,9 +71,10 @@ This document is not a deployed-revision audit or evidence of a passing live run
72
71
 
73
72
  The initial command set below is implemented; run it as `node dist/cli.js` from
74
73
  this checkout after `npm run build`. See README for exact options and recovery.
75
- The first implementation uses fresh `work-*` Branches and observed-local-tag Alias
76
- synchronization; persistent tracked branches and authoritative pruning remain
77
- follow-up work. Immutable manifest `requestedRef` is normalized to the resolved
74
+ Git branch imports now reuse persistent `git-*` Branches; explicit commit/tag
75
+ imports use frozen `work-*` writers. Observed-local-tag Alias synchronization is
76
+ implemented; automatic Git observation and authoritative pruning remain follow-up
77
+ work. Immutable manifest `requestedRef` is normalized to the resolved
78
78
  commit OID; the
79
79
  original user spelling remains in the local build artifact. The broader contract
80
80
  below remains the target design.
@@ -477,7 +477,8 @@ fields are omitted when absent; records of different kinds need not share them.
477
477
  | Corpus root (`kind=manifest`, `role=corpus`, ID `__manifest__`) | `repoId`, `indexId`, full `commitOid`, `commitTime`, `requestedRef`, full `config`, `inventoryHash`, `recordsHash`, `counts`, `buildId`, `attemptId`, `inventoryPartIds` |
478
478
  | Inventory part (`kind=manifest`, `role=inventory`) | `partOrdinal`, `partHash`, ordered `entries` with path, file/chunk IDs, blob/content identities, inclusion/exclusion reasons, parse states, sizes, and embedding coverage |
479
479
  | Repository control (`kind=manifest`, `role=repository`, main ID `__repo__`) | Full source identity, repo/index IDs, immutable preset/config, initialization state |
480
- | Ref control (`kind=manifest`, `role=git-ref`, main) | Full Git ref name, encoded Alias/Branch name, observed commit/time, applied version and synchronization state |
480
+ | Git tag control (`kind=manifest`, `role=git-ref`, main) | Full Git tag ref, encoded Alias name, observed commit, applied version and synchronization state |
481
+ | Git branch control (`kind=manifest`, `role=git-branch`, main) | Full Git branch ref, encoded Branch name, validated writer baseline, canonical published Tag and pending attempt identity |
481
482
  | Validation summary (`kind=manifest`, `role=validation`, main) | Candidate name/Snapshot, build/config/attempt identity, verifier version and checked counts/hashes; no premature claim of publication |
482
483
 
483
484
  `startByte`/`endByte` are half-open; display lines are one-based/inclusive.
@@ -814,10 +815,16 @@ they do not authorize the next commit on that workspace.
814
815
  attempt identity and verifier version. Use an ID derived from the full commit
815
816
  OID and candidate Snapshot ID so attempts cannot overwrite another Snapshot's
816
817
  evidence. Confirm its readback before publication.
817
- 5. Create the deterministic published Tag **from the validated candidate Tag**,
818
- not from the mutable Branch. Verify both Tags have the same Snapshot ID and
819
- matching manifest. Publication changes naming, not corpus content.
820
- 6. Update optional branch-progress/control records and return the published version.
818
+ 5. For a first publication, create the deterministic published Tag **from the
819
+ validated candidate Tag**, not from the mutable Branch. Verify both Tags have
820
+ the same Snapshot ID and matching manifest. If the commit is already published,
821
+ validate and reuse its canonical Tag; retain this writer's validated candidate
822
+ separately when its Snapshot ID differs. Publication never overwrites a commit
823
+ Tag with another writer's snapshot.
824
+ 6. For a tracked Git branch, update its control record with the validated writer
825
+ snapshot and published commit Tag, clear pending ownership, and return the
826
+ published version. Branch selectors keep using the preceding published Tag
827
+ until this control update succeeds.
821
828
  A delayed bookkeeping write does not erase an already published immutable Tag.
822
829
 
823
830
  An empty Snapshot or incomplete candidate never becomes published. A stale Tag
@@ -827,6 +834,33 @@ avoid repeatedly validating known stale Snapshot IDs. A payload/build defect
827
834
  requires explicit same-build recovery, not endless polling. Publication must
828
835
  finish before the same code Branch starts a later commit.
829
836
 
837
+ ### Persistent Git branch state
838
+
839
+ Each full `refs/heads/...` name maps to one `git-<ref-digest>` writer and one
840
+ `branch-<full-ref-digest>` control document on main (`role=git-branch`). The control
841
+ record holds the last applied immutable baseline, canonical published Tag name,
842
+ and pending attempt/build/commit identity. Record pending ownership before branch
843
+ creation or corpus writes. A missing local journal cannot authorize a second
844
+ import over pending remote state, even if the committed head still matches the
845
+ old baseline. Only the same journal may resume; automatic abandoned-attempt
846
+ recovery remains unimplemented.
847
+
848
+ Compare the writer head with the recorded baseline snapshot before the next
849
+ import, then reconcile old IDs and hashes through its immutable Tag. This works
850
+ without the prior local artifact and supports a branch moving backward or across
851
+ history. Every target commit still comes from one full committed Git tree.
852
+
853
+ An already published commit does not skip updating a different tracked branch.
854
+ Validate that branch's own candidate, reuse the existing canonical commit Tag,
855
+ and retain the candidate as the writer's exact baseline when the snapshot IDs
856
+ differ. Never overwrite the canonical commit publication with another writer's
857
+ snapshot. This also applies when a branch returns to a previously indexed commit.
858
+
859
+ Branch search/resolve/read selects the last published Tag from the control record,
860
+ including while the next import is pending. This promises the last indexed state,
861
+ not the current Git tip. A first pending import has no searchable branch version.
862
+ An ambiguous tracked branch/Git tag short name requires an explicit heads/tags ref.
863
+
830
864
  ### `versions` reads LambdaDB
831
865
 
832
866
  1. Resolve the repository Collection through remote metadata.
package/README.md CHANGED
@@ -77,6 +77,13 @@ Chunks cover the exact source bytes, carry one-based line ranges, target 800 tok
77
77
  and stay below 1,500 tokens including path/symbol context. The internal window
78
78
  baseline is available to the test/build API, not as a public storage backend.
79
79
 
80
+ ## Evaluate retrieval quality
81
+
82
+ The internal [lexical chunking pilot](https://github.com/lambdadb/srcx/blob/develop/eval/README.md) compares syntax-aware and
83
+ window chunks on a fixed public corpus and 16 pinned investigation queries.
84
+ `npm run eval:prepare` builds and validates the comparison offline. Live evaluation
85
+ is an explicit separate operation and retains isolated evaluation Collections.
86
+
80
87
  ## Explicit live acceptance run
81
88
 
82
89
  The live harness accepts `LAMBDADB_BASE_URL`, `LAMBDADB_PROJECT_NAME`, and
@@ -96,6 +103,25 @@ It saves connection settings under `.srcx/live/config.json` and keeps its state
96
103
  separate under `.srcx/live/state`. Rerunning resumes the saved synthetic run and
97
104
  refuses to reuse it against a different destination.
98
105
 
106
+ For persistent Git branch acceptance, run `npm run test:live:branches`. It uses a
107
+ separate synthetic Collection and `.srcx/live-branches/` state/report, covering
108
+ in-place A/B updates, last-published reads during a pending update, shared commit
109
+ Tags across two branches, rewinds, no-op imports, and SHA-only manual imports.
110
+ From an isolated worktree, load the original checkout's env file explicitly:
111
+
112
+ ```sh
113
+ npm run build
114
+ node --env-file=/absolute/path/to/srcx/.env.local scripts/live-branches.mjs
115
+ ```
116
+
117
+ The branch harness retains resources and resumes saved checkpoints on rerun.
118
+ It preserves the original source revision and completion time. Checkpoints from
119
+ different runtime code, harness, fixture, lockfile, or Node version are rejected
120
+ before connecting or overwriting evidence. To validate changed code, select a new
121
+ `SRCX_LIVE_BRANCHES_DIR` (for example `.srcx/live-branches-next`); retain the old
122
+ run and any pending journal. Its per-import deadline defaults to 300 seconds and accepts
123
+ `SRCX_LIVE_TIMEOUT_MS` up to 600000. Do not delete pending journals to start over.
124
+
99
125
  ## Connected workflow
100
126
 
101
127
  These commands create and write LambdaDB resources. Select an approved project
@@ -115,6 +141,11 @@ node dist/cli.js repo show --repo <name>
115
141
  # Import the exact artifact reviewed in the credential-free preview.
116
142
  node dist/cli.js import --repo <name> --artifact /tmp/srcx-build-a
117
143
  node dist/cli.js versions --repo <name>
144
+
145
+ # Keep a Git branch connected to its Collection Branch.
146
+ node dist/cli.js import --repo <name> --ref develop
147
+ node dist/cli.js search --repo <name> --version develop --query retry
148
+ node dist/cli.js resolve --repo <name> --ref refs/heads/develop
118
149
  node dist/cli.js search --repo <name> --version <full-commit-A> --query retry
119
150
  node dist/cli.js read --result <result-id> --context 20
120
151
  node dist/cli.js read --result <result-id> --full-file
@@ -152,10 +183,28 @@ are one-based and inclusive.
152
183
  ## Publication and recovery
153
184
 
154
185
  The control Branch `main` holds descriptors/version summaries. `checkpoint-empty`
155
- is forked before any control write. Each import uses a new `work-*` Branch,
156
- optionally forked from the last locally retained, remotely validated writer
157
- baseline. Writers are frozen after publication. A fresh local state can start a
158
- full import from `checkpoint-empty`; source data is never forked from a Tag.
186
+ is forked before any control write. Importing a Git branch creates or updates its
187
+ stable `git-*` Collection Branch, derived from the full `refs/heads/...` name.
188
+ Git `main` also uses a `git-*` Branch; Collection `main` remains control-only.
189
+ Each later import reconciles against that branch's last validated snapshot,
190
+ including deletions and non-fast-forward changes. Branches sharing a commit share
191
+ one canonical `ver-*` Tag while retaining their own writer snapshots.
192
+
193
+ `search/read --version develop` and `resolve --ref develop` select the branch's
194
+ last successfully published commit Tag. During an import or after a failed update,
195
+ they keep serving the previous published commit; the first import is unavailable
196
+ until publication. This is the last indexed state, not a live Git HEAD lookup.
197
+ Nothing polls or fetches Git automatically: run import again to advance the branch.
198
+ If an indexed branch and synchronized Git tag share a short name, use
199
+ `refs/heads/<name>` or `refs/tags/<name>` explicitly. Known Git names take precedence
200
+ over commit prefixes.
201
+
202
+ A commit SHA or Git tag import does not infer a containing branch. An unpublished
203
+ commit uses a fresh `work-*` Branch, optionally forked from a validated previous
204
+ manual writer; an already published commit reuses its Tag. Manual writers remain
205
+ frozen. Source data is never forked from a Tag. A clean tracked branch can be
206
+ updated from fresh local state using its remote baseline. Local build reuse is
207
+ cached separately for each Git branch and for manual imports.
159
208
 
160
209
  The importer deletes obsolete IDs, upserts changed records and inventory parts in
161
210
  bounded sequential requests, then sends `__manifest__` **alone** after every prior
@@ -167,7 +216,10 @@ an early/stale snapshot even after the marker is observed.
167
216
 
168
217
  A per-Collection local lock and durable `pending.json` journal prevent another
169
218
  commit from overwriting a partial attempt. Only one importing host is supported.
170
- After a timeout or unknown write result, retain the artifacts and journal:
219
+ A tracked branch also records pending import ownership in control `main` before
220
+ writing code. If the local journal is lost, new local state refuses to overwrite
221
+ that pending branch even when its committed head has not advanced yet. After a
222
+ timeout or unknown write result, retain the artifacts and journal:
171
223
 
172
224
  ```sh
173
225
  node dist/cli.js import --repo <name> --artifact /path/from/pending.json \
@@ -195,8 +247,17 @@ For search and resolve, a synchronized Git tag name takes precedence over a comm
195
247
  prefix, matching Git import's tag-before-OID rule. A pending tag fails explicitly
196
248
  instead of falling back to a matching commit prefix. Use `refs/tags/<name>` to
197
249
  select a Git tag explicitly.
198
- Explicit authoritative pruning and persistent tracked-branch synchronization are
199
- follow-up work; no full history import is required.
250
+ Automatic Git observation, authoritative pruning, branch rename/deletion handling,
251
+ and garbage collection remain follow-up work; no full history import is required.
252
+
253
+ Existing commit Tags and frozen `work-*` Branches remain valid. The next import
254
+ using a Git branch name establishes its fixed mapping, even if that commit was
255
+ already published. A pending journal from the previous implementation resumes on
256
+ its original `work-*` writer; import the branch again after recovery to establish
257
+ tracking. `--artifact` uses the Git branch recorded when the artifact was built,
258
+ with its pinned commit; it does not reread the branch's current tip. The publication
259
+ JSON continues to describe the canonical commit Tag: its `writer` can be the
260
+ original publishing branch when multiple Git branches share that commit.
200
261
 
201
262
  ## State and implementation map
202
263
 
package/VALIDATION.md CHANGED
@@ -4,12 +4,108 @@ Date: 2026-09-25 (Asia/Seoul).
4
4
 
5
5
  ## Evidence boundary
6
6
 
7
- This implementation has passed local fixtures/fault injection/SDK transport checks,
7
+ The initial implementation passed local fixtures/fault injection/SDK transport checks,
8
8
  a live synthetic A/B acceptance run, and an exact-package self-index of the public
9
9
  srcx repository against the user-supplied LambdaDB connection. No private source
10
10
  or paid embeddings were used. These checks are not a throughput, general
11
11
  concurrency, or retrieval-quality benchmark. npm publication evidence is recorded
12
- separately below.
12
+ separately below. The persistent Git branch changes have a separate synthetic
13
+ live run recorded next; the earlier live runs do not validate this new path.
14
+
15
+ ## Retrieval evaluation harness
16
+
17
+ The internal pilot adds five checks for unique source-range scoring, token-budget
18
+ prefix selection, source/hit integrity, equal path-only enrichment, and rejecting
19
+ stale runtime checkpoints before any connection. With these checks, Node.js
20
+ 24.15.0 passed **50 tests**, typechecking, version validation, and clean installed
21
+ package checks. The default CLI preset and config hash remain unchanged.
22
+
23
+ The suite fixes 16 queries, expected source byte ranges, and two full Git commits
24
+ before retrieval. Both chunkers materialize the same included files, use separate
25
+ config identities, and run through the existing immutable publication validation.
26
+ Live retrieval observations and limitations are in [eval/RESULTS.md](https://github.com/lambdadb/srcx/blob/develop/eval/RESULTS.md),
27
+ with reproduction instructions in [eval/README.md](https://github.com/lambdadb/srcx/blob/develop/eval/README.md). These diagnostic
28
+ labels were authored from source before querying and are not independently
29
+ human-reviewed judgments or a general retrieval-quality benchmark.
30
+
31
+ Post-review, `splitEvidence` now requires complete coverage of all required ranges
32
+ before classifying a result as split across chunks. The multi-range regression
33
+ brings the local suite to **51 passing tests**. Offline rescoring of all 32 retained
34
+ query/method pairs preserved every metric and category summary. The original live
35
+ report, runtime fingerprint, and completion timestamp were not changed.
36
+
37
+ ## Persistent Git branch tracking
38
+
39
+ Local regression coverage exercises one writer across consecutive commits,
40
+ branch-local deletion/diff baselines, separate branches sharing canonical Tags,
41
+ rewinds to already published commits, and imports from fresh local state. Fault
42
+ injection verifies last-published branch resolution during partial writes, pending
43
+ ownership protection when the local journal is missing, stale/corrupt candidate
44
+ rejection, and retries after uncertain control writes. Branch/tag ambiguity and
45
+ explicit full refs are covered.
46
+
47
+ The CLI fixture also imports and updates a tracked branch through the real SDK
48
+ transport and selects it for search, resolve, and read. The same fixture runs
49
+ against the installed tarball. These checks use a loopback fault-injection model,
50
+ not a live LambdaDB deployment.
51
+
52
+ A separate **live LambdaDB run passed all 12 checkpoints** on September 25 using
53
+ Node **24.15.0**, application source commit
54
+ `f42a9141cef3bfc0b604e1b14a00c79607c7dd98`, and the original checkout's `.env.local`
55
+ loaded explicitly through Node. The run took **414.195 seconds** and uploaded only
56
+ synthetic Git source with no paid embeddings. It verified:
57
+
58
+ - First-import timeout remains unpublished, followed by same-journal recovery.
59
+ - A -> B uses one fixed Collection Branch; pending B still resolves/searches A,
60
+ and a fresh local state cannot overwrite that pending branch.
61
+ - Added/modified/deleted code searches correctly after B; old A evidence still
62
+ reads the exact original source bytes.
63
+ - A second Git branch shares canonical A/B Tags while maintaining its own writer
64
+ baseline, including B -> A -> B movement and an unchanged repeated import.
65
+ - A SHA-only new commit uses a manual `work-*` writer.
66
+
67
+ A separate invocation of the actual CLI against that live Collection passed
68
+ branch `resolve`, branch-selected `search`, and a full-file `read` compared byte
69
+ for byte with the pinned Git blob. It used the built CLI, not a registry-installed
70
+ package. Local installed-package evidence remains separate above.
71
+
72
+ The reproducible harness is `scripts/live-branches.mjs` (`npm run
73
+ test:live:branches`). Its ignored evidence is `.srcx/live-branches/report.json`
74
+ and `.srcx/live-branches/cli-report.json` in the validation worktree. The report
75
+ records the exact source commit, harness SHA-256, per-check results, and resource
76
+ URL. One synthetic Collection is retained with two tracked writers, one manual
77
+ writer, the two control/checkpoint Branches, three canonical commit Tags, and seven
78
+ candidate Tags. No application fix was needed during this live run.
79
+
80
+ On Node **22.14.0** and **24.15.0**, typechecking, all **43 tests**, and installed
81
+ package checks passed. Formatting, release-version validation, and `git diff
82
+ --check` also passed locally. These results are not GitHub CI evidence.
83
+
84
+ ## Final branch review validation
85
+
86
+ The final pre-PR review reproduced a read-order race: a concurrent publication
87
+ could advance branch control beyond the version list already captured by the
88
+ reader. Resolution now pins the control record first. The review also found that
89
+ live reruns could skip saved checkpoints while replacing the reported source
90
+ revision; checkpoints now require matching runtime, harness, fixture, lockfile,
91
+ and Node fingerprints and preserve their original revision/completion time.
92
+ Regression tests cover both cases, including rejecting stale evidence before any
93
+ connection or report mutation.
94
+
95
+ After these fixes, Node **22.14.0** and **24.15.0** each passed typechecking,
96
+ all **45 tests**, and installed-package checks. Formatting, release-version
97
+ validation, and diff checks passed locally.
98
+
99
+ A fresh synthetic live run at application/harness commit
100
+ `2988c7e1826a44cfed48381681d0125b28ae9086` passed all **12 checkpoints** in
101
+ **432.836 seconds**. The built CLI also passed live branch resolution,
102
+ search, and exact source reads. Final reports are retained separately under
103
+ `.srcx/live-branches-review/report.json` and
104
+ `.srcx/live-branches-review/cli-report.json`; the previous run remains intact.
105
+ This final run retained one synthetic Collection with two tracked writers, one
106
+ manual writer, two control/checkpoint Branches, three canonical commit Tags,
107
+ and seven candidate Tags. CI evidence, once available on the PR, is separate
108
+ from these local and live results.
13
109
 
14
110
  ## Initial npm package and live self-index
15
111
 
@@ -135,19 +231,22 @@ interface verifies eligibility/cache behavior only; production provider selectio
135
231
  semantic/hybrid querying, pricing, and evaluation remain open. Public imports
136
232
  reject a vector-enabled build to prevent fixture vectors from reaching LambdaDB.
137
233
 
138
- Each import gets a fresh `work-*` Branch, with incremental reuse only from an exact
139
- validated previous writer snapshot. Existing writers are not mutated after
140
- publication. Persistent `git-*` tracking, automatic failed-workspace recovery,
141
- Alias pruning, and garbage collection are not yet implemented. Failed/candidate
234
+ Git branch imports reuse a fixed `git-*` Branch with its last validated immutable
235
+ baseline; SHA/tag-only imports retain frozen `work-*` writers. Automatic Git
236
+ observation, failed-workspace recovery, branch rename/deletion handling, Alias
237
+ pruning, and garbage collection are not yet implemented. Failed/candidate
142
238
  resources and build artifacts are retained. A single importing host is required;
143
- the local lock is not a distributed lease.
239
+ the local lock is not a distributed lease. Remote pending ownership prevents
240
+ accidental adoption from fresh local state but is not a distributed compare-and-set
241
+ or lease protocol.
144
242
 
145
243
  Parsing uses the pinned packaged grammars. Unsupported/new syntax can fall back
146
244
  and is recorded; no claim of complete language-version coverage is made. There is
147
245
  no optimal-chunking claim. The fixed-window baseline is implemented internally;
148
- the planned 10–20-query retrieval comparison has not been run. The in-memory test
149
- model does not approximate Lucene ranking, distributed indexing, retention, or
150
- compaction timing.
246
+ the first 16-query live lexical comparison is recorded in [eval/RESULTS.md](https://github.com/lambdadb/srcx/blob/develop/eval/RESULTS.md).
247
+ It is a single-repository diagnostic, not a general optimal-chunking result. The
248
+ in-memory test model does not approximate Lucene ranking, distributed indexing,
249
+ retention, or compaction timing.
151
250
 
152
251
  Canonical publication records exist on main; listings require both the remote
153
252
  summary and the matching immutable Tag manifest. A candidate or a lone `ver-*`
package/dist/build.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { type Identity } from "./git.js";
1
+ import { resolveCommit, type Identity } from "./git.js";
2
2
  import { CHUNKER } from "./chunk.js";
3
3
  import { type Doc } from "./common.js";
4
4
  export declare const INDEX_CONFIGS: {
@@ -26,6 +26,8 @@ export type Preset = {
26
26
  schemaVersion: 1;
27
27
  chunker: typeof CHUNKER;
28
28
  mode: "syntax" | "window";
29
+ /** Internal evaluation override; the CLI keeps its original enrichment. */
30
+ enrichment?: "path-only-v1";
29
31
  maxFileBytes: number;
30
32
  embedding: {
31
33
  model: string;
@@ -84,6 +86,7 @@ export declare function loadBuild(directory: string): Promise<Build>;
84
86
  export declare function materialize(args: {
85
87
  identity: Identity;
86
88
  ref: string;
89
+ resolvedCommit?: Awaited<ReturnType<typeof resolveCommit>>;
87
90
  output: string;
88
91
  previous?: Build;
89
92
  preset?: Preset;
package/dist/build.js CHANGED
@@ -54,6 +54,8 @@ export async function materialize(args) {
54
54
  const preset = args.preset ?? PRESET, configHash = hash(preset), prev = args.previous;
55
55
  invariant(hash(preset.chunker) === hash(CHUNKER) &&
56
56
  ["syntax", "window"].includes(preset.mode) &&
57
+ (preset.enrichment === undefined ||
58
+ preset.enrichment === "path-only-v1") &&
57
59
  preset.maxFileBytes === PRESET.maxFileBytes, "Unsupported build preset.");
58
60
  if (prev) {
59
61
  invariant(prev.repoKey === args.identity.key && prev.configHash === configHash, "Previous build repository/config mismatch.");
@@ -62,7 +64,7 @@ export async function materialize(args) {
62
64
  invariant(!preset.embedding ||
63
65
  (args.embedder?.model === preset.embedding.model &&
64
66
  args.embedder.dimensions === preset.embedding.dimensions), "Embedding provider must match the pinned preset.");
65
- const commit = await resolveCommit(args.identity.path, args.ref);
67
+ const commit = args.resolvedCommit ?? (await resolveCommit(args.identity.path, args.ref));
66
68
  const directory = resolve(args.output);
67
69
  await mkdir(directory, { recursive: false, mode: 0o700 });
68
70
  const output = await open(join(directory, "records.jsonl"), "wx", 0o600);
@@ -138,7 +140,7 @@ export async function materialize(args) {
138
140
  item.reason = "lfs-pointer";
139
141
  continue;
140
142
  }
141
- const parsed = await chunk(source, e.path, preset.mode);
143
+ const parsed = await chunk(source, e.path, preset.mode, preset.enrichment);
142
144
  const contentHash = hash(data);
143
145
  const fileId = `f-${hash([e.pathBase64, contentHash])}`;
144
146
  const base = { schemaVersion: 1, configHash };
package/dist/build.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"build.js","sourceRoot":"","sources":["../src/build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,aAAa,EAAiB,MAAM,UAAU,CAAC;AAC1E,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EACL,MAAM,EACN,SAAS,EACT,IAAI,EACJ,SAAS,EACT,MAAM,EACN,IAAI,EACJ,IAAI,EAEJ,YAAY,GACb,MAAM,aAAa,CAAC;AACrB,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;IACzB,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;IACzB,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;IAC7B,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;IAC3B,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;IAC3B,UAAU,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,UAAU,CAAC,EAAE;CAC7C,CAAC;AAQX,MAAM,CAAC,MAAM,MAAM,GAAW;IAC5B,aAAa,EAAE,CAAC;IAChB,OAAO,EAA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QAChB,aAAa,EAAE,CAAC,CAAC,aAAa;QAC9B,WAAW,EAAE,CAAC,CAAC,WAAW;QAC1B,MAAM,EAAE,CAAC,CAAC,MAAM;QAChB,OAAO,EAAE,CAAC,CAAC,OAAO;QAClB,SAAS;QACT,gBAAgB,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACzC,CAAC;IACF,OAAO,CAAC,GAAG,KAAK,EAAE,IAAI,CAAC,CAAC;AAC1B,CAAC"}
package/dist/chunk.d.ts CHANGED
@@ -23,7 +23,8 @@ export type Span = {
23
23
  tokenCount: number;
24
24
  };
25
25
  export declare function detectLanguage(path: string): string;
26
- export declare function chunk(source: string, path: string, mode?: "syntax" | "window"): Promise<{
26
+ export type Enrichment = "path-scope-symbol-v1" | "path-only-v1";
27
+ export declare function chunk(source: string, path: string, mode?: "syntax" | "window", policy?: Enrichment): Promise<{
27
28
  spans: Span[];
28
29
  parseStatus: string;
29
30
  language: string;
package/dist/chunk.js CHANGED
@@ -49,7 +49,9 @@ export function detectLanguage(path) {
49
49
  ini: "ini",
50
50
  }[ext ?? ""] ?? "text");
51
51
  }
52
- function enrichment(path, u) {
52
+ function enrichment(path, u, policy) {
53
+ if (policy === "path-only-v1")
54
+ return path.slice(0, 240) + "\n";
53
55
  return ([path.slice(0, 240), u.scope?.slice(0, 160), u.symbol?.slice(0, 160)]
54
56
  .filter(Boolean)
55
57
  .join("\n") + "\n");
@@ -77,10 +79,10 @@ function scopeName(n) {
77
79
  return names.length ? names.join(".") : undefined;
78
80
  }
79
81
  /** Bound strings without slicing a surrogate pair; prefer line ends where possible. */
80
- function splitUnit(source, path, u, overlap) {
82
+ function splitUnit(source, path, u, overlap, policy) {
81
83
  const result = [];
82
84
  let start = u.start;
83
- const prefix = enrichment(path, u);
85
+ const prefix = enrichment(path, u, policy);
84
86
  invariant(tokens(prefix) < CHUNKER.maxTokens, "Path/scope enrichment exceeds token limit.");
85
87
  while (start < u.end) {
86
88
  let end = u.end;
@@ -151,7 +153,7 @@ function textUnits(source, lang) {
151
153
  });
152
154
  return units;
153
155
  }
154
- export async function chunk(source, path, mode = "syntax") {
156
+ export async function chunk(source, path, mode = "syntax", policy = CHUNKER.enrichment) {
155
157
  const lang = detectLanguage(path);
156
158
  if (!source.length)
157
159
  return { spans: [], parseStatus: "empty", language: lang };
@@ -189,7 +191,7 @@ export async function chunk(source, path, mode = "syntax") {
189
191
  u.signature = n.text.split(/[\n{]/, 1)[0]?.slice(0, 240);
190
192
  if (n.namedChildCount &&
191
193
  (container ||
192
- tokens(enrichment(path, u) + n.text) > CHUNKER.maxTokens)) {
194
+ tokens(enrichment(path, u, policy) + n.text) > CHUNKER.maxTokens)) {
193
195
  for (const child of n.namedChildren)
194
196
  if (child)
195
197
  visit(child);
@@ -242,8 +244,7 @@ export async function chunk(source, path, mode = "syntax") {
242
244
  prev.kind !== "function" &&
243
245
  u.kind === prev.kind &&
244
246
  u.scope === prev.scope &&
245
- tokens(enrichment(path, prev) + source.slice(prev.start, u.end)) <=
246
- CHUNKER.targetTokens) {
247
+ tokens(enrichment(path, prev, policy) + source.slice(prev.start, u.end)) <= CHUNKER.targetTokens) {
247
248
  prev.end = u.end;
248
249
  delete prev.symbol;
249
250
  delete prev.signature;
@@ -251,7 +252,7 @@ export async function chunk(source, path, mode = "syntax") {
251
252
  else
252
253
  merged.push({ ...u });
253
254
  }
254
- const bounded = merged.flatMap((u) => splitUnit(source, path, u, fallback ? CHUNKER.fallbackOverlap : 0));
255
+ const bounded = merged.flatMap((u) => splitUnit(source, path, u, fallback ? CHUNKER.fallbackOverlap : 0, policy));
255
256
  const offsets = new Uint32Array(source.length + 1);
256
257
  let byte = 0;
257
258
  for (let i = 0; i < source.length;) {
@@ -268,7 +269,7 @@ export async function chunk(source, path, mode = "syntax") {
268
269
  const spans = bounded.map((u) => {
269
270
  const startByte = offsets[u.start], endByte = offsets[u.end];
270
271
  const text = source.slice(u.start, u.end);
271
- const searchText = enrichment(path, u) + text;
272
+ const searchText = enrichment(path, u, policy) + text;
272
273
  const kind = text.trim() === "" ? "structural" : u.kind;
273
274
  return {
274
275
  startByte,