@functional-systems/srcx 0.1.0-dev.31 → 0.1.0-dev.33

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
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ - Preserve Java source and test packages named `build`, `dist`, `target` or
6
+ `coverage` under `src/<source-set>/java/`, while still excluding output trees
7
+ above the source root and nested dependencies/caches. Advance the pinned source
8
+ policy to `source-v3`; new registrations/builds use a distinct configuration,
9
+ and presets from the earlier source policy are not accepted by this runtime.
10
+
5
11
  - Look up explicit generated Collection names directly instead of discovering
6
12
  every repository. Exact Collection names take precedence over aliases; only
7
13
  missing Collections fall back to discovery. Preserve descriptor, schema and
package/DESIGN.md CHANGED
@@ -628,6 +628,11 @@ and generated code (common suffixes or explicit generated/do-not-edit comments i
628
628
  lexical-only by default. Tests, ordinary docs, manifests and build/CI config remain
629
629
  eligible. Embedded license headers are not removed from source chunks.
630
630
 
631
+ For Java files in `src/<source-set>/java/`, package components named `build`,
632
+ `dist`, `target`, or `coverage` do not imply build output. Those directory names
633
+ still exclude trees above the source root; dependency/cache directories retain
634
+ their exclusions throughout. The source policy revision is part of preset identity.
635
+
631
636
  `--file-policy` accepts JSON on registration and local path dry runs. Last matching
632
637
  rule wins (`exclude`, `lexical`, `semantic`); rules use case-sensitive relative
633
638
  paths, `*`, `?` and whole-segment `**`. Rules can override default purpose decisions,
package/README.md CHANGED
@@ -163,6 +163,12 @@ extensions. These are targeted exclusions, **not a general secret scanner**;
163
163
  review the dry-run inventory before uploading. `.gitignore` does not remove
164
164
  already tracked Git objects, and `.gitattributes` is not interpreted for selection.
165
165
 
166
+ Java files under `src/<source-set>/java/` keep package directories named `build`,
167
+ `dist`, `target` or `coverage`. For example, `src/main/java/example/build/Builder.java`
168
+ is source, while `build/generated/src/main/java/example/Builder.java` is excluded.
169
+ Dependency and cache exclusions still apply inside source roots. Other ambiguous
170
+ layouts can use explicit file-policy rules below.
171
+
166
172
  Use `--file-policy policy.json` with `repo add` or `import --dry-run --path` to
167
173
  adjust the scope explicitly. The JSON contents are pinned in the repository
168
174
  preset; subsequent connected imports use that preset, not the local policy file.
@@ -453,6 +459,12 @@ The subsequent [exact-Collection lookup replay](https://github.com/lambdadb/srcx
453
459
  removes 22 requests per command in that project, with identical source results
454
460
  and lower observed read/search latency. It does not measure complete-agent cost.
455
461
 
462
+ In the subsequent [agent choice comparison](https://github.com/lambdadb/srcx/blob/develop/eval/VERSION-AGENT-RESULTS.md),
463
+ all three agents offered srcx read its installed skill but used local tools only
464
+ to investigate the prepared CLI/SDK versions. No srcx retrieval benefit was
465
+ established; multiple repositories and historical versions alone did not lead to
466
+ tool adoption when their source trees were already available locally.
467
+
456
468
  The internal [lexical chunking pilot](https://github.com/lambdadb/srcx/blob/develop/eval/README.md) compares syntax-aware and
457
469
  window chunks on a fixed public corpus and 16 pinned investigation queries.
458
470
  `npm run eval:prepare` builds and validates the comparison offline. Live evaluation
package/VALIDATION.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # Validation record
2
2
 
3
+ ## Agent choice across repositories and versions
4
+
5
+ The [six-session comparison](eval/VERSION-AGENT-RESULTS.md) offers the installed
6
+ srcx skill alongside identical local CLI/SDK source trees for three fresh
7
+ maintenance questions. All three srcx-condition agents read the skill but make
8
+ zero srcx calls. Both conditions meet 14 frozen facts and partially meet one;
9
+ no material answer errors were found under assistant source review. All 82 linked
10
+ citation ranges were opened and checked. Tests cited by agents were not executed.
11
+
12
+ Mean total input is 11.0% lower and time 8.1% lower with srcx offered, but uncached
13
+ input is 6.1% higher. With no retrieval calls, these are session differences, not
14
+ evidence of srcx search efficiency or cost savings. Stop tuning this prepared-local
15
+ workflow; any team pilot needs an actual recurring source-access need.
16
+
17
+ All six sessions finish within budget, all 18 source checkouts stay clean at their
18
+ pins, and all 31 frozen inputs match. Six before/after resolution checks confirm
19
+ unchanged commit/Tag/Snapshot identities. No imports, task searches, embeddings or
20
+ remote writes occur. The protocol, rubric and runtime hashes were committed before
21
+ execution; raw sessions and source evidence remain in the local evaluation archive.
22
+
3
23
  ## Direct Collection lookup
4
24
 
5
25
  Exact generated Collection selectors now fetch only the selected metadata and
package/dist/chunk.d.ts CHANGED
@@ -11,7 +11,7 @@ export declare const CHUNKER: {
11
11
  readonly maxTokens: 1500;
12
12
  readonly fallbackOverlap: 0.1;
13
13
  readonly enrichment: "path-scope-symbol-v1";
14
- readonly policy: "source-v2";
14
+ readonly policy: "source-v3";
15
15
  };
16
16
  export type Span = {
17
17
  startByte: number;
package/dist/chunk.js CHANGED
@@ -19,7 +19,7 @@ export const CHUNKER = {
19
19
  maxTokens: 1500,
20
20
  fallbackOverlap: 0.1,
21
21
  enrichment: "path-scope-symbol-v1",
22
- policy: "source-v2",
22
+ policy: "source-v3",
23
23
  };
24
24
  const languages = new Map();
25
25
  let initialized;
@@ -67,10 +67,17 @@ export function hardExclusion(path) {
67
67
  export function privateKeyContent(source) {
68
68
  return /(?:^|\r?\n)-----BEGIN (?:[A-Z0-9]+ )*PRIVATE KEY-----\r?\n/.test(source);
69
69
  }
70
+ function excludedDirectory(path) {
71
+ // Under a Java source-set root, build/dist/target/coverage can be package
72
+ // names. Output directories above that root still exclude the whole tree.
73
+ const javaRoot = /(^|\/)src\/[^/]+\/java\//i.exec(path);
74
+ const outputPath = javaRoot && /\.java$/i.test(path) ? path.slice(0, javaRoot.index) : path;
75
+ return (/(^|\/)(node_modules|vendor|vendored|third_party|third-party|\.git|\.next|\.nuxt|\.venv|venv|__pycache__|\.cache|\.pytest_cache|\.mypy_cache|\.ruff_cache|\.tox|\.nox|\.srcx)(\/|$)/i.test(path) || /(^|\/)(dist|build|target|coverage)(\/|$)/i.test(outputPath));
76
+ }
70
77
  /** Explicit rules override defaults, in order; the final matching rule wins. */
71
78
  export function fileDecision(path, policy, source) {
72
79
  let decision = { action: "semantic", reason: "source" };
73
- if (/(^|\/)(node_modules|vendor|vendored|third_party|third-party|dist|build|target|coverage|\.git|\.next|\.nuxt|\.venv|venv|__pycache__|\.cache|\.pytest_cache|\.mypy_cache|\.ruff_cache|\.tox|\.nox|\.srcx)(\/|$)/i.test(path))
80
+ if (excludedDirectory(path))
74
81
  decision = { action: "exclude", reason: "dependency-or-build-output" };
75
82
  else if (/\.(min\.(js|css)|map)$/i.test(path))
76
83
  decision = { action: "exclude", reason: "generated-output" };
@@ -1 +1 @@
1
- {"version":3,"file":"file-policy.js","sourceRoot":"","sources":["../src/file-policy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAKxC,MAAM,CAAC,MAAM,WAAW,GAAe,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;AAGjE,uFAAuF;AACvF,SAAS,IAAI,CAAC,OAAe;IAC3B,IAAI,UAAU,GAAG,GAAG,CAAC;IACrB,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACjC,KAAK,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC;QAC5C,IAAI,IAAI,KAAK,IAAI;YACf,UAAU,IAAI,KAAK,KAAK,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,aAAa,CAAC;aACpE,CAAC;YACJ,KAAK,MAAM,IAAI,IAAI,IAAI;gBACrB,UAAU;oBACR,IAAI,KAAK,GAAG;wBACV,CAAC,CAAC,OAAO;wBACT,CAAC,CAAC,IAAI,KAAK,GAAG;4BACZ,CAAC,CAAC,MAAM;4BACR,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;YACtD,IAAI,KAAK,KAAK,KAAK,CAAC,MAAM,GAAG,CAAC;gBAAE,UAAU,IAAI,GAAG,CAAC;QACpD,CAAC;IACH,CAAC;IACD,OAAO,I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G,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,sBAAsB,EAAE,CAAC;SAC9D,IACH,iCAAiC,CAAC,IAAI,CAAC,IAAI,CAAC;QAC5C,wBAAwB,CAAC,IAAI,CAAC,IAAI,CAAC;QAEnC,QAAQ,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,kBAAkB,EAAE,CAAC;SAC1D,IACH,wCAAwC,CAAC,IAAI,CAAC,IAAI,CAAC;QACnD,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC;QACjC,CAAC,MAAM,KAAK,SAAS;YACnB,+LAA+L,CAAC,IAAI,CAClM,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAC/D,CAAC;QAEJ,QAAQ,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,kBAAkB,EAAE,CAAC;IAC/D,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,KAAK;QAC7B,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;YAC/B,QAAQ,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,aAAa,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;IAC3E,OAAO,QAAQ,CAAC;AAClB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@functional-systems/srcx",
3
- "version": "0.1.0-dev.31",
3
+ "version": "0.1.0-dev.33",
4
4
  "private": false,
5
5
  "description": "Version-aware code search on LambdaDB",
6
6
  "type": "module",
@@ -66,5 +66,5 @@
66
66
  "url": "https://github.com/lambdadb/srcx/issues"
67
67
  },
68
68
  "license": "Apache-2.0",
69
- "gitHead": "642169ee7abdc8fc71508418f43a52ca863dce5f"
69
+ "gitHead": "2afbf938ef0916da5aa4e5b7744a700128581a6b"
70
70
  }
package/src/chunk.ts CHANGED
@@ -21,7 +21,7 @@ export const CHUNKER = {
21
21
  maxTokens: 1500,
22
22
  fallbackOverlap: 0.1,
23
23
  enrichment: "path-scope-symbol-v1",
24
- policy: "source-v2",
24
+ policy: "source-v3",
25
25
  } as const;
26
26
  export type Span = {
27
27
  startByte: number;
@@ -107,6 +107,19 @@ export function privateKeyContent(source: string): boolean {
107
107
  );
108
108
  }
109
109
 
110
+ function excludedDirectory(path: string): boolean {
111
+ // Under a Java source-set root, build/dist/target/coverage can be package
112
+ // names. Output directories above that root still exclude the whole tree.
113
+ const javaRoot = /(^|\/)src\/[^/]+\/java\//i.exec(path);
114
+ const outputPath =
115
+ javaRoot && /\.java$/i.test(path) ? path.slice(0, javaRoot.index) : path;
116
+ return (
117
+ /(^|\/)(node_modules|vendor|vendored|third_party|third-party|\.git|\.next|\.nuxt|\.venv|venv|__pycache__|\.cache|\.pytest_cache|\.mypy_cache|\.ruff_cache|\.tox|\.nox|\.srcx)(\/|$)/i.test(
118
+ path,
119
+ ) || /(^|\/)(dist|build|target|coverage)(\/|$)/i.test(outputPath)
120
+ );
121
+ }
122
+
110
123
  /** Explicit rules override defaults, in order; the final matching rule wins. */
111
124
  export function fileDecision(
112
125
  path: string,
@@ -114,11 +127,7 @@ export function fileDecision(
114
127
  source?: string,
115
128
  ): FileDecision {
116
129
  let decision: FileDecision = { action: "semantic", reason: "source" };
117
- if (
118
- /(^|\/)(node_modules|vendor|vendored|third_party|third-party|dist|build|target|coverage|\.git|\.next|\.nuxt|\.venv|venv|__pycache__|\.cache|\.pytest_cache|\.mypy_cache|\.ruff_cache|\.tox|\.nox|\.srcx)(\/|$)/i.test(
119
- path,
120
- )
121
- )
130
+ if (excludedDirectory(path))
122
131
  decision = { action: "exclude", reason: "dependency-or-build-output" };
123
132
  else if (/\.(min\.(js|css)|map)$/i.test(path))
124
133
  decision = { action: "exclude", reason: "generated-output" };