Skip to content

fix(desktop): find ids in archive entries and draft nothing for a state directory's lock - #9210

Merged
morluto merged 721 commits into
morluto:mainfrom
earakely-scale:fix/desktop-root-array-additions
Nov 9, 2026
Merged

morluto merged 721 commits into
morluto:mainfrom
earakely-scale:fix/desktop-root-array-additions

Conversation

@earakely-scale

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

Copy link
Copy Markdown
Contributor

Stacked on #9185. Once #9185 merges, the diff is 9 files, about 160 lines, about 130 of them tests.

Summary

Two draft gaps that a review of the stack found:

  • ids inside an archive view's entries were never found, so a zipped model's copied type lost its check;
  • the draft decided which files to leave out without the export's state directories, so it drafted checks on a lock that sits directly in a state directory, which the export leaves out of the seed.

This PR first kept a check for a record added whole to a top-level array. #9185 now covers that with its root-array count (eea99c7c7) and keeps the witness of an unreadable reset undecided, so merging #9185 in dropped both fixes from this PR along with their tests.

Problem and expected behavior

  • Archive ids. A UML model zipped as library.xmi had its new attribute's type id skipped, because idsIn walked children and records but not the archive's entries array. The draft now suggests the attribute's type value and the attribute count; both fail at the seed and pass at the end.
  • State-directory lock. .config/notes/sync.lock changed between the ends. The export leaves it out of the seed, but the draft drafted lines_present/lines_absent checks on it, which would fail on any rebuilt seed. It now drafts nothing for that lock.

Change and scope

Contract and boundary impact

  • Semantic owner and earliest changed stage: the task draft's JSON suggestions.
  • Contribution scope fit and linked maintainer decision: same approved desktop-environments work as feat(desktop): capture a Linux desktop application in use #8874.
  • CLI and MCP/tool-catalog contract: none.
  • Provider, bridge, target-format, or platform compatibility: none.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact: none.

Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

  • npx oxfmt --check .: passed.
  • oxlint on the changed files: the same max-lines warning on appExport.ts as feat(desktop): name a record by a nested field or a child's attribute #9185 has; nothing new.
  • npm run typecheck: no errors outside the API-contract files, which fail only on a dependency missing locally.
  • vitest over the desktop folders: 929 passed, 12 skipped.
  • Merges cleanly into main.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: not applicable.

Maintainer follow-up

Integrated parent repairs for JSON/archive selector formats, joined text coverage, numeric seed comparisons, retained caller path spelling and nested aliases. TypeScript and generated Python checks agree. The previously failing contract-presentation CI test is rerun through its artifact-aware focused command; no timeout was raised. Nested timestamp omissions now preserve text boundaries through recursion, so generated checks pass the captured end without joining across omitted text; redundant test copies are removed. Additional checks passed: npm run test:focused -- tests/boundary/mcp/contractPresentation.test.ts.

At head 3a7fc5ed9e, the affected tests below completed with 307 passed (307); 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 tests/boundary/providers/desktopTaskPython.test.ts src/application/desktop/DesktopTaskExport.test.ts src/application/desktop/DesktopTaskDraftNotes.test.ts src/domain/desktop/stateRoles.test.ts src/domain/desktop/appTaskDraft.test.ts src/domain/desktop/appTaskDraftAdded.test.ts src/domain/desktop/appTaskDraftAttributeText.test.ts src/domain/desktop/appTaskDraftCounts.test.ts src/domain/desktop/appTaskDraftFileNotes.test.ts src/domain/desktop/appTaskDraftGuards.test.ts src/domain/desktop/appTaskDraftItems.test.ts src/domain/desktop/appTaskDraftJson.test.ts src/domain/desktop/appTaskDraftLineGuards.test.ts src/domain/desktop/appTaskDraftModel.test.ts src/domain/desktop/appTaskDraftNoise.test.ts src/domain/desktop/appTaskDraftPositional.test.ts src/domain/desktop/appTaskDraftTextAdded.test.ts src/domain/desktop/appTaskDraftValues.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.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🤖 Generated with Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-07T00:02:40.252637Z
We couldn’t complete this review. Comment @codex review to try again.
53bd8f8 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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 7, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 3/5 Tier: plus

[High impact] The PR reaches the desktop build, capture, export, and witness workflows.

Fix the plain-text grading gap and the custom-path setup loop before merging.

Findings

  1. P1 Wrong numbers pass grading ▶
  2. P1 Custom paths keep setup failing ▶
Fix with agent prompt
### Issue 1
src/domain/desktop/appTaskDraftLineGuards.ts:143-150
Adding the ordinary Markdown line `Set created=2025550123 and save` makes `volatileAt` treat the requested number as generated metadata. The draft suggests only `line_count` with `contains: "Set created="`, so `Set created=WRONG and save` passes too. `lineCounts` adds no exact check for a newly added line, so authors who copy the suggestions can export a task that accepts the wrong answer.

Only strip generated values when the file's format establishes that they are metadata. Keep ordinary prose exact.

### Issue 2
src/application/DesktopBuildDoctor.ts:355-357
A valid custom `REA_BUILD_COMPUTER_REA_ARCHIVE` or `REA_DOCKER_COMMAND` already recorded by a client fails this check whenever it differs from the terminal's default. The suggested repair cannot clear the failure: `rea setup --desktop-build` deliberately preserves those recorded values, then runs this same check again and returns `needs_human`.

Check the client's recorded paths where possible. Distinguish an unverified custom path from a broken one instead of requiring it to equal the terminal's path.

---

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

Summary

This PR combines stacked changes to desktop capture, task drafts, exports, grading, and host setup.

  • Desktop build requests can set up a host and check whether it is ready.
  • Desktop captures record selected paths and name the files that changed.
  • Task drafts show changed values and checks for more app data.
  • Exports leave out live locks and let witness runs grade settled app state.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Capture[Capture app and checkpoints] --> Views[Read typed file views]
  Views --> Draft[Suggest checks and guards]
  Views --> Export[Choose seed files and exclusions]
  Draft --> Task[Author task]
  Task --> Export
  Export --> Bundle[Write desktop bundle]
  Bundle --> Grade[Read files until they settle]
  Grade --> Witness[Grade task and record witness]
Loading

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

Comment thread src/domain/desktop/appTaskDraft.ts Resolved
Comment thread src/domain/desktop/buildWitness.ts Resolved
Comment thread src/domain/desktop/appTaskDraftAdded.ts Resolved
Comment thread src/domain/desktop/appTaskDraft.ts Resolved
@earakely-scale earakely-scale changed the title fix(desktop): keep one check for a record added whole whose fields are all defaults fix(desktop): keep a check for every record added whole, and close three gaps a review found Nov 7, 2026
Comment thread src/domain/desktop/appTaskDraftAdded.ts Resolved
@earakely-scale

Copy link
Copy Markdown
Contributor Author

@morluto this one is ready for review. It merges cleanly into main. It's stacked on #9185.

It makes sure a record added whole keeps at least one suggested check, and it fixes three gaps a review of the stack found:

  • the witness's reset stage could hold while a check the seed decided was no longer readable;
  • ids inside a zipped document's entries were never found;
  • the draft left out logs without the export's own selections.

The last run's only failure is unrelated: a Ghidra lineage test in shard 2 (reports failure-path lineage … wrong xrefs: true) took 25 s and the shard then hit its time limit. The previous run on this branch passed every check, and no desktop test runs in that shard. Could you rerun the failed jobs? I can't without admin rights.

# Conflicts:
#	src/domain/desktop/appTaskDraftNoise.test.ts
# Conflicts:
#	src/application/desktop/DesktopApplicationExport.ts
#	src/application/desktop/DesktopBuildComputers.ts
#	src/desktop/AgentEnvComputer.ts
#	src/domain/desktop/stateRoles.ts
# Conflicts:
#	docs/desktop-application-tasks.md
#	docs/desktop-build-witness.md
#	docs/specs/desktop-app-environments/build-witness/spec.md
#	src/domain/desktop/appTaskDraftNamed.ts
#	src/domain/desktop/appTaskDraftNoise.ts
#	src/domain/desktop/appTaskDraftValues.test.ts
# Conflicts:
#	src/domain/desktop/appTaskDraftNamed.ts
#	src/domain/desktop/appTaskDraftNoise.ts
Comment thread src/desktop/DesktopBuildDoctorFacts.ts Resolved
# Conflicts:
#	src/application/Setup.ts
#	src/composition/capabilityServices.ts
#	src/doctorRuntime.ts
# Conflicts:
#	.agents/skills/reverse-engineer-anything/references/desktop-build.md
#	docs/desktop-application-capture.md
#	docs/desktop-application-export.md
#	docs/desktop-application-state.md
#	docs/desktop-application-tasks.md
#	docs/desktop-build-computer.md
#	docs/desktop-build-witness.md
#	docs/specs/desktop-app-environments/build-witness/spec.md
#	docs/specs/desktop-app-environments/build-witness/verification.md
#	src/application/desktop/DesktopApplicationCapture.ts
#	src/application/desktop/DesktopApplicationExport.test.ts
#	src/application/desktop/DesktopApplicationExport.ts
#	src/application/desktop/DesktopBuildBundle.ts
#	src/application/desktop/DesktopBuildCapture.ts
#	src/application/desktop/DesktopBuildComputers.ts
#	src/application/desktop/DesktopBuildOutputRead.test.ts
#	src/application/desktop/DesktopBuildSummary.ts
#	src/application/desktop/DesktopBuildWitness.test.ts
#	src/application/desktop/DesktopExportFiles.ts
#	src/application/desktop/DesktopExportLaunch.ts
#	src/application/desktop/DesktopGzipDocument.test.ts
#	src/application/desktop/DesktopTaskDraft.ts
#	src/application/desktop/DesktopTaskDraftNotes.test.ts
#	src/application/desktop/DesktopTaskExport.test.ts
#	src/composition/capabilityServices.ts
#	src/contracts/desktopBuildToolContracts.ts
#	src/desktop/DesktopApplicationSession.test.ts
#	src/domain/desktop/appExport.test.ts
#	src/domain/desktop/appExport.ts
#	src/domain/desktop/appExportPython.ts
#	src/domain/desktop/appExportUnowned.test.ts
#	src/domain/desktop/appExportUnowned.ts
#	src/domain/desktop/appTaskChecks.fixture.ts
#	src/domain/desktop/appTaskChecks.ts
#	src/domain/desktop/appTaskDraft.fixture.ts
#	src/domain/desktop/appTaskDraft.ts
#	src/domain/desktop/appTaskDraftAdded.test.ts
#	src/domain/desktop/appTaskDraftAdded.ts
#	src/domain/desktop/appTaskDraftFileNotes.test.ts
#	src/domain/desktop/appTaskDraftFileNotes.ts
#	src/domain/desktop/appTaskDraftGuards.test.ts
#	src/domain/desktop/appTaskDraftGuards.ts
#	src/domain/desktop/appTaskDraftLineGuards.ts
#	src/domain/desktop/appTaskDraftNamed.ts
#	src/domain/desktop/appTaskDraftNoise.test.ts
#	src/domain/desktop/appTaskDraftNoise.ts
#	src/domain/desktop/appTaskDraftNotes.ts
#	src/domain/desktop/appTaskDraftPositional.test.ts
#	src/domain/desktop/appTaskDraftScalars.ts
#	src/domain/desktop/appTaskDraftText.ts
#	src/domain/desktop/appTaskDraftTextAdded.test.ts
#	src/domain/desktop/appTaskDraftValues.test.ts
#	src/domain/desktop/appTaskDraftValues.ts
#	src/domain/desktop/appTaskPython.ts
#	src/domain/desktop/attributeRank.ts
#	src/domain/desktop/desktopCapture.test.ts
#	src/domain/desktop/desktopCapture.ts
#	src/domain/desktop/positionalKeys.ts
#	src/domain/desktop/runtimeFiles.ts
#	src/domain/desktop/seedDocument.test.ts
#	src/domain/desktop/seedScrub.ts
#	src/domain/desktop/selectorCandidates.ts
#	src/domain/desktop/stateChanges.ts
#	src/domain/desktop/stateFormats.ts
#	src/domain/desktop/stateRoles.test.ts
#	src/domain/desktop/stateRoles.ts
#	src/domain/desktop/viewPointer.test.ts
#	src/domain/desktop/viewPointer.ts
#	tests/boundary/mcp/buildCaptureDraftMcp.test.ts
#	tests/boundary/mcp/buildCaptureRetryMcp.test.ts
#	tests/boundary/mcp/buildComputerMcp.test.ts
#	tests/boundary/providers/desktopExportPython.test.ts
#	tests/fixtures/buildCaptureFakes.ts
#	tests/fixtures/buildComputerMcp.ts
# Conflicts:
#	docs/desktop-application-tasks.md
#	src/application/DesktopBuildDoctor.test.ts
#	src/application/DesktopBuildDoctor.ts
#	src/desktop/DesktopBuildDoctorFacts.test.ts
#	src/desktop/DesktopBuildDoctorFacts.ts
#	src/domain/desktop/appExport.ts
#	src/domain/desktop/appExportPython.ts
#	src/domain/desktop/appTaskChecks.fixture.ts
#	src/domain/desktop/appTaskDraft.fixture.ts
#	src/domain/desktop/appTaskDraftFileNotes.ts
#	src/domain/desktop/appTaskDraftLineGuards.test.ts
#	src/domain/desktop/appTaskDraftLineGuards.ts
#	src/domain/desktop/appTaskDraftModel.test.ts
#	src/domain/desktop/appTaskPythonPointer.ts
#	src/domain/desktop/stateFormats.ts
@morluto
morluto merged commit d71e35a into morluto:main Nov 9, 2026
4 checks passed
@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