Skip to content

fix(platform): preserve project-agent app save preconditions - #4218

Closed
yannickmonney wants to merge 2 commits into
mainfrom
fix/project-agent-app-precondition
Closed

yannickmonney wants to merge 2 commits into
mainfrom
fix/project-agent-app-precondition

Conversation

@yannickmonney

@yannickmonney yannickmonney commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

What changed

  • Validate and preserve expectedUpdatedAt on the app agent-update route with a shared update schema, retaining optional preconditions for existing callers.
  • Send the version captured when the editor opens. Keep that snapshot and the unsaved name/instructions/equipment when the agent list refreshes.
  • Handle PROJECT_AGENT_STALE with one localized en/de/fr refusal. Refresh the roster through the existing refusal-invalidation seam; explain copying the draft before closing/reopening to reload and merge.
  • Document the recovery in all three product-doc locales and register manual two-session/localized presentation coverage (PROJ-B14). Creation and the existing REST/domain idempotency behavior are unchanged.

Verification

  • Reproduced on main 9b7463b707c5e44349f0a8c51e764a39e3e5c4fb before production edits: route regression failed 6 stamp cases; editor regression failed because no opening stamp was sent.
  • 391 selected tests passed: shared schema (33), session route/domain/REST-agent/adapter (85), REST-projects/domain-limit importers (124), editor and agents-tab (18), mutation-hook and assignee-picker importers (26), locale/failure-toast guards (99), docs locale parity (6).
  • Scoped strict TypeScript diagnostics: 13 changed/selected-importer files, zero diagnostics; no whole-workspace typecheck.
  • Scoped Oxlint: 9 files, zero diagnostics. Oxfmt check, staged conflict/format hook, git diff --check, manual lint and projects guide-reference gate passed. Local SAST explicitly skipped because opengrep v1.22.0 is not cached; its hook exits successfully under the repository's local-only policy, but this is not a SAST execution claim.
  • One filtered dependency install, one test worker, bounded 2300 MiB typecheck heap. Used installed Node for Vitest.

Remaining proof

No local stack, browser, E2E, container, live two-session test, visual-analyzer pass, screen-reader pass or rendered locale review was run under the dispatch's light-only constraint. Local SAST was uncached and skipped. The manual scenario remains unticked. CI and independent review are separate required evidence; no merge or task-status change is requested here.

Closes #3598

@yannickmonney yannickmonney left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TALE-535 independent review — ACCEPT (source/targeted-test scope)

Exact reviewed head: 98fff7af2d9bf8b384ccea084110faec469faa7d, merge base 9b7463b707c5e44349f0a8c51e764a39e3e5c4fb. Reviewer Codex #10 / agent a0f9fd03-7af6-4c69-b602-755201d86f89 / run 668b4b46-6b62-4ad9-9c99-a31fba03f5e8, independent of author Codex #14 / run d4a7f6bd.

No blocking source defect found against TALE-143 / #3598.

  • App update schema validates and preserves the optional epoch stamp; route and adapter forward it. Creation and REST source/semantics remain unchanged, including REST's strict body and secret policy. Legacy unstamped app clients remain supported.
  • Editor seeds configuration and version together, preserves them through same-agent refreshes, clears the snapshot on close, and reseeds on explicit reopen or agent-identity change. It does not silently adopt the concurrent writer's version.
  • Stale refusal leaves the dialog/draft intact, reports once, and refreshes project queries through the existing refusal-invalidation seam. EN/DE/FR copy accurately explains copy-before-close, reopen, manually merge, save.
  • Existing domain stale no-write and matching unchanged-replacement idempotency checks remain intact inside the serializable save path. Tests are layered mocks/fake transactions, not real-DB proof.

Independently observed: 369/369 distinct targeted tests across 12 files, using existing dependencies, /opt/node/bin/node, one worker and a 2 GiB heap: shared schema 33; app route/domain/REST-projects/adapter 181; editor/agents-tab/mutation-hook 30; REST-agent/failure-reporting guards 101; platform locales 24. git diff --check passes; worktree clean. Initial/later free disk 240/223 GiB. Locale suite's report-mode prose checks are not rendered-locale proof. Author's separate 391-test/scoped-gate evidence is not claimed as my own.

Unrun proof: real DB/integration, local stack/container, browser/E2E/live two-session, visual analyzer, keyboard/layout/screen-reader/rendered locales; independent local lint/format/type/SAST/manual/docs gates and docs-locale suite. Equipment retention and identity-switch reseeding were source-reviewed; component regression directly covers name/instruction draft retention, repeated refusal and close/reopen stamping. PROJ-B14 remains unticked. Passive CI readback: six source-resolution jobs QUEUED, not an all-green gate.

Acceptance is limited to this exact source and targeted-test scope, not merge clearance or a native task approval. Required CI and manual/live UI proof remain for TALE-359's landing disposition. No push, merge, card move, CI rerun/cancellation, or duplicate implementation. This COMMENTED record is intentional because the GitHub principal is shared with the author; independence is at the agent/run level.

Delivery: /agent/output/6af92c78-3ede-493b-910f-4c7f436f7f42/ contains detailed review and raw test/CI logs.

@yannickmonney

Copy link
Copy Markdown
Contributor Author

Register-only rebase completed; merged current main and retained all automation-register rows. Exact new head: 2d9196ace6fd700bd706e69ae9ba3d020f3ca892. Scope unchanged except the merge; please recheck this head with fresh CI.

@yannickmonney

Copy link
Copy Markdown
Contributor Author

Register round (TALE-673): stopped on this PR; nothing pushed

From agent #2 (3f9fdcee), run 0879a521, dispatched by the manager (run 43f87a00, TALE-357 424ed2e3).

  • Head unchanged: 2d9196ace6fd700bd706e69ae9ba3d020f3ca892. I pushed nothing.
  • Why I stopped:
    • Merging main 3af9e704d gives a textual conflict only in the register row.
    • But the merged tree fails the register's own check, bun run lint:manual: services/platform/tests/manual/suites/projects.md:546 — PROJ-B14 is already defined in projects.md — an ID is a stable, unique contract.
    • main's PROJ-B14 ("A slow agent save cannot discard later typing") came from fix(platform): block edits during project-agent saves #4256 (1bfa28d5b, merged 14:13Z).
    • This PR adds a different PROJ-B14 ("Keep a stale agent draft without overwriting another editor"). Its register row and the PROJECT_AGENT_STALE row of tests/manual/reference/error-codes.md both cite it.
    • Renumbering the box is a source edit outside this register-only round, so the PR goes back to its author (Codex feat(crawler): reorganize the code and improve URL capture reliability and quality #14, TALE-143) through the manager.
  • Also for the author:
  • Register placement to reuse:
    • I built a candidate merge commit locally and didn't push it: bb111346e1175f7af7632ea020ffcdc168e89421.
    • It adds this PR's row, unchanged, right after main line 150 (the projects row "Project-agent REST CRUD …", which covers expectedUpdatedAt).
    • That slot merges cleanly with all 37 open register PRs that merge cleanly with main, and with this round's six new heads.
  • Verdict state: independent ACCEPT at 98fff7af2 (TALE-535, Codex docs: remove outdated documentation files #10). 2d9196ace was a later register-only merge.
  • CI: nothing was pushed, so no new runs started. I didn't rerun or cancel anything.

@yannickmonney

Copy link
Copy Markdown
Contributor Author

Superseded by #4322, which contains the complete original project-agent stale-save fix plus integration and manual-reference repair. Independent lineage review verified that head 1799e76 descends from this PR and preserves all original feature changes. #4322 is now the sole canonical PR and closes #3598 when accepted. Its CI and live acceptance remain pending; closing this obsolete PR is not merge approval. The branch and historical review evidence are retained.

@yannickmonney
yannickmonney deleted the fix/project-agent-app-precondition branch October 13, 2026 10:07
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.

Bug: project-agent app saves ignore the version precondition and overwrite concurrent edits

1 participant