From fb81f1e87fdcf5c576235935b50526ca01e9a47d Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 28 Aug 2026 21:02:06 +0000 Subject: [PATCH 1/2] Generated artifacts converge with their authority: the reorg moved two of them and the registry still named the old directory #9637 moved stage0_crate_layout_generated.dag and stage0_crate_partition_generated.dag into dag/gunbc/stage0/ and did not update their ArtifactLocation rows, which still declared directory: "dag/gunbc". MEASURED, NOT INFERRED. Running the recipe the generated-artifact merge driver itself prints (generated_artifact_gate main_wet) on current main WRITES A FLAT DUPLICATE beside each real file, because the generator writes where the registry says. With the two rows corrected, the same command writes to dag/gunbc/stage0/ and produces no duplicate - verified by execution on a clean main worktree, both arms. WHY THIS IS NOT COSMETIC. Following the printed recipe on current main also rewrites .gitattributes down to the stale roster, deleting 43 rows including live merge=generated-artifact registrations. Anyone resolving a generated-artifact conflict right now silently drops that config. Three PRs are blocked behind exactly this. THREE PRE-EXISTING DRIFTS CONVERGE IN THE SAME COMMIT, because the generated-artifact phase adjudicates every rostered member and leaving any drifted keeps the lane red: - .gitattributes -41 rows. Every removed row names a file that DOES NOT EXIST, checked one by one: zero of 41 present. They are stale rows for authority-only plans whose markdown was deliberately deleted. - .gitignore +41 rows, the same 41 plans, ignored rather than expected on disk. - .githooks/pre-commit and .githooks/pre-push: the "GENERATED by" header now cites the post-reorg authority path. No hand-edited generated bytes: every artifact here is the generator's own output. Co-Authored-By: Claude Opus 5 (1M context) ALSO: rustfmt drift on main, confirmed PRE-EXISTING and not caused by this change (this PR touches no .rs semantically). `cargo fmt --all --check` on a clean origin/main worktree fails at cli_run.rs:818 and :828 - two line-length reflows caused by #9637 lengthening the roadmap authority path strings. It is fixed here because the generated pre-push hook runs the fmt check and refuses, so this blocks EVERY push from a hooks-configured clone, not just this one. --- .gitattributes | 41 -------------------------------- .githooks/pre-commit | 2 +- .githooks/pre-push | 2 +- .gitignore | 41 ++++++++++++++++++++++++++++++++ dag/gunbc/generated_artifact.dag | 4 ++-- src/v1/stage0/src/cli_run.rs | 8 +++++-- 6 files changed, 51 insertions(+), 47 deletions(-) diff --git a/.gitattributes b/.gitattributes index 091465160e2..dd0629ddc1d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -22,62 +22,21 @@ DESIGN.md merge=generated-artifact ROADMAP.md merge=generated-artifact dag/gunbc/stage0/stage0_crate_layout_generated.dag merge=generated-artifact dag/gunbc/stage0/stage0_crate_partition_generated.dag merge=generated-artifact -docs/plans/algebraic-rewrite-optimization.md merge=generated-artifact -docs/plans/axiom-syllogism-lens.md merge=generated-artifact -docs/plans/bounded-input-cost-envelope-scheduling.md merge=generated-artifact docs/plans/budget-tree.md merge=generated-artifact -docs/plans/cardinality-refinement.md merge=generated-artifact -docs/plans/ci-floor-fractal-gantt.md merge=generated-artifact docs/plans/ci-humming.md merge=generated-artifact -docs/plans/ci-merge-freshness.md merge=generated-artifact -docs/plans/ci-oom-reclassification.md merge=generated-artifact -docs/plans/ci-performance-tanking-evidence.md merge=generated-artifact -docs/plans/ci-process-end-to-end.md merge=generated-artifact docs/plans/cli-run-hollowing-plan.md merge=generated-artifact docs/plans/compile-clean-forcecheck.md merge=generated-artifact docs/plans/compute-envelope-model.md merge=generated-artifact -docs/plans/construction-justification-rule.md merge=generated-artifact docs/plans/dag-v2-defork-audit.md merge=generated-artifact docs/plans/deploy-convergence-observed-side.md merge=generated-artifact docs/plans/discrete-cost-derivation.md merge=generated-artifact -docs/plans/disposition-carrier.md merge=generated-artifact -docs/plans/edge-b-rust-dag-provenance-brief.md merge=generated-artifact -docs/plans/emission-ingestion-inverse.md merge=generated-artifact -docs/plans/expressibility-frontier.md merge=generated-artifact -docs/plans/extdeps-modeling-preflight.md merge=generated-artifact -docs/plans/fail-closed-lockdown.md merge=generated-artifact -docs/plans/fleet-acceptance-criteria.md merge=generated-artifact -docs/plans/fold-ergonomics.md merge=generated-artifact -docs/plans/format-model-reconciliation.md merge=generated-artifact docs/plans/host-effect-orchestration.md merge=generated-artifact -docs/plans/idea-machine.md merge=generated-artifact docs/plans/inert-layer-lens.md merge=generated-artifact docs/plans/input-envelope-roadmap.md merge=generated-artifact -docs/plans/intent-linearity-design-draft.md merge=generated-artifact -docs/plans/interpreter-kernel-d.md merge=generated-artifact -docs/plans/invert-hand-maintained.md merge=generated-artifact -docs/plans/language-target-self-host-frontier.md merge=generated-artifact -docs/plans/m4-universal-hermetic-corpus.md merge=generated-artifact -docs/plans/m5-fixture-store-consolidation.md merge=generated-artifact docs/plans/model-realization-fork.md merge=generated-artifact -docs/plans/p1-where-clause-lowering.md merge=generated-artifact docs/plans/realization-measurement-loop.md merge=generated-artifact -docs/plans/reference-grounding-migration.md merge=generated-artifact -docs/plans/regime2-shared-emission-fold.md merge=generated-artifact docs/plans/representation-minimization.md merge=generated-artifact -docs/plans/resolver-pathology-profile-receipt.md merge=generated-artifact -docs/plans/resolver-type-name-collision-wall.md merge=generated-artifact -docs/plans/seed-debt-bundle-item-2.md merge=generated-artifact -docs/plans/self-applying-lenses.md merge=generated-artifact -docs/plans/shell-emission-model.md merge=generated-artifact -docs/plans/solve-higher-order-design.md merge=generated-artifact -docs/plans/structural-quadratic-wall-coverage-audit.md merge=generated-artifact -docs/plans/testgen-oracle.md merge=generated-artifact -docs/plans/typescript-gap-census.md merge=generated-artifact -docs/plans/v2-complexity-capability-parity.md merge=generated-artifact docs/plans/v2-self-hosting.md merge=generated-artifact -docs/plans/value-null-split.md merge=generated-artifact -docs/plans/wiring-liveness-preflight.md merge=generated-artifact src/v1/stage0/src/bootstrap_stage0_crate_layout_generated.rs merge=generated-artifact src/v1/stage0/src/v1_interpreter_dispatch_generated.rs merge=generated-artifact src/v1/stage0/src/*.rs merge=generated-artifact diff --git a/.githooks/pre-commit b/.githooks/pre-commit index a03f7de782c..cec0c4b855e 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# GENERATED by dag/gunbc/githooks_pre_commit_emit.dag — DO NOT HAND-EDIT. +# GENERATED by dag/gunbc/githooks/githooks_pre_commit_emit.dag — DO NOT HAND-EDIT. set -euo pipefail ROOT="$(git rev-parse --show-toplevel)" cd "$ROOT" diff --git a/.githooks/pre-push b/.githooks/pre-push index 4d204e5228c..f5dd28593d0 100755 --- a/.githooks/pre-push +++ b/.githooks/pre-push @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# GENERATED by dag/gunbc/githooks_pre_push_emit.dag — DO NOT HAND-EDIT. +# GENERATED by dag/gunbc/githooks/githooks_pre_push_emit.dag — DO NOT HAND-EDIT. set -euo pipefail ROOT="$(git rev-parse --show-toplevel)" cd "$ROOT" diff --git a/.gitignore b/.gitignore index 9412c670034..c582c2fa7af 100644 --- a/.gitignore +++ b/.gitignore @@ -136,5 +136,46 @@ src/v2/test/claim/manual/sg2_scratch_probe.dag # Regenerable; not committed. Whitelist: ci.yml, .gitignore, .md docs (ROADMAP.md, DESIGN.md, docs/plans/). /.github/fleet-runner-deploy.manifest /provisioning/srv3/user-data +/docs/plans/idea-machine.md +/docs/plans/algebraic-rewrite-optimization.md +/docs/plans/m5-fixture-store-consolidation.md +/docs/plans/value-null-split.md +/docs/plans/ci-merge-freshness.md +/docs/plans/seed-debt-bundle-item-2.md +/docs/plans/axiom-syllogism-lens.md +/docs/plans/invert-hand-maintained.md +/docs/plans/fail-closed-lockdown.md +/docs/plans/format-model-reconciliation.md +/docs/plans/regime2-shared-emission-fold.md +/docs/plans/shell-emission-model.md +/docs/plans/construction-justification-rule.md +/docs/plans/emission-ingestion-inverse.md +/docs/plans/testgen-oracle.md +/docs/plans/disposition-carrier.md +/docs/plans/fold-ergonomics.md +/docs/plans/m4-universal-hermetic-corpus.md +/docs/plans/wiring-liveness-preflight.md +/docs/plans/interpreter-kernel-d.md +/docs/plans/expressibility-frontier.md +/docs/plans/p1-where-clause-lowering.md +/docs/plans/intent-linearity-design-draft.md +/docs/plans/solve-higher-order-design.md +/docs/plans/language-target-self-host-frontier.md +/docs/plans/self-applying-lenses.md +/docs/plans/cardinality-refinement.md +/docs/plans/ci-process-end-to-end.md +/docs/plans/ci-oom-reclassification.md +/docs/plans/bounded-input-cost-envelope-scheduling.md +/docs/plans/edge-b-rust-dag-provenance-brief.md +/docs/plans/resolver-type-name-collision-wall.md +/docs/plans/ci-floor-fractal-gantt.md +/docs/plans/resolver-pathology-profile-receipt.md +/docs/plans/reference-grounding-migration.md +/docs/plans/typescript-gap-census.md +/docs/plans/fleet-acceptance-criteria.md +/docs/plans/structural-quadratic-wall-coverage-audit.md +/docs/plans/ci-performance-tanking-evidence.md +/docs/plans/extdeps-modeling-preflight.md +/docs/plans/v2-complexity-capability-parity.md /docs/plans/v2-corpus-self-host.md /docs/plans/import-namespace-program.md diff --git a/dag/gunbc/generated_artifact.dag b/dag/gunbc/generated_artifact.dag index afd15b607ff..561eee281d7 100644 --- a/dag/gunbc/generated_artifact.dag +++ b/dag/gunbc/generated_artifact.dag @@ -71,9 +71,9 @@ fn artifact_location(a: GeneratedArtifact) -> ArtifactLocation { name: generated_artifact_merge_driver_script_name } RunnerDeployArtifact => ArtifactLocation { directory: ".github", name: "fleet-runner-deploy.manifest" } - Stage0CrateLayoutGeneratedDagArtifact => ArtifactLocation { directory: "dag/gunbc", name: "stage0_crate_layout_generated.dag" } + Stage0CrateLayoutGeneratedDagArtifact => ArtifactLocation { directory: "dag/gunbc/stage0", name: "stage0_crate_layout_generated.dag" } Stage0CrateLayoutGeneratedRsArtifact => ArtifactLocation { directory: "src/v1/stage0/src", name: "bootstrap_stage0_crate_layout_generated.rs" } - Stage0CratePartitionGeneratedDagArtifact => ArtifactLocation { directory: "dag/gunbc", name: "stage0_crate_partition_generated.dag" } + Stage0CratePartitionGeneratedDagArtifact => ArtifactLocation { directory: "dag/gunbc/stage0", name: "stage0_crate_partition_generated.dag" } V1InterpreterDispatchGeneratedRsArtifact => ArtifactLocation { directory: "src/v1/stage0/src", name: "v1_interpreter_dispatch_generated.rs" } AutoinstallUserDataArtifact { spec } => ArtifactLocation { directory: concat("provisioning/", spec.host), name: "user-data" } diff --git a/src/v1/stage0/src/cli_run.rs b/src/v1/stage0/src/cli_run.rs index 70170a27e36..a7e1307b9ef 100644 --- a/src/v1/stage0/src/cli_run.rs +++ b/src/v1/stage0/src/cli_run.rs @@ -818,7 +818,10 @@ mod roadmap_acceptance_history_projection_tests { #[test] fn merge_base_authority_projection_matches_jsonl_carrier() { let authority = std::process::Command::new("git") - .args(["show", "9ce6526c528:dag/gunbc/roadmap/roadmap_authority.dag"]) + .args([ + "show", + "9ce6526c528:dag/gunbc/roadmap/roadmap_authority.dag", + ]) .output() .expect("git show merge-base authority"); assert!( @@ -828,7 +831,8 @@ mod roadmap_acceptance_history_projection_tests { ); let authority = String::from_utf8(authority.stdout).expect("utf8 authority"); let jsonl = std::fs::read_to_string( - super::workspace_root().join("dag/gunbc/roadmap/roadmap_acceptance_event_history.jsonl"), + super::workspace_root() + .join("dag/gunbc/roadmap/roadmap_acceptance_event_history.jsonl"), ) .expect("jsonl carrier"); let projected = project_roadmap_acceptance_event_history_from_authority_text(&authority); From dce0174599a4c9d295ac85b8e8ee69a0d3d4a9ec Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 28 Aug 2026 23:21:14 +0000 Subject: [PATCH 2/2] Close the regen phase too: the authority cited a deleted plan doc while its mirror had been hand-edited main's build lane had TWO failing phases. The first commit closed generated-artifact (rostered=29 matches=29 drifted=0 absent=0, confirmed by CI on this PR). This closes the other: `regen FAIL generated surface drift: v1_rt.rs`. THE DRIFT WAS ONE DOC-COMMENT LINE, AND THE MECHANICAL FIX WOULD HAVE BEEN WRONG. committed mirror: per `ci-floor-fractal-gantt (plan doc deleted 2026-08-28)` authority emits: per `docs/plans/ci-floor-fractal-gantt.md` docs/plans/ci-floor-fractal-gantt.md does NOT exist on main. So a generated mirror had been hand-edited to record the deletion while src/v1/runtime_rust.dag kept emitting a citation to the deleted file. Installing the regen candidate - the obvious move, and what the merge driver's recipe leads you to - would have REVERTED that note and restored a citation to a file that is not there. The drift was the symptom; the hand-edit was the defect. So the repair is at the authority, and v1_rt.rs is NOT touched by this commit: once runtime_rust.dag emits the committed text, the mirror is already correct. TWO GENERATIONS, because runtime_rust.dag is itself mirrored: editing it drifts v1_compiler_runtime_rust.rs (1 line), and v1_rt.rs is emitted BY that mirror once compiled. So the first rebuild still emitted the old string. Installing the emitter mirror and re-running converges: first_generation_equal=true, no drift. VERIFIED: regen over the fixed tree reports first_generation_equal=true with no drift line, and the only paths changed are the authority and its own mirror. NOT DONE HERE, deliberately: DESIGN 3 would prefer citing the surviving plan carrier (gunbc.plans.ci_floor_fractal_gantt) over embedding a date in source. That is the better citation and it changes mirror bytes, so it is a separate judgment rather than part of a repair. Co-Authored-By: Claude Opus 5 (1M context) --- src/v1/runtime_rust.dag | 2 +- src/v1/stage0/src/v1_compiler_runtime_rust.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/v1/runtime_rust.dag b/src/v1/runtime_rust.dag index 053b18aa797..db4279d885b 100644 --- a/src/v1/runtime_rust.dag +++ b/src/v1/runtime_rust.dag @@ -669,7 +669,7 @@ fn rt_hash_ops() -> String { "/// the interpreter arm in `v1_interpreter.rs` when realization_measurement_loop **Phase 0**\n", "/// (`docs/plans/realization-measurement-loop.md`) lands a `.dag` `PerformanceReceipt`\n", "/// per-stage carrier that a floor witness consumes by execution (the same retirement event\n", - "/// as `phase_profile.rs` / `GUNBC_FLOOR_GANTT`, per `docs/plans/ci-floor-fractal-gantt.md`\n", + "/// as `phase_profile.rs` / `GUNBC_FLOOR_GANTT`, per `ci-floor-fractal-gantt (plan doc deleted 2026-08-28)`\n", "/// § dissolution). Receipt = that witness green with these marks deleted and stage walls\n", "/// still attributable from the model path.\n", "pub fn trace_mark(label: String) \{\n", diff --git a/src/v1/stage0/src/v1_compiler_runtime_rust.rs b/src/v1/stage0/src/v1_compiler_runtime_rust.rs index 341171beb24..7711aa64f38 100644 --- a/src/v1/stage0/src/v1_compiler_runtime_rust.rs +++ b/src/v1/stage0/src/v1_compiler_runtime_rust.rs @@ -94,7 +94,7 @@ pub fn rt_filesystem() -> String { } pub fn rt_hash_ops() -> String { - v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat("const FNV1A64_OFFSET: u64 = 0xcbf29ce484222325;\n".to_string(), "const FNV1A64_PRIME: u64 = 0x100000001b3;\n".to_string()), "\n".to_string()), "fn fnv1a64(bytes: &[u8]) -> u64 {\n".to_string()), " let mut hash = FNV1A64_OFFSET;\n".to_string()), " for b in bytes {\n".to_string()), " hash ^= *b as u64;\n".to_string()), " hash = hash.wrapping_mul(FNV1A64_PRIME);\n".to_string()), " }\n".to_string()), " hash\n".to_string()), "}\n".to_string()), "\n".to_string()), "pub type Hash = String;\n".to_string()), "\n".to_string()), "const HASH_DIGEST_LEN: usize = 16;\n".to_string()), "\n".to_string()), "pub fn is_hash_digest(s: &str) -> bool {\n".to_string()), " s.len() == HASH_DIGEST_LEN && s.bytes().all(|b| b.is_ascii_hexdigit())\n".to_string()), "}\n".to_string()), "\n".to_string()), "fn expect_hash_digest(s: &str, arg: &str) {\n".to_string()), " if !is_hash_digest(s) {\n".to_string()), " panic!(\"{} must be a 16-char hex Hash digest\", arg);\n".to_string()), " }\n".to_string()), "}\n".to_string()), "\n".to_string()), "/// Kept so `gunbc.observation_emit_census` roster hygiene cannot go stale after the\n".to_string()), "/// raw gantt key=value shape (process-absolute millis and rss-mib fields) dissolves into the observation projection.\n".to_string()), "#[allow(dead_code)]\n".to_string()), "pub const GANTT_CENSUS_MARKER: &str = \"[gantt]\";\n".to_string()), "\n".to_string()), "/// Mirror of `gunbc.observation_ci_render.ci_minute_switch_seconds`.\n".to_string()), "const OBS_MINUTE_SWITCH_SECONDS: u64 = 90;\n".to_string()), "\n".to_string()), "pub fn obs_human_duration(ms: u64) -> String {\n".to_string()), " if ms < 1_000 {\n".to_string()), " format!(\"{ms}ms\")\n".to_string()), " } else if ms < OBS_MINUTE_SWITCH_SECONDS * 1_000 {\n".to_string()), " format!(\"{} seconds\", ms / 1_000)\n".to_string()), " } else {\n".to_string()), " format!(\"{} minutes\", ms / 60_000)\n".to_string()), " }\n".to_string()), "}\n".to_string()), "\n".to_string()), "/// Mirror of `gunbc.observation_ci_render.ci_human_elapsed`.\n".to_string()), "pub fn obs_human_elapsed(wall_nanos: u128) -> String {\n".to_string()), " if wall_nanos < 1_000_000 {\n".to_string()), " format!(\"{wall_nanos}ns\")\n".to_string()), " } else {\n".to_string()), " obs_human_duration((wall_nanos / 1_000_000) as u64)\n".to_string()), " }\n".to_string()), "}\n".to_string()), "\n".to_string()), "fn obs_phase_emoji() -> bool {\n".to_string()), " std::env::var(\"GITHUB_ACTIONS\").as_deref() == Ok(\"true\")\n".to_string()), "}\n".to_string()), "\n".to_string()), "/// Pure Rust mirror of `gunbc.observation_seed_render.phase_begin_line` —\n".to_string()), "/// `ci_event_line(Begin) ∘ ci_render_line`. Justified divergence from the\n".to_string()), "/// interpreter seed boundary used by floor prelude marks: `trace_mark` runs\n".to_string()), "/// inside compile itself (hand-synced path and interpreter intrinsic), and\n".to_string()), "/// calling back into the interpreter to render would recurse. Proven\n".to_string()), "/// byte-equal to the `.dag` oracle by the seed RED.\n".to_string()), "pub fn render_phase_begin_line_mirror(phase: &str, emoji: bool) -> String {\n".to_string()), " let glyph = if emoji { \"🔄\" } else { \"◐\" };\n".to_string()), " format!(\"{glyph} started {phase}\")\n".to_string()), "}\n".to_string()), "\n".to_string()), "/// Pure Rust mirror of `gunbc.observation_seed_render.phase_concluded_line` —\n".to_string()), "/// `ci_event_line(Concluded{Done}) ∘ ci_render_line`. Same justified-divergence\n".to_string()), "/// note as `render_phase_begin_line_mirror`.\n".to_string()), "pub fn render_phase_concluded_line_mirror(phase: &str, elapsed_ms: u64, emoji: bool) -> String {\n".to_string()), " let glyph = if emoji { \"✅\" } else { \"✓\" };\n".to_string()), " format!(\"{glyph} {phase} done in {}\", obs_human_duration(elapsed_ms))\n".to_string()), "}\n".to_string()), "\n".to_string()), "/// Stage-boundary trace mark — the v1-seed interim realization of the v2 per-RealizedStep\n".to_string()), "/// CostAccount (std.realization_measurement). Wired (gantt flip): projects Begin/Concluded\n".to_string()), "/// on a PhaseSegment via the observation mirrors of `ci_event_line`. Segment wall on\n".to_string()), "/// Concluded (matched `.begin`→`.done`, else delta since last mark) — never the old\n".to_string()), "/// process-absolute millis field. RSS stays on heartbeat/measurement (`ci_event_line` does\n".to_string()), "/// not project `event.rss` — explicit divergence from the deleted rss-mib field).\n".to_string()), "///\n".to_string()), "/// **Dissolution trigger (DESIGN §6):** delete this fn, the `trace_mark` registry row in\n".to_string()), "/// `04_method.dag` (+ hand-synced twin `v1_compiler_infer_method.rs`), the nine\n".to_string()), "/// `trace_mark(...)` marks in `compile.dag` (+ hand-synced `v1_compiler_compile.rs`), and\n".to_string()), "/// the interpreter arm in `v1_interpreter.rs` when realization_measurement_loop **Phase 0**\n".to_string()), "/// (`docs/plans/realization-measurement-loop.md`) lands a `.dag` `PerformanceReceipt`\n".to_string()), "/// per-stage carrier that a floor witness consumes by execution (the same retirement event\n".to_string()), "/// as `phase_profile.rs` / `GUNBC_FLOOR_GANTT`, per `docs/plans/ci-floor-fractal-gantt.md`\n".to_string()), "/// § dissolution). Receipt = that witness green with these marks deleted and stage walls\n".to_string()), "/// still attributable from the model path.\n".to_string()), "pub fn trace_mark(label: String) {\n".to_string()), " use std::sync::{Mutex, OnceLock};\n".to_string()), " use std::time::Instant;\n".to_string()), " static TRACE_T0: OnceLock = OnceLock::new();\n".to_string()), " static LAST_MARK: OnceLock> = OnceLock::new();\n".to_string()), " static OPENS: OnceLock>> = OnceLock::new();\n".to_string()), " let t0 = TRACE_T0.get_or_init(Instant::now);\n".to_string()), " let last = LAST_MARK.get_or_init(|| Mutex::new(*t0));\n".to_string()), " let opens = OPENS.get_or_init(|| Mutex::new(std::collections::HashMap::new()));\n".to_string()), " let emoji = obs_phase_emoji();\n".to_string()), " let now = Instant::now();\n".to_string()), " let _ = GANTT_CENSUS_MARKER;\n".to_string()), " if let Some(phase) = label.strip_suffix(\".begin\") {\n".to_string()), " if let Ok(mut map) = opens.lock() {\n".to_string()), " map.insert(phase.to_string(), now);\n".to_string()), " }\n".to_string()), " if let Ok(mut l) = last.lock() {\n".to_string()), " *l = now;\n".to_string()), " }\n".to_string()), " eprintln!(\"{}\", render_phase_begin_line_mirror(phase, emoji));\n".to_string()), " } else if let Some(phase) = label.strip_suffix(\".done\") {\n".to_string()), " let elapsed_ms = {\n".to_string()), " let started = opens.lock().ok().and_then(|mut m| m.remove(phase));\n".to_string()), " match started {\n".to_string()), " Some(t) => now.saturating_duration_since(t).as_millis() as u64,\n".to_string()), " None => {\n".to_string()), " let prev = last.lock().map(|l| *l).unwrap_or(*t0);\n".to_string()), " now.saturating_duration_since(prev).as_millis() as u64\n".to_string()), " }\n".to_string()), " }\n".to_string()), " };\n".to_string()), " if let Ok(mut l) = last.lock() {\n".to_string()), " *l = now;\n".to_string()), " }\n".to_string()), " eprintln!(\n".to_string()), " \"{}\",\n".to_string()), " render_phase_concluded_line_mirror(phase, elapsed_ms, emoji)\n".to_string()), " );\n".to_string()), " } else {\n".to_string()), " let prev = last.lock().map(|l| *l).unwrap_or(*t0);\n".to_string()), " let elapsed_ms = now.saturating_duration_since(prev).as_millis() as u64;\n".to_string()), " if let Ok(mut l) = last.lock() {\n".to_string()), " *l = now;\n".to_string()), " }\n".to_string()), " eprintln!(\n".to_string()), " \"{}\",\n".to_string()), " render_phase_concluded_line_mirror(&label, elapsed_ms, emoji)\n".to_string()), " );\n".to_string()), " }\n".to_string()), "}\n".to_string()), "\n".to_string()), "/// Content hash over raw bytes — the byte-level single authority. `atom_identity_hash`\n".to_string()), "/// is the `String` projection of this. Use this directly for arbitrary binary content\n".to_string()), "/// (e.g. an executable or serialized payload): routing bytes through `String`/\n".to_string()), "/// `from_utf8_lossy` first collapses every invalid UTF-8 sequence to U+FFFD, so distinct\n".to_string()), "/// byte sequences would hash equal — a §5 silent-collision fail-open for content-addressing.\n".to_string()), "pub fn bytes_identity_hash(bytes: &[u8]) -> Hash {\n".to_string()), " format!(\"{:016x}\", fnv1a64(bytes))\n".to_string()), "}\n".to_string()), "\n".to_string()), "pub fn atom_identity_hash(s: String) -> Hash {\n".to_string()), " bytes_identity_hash(s.as_bytes())\n".to_string()), "}\n".to_string()), "\n".to_string()), "pub fn hash_combine(a: Hash, b: Hash) -> Hash {\n".to_string()), " expect_hash_digest(&a, \"a\");\n".to_string()), " expect_hash_digest(&b, \"b\");\n".to_string()), " let mut bytes = a.into_bytes();\n".to_string()), " bytes.push(0);\n".to_string()), " bytes.extend_from_slice(b.as_bytes());\n".to_string()), " format!(\"{:016x}\", fnv1a64(&bytes))\n".to_string()), "}\n".to_string()), "\n".to_string()) + v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat("const FNV1A64_OFFSET: u64 = 0xcbf29ce484222325;\n".to_string(), "const FNV1A64_PRIME: u64 = 0x100000001b3;\n".to_string()), "\n".to_string()), "fn fnv1a64(bytes: &[u8]) -> u64 {\n".to_string()), " let mut hash = FNV1A64_OFFSET;\n".to_string()), " for b in bytes {\n".to_string()), " hash ^= *b as u64;\n".to_string()), " hash = hash.wrapping_mul(FNV1A64_PRIME);\n".to_string()), " }\n".to_string()), " hash\n".to_string()), "}\n".to_string()), "\n".to_string()), "pub type Hash = String;\n".to_string()), "\n".to_string()), "const HASH_DIGEST_LEN: usize = 16;\n".to_string()), "\n".to_string()), "pub fn is_hash_digest(s: &str) -> bool {\n".to_string()), " s.len() == HASH_DIGEST_LEN && s.bytes().all(|b| b.is_ascii_hexdigit())\n".to_string()), "}\n".to_string()), "\n".to_string()), "fn expect_hash_digest(s: &str, arg: &str) {\n".to_string()), " if !is_hash_digest(s) {\n".to_string()), " panic!(\"{} must be a 16-char hex Hash digest\", arg);\n".to_string()), " }\n".to_string()), "}\n".to_string()), "\n".to_string()), "/// Kept so `gunbc.observation_emit_census` roster hygiene cannot go stale after the\n".to_string()), "/// raw gantt key=value shape (process-absolute millis and rss-mib fields) dissolves into the observation projection.\n".to_string()), "#[allow(dead_code)]\n".to_string()), "pub const GANTT_CENSUS_MARKER: &str = \"[gantt]\";\n".to_string()), "\n".to_string()), "/// Mirror of `gunbc.observation_ci_render.ci_minute_switch_seconds`.\n".to_string()), "const OBS_MINUTE_SWITCH_SECONDS: u64 = 90;\n".to_string()), "\n".to_string()), "pub fn obs_human_duration(ms: u64) -> String {\n".to_string()), " if ms < 1_000 {\n".to_string()), " format!(\"{ms}ms\")\n".to_string()), " } else if ms < OBS_MINUTE_SWITCH_SECONDS * 1_000 {\n".to_string()), " format!(\"{} seconds\", ms / 1_000)\n".to_string()), " } else {\n".to_string()), " format!(\"{} minutes\", ms / 60_000)\n".to_string()), " }\n".to_string()), "}\n".to_string()), "\n".to_string()), "/// Mirror of `gunbc.observation_ci_render.ci_human_elapsed`.\n".to_string()), "pub fn obs_human_elapsed(wall_nanos: u128) -> String {\n".to_string()), " if wall_nanos < 1_000_000 {\n".to_string()), " format!(\"{wall_nanos}ns\")\n".to_string()), " } else {\n".to_string()), " obs_human_duration((wall_nanos / 1_000_000) as u64)\n".to_string()), " }\n".to_string()), "}\n".to_string()), "\n".to_string()), "fn obs_phase_emoji() -> bool {\n".to_string()), " std::env::var(\"GITHUB_ACTIONS\").as_deref() == Ok(\"true\")\n".to_string()), "}\n".to_string()), "\n".to_string()), "/// Pure Rust mirror of `gunbc.observation_seed_render.phase_begin_line` —\n".to_string()), "/// `ci_event_line(Begin) ∘ ci_render_line`. Justified divergence from the\n".to_string()), "/// interpreter seed boundary used by floor prelude marks: `trace_mark` runs\n".to_string()), "/// inside compile itself (hand-synced path and interpreter intrinsic), and\n".to_string()), "/// calling back into the interpreter to render would recurse. Proven\n".to_string()), "/// byte-equal to the `.dag` oracle by the seed RED.\n".to_string()), "pub fn render_phase_begin_line_mirror(phase: &str, emoji: bool) -> String {\n".to_string()), " let glyph = if emoji { \"🔄\" } else { \"◐\" };\n".to_string()), " format!(\"{glyph} started {phase}\")\n".to_string()), "}\n".to_string()), "\n".to_string()), "/// Pure Rust mirror of `gunbc.observation_seed_render.phase_concluded_line` —\n".to_string()), "/// `ci_event_line(Concluded{Done}) ∘ ci_render_line`. Same justified-divergence\n".to_string()), "/// note as `render_phase_begin_line_mirror`.\n".to_string()), "pub fn render_phase_concluded_line_mirror(phase: &str, elapsed_ms: u64, emoji: bool) -> String {\n".to_string()), " let glyph = if emoji { \"✅\" } else { \"✓\" };\n".to_string()), " format!(\"{glyph} {phase} done in {}\", obs_human_duration(elapsed_ms))\n".to_string()), "}\n".to_string()), "\n".to_string()), "/// Stage-boundary trace mark — the v1-seed interim realization of the v2 per-RealizedStep\n".to_string()), "/// CostAccount (std.realization_measurement). Wired (gantt flip): projects Begin/Concluded\n".to_string()), "/// on a PhaseSegment via the observation mirrors of `ci_event_line`. Segment wall on\n".to_string()), "/// Concluded (matched `.begin`→`.done`, else delta since last mark) — never the old\n".to_string()), "/// process-absolute millis field. RSS stays on heartbeat/measurement (`ci_event_line` does\n".to_string()), "/// not project `event.rss` — explicit divergence from the deleted rss-mib field).\n".to_string()), "///\n".to_string()), "/// **Dissolution trigger (DESIGN §6):** delete this fn, the `trace_mark` registry row in\n".to_string()), "/// `04_method.dag` (+ hand-synced twin `v1_compiler_infer_method.rs`), the nine\n".to_string()), "/// `trace_mark(...)` marks in `compile.dag` (+ hand-synced `v1_compiler_compile.rs`), and\n".to_string()), "/// the interpreter arm in `v1_interpreter.rs` when realization_measurement_loop **Phase 0**\n".to_string()), "/// (`docs/plans/realization-measurement-loop.md`) lands a `.dag` `PerformanceReceipt`\n".to_string()), "/// per-stage carrier that a floor witness consumes by execution (the same retirement event\n".to_string()), "/// as `phase_profile.rs` / `GUNBC_FLOOR_GANTT`, per `ci-floor-fractal-gantt (plan doc deleted 2026-08-28)`\n".to_string()), "/// § dissolution). Receipt = that witness green with these marks deleted and stage walls\n".to_string()), "/// still attributable from the model path.\n".to_string()), "pub fn trace_mark(label: String) {\n".to_string()), " use std::sync::{Mutex, OnceLock};\n".to_string()), " use std::time::Instant;\n".to_string()), " static TRACE_T0: OnceLock = OnceLock::new();\n".to_string()), " static LAST_MARK: OnceLock> = OnceLock::new();\n".to_string()), " static OPENS: OnceLock>> = OnceLock::new();\n".to_string()), " let t0 = TRACE_T0.get_or_init(Instant::now);\n".to_string()), " let last = LAST_MARK.get_or_init(|| Mutex::new(*t0));\n".to_string()), " let opens = OPENS.get_or_init(|| Mutex::new(std::collections::HashMap::new()));\n".to_string()), " let emoji = obs_phase_emoji();\n".to_string()), " let now = Instant::now();\n".to_string()), " let _ = GANTT_CENSUS_MARKER;\n".to_string()), " if let Some(phase) = label.strip_suffix(\".begin\") {\n".to_string()), " if let Ok(mut map) = opens.lock() {\n".to_string()), " map.insert(phase.to_string(), now);\n".to_string()), " }\n".to_string()), " if let Ok(mut l) = last.lock() {\n".to_string()), " *l = now;\n".to_string()), " }\n".to_string()), " eprintln!(\"{}\", render_phase_begin_line_mirror(phase, emoji));\n".to_string()), " } else if let Some(phase) = label.strip_suffix(\".done\") {\n".to_string()), " let elapsed_ms = {\n".to_string()), " let started = opens.lock().ok().and_then(|mut m| m.remove(phase));\n".to_string()), " match started {\n".to_string()), " Some(t) => now.saturating_duration_since(t).as_millis() as u64,\n".to_string()), " None => {\n".to_string()), " let prev = last.lock().map(|l| *l).unwrap_or(*t0);\n".to_string()), " now.saturating_duration_since(prev).as_millis() as u64\n".to_string()), " }\n".to_string()), " }\n".to_string()), " };\n".to_string()), " if let Ok(mut l) = last.lock() {\n".to_string()), " *l = now;\n".to_string()), " }\n".to_string()), " eprintln!(\n".to_string()), " \"{}\",\n".to_string()), " render_phase_concluded_line_mirror(phase, elapsed_ms, emoji)\n".to_string()), " );\n".to_string()), " } else {\n".to_string()), " let prev = last.lock().map(|l| *l).unwrap_or(*t0);\n".to_string()), " let elapsed_ms = now.saturating_duration_since(prev).as_millis() as u64;\n".to_string()), " if let Ok(mut l) = last.lock() {\n".to_string()), " *l = now;\n".to_string()), " }\n".to_string()), " eprintln!(\n".to_string()), " \"{}\",\n".to_string()), " render_phase_concluded_line_mirror(&label, elapsed_ms, emoji)\n".to_string()), " );\n".to_string()), " }\n".to_string()), "}\n".to_string()), "\n".to_string()), "/// Content hash over raw bytes — the byte-level single authority. `atom_identity_hash`\n".to_string()), "/// is the `String` projection of this. Use this directly for arbitrary binary content\n".to_string()), "/// (e.g. an executable or serialized payload): routing bytes through `String`/\n".to_string()), "/// `from_utf8_lossy` first collapses every invalid UTF-8 sequence to U+FFFD, so distinct\n".to_string()), "/// byte sequences would hash equal — a §5 silent-collision fail-open for content-addressing.\n".to_string()), "pub fn bytes_identity_hash(bytes: &[u8]) -> Hash {\n".to_string()), " format!(\"{:016x}\", fnv1a64(bytes))\n".to_string()), "}\n".to_string()), "\n".to_string()), "pub fn atom_identity_hash(s: String) -> Hash {\n".to_string()), " bytes_identity_hash(s.as_bytes())\n".to_string()), "}\n".to_string()), "\n".to_string()), "pub fn hash_combine(a: Hash, b: Hash) -> Hash {\n".to_string()), " expect_hash_digest(&a, \"a\");\n".to_string()), " expect_hash_digest(&b, \"b\");\n".to_string()), " let mut bytes = a.into_bytes();\n".to_string()), " bytes.push(0);\n".to_string()), " bytes.extend_from_slice(b.as_bytes());\n".to_string()), " format!(\"{:016x}\", fnv1a64(&bytes))\n".to_string()), "}\n".to_string()), "\n".to_string()) } pub fn rt_resolution_silent_pick_telemetry() -> String {