Skip to content

factory: a page's history names the version the page holds (film D12) - #2658

Merged
santoshkumarradha merged 2 commits into
work/teamsfrom
d12/page-live-version
Nov 16, 2026
Merged

santoshkumarradha merged 2 commits into
work/teamsfrom
d12/page-live-version

Conversation

@santoshkumarradha

Copy link
Copy Markdown
Member

What

Film D12: while a page is edited live, the server agent's text is kept as the newest version, not applied (workstream_agent.go). The desk marked the highest version current and offers Restore only on non-current rows. So History called the agent's version current while the page didn't hold it, and the agent's "restore it from history" couldn't be followed.

  • GET /v1/workstreams/{id}/pages/{pid}/versions (and factory.org_workstream_page_versions) now answers live_version: the newest version the page held, meaning an idle or manual snapshot of the live document, or a restore. A client marks that version current, never the highest number. It is absent when no version the page held is kept.
  • Each version the agent kept and nobody has restored carries kept: true. Restoring it applies it, makes the restore live, and clears kept.
  • One rule, versionsWire in workstream_parts.go. The agent's kept reason is the named constant versionReasonKept ("agent"); the schema enum now lists it.
  • The agent's words match the desk: "…your text was not applied: it was kept as version N in the page's History, marked Kept · not applied; anyone who can edit the page opens History, chooses that version and presses Restore this version to apply it".
  • Manual: new section in internal/manual/chat/organization-workstream-agent.md.

Proof

  • TestServerAgentsKeptVersionIsNotTheLiveOneUntilRestored: idle v1, then the agent's kept v2, gives live_version 1 with v2 kept. Restoring v2 gives v3 (restored_from 2), live_version 3, nothing kept, and the page's words hold the agent's text. It also checks the agent's words.
  • TestPageVersionsNameTheLiveOneNeverTheHighest: table over empty, kept-only, kept above held, held above kept, and restored.
  • make pr-ready BASE=f9aeb9fe2.

Desk PR (marks current by live_version, "Kept · not applied", Restore): to follow.

🤖 Generated with Claude Code

santoshkumarradha and others added 2 commits November 16, 2026 00:54
The server agent's text on a page edited live is kept as the newest
version without being applied, so a client that called the highest
version current called a version the page does not hold current, and
offered no Restore on it. GET .../versions now answers live_version (the
newest version the page held: a snapshot of the live document or a
restore) and marks the agent's unapplied versions kept until a restore
names them. The agent's words now match what History shows: "Kept · not
applied", and Restore this version to apply it.

Assisted-by: CodeAF
Co-Authored-By: CodeAF <[email protected]>
Assisted-by: CodeAF
Co-Authored-By: CodeAF <[email protected]>
@santoshkumarradha
santoshkumarradha merged commit bc25bbb into work/teams Nov 16, 2026
1 check passed
@santoshkumarradha
santoshkumarradha deleted the d12/page-live-version branch November 16, 2026 05:58
ZeroPoint95 pushed a commit that referenced this pull request Nov 24, 2026
…#2658)

The server agent's text on a page edited live is kept as the newest
version without being applied, so a client that called the highest
version current called a version the page does not hold current, and
offered no Restore on it. GET .../versions now answers live_version (the
newest version the page held: a snapshot of the live document or a
restore) and marks the agent's unapplied versions kept until a restore
names them. The agent's words now match what History shows.

Assisted-by: CodeAF
Co-Authored-By: CodeAF <[email protected]>
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.

1 participant