@guanlin4924/devflow-pi 0.1.79 → 0.1.81

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.
@@ -4,6 +4,7 @@ from pathlib import Path
4
4
 
5
5
  from adapters.capabilities import confidence_for_parser
6
6
  from core.schema import json_dumps
7
+ from source_content import build_content
7
8
 
8
9
 
9
10
  SCHEMA = """
@@ -195,7 +196,7 @@ CREATE INDEX IF NOT EXISTS idx_relations_external ON relations(to_external);
195
196
 
196
197
 
197
198
  def write_sqlite(path: Path, files, symbols, relations, diagnostics, snapshot_id="pending",
198
- workspace_state=None, semantic_entities=None, semantic_flows=None, feature_bindings=None) -> None:
199
+ workspace_state=None, semantic_entities=None, semantic_flows=None, feature_bindings=None, source_root=None) -> None:
199
200
  path.parent.mkdir(parents=True, exist_ok=True)
200
201
  if path.exists():
201
202
  path.unlink()
@@ -210,7 +211,7 @@ def write_sqlite(path: Path, files, symbols, relations, diagnostics, snapshot_id
210
211
  parsed_count = sum(1 for item in files if item.get("path") not in parse_failed_paths)
211
212
  conn.execute(
212
213
  "INSERT INTO analysis_snapshots(snapshot_id, schema_version, source_revision, content_manifest_hash, extractor_set_hash, created_at, status) VALUES(?,?,?,?,?,?,?)",
213
- (snapshot_id, 3, workspace_state.get("repositoryRevision", ""), workspace_state.get("contentManifestHash", ""),
214
+ (snapshot_id, 4 if source_root is not None else 3, workspace_state.get("repositoryRevision", ""), workspace_state.get("contentManifestHash", ""),
214
215
  workspace_state.get("extractorSetHash", ""), workspace_state.get("generatedAt", ""), "current"),
215
216
  )
216
217
  # Structural symbols and files are first-class graph nodes as well.
@@ -304,6 +305,8 @@ def write_sqlite(path: Path, files, symbols, relations, diagnostics, snapshot_id
304
305
  """,
305
306
  [_symbol_row(record) for record in symbols],
306
307
  )
308
+ if source_root is not None:
309
+ workspace_state["contentSearch"] = build_content(conn, source_root, files, snapshot_id, workspace_state.get("scanScope", {}))
307
310
  conn.commit()
308
311
  finally:
309
312
  conn.close()
package/src/constants.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export const PRODUCT_NAME = "Devflow Pi";
2
- export const PRODUCT_VERSION = "0.1.79";
2
+ export const PRODUCT_VERSION = "0.1.81";
3
3
  export const PROJECT_SCHEMA_VERSION = 1;
4
4
  export const OMP_RUNTIME_VERSION = "17.2.7";
5
5
 
@@ -32,6 +32,7 @@ export interface ScanConfigInput {
32
32
  repositories: ScanRepository[];
33
33
  includes?: string[];
34
34
  excludes?: string[];
35
+ maxFileSize?: number;
35
36
  requiredKinds?: FactKind[];
36
37
  adapterVersions?: Record<string, string>;
37
38
  }
@@ -219,9 +219,14 @@ async function buildCodeIndex(context: ProjectContext, config: ScanConfigInput):
219
219
  const script = path.resolve(import.meta.dir, "../plugins/devflow-intel/skills/workflow-code-index/scripts/code_index.py");
220
220
  const output = `.planning/.code-index-pending-${randomUUID()}`;
221
221
  const codebases = config.repositories.flatMap(repository => ["--codebase", `${repository.name}:${path.resolve(context.root, repository.relativePath)}:${repository.role}`]);
222
- await runProcess(["python3", script, "scan", "--root", context.root, "--output", output, ...codebases], context.root, "code-index scan");
223
- await runProcess(["python3", script, "validate", "--index", output], context.root, "code-index validate");
224
- await runProcess(["python3", script, "audit", "--root", context.root, "--index", output, "--skill-root", path.resolve(import.meta.dir, "../plugins/devflow-intel/skills")], context.root, "code-index audit");
222
+ const scopeArgs = [
223
+ ...(config.includes ?? ["**/*"]).flatMap(pattern => ["--include", pattern]),
224
+ ...(config.excludes ?? [".git/**", ".planning/**", ".devflow/**"]).flatMap(pattern => ["--exclude", pattern]),
225
+ "--max-file-size", String(config.maxFileSize ?? 2 * 1024 * 1024),
226
+ ];
227
+ await runProcess(["python3", script, "scan", "--root", context.root, "--output", output, ...scopeArgs, ...codebases], context.root, "code-index scan");
228
+ await runProcess(["python3", script, "validate", "--index", output, "--level", "publish"], context.root, "code-index validate");
229
+ await runProcess(["python3", script, "audit", "--root", context.root, "--index", output, "--skill-root", path.resolve(import.meta.dir, "../plugins/devflow-intel/skills"), "--level", "publish"], context.root, "code-index audit");
225
230
  const snapshotPath = path.join(context.root, output, "SNAPSHOT.json");
226
231
  const bytes = await readFile(snapshotPath); const snapshot = JSON.parse(bytes.toString("utf8")) as Record<string, unknown>;
227
232
  if (!snapshot.generation || !snapshot.immutablePath) throw new Error("Code index did not publish an immutable generation");