Skip to content

Define semantic artifact lifecycle and persistence gates#1140

Merged
DavidBakerEffendi merged 7 commits into
masterfrom
817-engineer-compact-semantic-graph-snapshots-and-lifecycle-aware-persistence
Jul 24, 2026
Merged

Define semantic artifact lifecycle and persistence gates#1140
DavidBakerEffendi merged 7 commits into
masterfrom
817-engineer-compact-semantic-graph-snapshots-and-lifecycle-aware-persistence

Conversation

@DavidBakerEffendi

@DavidBakerEffendi DavidBakerEffendi commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Description

Closes #817.

Defines and validates Bifrost's lifecycle policy for structural facts, semantic artifacts, CFG/ICFG views, oracle projections, and solver state. The change standardizes the evidence gates required before an artifact may move from request- or generation-local ownership into persistent storage.

The measured recommendation is to keep bounded exploded data-flow state ephemeral. Future reusable procedure, taint, and protocol summaries remain owned by #823 and should begin in memory, then earn SQLite persistence only after an equivalent serialized candidate demonstrates meaningful reuse and safe invalidation.

Key Changes:

  • Add a lifecycle matrix covering artifact ownership, identity, invalidation, representation, completeness admission, observability, and current storage decision.
  • Add a typed, overflow-safe promotion evaluator and migrate the existing semantic/CFG persistence experiment to the shared six-gate policy.
  • Add a reproducible fresh-process data-flow benchmark across generated TypeScript, inline TypeScript/Java, and pinned VS Code/Spring PetClinic datasets.
  • Bind retained solver evidence to canonical typed ICFG topology rather than snapshot-local IDs or graph counts.
  • Harden benchmark provenance, interruption cleanup, locked execution, and untracked-file fingerprinting after specialist review.
  • Keep the cross-adapter reference fixture external-owner-based after the base branch standardized same-owner usage exclusion.

Measured Result:

  • 72 fresh release processes across eight datasets; 56 retained samples reproduced identical canonical topology, solver work, completeness, and checksums.
  • The largest bounded result reached 98,313 states and retained an estimated 1,179,940 shallow bytes, with 31.526 ms first-solve and 28.001 ms repeat-solve medians.
  • VS Code workspace construction had a 657.3 MiB median process peak while the finite solver result retained only 5,136 shallow bytes, showing that workspace cost is not evidence for persisting query-local state.
  • No production persistence, packed data-flow DTO, cache insertion, or durable dense FactId is introduced.

Tradeoffs and Suggested Application:

  • The shared evaluator makes promotion decisions consistent and auditable, but intentionally requires candidate-specific benchmarks rather than automatically selecting storage.
  • The benchmark and evidence documents add maintenance surface without providing a runtime speedup by themselves.
  • Keep raw worklists, truncations, witnesses, and exploded results request-local. Apply the promotion gates only to complete reusable summaries with stable identity, demonstrated cross-query reuse, and targeted invalidation.

Validation:

  • cargo test --features nlp,python — all enabled library, binary, integration, and doc-test targets passed; the library target reported 1,870 passed, zero failed, and five ignored.
  • cargo clippy --locked --all-targets --all-features -- -D warnings
  • Focused artifact-lifecycle and semantic/data-flow benchmark tests
  • cargo fmt --all -- --check
  • 72-process retained lifecycle benchmark matrix
  • Security, duplication, intent, DevOps, and architecture specialist reviews

Touch Points:

  • .agents/docs/semantic-artifact-lifecycle-matrix.md
  • .agents/docs/dataflow-lifecycle-benchmark-2026-07-24.md
  • .agents/plans/issue-817-artifact-lifecycle-foundation.md
  • src/benchmark/artifact_lifecycle.rs
  • src/benchmark/mod.rs
  • tests/measure_semantic_cfg_persistence.rs
  • tests/measure_dataflow_lifecycle.rs
  • tests/code_query_pipelines.rs
  • scripts/run-dataflow-lifecycle-benchmarks.sh

Record the current ownership, identity, invalidation, representation, and evidence boundaries before adding shared promotion tooling. Keep request-local solver state and not-yet-shaped summaries out of SQLite so later milestones begin from explicit measured decisions.
Extract the six predeclared issue 817 persistence gates into a validated benchmark API. Preserve the semantic CFG benchmark report and no-go semantics while making missing or invalid evidence unable to pass future candidates.
Add a release-mode benchmark that isolates every generated, inline, and pinned external dataset in fresh processes so timing and peak-RSS evidence remain attributable. Validate exact structured roots, stable ICFG topology, fixed-point solver work, deterministic results, and the intentionally ephemeral lifecycle classification before aggregation.

Keep incomplete external ICFG coverage visible while rejecting incomplete benchmark matrices, unstable provenance, non-fixed-point solves, and fact-domain drift. This establishes evidence for current exploded dataflow state without introducing an invalid serialized candidate ahead of reusable summaries.
Retain all 56 measured timing and RSS samples plus stable median topology, solver-work, completeness, size, and checksum identities from the eight-dataset matrix. Tie the exact clean Bifrost, VS Code, PetClinic, toolchain, and host provenance to the lifecycle decision.

Document why request-local exploded state remains persistence-ineligible and why future reusable summaries need an equivalent serialized candidate and their own promotion-gate evidence.
Bind retained solver evidence to canonical typed ICFG topology and derive promotion outcomes from their gate statuses.

Harden provenance and benchmark execution after specialist review, correct lifecycle-matrix semantics, and record the reviewed 72-process v2 result.
Record that the live acceptance criteria are satisfied and that compositional summary design and persistence remain owned by dependent issue 823.
Use distinct caller and target owners for class/object-based adapters so the cross-adapter test remains compatible with the uniform same-owner exclusion policy.
@DavidBakerEffendi
DavidBakerEffendi force-pushed the 817-engineer-compact-semantic-graph-snapshots-and-lifecycle-aware-persistence branch from 7a910d7 to 8c0a992 Compare July 24, 2026 12:22
@DavidBakerEffendi
DavidBakerEffendi merged commit 257c132 into master Jul 24, 2026
20 checks passed
@DavidBakerEffendi
DavidBakerEffendi deleted the 817-engineer-compact-semantic-graph-snapshots-and-lifecycle-aware-persistence branch July 24, 2026 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Engineer compact semantic graph snapshots and lifecycle-aware persistence

1 participant