The web.fix lifecycle¶
The staged pipeline repairs a failing browser-UI suite — from a failure report to reviewed,
passing tests. It is the counterpart of web.automate: once that lifecycle
has landed accepted step-sentence tests, web.fix picks them up when they break. Each stage
is a dedicated goga skill (goga-tool-pybuggy-web-fix-*); every stage except
execute-fix-plan is a communication stage that involves you. The failing steps are
checked on the live page before any cause is settled, and every fix keeps the sentence,
the CODEMANIFEST annotation, and the step cache in agreement.
Launch¶
Prerequisites: the web kind initialized (.goga/tools/pybuggy/web.yml, see
Web / Configuration) and failing web tests to work on. Describe
the failures in the pipeline argument (a pytest output, a CI log, screenshots) — or let the
pipeline run the suite locally for you and capture the output.
Stages¶
| # | Stage | Purpose | Artifact |
|---|---|---|---|
| 1 | collect-failures |
Fix the failure source (argument, or a local diagnostic run) and the run environment; extract every failure with its technical category | fix-log.txt + fix-collect.md |
| 2 | analyze-failures |
Build a per-failure dossier, walk the failing steps on the live UI, classify the cause with you | fix-analysis.md |
| 3 | create-fix-plan |
Group the classified failures into executable tasks FIX-<N> and approve the plan |
fix-plan.md |
| 4 | execute-fix-plan |
Run the tasks in class order, each with its own verification; final strict run of the topic's tests | fix-execute.md + fix-log-final.txt |
| 5 | review-fixes |
Verify the executed plan and the final run, triage findings with you, deliver the cycle verdict | fix-review.md |
| 6 | commit-changes |
Commit all added and modified files | git commit |
Collect: failures and the run environment¶
The stage never opens pages — the live check belongs to analysis. It fixes the run
environment for the whole cycle, verbatim from web.yml and your answers: the LLM facts
(provider, generation_model), the site.base_url with its render arguments (env
prefixes / CLI suffixes of the run command, only for a Jinja2 template), the browser
endpoint ("from the config" or an address you enter — --browser-endpoint for the runs),
and the site's authorization mechanism (its credential source only — secret values are
never requested and never recorded). The environment is written into the report's run
section; every later stage builds its commands from there.
The diagnostic run (when the argument carries no ready output) runs without
--strict-mode: strict would mask the real cause behind a cache-miss. A missing step
cache regenerates during the run, so the LLM provider key must be in env/.env. Loopback
browser addresses are rewritten for the Docker host, as in web.automate.
Every FAILED / ERROR / SKIPPED record is extracted with a technical category —
expectation-mismatch, execution-error, error-before-run, generation-error,
cache-miss, connection-env, skip-masking, other; a SKIPPED is a masked failure
and is handled like any other.
Analyze: evidence, the live page, and the cause class¶
- Diagnose builds the dossier per failure — the test, its Routine annotation contract
(Purpose /
Precondition:/Data:/Prompt:/Steps:verbatim), the page-object methods it calls — and five ordered evidences: the cache evidence (every failing sentence has its cache file — test or shared page-method scope — withSTEP_TEXTmatching the sentence verbatim; orphans named), the test ↔ Routine comparison (sentence literals, glue,Prompt:↔@generation_prompt), the log evidence, an isolated stability re-run, and the environment reachability. - Explore walks the failing steps on the live page — only for failures with a UI surface
(
expectation-mismatch,execution-error,cache-miss; the pre-run and connection categories have none and are skipped with a recorded decision). Aplaywright-clisession attached at the browser endpoint executes each failing sentence (and its precondition): does the addressed element exist, does the expectation match the page's real state, are the preceding steps passable. The facts come only from the live page; the tree is read, never modified; secrets and selectors never reach the artifacts. - Classify settles exactly one class per failure, with you:
ui-drift(the page changed — the sentence no longer matches it),app-bug(the test is right, the page violates the expectation),test-defect(the test distorts its Routine),case-defect(the annotation itself was wrong),cache-defect(the sentence is right, its cached code is missing or stale),environment(browser endpoint, site, LLM key, network). Theui-drift/case-defectboundary: ui-drift follows the page away from a correct annotation (the explore observation proves it); case-defect was wrong when written.
Plan and execute: class-driven tasks¶
The plan groups failures into tasks FIX-<N> — one cell plus one class is one task;
app-bug is one task per problem; environment one task per diagnosis; cache-defect one
task per cache source (deleting a shared page-method cache joins every calling test, even
from other cells). The execution order is normative: environment first, then
cache-defect, ui-drift, case-defect, test-defect, app-bug — the sentence-level
fixes land before the tests that follow them, the honest red of an app-bug lands last. Each
task names its exact edits — the «was → became» sentences verbatim, the cache files to
delete — and ends with its own verification; the next task starts only after it.
Execution dispatches each task to its class executor, 3 attempts per task (one executor call = one attempt = actions plus verification, never retried inside). The class actions:
| Class | Action |
|---|---|
environment |
restore the browser endpoint / site / LLM key / network per the diagnosis; re-run the affected tests |
cache-defect |
delete the named cache files (never edited by hand), then the generation run + the repeat run — both without --strict-mode |
ui-drift |
reword the sentence synchronously in the CODEMANIFEST Steps:, the test_*.py literal, and — for a method sentence — pages/** plus its page-<name>.md usage; delete the changed sentences' cache; two runs |
case-defect |
fix the Routine annotation first, then the test after it; delete the changed sentences' cache; two runs |
test-defect |
fix the test per its annotation — sentence literals verbatim, glue (fixtures, order, vars=, activation blocks), no pytest.skip/xfail; one run |
app-bug |
record a BUG-<topic>-<N> entry in the topic's bugs.md — one record per problem, listing every test it failed; the tests stay red |
After the tasks, the final strict run of all the topic's web cells replays the whole
suite with zero LLM calls and checks the cache is complete (fix-log-final.txt); its
failures are honest facts for the review, not fixed here.
Review: findings triage and the verdict¶
The review verifies the plan execution (every task done, its check passed), the quality of
every changed file (sentence literals ↔ annotations, DSL validity, page methods ↔ usages ↔
cache, Prompt: ↔ decorators, no secrets, no locators, no skip masking) and the regressions
against the collect report. Every finding and every failed task is triaged with you, one
at a time: a small local fix is applied on the spot, an accepted finding is recorded as a
risk, and anything beyond that feeds a rebuilt plan or a new fix cycle. The verdict —
FIXED, FIXED_WITH_NOTES, ITERATE, or FAILED — closes the cycle; ITERATE restarts
the loop from collect.
Artifacts¶
The cycle accumulates its chain in the topic's history directory — every path printed by
goga history path -f <artifact> (.goga/history/<year>/<topic>/; the topic is the current
git branch, ensured by the collect stage):
fix-log.txt # captured failure output (collect, diagnostic run)
fix-collect.md # failure report + the run environment of the cycle
fix-analysis.md # per-failure dossier, live-UI observations, classification
fix-plan.md # approved fix plan (tasks, order, checks)
fix-execute.md # execution report per task
fix-log-final.txt # final strict run output
fix-review.md # review findings, decisions, cycle verdict
bugs.md # app-bug records (shared with the other lines)
playwright/ # session artifacts of the live check (screenshots/traces)
Topic status¶
Every artifact of the cycle marks a status on the fix line of the goga topic status
scale — an independent chain anchored at the built-in empty, so it never reorders the
automate line:
| Artifact | Status |
|---|---|
fix-collect.md |
pybuggy.fix.collected |
fix-analysis.md |
pybuggy.fix.analyzed |
fix-plan.md |
pybuggy.fix.planned |
fix-execute.md |
pybuggy.fix.executed |
fix-review.md |
pybuggy.fix.reviewed |
The fix artifacts are shared, so the topic carries the one neutral fix line —
pybuggy.fix.* — regardless of which fix pipeline runs: one topic hosts one fix lifecycle
at a time, and the commit stage runs with no skill of its own. A topic mid-repair shows
one maximal status per line — e.g. [pybuggy.fix.analyzed] [done].
Environment¶
The same preconditions as web.automate: the web kind
initialized (.goga/tools/pybuggy/web.yml), an external browser at the browser endpoint for
the live check and the runs, playwright-cli for the check, and an LLM provider key in
env/.env — required by the generation runs whenever a sentence's cache is rebuilt.
Relation to the rest¶
- Web / Overview — the
webfixture, step sentences, the cache, run modes. web.automate— writes the tests this line repairs; its page objects, step cache, and run modes are the material every stage works on.api.fix— the API counterpart; the same collect → analyze → plan → execute → review cycle with the API's cause classes.web.patch— the line for changing accepted UI tests on request; fix repairs what broke, patch changes what you ask.- Workflows — adjusting the pipeline with a
.goga/workflows/pybuggy:web.fix.ymlfile.