Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(ci): stop the boundary gate reddening on unrelated line shifts

M3gA-Mindcd9600716bf5
diff --git a/scripts/ci/agent-runtime-boundary-baseline.json b/scripts/ci/agent-runtime-boundary-baseline.json
index bed0103c55..f6dd82e4ed 100644
--- a/scripts/ci/agent-runtime-boundary-baseline.json
+++ b/scripts/ci/agent-runtime-boundary-baseline.json
@@ -151,7 +151,7 @@
"path": "crates/openhuman-core/src/agent/harness/fork_context.rs",
"line": 223,
"text": "AGENT_CONTEXT_PREPARED_SOURCES",
- "occurrence": 1
+ "occurrence": 2
},
{
"rule": "openhuman-task-local",
@@ -396,14 +396,14 @@
"path": "crates/openhuman-core/src/agent/orchestration/workflow_runs/engine/lifecycle.rs",
"line": 210,
"text": "let inherited_origin = crate::agent::turn_origin::capture();",
- "occurrence": 1
+ "occurrence": 2
},
{
"rule": "openhuman-task-local",
"path": "crates/openhuman-core/src/agent/orchestration/workflow_runs/engine/lifecycle.rs",
"line": 214,
"text": "crate::agent::turn_origin::with_inherited_origin(",
- "occurrence": 1
+ "occurrence": 2
},
{
"rule": "openhuman-task-local",
@@ -457,7 +457,7 @@
{
"rule": "openhuman-task-local",
"path": "crates/openhuman-core/src/agent/session_host/builder/factory.rs",
- "line": 1198,
+ "line": 1206,
"text": "let root = crate::agent::turn_workspace::current()?;",
"occurrence": 1
},
@@ -478,7 +478,7 @@
{
"rule": "openhuman-task-local",
"path": "crates/openhuman-core/src/agent/session_host/runtime_session.rs",
- "line": 1420,
+ "line": 1383,
"text": "request_id: crate::agent::turn_origin::current_request_id(),",
"occurrence": 1
},
@@ -592,7 +592,7 @@
"path": "crates/openhuman-core/src/agent/turn_origin.rs",
"line": 300,
"text": "Some(origin) => with_origin(origin, fut).await,",
- "occurrence": 1
+ "occurrence": 2
},
{
"rule": "openhuman-task-local",
@@ -765,14 +765,14 @@
{
"rule": "openhuman-task-local",
"path": "crates/openhuman-core/src/inference/host_runtime/ops/agent_chat.rs",
- "line": 212,
+ "line": 197,
"text": "if let Some(tx) = crate::agent::progress_sink::current_progress_sink() {",
"occurrence": 1
},
{
"rule": "openhuman-task-local",
"path": "crates/openhuman-core/src/inference/host_runtime/ops/agent_chat.rs",
- "line": 223,
+ "line": 208,
"text": "let run = crate::agent::turn_origin::with_origin(",
"occurrence": 1
},
@@ -1017,7 +1017,7 @@
{
"rule": "openhuman-task-local",
"path": "crates/openhuman-core/src/web_chat/ops/system_turn.rs",
- "line": 88,
+ "line": 87,
"text": "let result = with_origin(origin, agent.run_single(prompt))",
"occurrence": 1
},
@@ -1250,7 +1250,7 @@
"path": "vendor/tinyagents/crates/tinyagents-harness/src/providers/claude_code/input_builder_tests.rs",
"line": 167,
"text": "&[ChatMessage::user(",
- "occurrence": 1
+ "occurrence": 2
},
{
"rule": "tinyagents-openhuman-domain-name",
@@ -1306,21 +1306,21 @@
"path": "vendor/tinyagents/crates/tinyagents-harness/src/providers/claude_code/input_builder_tests.rs",
"line": 217,
"text": "ChatMessage::user(\"latest\"),",
- "occurrence": 1
+ "occurrence": 2
},
{
"rule": "tinyagents-openhuman-domain-name",
"path": "vendor/tinyagents/crates/tinyagents-harness/src/providers/claude_code/input_builder_tests.rs",
"line": 227,
"text": "&[ChatMessage::user(",
- "occurrence": 1
+ "occurrence": 3
},
{
"rule": "tinyagents-openhuman-domain-name",
"path": "vendor/tinyagents/crates/tinyagents-harness/src/providers/claude_code/input_builder_tests.rs",
"line": 242,
"text": "&[ChatMessage::user(",
- "occurrence": 1
+ "occurrence": 4
},
{
"rule": "tinyagents-openhuman-domain-name",
diff --git a/scripts/ci/check-agent-runtime-boundary.mjs b/scripts/ci/check-agent-runtime-boundary.mjs
index 4e492ad16a..bf7596882c 100644
--- a/scripts/ci/check-agent-runtime-boundary.mjs
+++ b/scripts/ci/check-agent-runtime-boundary.mjs
@@ -336,9 +336,17 @@ findings.sort((a, b) => a.rule.localeCompare(b.rule) || a.path.localeCompare(b.p
function stable(records) {
const occurrences = new Map();
return records.map(({ rule, path, line, text }) => {
- // Physical source locations are part of the temporary debt contract: a
- // moved violation is stale debt, not a silently accepted occurrence.
- const base = `${rule}\0${path}\0${line}\0${text}`;
+ // Deliberately excludes `line`. The identity of a violation is the rule it
+ // breaks, the file it is in, and the source text — not where in the file it
+ // sits. Keying on the line answers "did anything ABOVE this change?", which
+ // is a proximity alarm rather than debt tracking, and it made the gate red
+ // on every unrelated edit to a file containing a violation (#6525).
+ //
+ // `occurrence` carries the load the line was credited with: a file that
+ // gains a SECOND identical violation goes 1 -> 2 and is correctly reported
+ // as unbaselined. `line` is retained on the record as advisory metadata for
+ // the error output, and is refreshed whenever the baseline is regenerated.
+ const base = `${rule}\0${path}\0${text}`;
const occurrence = (occurrences.get(base) ?? 0) + 1;
occurrences.set(base, occurrence);
return { rule, path, line, text, occurrence };
@@ -360,11 +368,18 @@ if (!noBaseline) {
process.exit(1);
}
}
+// Compared on identity rather than on the whole record: `JSON.stringify` would
+// reintroduce `line`, and because the two sets are compared in both directions
+// a moved violation would land in `added` AND `stale` at once — which is why a
+// set of five that merely shifted used to report as "5 unbaselined + 5 stale",
+// inviting a triager to believe ten things had changed.
+const identity = ({ rule, path, text, occurrence }) =>
+ `${rule}\0${path}\0${text}\0${occurrence}`;
const actualStable = stable(findings);
-const expectedKeys = new Set(expected.map(JSON.stringify));
-const actualKeys = new Set(actualStable.map(JSON.stringify));
-const added = findings.filter((_, index) => !expectedKeys.has(JSON.stringify(actualStable[index])));
-const stale = expected.filter((record) => !actualKeys.has(JSON.stringify(record)));
+const expectedKeys = new Set(expected.map(identity));
+const actualKeys = new Set(actualStable.map(identity));
+const added = findings.filter((_, index) => !expectedKeys.has(identity(actualStable[index])));
+const stale = expected.filter((record) => !actualKeys.has(identity(record)));
if (added.length || stale.length) {
console.error("Agent-runtime ownership boundary changed.");
if (added.length) {