fix: refactor 5 additional aliased output.args mutations + strengthen audit test
Address Oracle review feedback: refactor 4 aliased mutations via argsObject in plugin/tool-execute-before.ts and 1 via toolOutput in atlas/tool-execute-before.ts. Strengthen audit test regex to catch Output.args mutations regardless of the variable name prefix (toolOutput, argsObject aliases). Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -23,8 +23,10 @@ async function collectTsFiles(dir: string): Promise<string[]> {
|
||||
|
||||
const HELPER_FILE = "shared/replace-tool-args.ts"
|
||||
|
||||
const DIRECT_MUTATION_PATTERN = /output\.args\.\w+\s*=[^=]/g
|
||||
const OBJECT_ASSIGN_PATTERN = /Object\.assign\(\s*output\.args/g
|
||||
// Matches direct mutations like `output.args.foo =` or `toolOutput.args.foo =`
|
||||
// but excludes comparisons (===, !==, ==)
|
||||
const DIRECT_MUTATION_PATTERN = /\w*[Oo]utput\.args\.\w+\s*=[^=]/g
|
||||
const OBJECT_ASSIGN_PATTERN = /Object\.assign\(\s*\w*[Oo]utput\.args/g
|
||||
|
||||
describe("replace-tool-args audit", () => {
|
||||
it("#given src/**/*.ts files #when scanning for direct output.args mutation #then no matches found outside the helper", async () => {
|
||||
|
||||
Reference in New Issue
Block a user