Skip to content

refactor: adopt lib v2.6.0 and fix the walk token - #17

Merged
jshvn merged 9 commits into
mainfrom
josh/lib-v2.6.0
Oct 9, 2026
Merged

jshvn merged 9 commits into
mainfrom
josh/lib-v2.6.0

Conversation

@jshvn

@jshvn jshvn commented Oct 9, 2026

Copy link
Copy Markdown
Member

Consistency review, phase 4, for dropbox: C2, C7, C9, C12, C13, C14, C19, C20, C35, C74 (batch.py:261) and C78 (the comments of the Python, the Taskfile and config/mirror.toml in ASD-STE100).

  • Migrator: one run clock, lib's S3 client, a tool-only pyproject.
  • Walk: a rotated worker token stays when the walk raises or meets its deadline. The two new tests fail on the old code.
  • Taskfile: lib v2.6.0's check, image and toolbox. empty-trash-pipeline starts by name.
  • Workflows: check.yml and sync.yml pinned to lib v2.6.0. This supersedes chore(deps): bump the actions group with 2 updates #14.
  • render.txt does not change: it equals the render that C8 accepted.

Before the first run on a laptop with an older proton-v2 image: task image-clean.

Test plan

  • task offline: 165 tests, ruff clean
  • task check: render matches render.txt
  • Fact check of the comments by a second agent (566 facts); U1-U4 fixed
  • The comment commits leave the Python AST and each YAML, TOML and op.env value unchanged
  • The first scheduled run after the merge

jshvn added 9 commits October 8, 2026 17:33
…ject

- The migrator's clock reads the start epoch from .run/start.txt, which
  the toolbox's clock writes, so reconciled and the budget use one epoch.
  RUN_EPOCH, MIRROR_RUN_EPOCH and Runtime.run_epoch go, and so does the
  chain entry of clock's stale list: the toolbox's clock removes it.
  state-push without a label uses the current epoch (C13).
- The S3 client is lib's s3.py one-liner. boto3 reads the endpoint, the
  keys and the checksum settings from the environment, which op run and
  the image fill. The unset-secret checks stay. conftest puts the AWS_*
  test values in the environment, so no test asks the EC2 metadata
  service, and one test reads the endpoint back from the client (C12).
- pyproject.toml keeps the pytest and ruff sections only; nothing installs
  the package, and ruff pins its target version (C14).
A walk that raised (a listing out of retries, an error from a worker)
skipped promote and the write-back, and WorkerSessions then deleted the
copies, with any token a worker had rotated. The next run restored the
token the server had retired.

_Walk.run now promotes the newest worker session and writes back in a
finally, after the pool shuts down and before the copies go, so no worker
can rotate a token after the adoption. Two tests: a walk that raises after
a worker rotated, and a walk that raises while a listing that rotates is
still in flight. Both fail on the old code; the second also fails if the
finally runs before the pool shuts down.
- check.yml is the caller of lib's check workflow, with offline: true;
  its own job, the toolbox action's op install and the second pin go.
  test and lint fold into one in-image offline verb (pytest, ruff check,
  ruff format --check), which the menu lists in their place (C7).
- sync.yml states timeout-minutes: 355, with the 335-minute budget it
  protects named beside it (C20).
- The toolbox defines no report-engine after v2.6.0: the toolbox include
  drops it from its excludes. dropbox's own no-op and the engine
  include's exclude stay (C6).
- The proton image sets PROTON_DRIVE_CREDENTIALS_STORE=unsafe_file, so
  run_phase stops setting it. The cache dir stays: it is the caller's (C9).

The pins move to v2.6.0, with render.txt, once the tag exists. Until then
lib's check workflow at the v2.1.3 pin has no offline input.
task empty-trash (the engine's verb) runs task empty-trash-pipeline by
name in the image through task op, and go-task refuses an internal task
from the command line. So the verb failed after its prompt and op run,
before anything reached Proton. dropbox's own empty-trash-pipeline drops
internal: true, as lib's copy did in lib#21.

The offline verb dry-runs the task by name, so the flag cannot come back
unnoticed: with internal: true, task run -- task offline exits non-zero.
- The Taskfile header takes the shared mirror shape (C35): the upstream,
  the folder, the cadence and how a run works; the toolbox and the proton
  engine at v2, flattened, with lib's README for what each supplies; the
  items that are only this mirror's; the secrets by name. It says that of
  the secrets only the age identity goes into a file, 0600, for one call.
- batch.py's confirm comment drops "as before" (C74).
- Every comment and docstring in the Python, the tests, the Taskfile, the
  workflows, op.env (the shared header) and pyproject.toml is in ASD-STE100
  (C78). Inline comments longer than a short clause move to their own
  lines above. Each comment keeps its place and its job.
- Code is unchanged: the AST of every Python file is equal once the
  docstrings are blanked, except the SQL comment inside state.py's SCHEMA,
  whose sqlite_master is identical. render.txt does not move.
- One stale fact goes: p50_trash's TRASH_CHUNK comment said a mutation
  never retries a timeout; _mutation retries up to mutation_max_attempts.
- p50_trash: the phase deletes the mirror rows of a unit one trash call
  at a time, not when the unit is complete (U1).
- crypt: age reads an identity from a file; "only" goes, because age
  can also read one from standard input (U2).
- p50_trash._trash_unit: the steps in their real order. It records and
  deletes the rows of the files that are not there first, then records
  and deletes the rows of each trash call after that call (U3).
- test_batch: fetch gets each file with its path_lower; the test only
  checks it (U4).
- S1: "by" (a math word only in STE) becomes "with", "from" or "on"; the
  header says each value goes into the image with its name, not on a
  command line, as the other five headers do.
- S2: "complete" as an adjective becomes "completed" or "did not
  complete". The COMPLETE status value stays.
- S3, S4: "progress" (n) and "below"/"above" as adverbs go.
- S5: upload, use and stop as nouns become verbs or `upload`.
- S6: lose, exist, leave, look, clear, take, ask, mark and "up to" give
  way to approved words.
- S7: the four description sentences over 25 words are split.
- Also, from the review's minor list: the two noqa lines fit in 92
  columns, an inline comment of two clauses moves above its line,
  verbless sentences get a verb, `purpose` is in backticks, and "own",
  "request", "against" and "before" as an adverb are rewritten.

Comments and docstrings only: the AST of every Python file is unchanged,
except the SQL comment in state.py's SCHEMA (sqlite_master identical).
The seven comment blocks of config/mirror.toml are in ASD-STE100, as the
rest of C78. Every value line is byte-identical and the parsed TOML is
equal. The file's sha256 changes, which the next run only records in the
migrations row and the phase inputs; nothing gates on it.
@jshvn
jshvn merged commit 86036ab into main Oct 9, 2026
1 check passed
@jshvn
jshvn deleted the josh/lib-v2.6.0 branch October 9, 2026 00:48
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