Agent Patches
Agents should edit ArchAI through explicit operations, canonical paths, selectors, and deterministic evals.
Patch Shape
Section titled “Patch Shape”const patch = branch.patch([ { type: "computeBuildableEnvelope", targetPath: "site.main.parcels.pcl_001", params: { includeRules: ["setbacks", "heightLimit", "lotCoverage"] } }, { type: "generateFloorplates", targetPath: "buildings.b_001", params: { envelope: "site.main.envelopes.primary", maxDepth: mm(14500) } }, { type: "placeCore", targetPath: "buildings.b_001.systems.core.main", params: { strategy: "central", stairs: 2, elevators: 2 } }]);Selector Targets
Section titled “Selector Targets”Use selectors when applying an operation to a set.
path("buildings.b_001.levels.*.floorplate")kind("space").where(program == "bedroom")within("site.main.envelopes.primary")dependsOn("site.main.parcels.pcl_001.constraints.zoning")Evaluation Loop
Section titled “Evaluation Loop”const result = await branch.evaluate(patch, { scope: "affected", tiers: [0, 1, 2, 3], returnRepairHints: true});
if (result.valid && result.score > branch.currentScore()) { await branch.commit(patch, "Generate compliant massing and core option");} else { await branch.rollback(patch);}Repair Hint
Section titled “Repair Hint”{ "kind": "operationSuggestion", "op": "fitMassingToEnvelope", "targetPath": "buildings.b_001", "params": { "reduceFootprintBySqm": 24.6 }}