Skip to content

Commit 42f93fc

Browse files
committed
Design the model in one call, and ask for a shape rather than a part count
Developer: Seif Hashish Project: HashCortX Summary: Four model calls became one. Structure, Surface and Detail each appended parts to the design the first call produced, and nothing owned the silhouette — so they did not refine a model, they grew a pile. Three extra calls, three more chances to meet a free-tier limit, and a worse object at the end. What they were reaching for is measured in code now, and Improve covers the case where a person looks at the result and wants another pass. The prompt asked for "24 to 56 nodes, or 38 to 86 for complex objects". That one line is why a fish arrived as eighteen shards: nothing in the request rewarded a part count that reads correctly, it rewarded volume. It now asks for few parts that read correctly, six to sixteen for most objects, and a part only when its absence would be noticed. The rest of that message went the same way. Paragraphs prescribing how to build a phone, an animal, a spoon, a human figure and a skeleton competed for attention in one system message; they are replaced by which shape describes which form — extrude for a silhouette, lathe for anything turned, capsule for rounded tubes. Symmetry is delegated: build one side, mark it mirrored, and the app produces the opposite exactly. Audit markers are forbidden rather than requested, because the app measures clearance and floor contact itself. Removing the pipeline left the partial-run reporting unreachable and two role helpers with no callers; all three are deleted rather than left to read as working code. Five checks pinned the old multi-agent failure path — they now pin the property that still matters, that a failed run never reports success, plus the absences, so a pass coming back is a decision rather than a drift. Verification: - Drove the real app: Forge mounts, the agent panel is one card, the viewport initialises with the floor at zero. - npm run check — 1,434 passed, 0 failed (forge checks 14 → 22) - cargo test --manifest-path src-tauri/Cargo.toml — 93 passed, 0 failed (no Rust changed) - Not yet exercised against a live provider run
1 parent 183d70d commit 42f93fc

3 files changed

Lines changed: 91 additions & 157 deletions

File tree

scripts/checks/app-size.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ const LINE_BUDGET = {
9090
// floor contact and unrenderable parts are settled in code before anything
9191
// is drawn, and the Audit Agent that used to be asked for them — and that
9292
// added marker geometry of its own — is gone from the pipeline.
93-
'modes/forge/mode.js': 3872,
93+
'modes/forge/mode.js': 3777,
9494
'modes/agent-maker/mode.js': 2980,
9595
'modes/finance/mode.js': 2705,
9696
'modes/code/mode.js': 2715,

scripts/checks/forge.mjs

Lines changed: 42 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -74,20 +74,49 @@ console.log('\nLosing the drawing context is survivable:');
7474
check('the render loop itself checks too', /!mounted \|\| contextLost/.test(src));
7575
}
7676

77-
console.log('\nA run that lost an agent does not report success:');
77+
console.log('\nA run that failed does not report success:');
7878
{
79-
// The failure path must not mark the agent done. This is the line that made
80-
// a partial model indistinguishable from a finished one.
81-
check('a failed agent is marked failed, not done',
82-
/catch \(err\) \{[\s\S]{0,600}setAgentState\(role, "failed"\)/.test(src));
83-
check('failures are collected', /failedRoles\.push\(/.test(src));
84-
check('the closing message reports them', /failedRoles\.length/.test(src));
85-
check('"Forge complete" is only said when nothing failed',
86-
/failedRoles\.length\)[\s\S]{0,700}Forge complete/.test(src),
87-
'the success line must sit in the branch where no agent failed');
88-
// Which pass is missing decides what the user does next: the surface pass is
89-
// what shapes the silhouette, so losing it is not a detail.
90-
check('the message names which agents did not run', /failedRoles\.join\(/.test(src));
79+
// The property these used to hold — a partial run must not read as a
80+
// finished one — still matters; what can be partial has changed. There is no
81+
// three-pass pipeline to lose a pass from any more, so the equivalent is that
82+
// the one design call failing ends the run as failed and says so.
83+
check('a design that fails ends the run',
84+
/failForgeRun\("Parameter Agent", "Model generation failed/.test(src) ||
85+
/failForgeRun\([\s\S]{0,120}generation failed/i.test(src),
86+
'the design call must route into failForgeRun, not fall through to the success line');
87+
check('a plan that produced nothing ends the run',
88+
/failForgeRun\([\s\S]{0,160}No model plan was produced/.test(src));
89+
check('"Forge complete" is not claimed for an empty scene',
90+
/partCount = renderableNodes\(plan\.nodes\)\.length/.test(src),
91+
'the closing message must count what actually reached the viewport');
92+
93+
// The appending passes are gone on purpose. If one comes back, it should be a
94+
// decision rather than a drift, so their absence is pinned.
95+
check('the three appending passes stay gone',
96+
!/ROLE_PIPELINE/.test(src) && !/askRoleAgentWithFailover/.test(src),
97+
'Structure, Surface and Detail grew a pile rather than refining a model');
98+
check('the Audit Agent stays gone', !/id: "audit"/.test(src));
99+
}
100+
101+
console.log('\nThe measurements are done in code, not asked of a model:');
102+
{
103+
check('the deterministic stage runs before anything is drawn',
104+
/assembleDeterministically\(plan\)[\s\S]{0,200}buildPlan\(plan\)/.test(src));
105+
check('it reports what it corrected', /log\("Assemble"/.test(src));
106+
check('it never hands back an empty scene',
107+
/if \(!out\.parts\.length\)[\s\S]{0,220}return plan;/.test(src));
108+
check('one floor height, read from the constant',
109+
/const FLOOR_Y = 0;/.test(src) && /grid\.position\.y = FLOOR_Y/.test(src) && /floor\.position\.y = FLOOR_Y/.test(src));
110+
}
111+
112+
console.log('\nThe design prompt asks for a model, not a part count:');
113+
{
114+
check('no node-count demand', !/\b24 to 56\b|\b38 to 86\b/.test(src),
115+
'asking for dozens of parts is what produced a pile of shards');
116+
check('symmetry is delegated to the app', /"mirror": true/.test(src));
117+
check('audit markers are forbidden rather than requested',
118+
/Do not add audit markers/.test(src));
119+
check('few parts that read correctly is stated', /FEW PARTS THAT READ CORRECTLY/.test(src));
91120
}
92121

93122
console.log(`\n${pass} passed, ${fail} failed (src/modes/forge/mode.js)`);

0 commit comments

Comments
 (0)