Skip to content

fix(desktop): grade a computer-app task only once the app's files have settled - #9105

Closed
earakely-scale wants to merge 294 commits into
morluto:mainfrom
earakely-scale:feat/desktop-verify-after-settle
Closed

earakely-scale wants to merge 294 commits into
morluto:mainfrom
earakely-scale:feat/desktop-verify-after-settle

Conversation

@earakely-scale

@earakely-scale earakely-scale commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

The exported verifier and build witness wait for app files to settle before grading, preventing a delayed save from being judged too early.

Both paths use the shared settle policy and report whether the view settled; time-bound and incomplete-read outcomes remain visible.

Stacked on #9091.

Maintainer follow-up and validation

Propagated the owning #9089 file-URL seed-path repair and #9058 scratch-export guidance correction. Previously validated format, selection and cleanup fixes remain included. Local file URLs now reopen the selected exported seed path while preserving their URL suffix and unchanged encoded segments.

At head 66914934bb, the affected tests below completed with 116 passed (116); npm run check:fast and git diff --check passed. This includes the updated parent stack and main through 25d3c7237f. Checks use source/domain and controlled boundary fixtures; no real desktop provider qualification was performed. Current-head CI and review remain required before auto-merge.

node node_modules/vitest/vitest.mjs run src/domain/desktop/seedDocument.test.ts src/application/desktop/DesktopExportLaunch.test.ts src/domain/desktop/appTaskDraft.test.ts src/domain/desktop/appTaskDraftValues.test.ts tests/boundary/mcp/buildCaptureMcp.test.ts src/application/desktop/DesktopTaskDraftNotes.test.ts src/domain/desktop/stateRoles.test.ts

Maintainer follow-up

Integrated one-time seed path mapping and simplified whole-text check ownership, removing unused child arguments after joined numeric checks superseded them. Whole-note equality rejects substituted or negated list items; sibling checks remain distinct.

At head adcc1c7ff7, the affected tests below completed with 120 passed (120); npm run check:fast, npm run format:check and git diff --check passed. This includes the updated parent stack and main through 25d3c7237f. Checks use source/domain and controlled boundary fixtures; no real desktop provider qualification was performed. Current-head CI and review remain required before auto-merge.

node node_modules/vitest/vitest.mjs run src/domain/desktop/seedDocument.test.ts src/application/desktop/DesktopExportLaunch.test.ts src/domain/desktop/appTaskDraft.test.ts src/domain/desktop/appTaskDraftValues.test.ts tests/boundary/mcp/buildCaptureMcp.test.ts src/application/desktop/DesktopTaskDraftNotes.test.ts src/domain/desktop/stateRoles.test.ts

Author readiness

Human owner: @earakely-scale

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@greptile-apps

greptile-apps Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5 Tier: plus

[High impact] The PR changes the full desktop-app task build path, from capture through export and grading.

The PR needs the two explicit repository requirements addressed before merging.

Findings

  1. P2 Selected files lose checks ▶
  2. P2 Large tasks lose recovery ▶
Fix with agent prompt
### Issue 1
src/domain/desktop/stateRoles.ts:163-168
Explicitly selecting both `Documents/report` and `Documents/report-journal` still removes the second file from `selectedRoots`. `sqliteSidecarRoots` guesses that it is a database log from its name and protects only selected directories. When both ordinary documents change, `report-journal` becomes `application_state`, so the draft skips its checks and values.

Preserve explicit file selections before inferring sidecars. `AGENTS.md` requires preserving caller-selected paths and using format-aware facts. This requirement must be satisfied before merging.

### Issue 2
src/desktop/BuildComputerController.ts:96-100
The new command-size guard throws a plain `Error` for an expected transport limit. A valid task with a large prompt can reach it because `desktopTaskSchema` has no prompt-size limit. `exportBuild` then wraps the refusal as `ProviderAdapterError`, losing structured limits and useful recovery.

`AGENTS.md` requires expected failures to use the tagged error algebra and `Result`. Return `AnalysisResourceConstraintError` with the measured size, allowed size and recovery. This requirement must be satisfied before merging.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

The verifier and build witness now wait for app files to stop changing before grading. Both preserve whether the read settled or hit its time bound.

  • Task checks wait for app files to stay unchanged before grading.
  • Build captures can name app files and settings, then show how the export uses them.
  • Task drafts show changed values and offer checks for edits and unchanged nearby content.
  • Build-capture tools return more detail about launch failures and bounded command output.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Start grading] --> B[Read app data]
  B --> C[Compare file digests]
  C --> D{Unchanged for quiet window?}
  D -- Yes --> E[Grade completed read: settled true]
  D -- No --> F{Time remains?}
  F -- Yes --> B
  F -- No --> G[Grade last completed read: settled false]
  B -- Later read reaches deadline --> H[Keep last completed read: read_cut true]
  H --> G
Loading

Reviews (41) · Last reviewed commit: "Merge remote-tracking branch 'live-5600/..." · Reviewed by Greptile

Comment thread src/domain/desktop/appExportUnowned.ts Resolved
Comment thread src/domain/desktop/desktopCapture.ts Resolved
Comment thread src/domain/desktop/positionalKeys.ts Resolved
Comment thread src/domain/desktop/appTaskDraftText.ts Resolved
Comment thread src/domain/desktop/appTaskDraftNoise.ts Resolved
earakely-scale and others added 3 commits November 6, 2026 00:20
…d records, and leave renumbered ids out of absent checks

- A date written in parts is a timestamp only when its tag, or one it sits
  in, names bookkeeping (cdate, mdate, created, modified, updated, saved,
  changed, accessed, timestamp); a birthday the user enters is an edit.
- An element holding a run of text (span, a, s, c, tspan, b, i, em,
  strong, r, t, link and the like) is text, not a record, so a new
  paragraph of runs keeps its whole-text check.
- A record removed whole that only its position names still gets its
  list's whole-text check, the one check that shows it is gone.
- A renamed element's old identifier gets an absent check only when the
  change is not renumbering noise.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
earakely-scale added a commit to earakely-scale/rea that referenced this pull request Nov 6, 2026
earakely-scale added a commit to earakely-scale/rea that referenced this pull request Nov 6, 2026
…, not by its fields' tags

An element holding only elements is a record, whatever its fields are
called and however often a tag repeats, unless its own tag names a
paragraph or piece of text (p, text:p, text:h, h1-h6, li, para, SVG's
text and tspan, a span or a holding runs) or a child's text opens or
closes with whitespace, as a sentence split into runs does. Records of
repeated <field> children, or with a field called link or code, get their
per-field checks again; Writer, AbiWord and SVG paragraphs of runs keep
their whole-text check.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Comment thread src/domain/desktop/appTaskDraftText.ts Resolved
earakely-scale and others added 7 commits November 6, 2026 00:50
… fails

Once data/reset and the ready wait succeed, act_on_build_computer's reset
is applied in the action log and returns success; a screenshot asked of it
that is then refused or throws is named in the result's screenshot_error,
with no frame, so the next after_reset stage is not refused. Cancellation
still propagates.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
earakely-scale added a commit to earakely-scale/rea that referenced this pull request Nov 6, 2026
earakely-scale added a commit to earakely-scale/rea that referenced this pull request Nov 6, 2026
Comment thread src/domain/desktop/appTaskDraftText.ts Resolved
# Conflicts:
#	src/domain/desktop/seedDocument.ts
# Conflicts:
#	src/domain/desktop/appTaskDraftText.ts
#	src/domain/desktop/appTaskDraftTextAdded.test.ts
#	src/domain/desktop/appTaskDraftTextAdded.ts
Comment thread src/domain/desktop/seedDocument.ts Resolved
Comment thread src/domain/desktop/appTaskDraftText.ts Resolved
# Conflicts:
#	src/domain/desktop/seedDocument.ts
# Conflicts:
#	src/domain/desktop/appTaskDraftText.ts
# Conflicts:
#	.agents/skills/reverse-engineer-anything/references/desktop-build.md
#	docs/desktop-build-witness.md
#	docs/specs/desktop-app-environments/build-witness/verification.md
#	src/application/desktop/DesktopApplicationExport.test.ts
#	src/application/desktop/DesktopApplicationExport.ts
#	src/application/desktop/DesktopBuildCapture.ts
#	src/application/desktop/DesktopExportLaunch.ts
#	src/domain/desktop/appExport.test.ts
#	src/domain/desktop/appExport.ts
#	src/domain/desktop/seedDocument.test.ts
#	src/domain/desktop/seedDocument.ts
#	tests/boundary/mcp/buildCaptureMcp.test.ts
#	tests/fixtures/fakeBuildComputerRea.ts
Comment thread src/domain/desktop/stateRoles.ts Resolved
Comment thread src/desktop/BuildComputerController.ts Resolved
@morluto

morluto commented Nov 9, 2026

Copy link
Copy Markdown
Owner

Closing as superseded: the desktop settle and related fixes are included in #9111, which has merged. The resolved branch has no remaining diff against current main.

@morluto morluto closed this Nov 9, 2026
@morluto morluto added bug Something isn't working area: runtime Process capture and runtime observation labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: runtime Process capture and runtime observation bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants