|
1 | | -//! # LandFixTier - Mountain's runtime tier banner |
| 1 | +//! # LandFixTier |
2 | 2 | //! |
3 | | -//! Emits one ISO-timestamped line at boot listing every tier variable's |
4 | | -//! compiled value. Because the values are resolved at compile time via |
5 | | -//! `env!("Tier…")` (populated by `build.rs::PropagateTierGating`), the |
6 | | -//! banner is always correct for *this particular binary*, not "whatever |
7 | | -//! is in the env right now". |
| 3 | +//! Emits a single ISO-timestamped boot banner listing the compiled-in value of |
| 4 | +//! every tier variable. Because all `env!("Tier…")` calls are resolved by |
| 5 | +//! `build.rs::PropagateTierGating` at compile time, the banner always reflects |
| 6 | +//! the exact configuration baked into *this* binary — not whatever the host |
| 7 | +//! environment happens to export at runtime. |
8 | 8 | //! |
9 | | -//! ## Why this shape |
| 9 | +//! ## Design Rationale |
10 | 10 | //! |
11 | | -//! Three distinct audiences need the banner: |
| 11 | +//! Three distinct audiences depend on this banner: |
12 | 12 | //! |
13 | | -//! | Audience | Reason | |
14 | | -//! | ----------------------- | ----------------------------------------------------------------- | |
15 | | -//! | Log readers (humans) | A pasted session log must show at-a-glance which tier was active. | |
16 | | -//! | Regression triage | Confirms the binary on disk matches the `.env.Land` that shipped. | |
17 | | -//! | Cross-Element agreement | Pairs with Cocoon's `[LandFix:Tier] Cocoon tier set resolved:` and Sky's `[LandFix:Tier] Sky tier set:` - if Mountain disagrees with either, configuration drift is the root cause. | |
| 13 | +//! | Audience | Why it matters | |
| 14 | +//! |---|---| |
| 15 | +//! | Log readers (humans) | A pasted session log must show at-a-glance which tier was active when the problem occurred. | |
| 16 | +//! | Regression triage | Confirms the binary on disk was built from the same `.env.Land` that shipped. | |
| 17 | +//! | Cross-element agreement | Pairs with Cocoon's `[LandFix:Tier] Cocoon tier set resolved:` and Sky's `[LandFix:Tier] Sky tier set:`. A mismatch between any two signals configuration drift as the root cause. | |
18 | 18 | //! |
19 | | -//! ## Call site |
| 19 | +//! ## Call Site |
20 | 20 | //! |
21 | 21 | //! `LogResolvedTiers()` is called unconditionally from `Binary/Main/Entry::Fn` |
22 | | -//! before the Tokio runtime starts spawning tasks, because `dev_log!` is |
23 | | -//! synchronous and the banner should land before any extension code runs. |
| 22 | +//! before the Tokio runtime begins spawning tasks. `dev_log!` is synchronous, |
| 23 | +//! so the banner is guaranteed to land in the log before any extension code runs. |
24 | 24 | //! |
25 | | -//! Runtime overhead is zero - all `env!(...)` invocations resolve to string |
26 | | -//! literals at compile time and Rust's `println!`/`dev_log!` codegen inlines |
27 | | -//! the format arguments into a single write call. |
| 25 | +//! Runtime overhead is zero — all `env!(...)` invocations become string |
| 26 | +//! literals at compile time and are inlined into a single write call. |
28 | 27 | //! |
29 | 28 | //! ## References |
30 | 29 | //! |
31 | | -//! See `Documentation/GitHub/Workflow/TierGatedImplementationSelection.md` |
32 | | -//! (rendered at |
33 | | -//! <https://github.com/CodeEditorLand/Land/tree/Current/Documentation/GitHub/Workflow/TierGatedImplementationSelection.md>) |
34 | | -//! for the end-to-end workflow and the matching call sites in Cocoon, Wind |
35 | | -//! and Sky. Every capability listed in the banner below maps to one or more |
36 | | -//! tier-marker comments of the form `// Tier:<Capability>:<Value>` at the |
37 | | -//! corresponding dispatch site. |
| 30 | +//! See `Documentation/GitHub/Workflow/TierGatedImplementationSelection.md` for |
| 31 | +//! the end-to-end tier-gating workflow and the matching call sites in Cocoon, |
| 32 | +//! Wind, and Sky. Every capability listed in the boot banner maps to one or |
| 33 | +//! more `// Tier:<Capability>:<Value>` comments at its dispatch site. |
38 | 34 |
|
39 | 35 | use crate::dev_log; |
40 | 36 |
|
41 | | -/// Emits one line at boot listing every tier variable's compiled value. |
42 | | -/// Call once, from `tauri::Builder`'s setup hook, after the logging |
43 | | -/// infrastructure is ready. |
| 37 | +/// Emits one ISO-timestamped line at boot listing the compiled-in value of all |
| 38 | +/// 17 tier variables (`TierRemoteProcedureCall` … `TierTelemetry`). Call once, |
| 39 | +/// from `Binary/Main/Entry::Fn`, after the logging infrastructure is ready and |
| 40 | +/// before the Tokio runtime spawns any tasks. |
44 | 41 | pub fn LogResolvedTiers() { |
45 | 42 | dev_log!( |
46 | 43 | "lifecycle", |
|
0 commit comments