Skip to repository content

tenant.openagents/omega

No repository description is available.

OpenAgents Git authority 2026-07-28T04:13:56.436Z Public web read
NIP-34 coordinate30617:7649603503856e5148d571eac2766b288a8ff1e9e35d380337a1d2b0015b4f92:omega
MaintainersHidden in public view
References2 branches · 1 tag
Read-only clonegit clone https://openagents.com/git/tenant.openagents/omega.git
Browse files

public_branding.rs

170 lines · 5.8 KB · rust
1use serde::Deserialize;
2
3#[derive(Debug, Deserialize)]
4struct CompatibilityAllowList {
5    version: u32,
6    owner: String,
7    policy: String,
8    allowed_dispositions: Vec<String>,
9    entries: Vec<CompatibilityEntry>,
10}
11
12#[derive(Debug, Deserialize)]
13struct CompatibilityEntry {
14    #[serde(rename = "match")]
15    match_text: String,
16    path: Option<String>,
17    reason: String,
18    owner: String,
19    disposition: String,
20    expiry: String,
21}
22
23fn load_allowlist() -> CompatibilityAllowList {
24    let path = std::path::Path::new(env!("CARGO_MANIFEST_DIR"))
25        .join("fixtures/compatibility_allowlist.json");
26    let text = std::fs::read_to_string(&path)
27        .unwrap_or_else(|error| panic!("read {}: {error}", path.display()));
28    serde_json::from_str(&text).unwrap_or_else(|error| panic!("parse allowlist: {error}"))
29}
30
31#[test]
32fn compatibility_allowlist_has_required_fields() {
33    let allowlist = load_allowlist();
34    assert_eq!(allowlist.version, 1);
35    assert_eq!(allowlist.owner, "OpenAgents");
36    assert!(!allowlist.policy.is_empty());
37    assert!(
38        allowlist
39            .allowed_dispositions
40            .iter()
41            .any(|disposition| disposition == "approved_compatibility")
42    );
43    assert!(
44        allowlist
45            .allowed_dispositions
46            .iter()
47            .any(|disposition| disposition == "blocked")
48    );
49    assert!(!allowlist.entries.is_empty());
50
51    for entry in &allowlist.entries {
52        assert!(
53            !entry.match_text.is_empty(),
54            "entry match must be non-empty"
55        );
56        assert!(!entry.reason.is_empty(), "entry reason must be non-empty");
57        assert_eq!(entry.owner, "OpenAgents");
58        assert!(!entry.expiry.is_empty(), "entry expiry must be non-empty");
59        assert!(
60            allowlist
61                .allowed_dispositions
62                .iter()
63                .any(|disposition| disposition == &entry.disposition),
64            "unknown disposition {} for {}",
65            entry.disposition,
66            entry.match_text
67        );
68        if let Some(path) = &entry.path {
69            assert!(!path.is_empty(), "entry path must be non-empty when set");
70        }
71    }
72}
73
74#[test]
75fn high_risk_public_files_forbid_zed_product_phrases() {
76    let workspace_root = std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("../..");
77    let paths = [
78        "crates/onboarding/src/basics_page.rs",
79        "crates/onboarding/src/multibuffer_hint.rs",
80        "crates/ai_onboarding/src/ai_onboarding.rs",
81        "crates/settings_ui/src/settings_ui.rs",
82        "crates/settings_ui/src/page_data.rs",
83        "crates/workspace/src/notifications.rs",
84        "crates/workspace/src/workspace_error.rs",
85        "crates/title_bar/src/title_bar.rs",
86        "crates/title_bar/src/collab.rs",
87        "crates/extensions_ui/src/extensions_ui.rs",
88        "crates/auto_update_helper/src/dialog.rs",
89        "crates/edit_prediction/src/edit_prediction.rs",
90        "crates/edit_prediction/src/zeta.rs",
91        "crates/agent/src/agent.rs",
92        "crates/agent_ui/src/agent_ui.rs",
93        "crates/agent_ui/src/agent_panel.rs",
94        "crates/sidebar/src/sidebar.rs",
95        "crates/ui/src/components/ai/agent_setup_button.rs",
96        "crates/eval_cli/src/headless.rs",
97    ];
98
99    let forbidden = [
100        "Welcome to Zed",
101        "Welcome to Zed AI",
102        "Updating Zed",
103        "About Zed",
104        "Move Zed to Applications",
105        "Installing Zed",
106        "Help improve Zed",
107        "Help fix Zed",
108        "Zed Agent",
109        "Try Zed Pro",
110        "Zed — Settings",
111        "Restart to update Zed",
112        "Please update Zed",
113        "Please restart Zed",
114        "built-in to Zed",
115        "version of Zed",
116        "Update Zed",
117        "A new version of Zed",
118        "Zed needs an xdg-desktop-portal",
119        "continue using Zed AI",
120        "billing-support@zed.dev",
121        "https://zed.dev/releases",
122        "https://zed.dev/docs/multibuffers",
123        "https://zed.dev/docs/linux",
124    ];
125
126    for relative in paths {
127        let path = workspace_root.join(relative);
128        let source = std::fs::read_to_string(&path)
129            .unwrap_or_else(|error| panic!("read {}: {error}", path.display()));
130        for phrase in forbidden {
131            assert!(
132                !source.contains(phrase),
133                "{relative} still contains forbidden public phrase: {phrase}"
134            );
135        }
136    }
137}
138
139#[test]
140fn omega_hosted_ai_and_external_agent_copy_is_honest() {
141    let workspace_root = std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("../..");
142    let ai_onboarding =
143        std::fs::read_to_string(workspace_root.join("crates/ai_onboarding/src/ai_onboarding.rs"))
144            .expect("read ai_onboarding");
145    // This used to require the disclaimer "not available in Omega". omega#60
146    // removed the hosted-AI onboarding surface entirely, so there is nothing
147    // left to disclaim — the file is now a module list. A disclaimer about a
148    // surface that no longer exists is not honesty, it is residue.
149    //
150    // What still matters is that the Zed-cloud copy cannot come back.
151    for forbidden in [
152        "Welcome to Zed AI",
153        "Try Zed Pro for Free",
154        "Zed Pro",
155        "zed.dev",
156    ] {
157        assert!(
158            !ai_onboarding.contains(forbidden),
159            "ai_onboarding must not carry Zed hosted-service copy: {forbidden:?}"
160        );
161    }
162
163    let basics =
164        std::fs::read_to_string(workspace_root.join("crates/onboarding/src/basics_page.rs"))
165            .expect("read basics_page");
166    assert!(basics.contains("Install external agents to start a thread"));
167    assert!(basics.contains("Codex uses its own login and configuration"));
168    assert!(!basics.contains(".name(\"Zed Agent\")"));
169}
170
Served at tenant.openagents/omega Member data and write actions are omitted.