The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
fix(ci): scope static ownership records to inline modules
Steven Enamakel9aa30d2ba56f
diff --git a/scripts/__tests__/process-statics.test.mjs b/scripts/__tests__/process-statics.test.mjsindex 8f36b65c13..05dbfb264b 100644--- a/scripts/__tests__/process-statics.test.mjs+++ b/scripts/__tests__/process-statics.test.mjs@@ -222,13 +222,43 @@ test("array length expressions do not treat shifts as generic brackets", () => {);});test("swapping same-named static types between modules requires ownership review", () => {- const before = scan("mod user { static CACHE: UserCache = x; } mod infra { static CACHE: InfraCache = x; }");- const after = scan("mod user { static CACHE: InfraCache = x; } mod infra { static CACHE: UserCache = x; }");+ const before = scan(+ "mod user { static CACHE: UserCache = x; } mod infra { static CACHE: InfraCache = x; }",+ );+ const after = scan(+ "mod user { static CACHE: InfraCache = x; } mod infra { static CACHE: UserCache = x; }",+ );assert.equal(reviewChanges(before, after, []).length, 2);});+test("module ownership records survive line and module-order changes but cannot cover another module", () => {+ const before = scan(`mod outer { mod user { ${source} } }`);+ const approval = { ...entry, scope: "outer::user" };+ assert.deepEqual(reviewChanges([], before, [approval]), []);+ assert.deepEqual(+ reviewChanges(+ before,+ scan(`mod other {}\n\nmod outer { mod user { ${source} } }`),+ [approval],+ ),+ [],+ );+ assert.equal(+ reviewChanges(before, scan(`mod outer { mod infra { ${source} } }`), [+ approval,+ ]).length > 0,+ true,+ );+});test("type macros preserve comparison tokens in parentheses and square token trees", () => {- for (const type of ["ty!(1 < 2)", "ty![1 > 2]", "Wrapper<ty!(1 << 2), Option<u8>>"]) {- assert.equal(scan(`static X: ${type} = x;`)[0].type, type.replaceAll(" ", ""));+ for (const type of [+ "ty!(1 < 2)",+ "ty![1 > 2]",+ "Wrapper<ty!(1 << 2), Option<u8>>",+ ]) {+ assert.equal(+ scan(`static X: ${type} = x;`)[0].type,+ type.replaceAll(" ", ""),+ );}});test("repository scan reads the merge base, enforces records, and fails without history", () => {diff --git a/scripts/ci/check-process-statics.mjs b/scripts/ci/check-process-statics.mjsindex 5fa179c19e..85f624eebe 100644--- a/scripts/ci/check-process-statics.mjs+++ b/scripts/ci/check-process-statics.mjs@@ -19,7 +19,9 @@ const signature = (entry) =>// blocks and macro expansion are outside this source-level identity model.function moduleScopes(code) {const openings = new Map();- for (const match of code.matchAll(/\bmod\s+((?:r#)?[_\p{ID_Start}][_\p{ID_Continue}]*)\s*\{/gu))+ for (const match of code.matchAll(+ /\bmod\s+((?:r#)?[_\p{ID_Start}][_\p{ID_Continue}]*)\s*\{/gu,+ ))openings.set(match.index + match[0].lastIndexOf("{"), match[1]);const stack = [];const scopes = [];@@ -60,11 +62,13 @@ export function declarations(text, file) {)continue;if ("<([{".includes(char)) {- if ("([{".includes(char) && code.slice(start, end).trimEnd().endsWith("!"))+ if (+ "([{".includes(char) &&+ code.slice(start, end).trimEnd().endsWith("!")+ )macroTrees.add(stack.length + 1);stack.push(char);- }- else if (">)]}".includes(char) && stack.length) {+ } else if (">)]}".includes(char) && stack.length) {// An arrow inside a function type is not a generic closing bracket.if (char === ">" && code[end - 1] === "-") continue;const expected = { ">": "<", ")": "(", "]": "[", "}": "{" }[char];diff --git a/scripts/ci/process-statics.md b/scripts/ci/process-statics.mdindex dbce70a539..dea16cd979 100644--- a/scripts/ci/process-statics.md+++ b/scripts/ci/process-statics.md@@ -21,6 +21,7 @@ Each record has these fields:```json{"file": "crates/openhuman-core/src/example/store.rs",+ "scope": "","name": "CACHE","type": "OnceLock<Mutex<Cache>>","count": 1,@@ -33,7 +34,9 @@ Each record has these fields:Use the type printed by the failure message, with whitespace outside literalsremoved (except the `mut ` or `ref ` prefix). ABI and other literal contents,including their whitespace, remain significant. `count` is the exact number of matching-file/name/type declarations, including declarations in nested modules.+file/module-scope/name/type declarations. `scope` is the inline module path,+such as `outer::user`; an empty or omitted scope denotes the file root.+Swapping types between inline modules requires separate ownership review.Duplicate records, missing fields, and records that no longer match thesource fail. Update or remove the record when its declaration changes.Records present in the base manifest remain mandatory while their corresponding@@ -58,6 +61,9 @@ This is a source declaration guard, not a Rust macro expander. It recognizesordinary `static`, `static mut`, and `lazy_static!`'s `static ref`, multilineand qualified types, and ignores comments and string fixtures. Staticsgenerated without a literal declaration by another macro need manual review.+Type-position macro token trees are preserved without expanding them. Named+inline modules contribute declaration identity; anonymous blocks and function+scopes within one module still share its declaration counts.Sibling `*_tests.rs` files are excluded; declarations behind `cfg(test)` inproduction source files are conservatively included. Initializer and alias-definitionedits to existing declarations are subject to ordinary code review. Other crates and