Skip to content

Add the Factory — supervision for weak-model app builds - #397

Merged
zfoong merged 2 commits into
livingui-communication-protocolfrom
livingui-third-party-fix
Aug 4, 2026
Merged

Add the Factory — supervision for weak-model app builds#397
zfoong merged 2 commits into
livingui-communication-protocolfrom
livingui-third-party-fix

Conversation

@ahmad-ajmal

Copy link
Copy Markdown
Collaborator

Cheap AI models write good code but manage themselves badly. Across 26
recorded builds, every failure was bad self-management: retrying the same
dead end for half an hour, inventing explanations when error details were
missing, quietly downgrading "email me" into "log it", claiming success
right after its own test failed, or just stopping — with nothing noticing.
So the AI keeps doing all the coding, and a small plain program now does
all the managing.

  • New app/factory: a state machine that tracks each build in a small JSON
    file. It doesn't direct the work — on a clean build it only confirms the
    checkpoints and announces the result. It steps in only when something
    fails or stalls: it allows tries per problem, then stops
    with an honest report. Failures are turned into "defect cards": what
    broke, the exact error line as proof, and a command to reproduce it.
    A card can never contain a guess — proof or "unknown".
  • Every fix attempt is a fresh AI session that gets only the cards plus a
    short file of known-good code patterns to copy. All "ready" and "failed"
    messages to the user are written by the program from its records — the
    AI no longer reports on its own work.
  • Every error now carries its cause: compiler output, server responses,
    which URL failed and why, crash logs. The AI only invented explanations
    where the platform gave it nothing — so nothing gives it nothing anymore.
  • Apps use connected services (like Gmail) through one simple call that
    runs CraftBot's own tested code. Permissions are read from the app's
    code automatically; sending needs an explicit confirm; a "dry run" mode
    checks everything without sending. Apps never see the user's email
    address or passwords. The setup wizard now also offers ready-made
    marketplace apps before building from scratch.
  • The independent tester must cover every promised feature, flag data that
    looks fake (all zeros), and its verdict only counts if it parses cleanly.

Weak models write code well but manage themselves badly: 26 logged builds,
and every failure was self-management — churning on one dead end, fabricating
causes where evidence was blank, shrinking "email me" into "logs it",
announcing success after failed verification, or quitting unnoticed.
The model keeps the hands; this takes away the clipboard.

- app/factory: stdlib-pure Machine (persisted arc, 3×/12 retry caps,
  escalation, redispatch-on-surrender, honest stuck reports), defect cards
  (cause = quoted evidence or "unknown" — theories unrepresentable), build
  graph as a pure transition (only a parsed PASS reaches done), distiller,
  cookbooks (one generic callAction pattern + dry-run param discovery, email
  as the proven worked example), CraftBot host adapter; layering lint +
  3 test suites incl. replays of two real incidents.
- Fix missions are fresh runs carrying cards; ready/stuck messages are
  machine-composed — agent-authored status is retired.
- Evidence everywhere the platform was silent: gate stderr, response bodies,
  refused-request URLs, boot-log excerpts, handler exceptions, migrate-hang
  kills, pre-boot migration-rename check, CLI error.cause unwrapping.
- Integrations: bridge action endpoint runs CraftBot's own implementations
  (send_gmail, semantic params), grants derived from code by the gate,
  irreversible-confirm + dry-run; omitted `to` = account owner — apps never
  hold identity. Wizard offers marketplace matches; capability map injected.
- Verifier: full spec coverage required, value plausibility, fail-closed
  verdict parsing.
@ahmad-ajmal ahmad-ajmal self-assigned this Aug 3, 2026
@ahmad-ajmal
ahmad-ajmal requested a review from zfoong August 3, 2026 10:44
@ahmad-ajmal ahmad-ajmal changed the title Add the Factory — deterministic supervision for weak-model app builds Add the Factory — supervision for weak-model app builds Aug 3, 2026
@zfoong

zfoong commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Despite having hard-coded filters and pattern-matching patterns, those are only activated when with bad model. However, a solution like this will miss many edge cases and unforesee situation. We will have to revise in the future.

@zfoong
zfoong merged commit cf8d246 into livingui-redesign Aug 4, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants