100%

graph-standup-setup-process

Goal

A new dev environment reaches a fully-populated, verified intelligence graph with ONE command that shows per-stage progress - no hand-sequenced backfills.

Trigger (recorded at insertion, 2026-07-14)

The per-facet CPG backfills (repo-wide binder densification, attribute/disposition scan) currently run as hand-invoked cpg_extractor.py --all-scopes passes with only a per-50-file progress line; standing up a fresh environment requires knowing the sequence (schema apply -> import -> backfill -> resolver -> baseline regen -> verify) by heart. User directive: make this a setup process that shows progress.

Work Items

  • One-command graph standup for a new dev environment: a setup entry point (scripts/intel-query.sh setup or intel_repo script) that sequences schema.cypher apply, code import, CPG per-facet backfill (run_all_scopes incl. the repo-wide binder + attribute facets and the .ori disposition scan), resolver one-shot, fitness baseline regeneration, and a terminal verify (graph contract + fitness) - each stage with live progress output (stage name, N/M counts, per-stage ok/failed) and a machine-readable terminal envelope
  • Resumability + idempotence: re-running the setup after an interruption skips already-fresh stages (facet stamps / fingerprints decide, never wall-clock guesses); a failed stage names itself and its retry command
  • Tests: pin the NEW setup-orchestrator surface the dossier identifies as unpinned (§3.7) - the seven stage engines already have disk test coverage (test_cpg_extraction.py, test_fitness_baseline.py, test_cpg_resolver.py, etc.) but the orchestrator itself does not. Add: a terminal-envelope schema-acceptance test (the machine-readable envelope from w-f67d4887 validates against a versioned schema, mirroring the generated-baseline.schema.json precedent per §3H SCHEMA row), a resume-skips-already-fresh-stage test (facet-stamp-driven skip per w-bb0dd11f, never wall-clock), and a failed-stage-names-itself-and-its-retry-command test. Without this item the section’s own new deliverable (the coordinator + envelope + resumability skip-decision) ships unpinned, undermining the mission’s ‘code that proves itself’ testing standard for the new surface this section introduces.
  • Docs: intel_repo/CLAUDE.md Running section documents the setup entry point as the canonical new-environment bootstrap; per-stage progress contract recorded

Fresh intel (regenerated)

This is NOT “write a shell script.” The section wants a script-driven, resumable, progress-emitting orchestrator that sequences SEVEN existing ingestion stages — schema apply -> code import -> CPG per-facet backfill -> resolver one-shot -> fitness baseline regen -> terminal verify — that TODAY live scattered across seven distinct Leiden communities with NO single coordinator. The graph confirms every stage function already exists and is individually tested; the deliverable is the missing orchestration home, not new stage logic.

Decisions this package forces before any code is written:

  1. REUSE, do not re-derive. Every stage’s engine already exists (bootstrap_repo, upsert_file_symbols, run_all_scopes, resolve_emits_indirect_batch, build_generated_baseline/write_generated_baseline, cmd_fitness). The wrapper CALLS them; re-implementing any is LEAK:algorithmic-duplication (§3H).
  2. Do NOT fold standup into run_incremental. run_incremental is the highest-churn symbol in the terrain (hotspot 29, blast-radius 28) and the parallel incremental engine. The full-standup wrapper is a SEPARATE entry; absorbing/refactoring run_incremental perturbs the hot incremental path (constrained-symbols, §9).
  3. Honor the walking-skeleton locked design (s-a61c303c): “schema.cypher is NOT auto-applied by refresh — the section applies constraints explicitly.” The setup’s stage-1 schema apply is the explicit-apply owner; it must NOT be wired into the refresh/run_incremental path (§4, §3H).
  4. Resumability = facet stamps, never wall-clock (wi-2). The SSOT is staleness.py FRESHNESS_FACETS (timestamp_property + sha_property per facet) + graph_manifest.py atomic writes. Skip-a-fresh-stage reads that substrate; re-deriving freshness is an SSOT fork (§3H) [JOIN with sibling s-031257a4].
  5. This is workflow/orchestration tooling → script-first. The setup entry point IS a script driving a multi-stage loop with progress; it belongs in a script (cmd_setup in query_graph.py following the cmd_fitness precedent, or an intel_repo orchestration module), never LLM-narrated sequencing (workflow-ownership.md §1; §3H).
["run_incremental"]

DIG DEEPER

scripts/intel-query.sh cypher "MATCH (s:Symbol {repo:'ori-platform'}) WHERE s.name IN ['run_all_scopes','bootstrap_repo','run_incremental','resolve_emits_indirect_batch','build_generated_baseline'] RETURN s.name, s.community_leiden, s.hotspot_score, s.blast_radius" --human
sed -n '1,30p' plans/intel-graph-deepening/content/graph-standup-setup-process--s-92675663.md

(full dossier: graph-standup-setup-process—s-92675663.intel.md)