Skip to repository content142 lines · 4.4 KB · rust
tenant.openagents/omega
No repository description is available.
OpenAgents Git authority 2026-07-28T04:13:10.693Z Public web read
NIP-34 coordinate
30617:7649603503856e5148d571eac2766b288a8ff1e9e35d380337a1d2b0015b4f92:omegaMaintainersHidden in public view
References2 branches · 1 tag
Read-only clone
git clone https://openagents.com/git/tenant.openagents/omega.gitBrowse files
release_record.rs
1use serde::Deserialize;
2
3#[derive(Debug, Deserialize)]
4struct ReleaseRecord {
5 schema_version: u32,
6 product: String,
7 channel: String,
8 version: String,
9 artifact_name: String,
10 volume_name: String,
11 bundle_identifier: String,
12 team_id: String,
13 signing_identity: String,
14 source: SourceSection,
15 toolchains: ToolchainsSection,
16 digests: DigestsSection,
17 notarization: NotarizationSection,
18 legal: LegalSection,
19 publication: PublicationSection,
20}
21
22#[derive(Debug, Deserialize)]
23struct SourceSection {
24 commit: String,
25 #[serde(default)]
26 #[allow(dead_code)]
27 upstream_commit: Option<String>,
28 dirty: bool,
29}
30
31#[derive(Debug, Deserialize)]
32struct ToolchainsSection {
33 rustc: String,
34 host: String,
35 target: String,
36}
37
38#[derive(Debug, Deserialize)]
39struct DigestsSection {
40 cargo_lock_sha256: String,
41 icon_family_manifest_sha256: String,
42 #[serde(default)]
43 package_sha256: Option<String>,
44}
45
46#[derive(Debug, Deserialize)]
47struct NotarizationSection {
48 attempted: bool,
49 stapled: bool,
50 /// OMEGA-DELTA-0023. Whether the ticket is stapled to `Omega.app` itself.
51 ///
52 /// Kept separate from `stapled`, which covers the disk image. A DMG ticket
53 /// does not travel with the application that ends up in `/Applications`,
54 /// so conflating the two is how a candidate could claim Gatekeeper
55 /// acceptance while `stapler validate /Applications/Omega.app` reported no
56 /// ticket and offline first start was unprovable.
57 #[serde(default)]
58 app_stapled: bool,
59 status: String,
60}
61
62#[derive(Debug, Deserialize)]
63struct LegalSection {
64 commercial_terms_attached: bool,
65}
66
67#[derive(Debug, Deserialize)]
68struct PublicationSection {
69 repository: String,
70 tag: String,
71 prerelease: bool,
72 latest: bool,
73}
74
75fn load_fixture() -> ReleaseRecord {
76 let path = std::path::Path::new(env!("CARGO_MANIFEST_DIR"))
77 .join("fixtures/release_record_v1.json");
78 let text = std::fs::read_to_string(&path)
79 .unwrap_or_else(|error| panic!("read {}: {error}", path.display()));
80 serde_json::from_str(&text).unwrap_or_else(|error| panic!("parse fixture: {error}"))
81}
82
83fn assert_sha256_hex(label: &str, value: &str) {
84 assert_eq!(value.len(), 64, "{label} must be 64 hex chars");
85 assert!(
86 value.chars().all(|character| character.is_ascii_hexdigit()),
87 "{label} must be hexadecimal"
88 );
89}
90
91#[test]
92fn release_record_fixture_matches_rc_contract() {
93 let record = load_fixture();
94
95 assert_eq!(record.schema_version, 1);
96 assert_eq!(record.product, "Omega");
97 assert_eq!(record.channel, "rc");
98 assert_eq!(record.version, "0.2.0-rc2");
99 assert_eq!(record.artifact_name, "Omega-v0.2.0-rc2-macos-arm64.dmg");
100 assert_eq!(record.volume_name, "Omega RC");
101 assert_eq!(record.bundle_identifier, "com.openagents.omega.rc");
102 assert_eq!(record.team_id, "HQWSG26L43");
103 assert!(
104 record
105 .signing_identity
106 .contains("OpenAgents, Inc. (HQWSG26L43)")
107 );
108 assert!(!record.source.commit.is_empty());
109 assert!(!record.source.dirty);
110 assert!(!record.toolchains.rustc.is_empty());
111 assert_eq!(record.toolchains.host, "aarch64-apple-darwin");
112 assert_eq!(record.toolchains.target, "aarch64-apple-darwin");
113 assert_sha256_hex(
114 "digests.cargo_lock_sha256",
115 &record.digests.cargo_lock_sha256,
116 );
117 assert_sha256_hex(
118 "digests.icon_family_manifest_sha256",
119 &record.digests.icon_family_manifest_sha256,
120 );
121 assert!(record.digests.package_sha256.is_none());
122 assert!(!record.legal.commercial_terms_attached);
123 assert!(!record.notarization.attempted);
124 assert!(!record.notarization.stapled);
125 assert!(!record.notarization.app_stapled);
126 assert_eq!(record.notarization.status, "not_attempted");
127 assert_eq!(record.publication.repository, "OpenAgentsInc/omega");
128 assert_eq!(record.publication.tag, "v0.2.0-rc2");
129 assert!(record.publication.prerelease);
130 assert!(!record.publication.latest);
131}
132
133#[test]
134fn release_record_publication_must_be_prerelease_not_latest() {
135 let record = load_fixture();
136 assert!(
137 record.publication.prerelease && !record.publication.latest,
138 "RC candidates must publish as prerelease and never as latest"
139 );
140 assert!(!record.legal.commercial_terms_attached);
141}
142