scopecairn 0.14.0 → 0.15.0

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.
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  isProtected
4
- } from "./chunk-4VHUOZ7J.js";
4
+ } from "./chunk-JQBYQ4EF.js";
5
5
 
6
6
  // src/retrieval/classify.ts
7
7
  var FANIN_THRESHOLD = 5;
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  isProtected,
7
7
  loadProtectedPatterns
8
- } from "./chunk-4VHUOZ7J.js";
8
+ } from "./chunk-JQBYQ4EF.js";
9
9
  import {
10
10
  coChangeSet,
11
11
  groupHistoryFiles
@@ -30,6 +30,9 @@ function openDb(repoRoot) {
30
30
  const db = new DatabaseSync(dbPath(repoRoot));
31
31
  db.exec(`
32
32
  PRAGMA journal_mode = WAL;
33
+ PRAGMA synchronous = NORMAL;
34
+ PRAGMA temp_store = MEMORY;
35
+ PRAGMA cache_size = -64000;
33
36
  PRAGMA foreign_keys = ON;
34
37
  CREATE TABLE IF NOT EXISTS files (
35
38
  id INTEGER PRIMARY KEY AUTOINCREMENT,
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  dataDir,
4
4
  ensureProtectedFile
5
- } from "./chunk-4VHUOZ7J.js";
5
+ } from "./chunk-JQBYQ4EF.js";
6
6
  import {
7
7
  tokenizeIdentifier,
8
8
  tokenizeTask
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  classify
4
- } from "./chunk-UUPA64KG.js";
5
- import "./chunk-4VHUOZ7J.js";
4
+ } from "./chunk-2MIHTOLI.js";
5
+ import "./chunk-JQBYQ4EF.js";
6
6
  export {
7
7
  classify
8
8
  };
package/dist/cli.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  buildContext,
5
5
  buildContextPayload,
6
6
  resolveEffectiveMode
7
- } from "./chunk-HTJIVHYW.js";
7
+ } from "./chunk-IRYNTYZD.js";
8
8
  import "./chunk-ZV4BSIQM.js";
9
9
  import {
10
10
  ensureHistoryIndex
@@ -25,10 +25,10 @@ import {
25
25
  gitSignalsFor,
26
26
  retrieve,
27
27
  syncFileIndex
28
- } from "./chunk-K7D5EIMF.js";
28
+ } from "./chunk-NAQXQTMH.js";
29
29
  import {
30
30
  classify
31
- } from "./chunk-UUPA64KG.js";
31
+ } from "./chunk-2MIHTOLI.js";
32
32
  import {
33
33
  dataDir,
34
34
  dbPath,
@@ -38,7 +38,7 @@ import {
38
38
  loadProtectedPatterns,
39
39
  matchPattern,
40
40
  openDb
41
- } from "./chunk-4VHUOZ7J.js";
41
+ } from "./chunk-JQBYQ4EF.js";
42
42
  import {
43
43
  coChangeSet,
44
44
  groupHistoryFiles,
@@ -5913,15 +5913,24 @@ function writeArchaeologyIfAbsent(repoRoot2) {
5913
5913
  function toPosixRel(repoRoot2, abs) {
5914
5914
  return path14.relative(repoRoot2, abs).split(path14.sep).join("/");
5915
5915
  }
5916
- function walk(absDir, out) {
5917
- const entries = fs13.readdirSync(absDir, { withFileTypes: true });
5916
+ function walk(repoRoot2, absDir, rules, out) {
5917
+ let entries;
5918
+ try {
5919
+ entries = fs13.readdirSync(absDir, { withFileTypes: true });
5920
+ } catch {
5921
+ return;
5922
+ }
5918
5923
  for (const e of entries) {
5919
5924
  const abs = path14.join(absDir, e.name);
5925
+ const rel = toPosixRel(repoRoot2, abs);
5920
5926
  if (e.isDirectory()) {
5921
5927
  if (e.isSymbolicLink()) continue;
5922
- walk(abs, out);
5928
+ if (isIgnored(rel + "/", rules) || isIgnored(rel, rules)) continue;
5929
+ walk(repoRoot2, abs, rules, out);
5923
5930
  } else if (e.isFile()) {
5924
- out.push(abs);
5931
+ if (!isIgnored(rel, rules)) {
5932
+ out.push(abs);
5933
+ }
5925
5934
  }
5926
5935
  }
5927
5936
  }
@@ -5933,8 +5942,8 @@ async function scanRepository(repoRoot2) {
5933
5942
  try {
5934
5943
  ensureDefaultFiles(repoRoot2);
5935
5944
  const allAbs = [];
5936
- walk(repoRoot2, allAbs);
5937
- await prepareTreeSitter(allAbs.filter((abs) => isSourceFile(abs) && !isIgnored(toPosixRel(repoRoot2, abs), rules)).map((abs) => grammarForPath(abs)).filter((name) => name !== null));
5945
+ walk(repoRoot2, repoRoot2, rules, allAbs);
5946
+ await prepareTreeSitter(allAbs.filter((abs) => isSourceFile(abs)).map((abs) => grammarForPath(abs)).filter((name) => name !== null));
5938
5947
  let totalFilesSeen = 0;
5939
5948
  let inserted = 0;
5940
5949
  let updated = 0;
@@ -6381,6 +6390,11 @@ Patuhi prinsip ini di setiap baris kode secara otomatis tanpa perlu diminta user
6381
6390
  2. Pertanyaan berupa diskusi konseptual, code review, arsitektur, atau sekadar tanya jawab.
6382
6391
  3. Melanjutkan percakapan dalam sesi yang sama di mana scope file sudah diketahui.
6383
6392
  - **Ekstraksi Query**: Jika prompt user panjang atau berupa spesifikasi kompleks, jangan masukkan seluruh paragraf ke terminal. Ambil 2\u20134 kata kunci teknis utama (nama modul, entitas, aksi) sebagai argumen context untuk mencari file jangkar (anchor), sementara detail spesifikasi lengkap tetap diikuti langsung dari prompt user.
6393
+ - **Transparansi Status (Status Cue 1-Baris)**: Awali baris pertama setiap respon task coding dengan penanda ringkas status ScopeCairn agar user mengetahui status scope secara transparan:
6394
+ - Jika context dipanggil: \`> \u{1F9ED} [ScopeCairn: context "<query>" \u2192 N files in scope]\`
6395
+ - Jika context dilewati: \`> \u{1F9ED} [ScopeCairn: scope known (<alasan singkat, misal: target file sudah spesifik>), context skipped]\`
6396
+ - Jika impact dijalankan: \`> \u{1F9ED} [ScopeCairn: impact <path> checked]\`
6397
+ - Jika verify dijalankan: \`> \u{1F9ED} [ScopeCairn: verify passed within scope]\`
6384
6398
 
6385
6399
  Gunakan hasilnya sebagai titik awal. Jangan menjelajah repository dari nol.
6386
6400
 
@@ -6455,6 +6469,7 @@ Prinsip Otomatis:
6455
6469
  - Blast Radius: Simbol bersama wajib impact + safety fact + buktikan dengan tes.
6456
6470
  - Anti-Looping: 2x gagal perbaiki bug pada tes yang sama \u2192 dilarang coba cara ke-3 dengan asumsi serupa; serang premis dasar secara independen.
6457
6471
  - Prove It Works: Selalu buktikan perbaikan/fitur dengan tes nyata sebelum menyatakan selesai.
6472
+ - Transparansi Status: Awali respon dengan 1 baris penanda scope, misal: \`> \u{1F9ED} [ScopeCairn: ...]\`.
6458
6473
 
6459
6474
  Langkah Alur Kerja:
6460
6475
  1. Jika prompt user panjang/kompleks, ambil 2\u20134 kata kunci teknis utama sebagai argumen context.
@@ -6477,13 +6492,14 @@ description: ScopeCairn codebase context + scope + engineering rigor for a task
6477
6492
 
6478
6493
  Run \`${prefix} context "$ARGUMENTS"\` with the bash tool (extract 2-4 technical keywords if query is complex), then:
6479
6494
 
6480
- 1. Use Relevant Files as the starting point \u2014 do not explore from zero.
6481
- 2. Change only Required and Optional files; Protected needs user approval.
6482
- 3. If shared symbols change, run \`${prefix} impact <path>\`, formulate one safety fact, and verify with tests.
6483
- 4. If bug fix fails 2x on the same test, stop and attack the premise independently before attempting a 3rd time.
6484
- 5. Need a function body? Use \`${prefix} read symbol <nama>\`, not full reads.
6485
- 6. Before finishing: perform adversarial self-review, ensure real tests pass, run \`${prefix} scan\`, then run \`${prefix} verify --task "$ARGUMENTS" --strict\` to catch out-of-scope files.
6486
- 7. Settled an architectural decision? Record it once: \`${prefix} decide "<choice> because <why>"\`.
6495
+ 1. Always show a 1-line status cue at the start of your response, e.g. \`> \u{1F9ED} [ScopeCairn: context "$ARGUMENTS" \u2192 N files]\` (or explain if skipped).
6496
+ 2. Use Relevant Files as the starting point \u2014 do not explore from zero.
6497
+ 3. Change only Required and Optional files; Protected needs user approval.
6498
+ 4. If shared symbols change, run \`${prefix} impact <path>\`, formulate one safety fact, and verify with tests.
6499
+ 5. If bug fix fails 2x on the same test, stop and attack the premise independently before attempting a 3rd time.
6500
+ 6. Need a function body? Use \`${prefix} read symbol <nama>\`, not full reads.
6501
+ 7. Before finishing: perform adversarial self-review, ensure real tests pass, run \`${prefix} scan\`, then run \`${prefix} verify --task "$ARGUMENTS" --strict\` to catch out-of-scope files.
6502
+ 8. Settled an architectural decision? Record it once: \`${prefix} decide "<choice> because <why>"\`.
6487
6503
  <!-- scopecairn:managed -->
6488
6504
  `;
6489
6505
  }
@@ -7811,10 +7827,10 @@ function loadPersistedScope(db, task) {
7811
7827
  return { scope, taskId: row.id };
7812
7828
  }
7813
7829
  async function computeTaskScope(db, repoRoot2, task, opts) {
7814
- const { retrieve: retrieve2 } = await import("./retrieve-TDD2N24I.js");
7815
- const { classify: classify2 } = await import("./classify-HAX4TC7I.js");
7816
- const { buildContext: buildContext2 } = await import("./contextBuilder-HVF5CRXG.js");
7817
- const { loadProtectedPatterns: loadProtectedPatterns2 } = await import("./protected-MW57HNV6.js");
7830
+ const { retrieve: retrieve2 } = await import("./retrieve-GW6YA7BQ.js");
7831
+ const { classify: classify2 } = await import("./classify-V7GTELLP.js");
7832
+ const { buildContext: buildContext2 } = await import("./contextBuilder-A5NX7EQO.js");
7833
+ const { loadProtectedPatterns: loadProtectedPatterns2 } = await import("./protected-37GK4NAJ.js");
7818
7834
  const { historySearch: historySearch2 } = await import("./search-RFQREAFV.js");
7819
7835
  const result = retrieve2(db, repoRoot2, task);
7820
7836
  if (result.ranked.length === 0) {
@@ -9867,7 +9883,7 @@ import { execFileSync as execFileSync6, execSync } from "child_process";
9867
9883
  // package.json
9868
9884
  var package_default = {
9869
9885
  name: "scopecairn",
9870
- version: "0.14.0",
9886
+ version: "0.15.0",
9871
9887
  description: "ScopeCairn \u2014 Codebase Intelligence & Agent Optimization Layer (local-first)",
9872
9888
  license: "MIT",
9873
9889
  type: "module",
@@ -3,9 +3,9 @@ import {
3
3
  buildContext,
4
4
  buildContextPayload,
5
5
  resolveEffectiveMode
6
- } from "./chunk-HTJIVHYW.js";
6
+ } from "./chunk-IRYNTYZD.js";
7
7
  import "./chunk-ZV4BSIQM.js";
8
- import "./chunk-4VHUOZ7J.js";
8
+ import "./chunk-JQBYQ4EF.js";
9
9
  import "./chunk-GQFBQRDD.js";
10
10
  import "./chunk-OPA4TMAT.js";
11
11
  import "./chunk-UVKHDHBU.js";
@@ -8,7 +8,7 @@ import {
8
8
  isSecretFile,
9
9
  loadProtectedPatterns,
10
10
  matchPattern
11
- } from "./chunk-4VHUOZ7J.js";
11
+ } from "./chunk-JQBYQ4EF.js";
12
12
  export {
13
13
  DEFAULT_PROTECTED_PATTERNS,
14
14
  SECRET_PATTERNS,
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  retrieve
4
- } from "./chunk-K7D5EIMF.js";
5
- import "./chunk-4VHUOZ7J.js";
4
+ } from "./chunk-NAQXQTMH.js";
5
+ import "./chunk-JQBYQ4EF.js";
6
6
  import "./chunk-UVKHDHBU.js";
7
7
  export {
8
8
  retrieve
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scopecairn",
3
- "version": "0.14.0",
3
+ "version": "0.15.0",
4
4
  "description": "ScopeCairn — Codebase Intelligence & Agent Optimization Layer (local-first)",
5
5
  "license": "MIT",
6
6
  "type": "module",