Scope saved work sessions to the account and instance (#157 step 2b-iv) #317
Loading…
Reference in a new issue
No description provided.
Delete branch "fj-157-work-sessions"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Step 2b-iv of #157: a saved work session now belongs to one host, account and Fjord instance, so
fj work resumeandfj work continuecannot show or advance another account's snapshot. Lead decision: refuse on a mismatch.Behavior
fj work contextresolves its destination once (--host, else the clone host routed through the selected account, else the configured default or sole host;-Rignores the clone host, as the other repo commands do). That one target feeds the account display, the API client, the saved host and the saved identity.identity, none for the legacy default) and whether it was saved with-R. No login name is written to disk or printed.resumeandcontinue(and their--dry-run) compare the digest before showing or writing anything and refuse with "the saved work session belongs to a different account or instance ... Runfj work context".continuefollows how the session was saved (-Ror not).Failure paths (STANDARDS)
continue --dry-run, A still advances; legacy valid only for legacy; clone host differs from default host;-Rwithcontinueand--jsonhost; sole host withoutcurrent; old JSON parses; no login name in session or error.Known limits, not fixed here
continuefollowing-R) was not re-reviewed locally; gerri reviews the PR.work contextawaits API reads can save the old data under the new digest (same family as CLS-1264). The race window is the API reads; carrying one resolved target through gather and save would narrow it but not close it without a config generation check.continuefor a session saved with-Rfollows the saved flag; resuming one without-Rresolves from the clone host and may refuse. Pass-Ragain.src/cli/pr_line_comment.rs:65(newer toolchain); CI pins 1.95. Size: 377 gross lines (cap 500).Automated Codex review (read-only) of head
3b9b985393.src/cli/work.rs:513: Invariant: gathered data and persisted identity must describe the same target (STANDARDS 7, 17). As acknowledged under “Known limits,” context resolves identity again after API reads. Another process switching the default account or instance during those reads can save the previous target’s snapshot under the new identity, allowing the new account to resume it. Both resume modes and continue modes trust that persisted digest. Carry the resolved target through gathering and saving, and check a configuration generation before persistence. This remains an accepted follow-up.No additional confirmed correctness or security findings. Review used read-only inspection; tests were not run.
BLOCKING: 0
Reviewed head
3b9b985393at 2026-11-11T17:14:43Z by codex exec (read-only sandbox).Automated Codex review (read-only) of head
d7652230df.src/cli/work.rs:513: Invariant: gathered data and persisted identity must describe the same target (STANDARDS 7, 17). As acknowledged under “Known limits,” another process switching the default account or instance during API reads can cause context to save the previous target’s snapshot under the new target’s digest. Subsequent resume or continue can then accept that mismatched snapshot. Carry the resolved target through gathering and saving, and reject persistence if its configuration generation changed. This remains an accepted follow-up, with no new evidence warranting escalation.No additional correctness or security findings.
BLOCKING: 0
Reviewed head
d7652230dfat 2026-11-11T17:21:15Z by codex exec (read-only sandbox).