The web.patch lifecycle¶
The PybuggyWebPatch pipeline changes existing browser UI tests on your request — small fixes
and improvements: a step sentence that no longer matches the page, a reworded expectation,
Prompt: bullets, a page-object method, a usage file, a removed or renamed test. The boundary
is drawn by intent, not by test color: web.automate writes new tests, patch
changes what you ask for. The run may start on red tests (the UI changed and the test went
stale — a typical reason to patch); every such test is pinned in a baseline and surfaced to
you, never masked.
Every stage but the commit is a goga skill (goga-tool-pybuggy-web-patch-*); the stages
exchange only the topic's artifacts. Every stage is a communication stage — the plan, the
applied changes, and the acceptance report are shown to you in full and approved before the
pipeline moves on.
Describe the requested change in the pipeline argument — what must change and, if you know it, which tests, pages, or methods it reaches.
Stages¶
| # | Stage | Purpose | Artifact |
|---|---|---|---|
| 1 | collect-requirements |
Intake (what to patch; the environment from web.yml), correlation with the CODEMANIFESTs / usages / pages/** / tests (draft changes, affected tests, discrepancies), a targeted live UI check of the changed places when needed, the pre-patch baseline of the affected tests, the agreed change plan |
patch-plan.md + patch-baseline-log.txt |
| 2 | apply-changes |
The manifest half (CODEMANIFEST, usages, page objects, stale cache deleted; goga lint / goga schema), then the test half: edit test_*.py, the generation run (the changed steps are regenerated) and the repeat run of every changed test, one run per dependent test — all without --strict-mode |
patch-apply.md + patch-runs-log.txt |
| 3 | accept-result |
Consistency of plan ↔ CODEMANIFEST ↔ test_*.py ↔ step cache, strict run of the changed tests plus every test affected through shared fixtures and page-object methods, failure triage with you, the verdict |
patch-accept.md + bugs.md |
| 4 | commit-changes |
Commit all added and modified files — reached only when acceptance passed | git commit |
The full flow: collect → apply → accept → commit, with the commit gated by the verdict (below).
Collect: the change plan¶
The stage is read-only over the tree — nothing is edited until the plan is approved.
- Intake reads the request, creates the topic (
goga history ensure), and fixes the run environment:site.base_urland the LLM facts verbatim from.goga/tools/pybuggy/web.yml, the base_url render arguments (only for a Jinja2 template), the browser endpoint for the live check and the runs ("from the config" or an address you enter — the same browser asweb.automateuses), and the site's authorization mechanism when the changes have a UI surface (its credential source only — secret values are never requested and never recorded). When the topic already carries arequirements.mdfrom an automate run, its §1 environment is reused after one confirmation. - Correlate resolves every target you named against the disk — the Routine in its cell's
CODEMANIFEST, the
test_*.py, the page-object module and method, the usage file, the sentence — and drafts the change listCH-<N>: the kind (sentences, prompt, data, signature, routine add/delete/move, page method, usage, header wiring, code-only, rename, cache regeneration), the exact «was → became», and the cache impact (which step-cache files become stale and who replays them). The affected-test set is built from actual calls on disk: the changed tests plus every test that calls a changed page method, uses a changed fixture, lives in a cell whose Header changed, depends on a changed usage, or replays a stale cache. Discrepancies between the request and the tree are listed (a target that does not resolve, a request contradicting the annotation, a shared page method with a wide blast radius); the blocking ones are asked right here. - Baseline: the affected tests run once before any change with the same strict command
the acceptance will use (
patch-baseline-log.txt). A red baseline is not a gate — it records which tests were already red so the acceptance can tell them apart from patch-caused failures. An unavailable environment is recorded asunavailable, not a stop. - Explore (when needed): changes with a UI surface — sentences, expectations, page methods,
a new page — are checked on the live site exactly as automate explores it: a
playwright-clisession attached at the browser endpoint (the pipeline's constraint supplies the Docker-aware attach command), the touched pages' elements by visible name, states and transient timings, and a walk of every changed or new sentence (actions executed, expectations compared verbatim). An infeasible or mismatching sentence is triaged with you while the session is open: the sentence or the expectation is corrected in the plan draft, the change is excluded, or — when the request is right and the page behaves differently — a service bug candidate is recorded inbugs.mdand the sentence stays in the plan as a contract. Changes without a UI surface (a usage file, a marker, a deletion) skip the check with a recorded decision. - Report assembles
patch-plan.md— the request, the environment verbatim, the changes with their final «was → became», the affected tests with their baseline colors, the UI findings, every discrepancy with your decision, and the build order — validates it against the DSL, and shows it in full for your approval.
Apply: manifests first, then tests¶
The defining rule of the line is that every change lives in the CODEMANIFEST and in the test code together; the two halves land in order inside one stage.
- Manifests: every delta of the plan is validated against the
goga-cellDSL before any file changes (annotation structure, signatures, backtick references, the base Header block untouched, no name collisions); then the CODEMANIFESTs, usage files (.goga/usages/cooks/ <key>.md,page-<name>.md) and page objects (pages/**) are edited exactly as planned, a new page object is scaffolded withgoga tool pybuggy page generate, the stale step-cache files of changed/removed sentences and the files of removed tests are deleted (the cache is never edited by hand), and the gates run:goga lint,goga schema tests/,pytest --collect-only. -
Tests: each changed
test_*.pyis edited from the plan (step sentences through the activated page's surface,@generation_prompt↔Prompt:,vars=, fixtures, parameterization), then runs twice, both times without--strict-mode: -
the generation run — the changed sentences turn into Playwright code via the LLM and land in the step cache; on a failure the log is parsed first (provider/generation error, cache-miss, execution failure), the step's cached code is read, and the live page is checked when the cause is not in the log; the fix is targeted — the sentence wording adapted to what the page has, the glue (fixtures, order,
vars, waits, the activation block) — with the stale cache file deleted and regenerated by the next run; up to 3 iterations per test; - the repeat run of the same test right after — a test green only once is not done.
A fix that preserves what a sentence checks is made autonomously and recorded («was →
became», synchronized into the annotation); a semantic deviation — a different
expectation, a weakened check, a dropped step — is asked: when you confirm it, the
CODEMANIFEST (and the page usage) moves together with the test. Dependent tests (affected
through a shared method, fixture, Header, or usage) run once. Nothing is skipped or
xfail-ed: an unfixable failure stays red and is recorded for the acceptance triage.
patch-apply.md reports both halves — what changed where, which cache files were deleted or
regenerated, every on-the-way fix, the semantic escalations, the unclosed tests — and is
approved by you before acceptance.
Accept: changed plus affected, strict, then the commit decision¶
- Scope: the artifacts of the cycle, the changed files (the apply report reconciled with
git status/git diff), and the acceptance scope — the changed tests plus every test affected through shared fixtures and page-object methods, re-derived from the calls on disk and cross-checked against the plan. The run command is strict — the generation runs already happened, so strict costs zero LLM calls and checks the cache is complete — with the browser endpoint suffix and the base_url render arguments from the plan. - Consistency (before the run): every change of the plan lives in the manifest and in the
code together; the on-the-way fixes are classified (a wording adaptation synchronized with
the annotation vs. a semantic drift); Routine → file → cache (each sentence has its cache
file, no orphan cache files by
STEP_TEXT, no files of removed tests); page methods ↔ thepage-<name>.mdusage ↔ the shared cache;Prompt:↔ decorators; page addressing by base_url-relative paths; no secrets, no locators, no skip masking. Findings are triaged with you one at a time. - Run: the scope in
--strict-mode(patch-accept-log.txt); every failure is triaged with you by category — patch defect (fixed here with your approval, the manifest moving together when needed; a stale cache is regenerated by one non-strict run; up to 2 iterations), pre-existing red (red in the baseline — surfaced, not repaired), service bug (a record inbugs.md, one per problem), environment (restored first), ambiguous (joint analysis; a new patch cycle if needed). - Report:
patch-accept.mdwith the verdict —ACCEPTED,ACCEPTED_WITH_NOTES,PARTIAL, orREJECTED.
The verdict gates the commit:
| Verdict | What happens next |
|---|---|
ACCEPTED |
the stage completes and commit-changes commits the patch |
ACCEPTED_WITH_NOTES |
you are asked whether to commit despite the recorded notes (service bugs, pre-existing reds, accepted findings); "no" stops the pipeline |
PARTIAL / REJECTED |
you are told what was not accepted; the pipeline stops before the commit — failing tests never land in a commit silently |
Artifacts¶
Every artifact is addressed with goga history path -f <artifact> and lives under
.goga/history/<year>/<topic>/ next to the automate artifacts of the same topic (the names are
distinct, so a patch of a topic built with web.automate overwrites nothing):
patch-plan.md # the agreed change plan: request, environment, CH-<N>, affected tests, UI findings, decisions
patch-baseline-log.txt # the affected tests' strict run before any change (collect)
patch-apply.md # the applied changes: manifests half, tests half (two runs each), cache, escalations
patch-runs-log.txt # the generation and repeat runs of apply
patch-accept.md # the acceptance report with the verdict and the commit decision
patch-accept-log.txt # the strict run of the acceptance scope
bugs.md # service bug candidates from the live UI check, records from the acceptance (shared)
playwright/ # session artifacts of the live UI check (screenshots/traces)
A repeated patch cycle in the same topic overwrites the chain — the latest cycle wins, the history stays in git.
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 of the apply stage whenever a sentence changed.
Topic status¶
The patch line registers three topic statuses — one chain anchored after the builtin
empty, read via goga history status:
| Artifact | Status |
|---|---|
patch-plan.md |
pybuggy.web.patch.planned |
patch-apply.md |
pybuggy.web.patch.applied |
patch-accept.md |
pybuggy.web.patch.accepted |
The commit-changes stage writes no artifact and gets no status. The line contributes no
autonomous window: every stage is interactive, and the commit is the only stage without a
skill of its own.
Relation to the rest¶
- Web / Overview — the
webfixture, step sentences, the cache, run modes. web.automate— writes the tests this line changes; itsrequirements.mdis reused for the environment and the page dossiers when present in the topic.web.fix— repairs what broke; patch changes what you ask for — the boundary is drawn by intent, not by test color.- Workflows — adjusting the pipeline with a
.goga/workflows/pybuggy:web.patch.ymlfile. - The
api.*line (api.automate, api.fix, api.patch) — the same context-handling principles for API tests.