layermap 0.1.10 → 0.1.11

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/README.md CHANGED
@@ -71,6 +71,7 @@ projects, graded blind against truth sets cross-checked with each language's own
71
71
  | Time, no request limit (Claude Code / Codex) | +25% / +20% | |
72
72
  | Failing tests the change check lists (Go / Python, functions made to fail) | **100% / 94–98%** | — |
73
73
  | Ripple tasks: runs leaving other features' tests passing (Codex / Claude Code, 4 tasks × 6 runs with, × 3 without) | **23 of 24** / 11 of 24 | 3 of 12 / 4 of 12 |
74
+ | Everyday tasks, no impact analysis needed: done right / time (Claude Code and Codex, 8 tasks × 2 runs) | 32 of 32 / +20–22% | 32 of 32 |
74
75
 
75
76
  With a tight budget, the map finds far more of the affected code, at about 24% more tokens. With
76
77
  no limit, both agents find nearly everything either way. Claude Code costs a third less with the
@@ -78,7 +79,8 @@ map. Codex's current defaults already search lean, so the map no longer saves it
78
79
  reasoning effort max, in the first round, it saved 55%. Agents with the map explore more widely,
79
80
  which takes longer. On requests whose obvious change breaks another feature, the change check
80
81
  helped Codex keep to the requested feature. Claude Code saw which tests of other features it had
81
- changed but often kept the broader change on purpose, so it showed no clear difference. These are small samples on tasks written by LayerMap's authors.
82
+ changed but often kept the broader change on purpose, so it showed no clear difference. On small
83
+ local tasks the map changed nothing but cost about a fifth more time and money. These are small samples on tasks written by LayerMap's authors.
82
84
  The [report](https://github.com/coffeecoproject/layermap/blob/main/docs/benchmark.md) has the
83
85
  setup, the published tasks and the limitations.
84
86
 
Binary file
Binary file
Binary file
Binary file
@@ -121442,6 +121442,8 @@ var Relater = class extends ParseTreeWalker {
121442
121442
  super();
121443
121443
  this.x = x2;
121444
121444
  this.path = path3;
121445
+ // Module variables each declaration reads, recorded once.
121446
+ this.reads = /* @__PURE__ */ new Set();
121445
121447
  this.scopes = [];
121446
121448
  this.callees = /* @__PURE__ */ new Set();
121447
121449
  // Names a function declares global.
@@ -121708,9 +121710,15 @@ var Relater = class extends ParseTreeWalker {
121708
121710
  const to = this.x.objectOf(declaration);
121709
121711
  if (to === void 0) continue;
121710
121712
  if (read && this.x.global(this.x.object(to).path, name.d.value) !== to) continue;
121713
+ const from = this.top(this.declared);
121714
+ if (read && !value) {
121715
+ const key = `${from}\0${to}`;
121716
+ if (this.reads.has(key)) return;
121717
+ this.reads.add(key);
121718
+ }
121711
121719
  this.relation({
121712
121720
  kind: "REFERENCES",
121713
- from: this.top(this.declared),
121721
+ from,
121714
121722
  to,
121715
121723
  start: expression.start,
121716
121724
  end: end(expression),
@@ -31126,6 +31126,7 @@ async function extractProjectMap(project, input, trace) {
31126
31126
  const exportedSymbols = /* @__PURE__ */ new Map();
31127
31127
  const pending = [];
31128
31128
  const moduleVariables = /* @__PURE__ */ new Set();
31129
+ const stateReads = /* @__PURE__ */ new Set();
31129
31130
  const contracts = [];
31130
31131
  const callableHolders = /* @__PURE__ */ new Set();
31131
31132
  const valueNames = /* @__PURE__ */ new Set();
@@ -31471,7 +31472,10 @@ async function extractProjectMap(project, input, trace) {
31471
31472
  trace.phase = "RELATION_TARGETS";
31472
31473
  for (const [index, item] of batch.entries()) {
31473
31474
  if (item.state) {
31474
- for (const destination of await targets.resolveMapped(symbols[index], moduleVariable))
31475
+ for (const destination of await targets.resolveMapped(symbols[index], moduleVariable)) {
31476
+ const read = `${item.owner}\0${destination.id}`;
31477
+ if (stateReads.has(read)) continue;
31478
+ stateReads.add(read);
31475
31479
  collect.relation({
31476
31480
  from: item.owner,
31477
31481
  to: destination.id,
@@ -31480,6 +31484,7 @@ async function extractProjectMap(project, input, trace) {
31480
31484
  target: item.target,
31481
31485
  basis: "TYPE_RESOLVED"
31482
31486
  });
31487
+ }
31483
31488
  continue;
31484
31489
  }
31485
31490
  if (item.kind === "REFERENCES") {
package/dist/cli.mjs CHANGED
@@ -17765,7 +17765,7 @@ function runMapOperation(resources, input, schema, signal, observeTiming) {
17765
17765
  var goModule = /(?:^|\/)go\.mod$/u;
17766
17766
  var codeHosts = /* @__PURE__ */ new Set(["github.com", "gitlab.com", "bitbucket.org"]);
17767
17767
  var GO_MAP_LANGUAGE = Object.freeze({
17768
- id: "go-1.24-map-v8",
17768
+ id: "go-1.24-map-v9",
17769
17769
  claims: (path11) => path11.endsWith(".go"),
17770
17770
  reads: (path11) => goModule.test(path11),
17771
17771
  // A module path, or the standard library, whose first path element has no dot.
@@ -17918,7 +17918,7 @@ var nameOf = (path11) => path11.slice(path11.lastIndexOf("/") + 1);
17918
17918
  var DEFAULT_RELEASE = 21;
17919
17919
  var platformPackage = /^(?:java|jdk|sun|com\.sun|javax\.(?:annotation\.processing|crypto|imageio|lang\.model|management|naming|net|print|script|security|sound|sql|swing|tools|transaction\.xa|xml))(?:\.|$)/u;
17920
17920
  var JAVA_MAP_LANGUAGE = Object.freeze({
17921
- id: "javac-lombok-1.18.48-map-v7",
17921
+ id: "javac-lombok-1.18.48-map-v8",
17922
17922
  claims: (path11) => path11.endsWith(".java"),
17923
17923
  reads: (path11) => buildFile.test(path11),
17924
17924
  // A package of the Java platform, or a library named by its first two package segments.
@@ -18470,7 +18470,7 @@ var pythonConfig = /(?:^|\/)(?:pyrightconfig\.json|pyproject\.toml|setup\.cfg)$/
18470
18470
  var directoryOf2 = (path11) => path11.slice(0, path11.lastIndexOf("/") + 1);
18471
18471
  var DEFAULT_PYTHON = { major: 3, minor: 13 };
18472
18472
  var PYTHON_MAP_LANGUAGE = Object.freeze({
18473
- id: "pyright-1.1.414-map-v12",
18473
+ id: "pyright-1.1.414-map-v13",
18474
18474
  claims: (path11) => /\.pyi?$/u.test(path11),
18475
18475
  reads: (path11) => pythonConfig.test(path11),
18476
18476
  // An absolute import names the standard library or a distribution's top-level package.
@@ -18625,7 +18625,7 @@ var PythonMapAnalyzer = class {
18625
18625
 
18626
18626
  // src/project-map-language-typescript.ts
18627
18627
  var TYPESCRIPT_MAP_LANGUAGE = Object.freeze({
18628
- id: "typescript-7.0.2-map-v16",
18628
+ id: "typescript-7.0.2-map-v17",
18629
18629
  claims: (path11) => /\.[cm]?[jt]sx?$/u.test(path11),
18630
18630
  reads: (path11) => path11.endsWith(".json") || path11 === "pnpm-workspace.yaml",
18631
18631
  create: () => new TypeScriptMapAnalyzer()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "layermap",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "mcpName": "io.github.coffeecoproject/layermap",
5
5
  "description": "A layered map of a codebase for coding agents: directories, modules and call chains across TypeScript, JavaScript, Go, Python and Java.",
6
6
  "license": "Apache-2.0",