Skip to content

refactor(proton): include lib's proton engine and drop its copies - #16

Merged
jshvn merged 3 commits into
mainfrom
josh/proton-engine
Oct 9, 2026
Merged

jshvn merged 3 commits into
mainfrom
josh/proton-engine

Conversation

@jshvn

@jshvn jshvn commented Oct 9, 2026

Copy link
Copy Markdown
Member

Consistency review C8: dropbox includes lib's proton engine (v2.6.0) instead of keeping line-for-line copies of its verbs.

  • Includes the engine with excludes: [pipeline, plan-pipeline, trash, empty-trash-pipeline, report-engine]. dropbox keeps its own pipeline, plan-pipeline, trash step, empty-trash-pipeline and report-engine no-op.
  • Deletes the copied pull/push, empty-trash, session-seal, session.restore, session.seal, _last_digest and their tests. Takes IMAGE from the engine (C2).
  • The write-back after every CLI call stays in-process. It compares against .run/session.sha, which the engine's session writes, so a phase no longer re-seals an unchanged session. A log line, "session: token rotated, sealing it back to the bucket", shows when a rotated token goes back.
  • New tests: the record is written only after a successful send (a failed send keeps the old record, so the next call sends again); a bundle that the write-back sends extracts with the engine's exact tar command.

Merge with the owner present (one Proton session; its refresh token rotates on every use). Then:

  1. gh workflow run sync.yml -R katoptra/dropbox -f vars=RECONCILE=false; check the log for "session: token rotated".
  2. When it passes, dispatch a second run the same way. It must pass too: that proves run 1 wrote the rotated session back.

Test plan

  • task test 162 passed; task lint clean; task check with render.txt accepted on v2.6.0 (only the session step moves)
  • Review (spec + safety): no path loses a rotated token that main keeps
  • Two supervised runs with RECONCILE=false

jshvn added 3 commits October 8, 2026 15:39
dropbox kept line-for-line copies of the proton engine's verbs. It now
includes engines/proton.yml beside the toolbox, with excludes: [pipeline,
plan-pipeline, trash, empty-trash-pipeline, report-engine]; its own trash
step and empty-trash-pipeline keep their names.

- Taskfile: delete session (python -m migrator session), pull, push,
  empty-trash and session-seal; the engine supplies each. Delete IMAGE on
  the toolbox include; the engine names proton-v2 (C2). The report-engine
  no-op stays, and the engine's is excluded (C6).
- session.py: delete restore, seal and _last_digest. writeback compares
  auth-session.json against .run/session.sha, which the engine's session
  writes at restore, and rewrites that file in sha256sum's format after
  each send. The re-seal at the first CLI call of each phase ends. The
  write-back after each CLI call stays in-process, and prints the line the
  engine's session-push prints when it sends a rotated token.
- commands and __main__: delete the session and session-seal commands.
- tests: the restore and seal tests go; new tests cover a rotation that
  reaches the bucket before the next CLI call, a missing digest, and
  interop with sha256sum and sha256sum -c.
- README, CLAUDE.md: the mirror includes the toolbox and the proton
  engine; session is a solid box in the diagram.

Needs lib v2.6.0 (the engine's IMAGE default): render.txt follows in a
render-update after the tag.
- A send that fails keeps the old .run/session.sha, so the next CLI call
  sends again. A writeback that writes the record before the send fails
  this test.
- A bundle from session._bundle opens with the engine's exact
  `tar -xf <bundle> auth-session.json clientUid.json && chmod 600`, both
  members byte for byte, mode 0600. Skipped where tar is missing; the
  image has it.
@jshvn
jshvn merged commit 307a773 into main Oct 9, 2026
1 check passed
@jshvn
jshvn deleted the josh/proton-engine branch October 9, 2026 01:12
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