Skip to content

docs(file-rules): document upload timestamp, timezone and {timezone} - #268

Merged
ben-miru merged 11 commits into
mainfrom
docs/upload-path-time-zone
Oct 24, 2026
Merged

ben-miru merged 11 commits into
mainfrom
docs/upload-path-time-zone

Conversation

@bens-agent

@bens-agent bens-agent commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Requested by bens-agent · project thread

Stacked on #267 (base is its branch).

Summary

  • Documents that path time variables always come from the file's modification time (mtime), with the device-clock caveat.
  • Documents the new upload.timezone field (utc | device) and the {timezone} path variable (ISO 8601 basic offset, e.g. -0500).
  • Explains how the agent resolves the device zone (TZ, then /etc/localtime) and how to set TZ for the miru service with a systemd drop-in, plus a New York example.

Stays draft until mirurobotics/openapi#335 and mirurobotics/backend#999 ship and the variable name and offset format are confirmed.


Generated by Claude Code


&lt;source media="(prefers-color-scheme: dark)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3.svg"&gt;&lt;source media="(prefers-color-scheme: light)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-light-v3.svg"&gt;&lt;img alt="View with [code]smith" src="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3-3x.png" width="162" height="28"&gt; <a href="https://backend.blacksmith.sh/track/enable-autofix?expires=1795213289&installation_model_id=425273&pr_number=268&ref=codesmith_pr_footer&repository=mirurobotics%2Fdocs&return_to=https%3A%2F%2Fgithub.com%2Fmirurobotics%2Fdocs%2Fpull%2F268&signature=6f1ef18e8d21b921a600e06bddd7964c2e7ee7b15d2f32da1661558e2a6a6df4"&gt;&lt;picture&gt;&lt;source media="(prefers-color-scheme: dark)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark.svg"&gt;&lt;source media="(prefers-color-scheme: light)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-light.svg"&gt;&lt;img alt="Autofix with [code]smith" src="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png" width="190" height="28"&gt;
Need help on this PR? Tag @codesmith-bot with what you need.


Generated by Claude Code

The {year}, {month}, {day}, {hour} and {minute} variables in an upload
path are rendered by the backend in UTC at upload creation, which happens
just before the agent transfers the file. Say so explicitly, and note that
they don't follow the file's modification time or the device's clock.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HWuN4Rqg9RQgRJYMAiSBKg
Comment thread docs/snippets/file-rules/upload.mdx
@github-actions

Copy link
Copy Markdown
Contributor

AI review: approve for abc3f28

This PR only changes docs. It updates the file-rules upload snippet in three ways. Path time variables now come from the file's mtime, with a warning that a wrong device clock means wrong date folders. It adds the upload.timezone field (utc | device) and the {timezone} variable. It also explains how to set TZ for the agent with a systemd drop-in. I checked the following and found no problems:

  • The miru service name matches the other agent docs.
  • The snippet appears only in rule-definition.mdx, so the #param-timezone anchor works there.
  • The New York example is correct: 20:30 EST on Jan 14 is 01:30 UTC on Jan 15, so device keeps the Jan 14 folder.
  • No other page still says time variables are in UTC at upload creation.

I left one non-blocking inline nit: a literal + in an object key like +0000/... can be decoded as a space in some S3 or URL tooling. There were no earlier review threads. Nothing blocks the merge.

Review run

ben-miru pushed a commit to mirurobotics/agent that referenced this pull request Oct 24, 2026
)

<!-- claude-projects-attribution: {"github_login":"miru-agents"} -->
_Requested by **bens-agent** · [project
thread](https://claude.ai/code/project/chan_01CAhx68ku57XYPMZ3ERH4TZ?thread=cmsg_01CAhx68ku57XYPMZ3ERH4TZGkkHc4V3iih2RynerMnhWZ)_

Before: the agent sends upload timestamps in UTC only, so the backend
can't render upload paths in the device's local time zone.

After: the agent sends `source.mtime` with the device's local offset.
The backend always renders path time variables from mtime, and
`upload.timezone: device` rules keep that offset.

Agent side of mirurobotics/openapi#335 and mirurobotics/backend#999.
Docs: mirurobotics/docs#268.

## Summary
- `new_upl_request` takes the time zone as a parameter; production
passes `chrono::Local`, which honors `TZ` (including POSIX strings) and
falls back to `/etc/localtime`.
- `first_observed_at` / `last_observed_at` stay UTC.
- Test fixtures set `FileRuleUpload.timezone`, which `agent/v0.5.10`
makes required in responses (mirurobotics/openapi#347).

## Commits
- Vendor the released backend agent spec `agent/v0.5.10` and regenerate
`libs/backend-api` (generated code only).
- Feature and tests.

## Points for review
- Because `timezone` is now required, this agent can't parse file rules
from a backend that doesn't send the field, which is any backend before
#999. Deploy backend#999 before releasing this agent.

## Testing
- `cargo test -p miru-agent --test mod data_uploads::upload::executor`
passes, including an EST case (`2026-01-14T20:30:00-05:00`).
- `cargo fmt` and `cargo clippy --no-deps -D warnings` are clean.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01Wxu7TtSTH5GBUwQvBCa8uH)_

<!-- codesmith:footer -->
---
<a
href="https://app.blacksmith.sh/mirurobotics/codesmith/agent/pr/356?autoLogin=true&ref=codesmith_pr_footer"><picture>``&lt;source
media="(prefers-color-scheme: dark)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3.svg"&gt;&lt;source
media="(prefers-color-scheme: light)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-light-v3.svg"&gt;&lt;img
alt="View with [code]smith"
src="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3-3x.png"
width="162" height="28"&gt;``</picture></a> <a
href="````'''https://backend.blacksmith.sh/track/enable-autofix?expires=1795214323&installation_model_id=425273&pr_number=356&ref=codesmith_pr_footer&repository=mirurobotics%2Fagent&return_to=https%3A%2F%2Fgithub.com%2Fmirurobotics%2Fagent%2Fpull%2F356&signature=4034a077180078507271d8c8c4466e3d54895113dd3252437e559a731e6495f3"&gt;&lt;picture&gt;&lt;source````
media="(prefers-color-scheme: dark)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark.svg"&gt;&lt;source
media="(prefers-color-scheme: light)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-light.svg"&gt;&lt;img
alt="Autofix with [code]smith"
src="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png"
width="190" height="28"&gt;```</picture></a>
<sup>Need help on this PR? Tag <code>@codesmith-bot</code> with what you
need.</sup>

<!-- codesmith:autofix:disabled -->
<!-- /codesmith:footer -->


---
_Generated by [Claude Code](https://claude.ai/code)_

---------

Co-authored-by: Claude <noreply@anthropic.com>

@ben-miru ben-miru left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we need to add cli changelog for the next cli version and then let users know what cli version is required to use the new timezone variable. Also please review the actual implementation to double check the docs are accurate

Copy link
Copy Markdown
Collaborator Author

Thanks, addressed in 8642cb3:

  • CLI changelog: added a v0.12.3 entry for the upload.timezone field. v0.12.3 is my guess at the next CLI tag (cli-private#243 is the only feature since v0.12.2). The date says Unreleased, so set it when you tag.
  • Required CLI version: added a timezone-cli-version.mdx Info callout under the timezone field, mirroring bundle-cli-version.mdx. Only the upload.timezone key needs the new CLI. The CLI does not check path variables, so {timezone} in path works with any CLI version.
  • Accuracy: I re-read backend uplpath.go (default path, variable list, -0700 layout, device keeps the reported offset and everything else converts to UTC) and agent #356 (chrono::Local, TZ then /etc/localtime). Those all match the docs. One line was wrong, so I fixed it. It now says agents before v0.11.2 send mtime in UTC, so they render device rules in UTC. v0.11.2 is also assumed, because #356 merged after v0.11.2-beta.3.

Generated by Claude Code

@bens-agent
bens-agent requested a review from ben-miru October 24, 2026 04:17
Comment thread docs/snippets/file-rules/upload.mdx Outdated
@github-actions

Copy link
Copy Markdown
Contributor

AI review: approve for 8642cb3

This PR only changes docs. Since the last review (abc3f28), it adds three things:

  • A v0.12.3 CLI changelog entry, marked Unreleased.
  • A timezone-cli-version.mdx Info callout that copies the pattern of bundle-cli-version.mdx.
  • A corrected line saying agents before v0.11.2 render device rules in UTC.

I checked the links and found no problems. The #v0-12-3 anchor matches the new # v0.12.3 heading. The #param-timezone anchor resolves to the new ParamField in rule-definition. The changelog entry follows the same layout as v0.12.2. The version numbers (CLI v0.12.3, agent v0.11.2) are the author's assumptions, and the PR stays in draft until the upstream PRs ship, which is fine.

I left one non-blocking inline nit: the TZ setup section only covers systemd, but the agent also supports Windows. The earlier +0000 thread is resolved and I didn't raise it again. Nothing blocks the merge.

Review run

@github-actions

Copy link
Copy Markdown
Contributor

AI review: approve for c8656c2

I found nothing that blocks this PR. Since the last review at 8642cb3, two commits have landed:

  • 3d4e1f9 (Windows note): this answers the earlier non-blocking thread. The device bullet now says Windows agents use the system time zone setting, and the systemd drop-in section now starts with "On Linux". That fits how chrono::Local picks the zone on each platform.
  • c8656c2 (merge of origin/main): this brings in chore(deps): fix the new audit advisories (zod, body-parser, fast-uri) #270, which is already on main. It touches the body-parser and fast-uri overrides, the zod GHSA ignore, and the README table. Those changes only appear in this PR's diff because the stacked base branch (docs(file-rules): state that upload path time variables are UTC #267) hasn't merged main yet. This PR adds nothing new to the dependency or CI config.

Two items stay as earlier threads settled them: the +0000 key format (the author deferred the choice to Ben) and the assumed version numbers (CLI v0.12.3, agent v0.11.2, which the author flagged and which stay in draft until the upstream PRs ship). I left no new inline comments.

Review run

@github-actions

Copy link
Copy Markdown
Contributor

AI review: approve for 3d4e1f9

Nothing here blocks the merge. The head commit 3d4e1f9 has the same content as the last review, which looked at c8656c2 and already covered 3d4e1f9. The diff hasn't changed since then.

This PR only changes docs:

  • Upload docs: path time variables now come from the file's mtime, with a warning about a wrong device clock. The PR also adds the upload.timezone field (utc | device), the {timezone} variable and the Linux systemd TZ drop-in steps, plus a note on how Windows agents pick their time zone.
  • CLI version: a CLI v0.12.3 changelog entry, marked Unreleased, and an Info callout giving the CLI version that upload.timezone needs.

The dependency and README changes (the body-parser and fast-uri overrides, the zod GHSA ignore) came in from main through #270. They aren't new in this PR.

The earlier threads are settled:

  • +0000 key format: the author deferred it to Ben.
  • Windows note: fixed in 3d4e1f9.
  • Version numbers: CLI v0.12.3 and agent v0.11.2 are the author's assumptions, and the PR stays in draft until the upstream PRs ship.

I left no new inline comments.

Review run

@ben-miru
ben-miru force-pushed the docs/upload-path-time-zone branch from 3d4e1f9 to 6ef2d77 Compare October 24, 2026 21:27
@github-actions

Copy link
Copy Markdown
Contributor

AI review: approve for 6ef2d77

Nothing blocks the merge. The head commit 6ef2d77 is a rebase of the stack onto the updated base. The diff has the same content as the last reviewed commit (3d4e1f9).

This PR only changes docs:

  • Upload docs: path time variables now come from the file's mtime, with a warning that a wrong device clock means wrong date folders. The PR also adds the upload.timezone field (utc | device), the {timezone} variable and the Linux systemd TZ drop-in steps. It notes that Windows agents use the system time zone setting.
  • CLI version: a CLI v0.12.3 changelog entry, marked Unreleased, and an Info callout giving the minimum CLI version for upload.timezone.

The README.md, package.json and pnpm-lock.yaml changes are from #270, which is already on main. They show up in this diff only because the stacked base branch hasn't merged main yet.

I re-checked the links. #param-timezone and #v0-12-3 both resolve, and the upload snippet is still used only on the rule-definition page.

Earlier threads are settled and I didn't raise them again:

  • +0000 key format: the author deferred the choice to Ben.
  • Windows note: fixed.
  • Version numbers: CLI v0.12.3 and agent v0.11.2 are the author's guesses. The PR stays in draft until the upstream PRs ship.

I left no new inline comments.

Review run

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wxu7TtSTH5GBUwQvBCa8uH
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wxu7TtSTH5GBUwQvBCa8uH
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wxu7TtSTH5GBUwQvBCa8uH
Add the CLI v0.12.3 changelog entry, an Info callout on the timezone
field naming the minimum CLI version, and correct the note on older
agents: before v0.11.2 they send mtime in UTC.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wxu7TtSTH5GBUwQvBCa8uH
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wxu7TtSTH5GBUwQvBCa8uH
@bens-agent
bens-agent force-pushed the docs/upload-path-time-zone branch from 6ef2d77 to c78416d Compare October 24, 2026 21:29

Copy link
Copy Markdown
Collaborator Author

The audit check fails because of the zod, body-parser and fast-uri advisories. That isn't from this PR. The fix is already on main as #270, and the user asked to keep it out of this PR. #268 is stacked on #267, and #267's branch is from before #270. Re-running won't help. The check will pass once #267 merges or picks up main.


Generated by Claude Code

@github-actions

Copy link
Copy Markdown
Contributor

AI review: approve for c78416d

AI review: approve for c78416d

Nothing blocks this PR. The head commit c78416d comes from rebasing the stack again. Its content matches the last reviewed commit, 6ef2d77. The diff is now just the four docs files: cspell.json, the CLI changelog, timezone-cli-version.mdx and upload.mdx. The #270 dependency changes don't appear in the diff anymore, because the base branch now includes main.

I checked these and found no problems:

  • Snippet use: upload.mdx is still imported only in rule-definition.mdx.
  • Links: the #param-timezone and #v0-12-3 links both point to the right places.
  • Old wording: no other page still says that time variables are rendered in UTC when the upload is created.

Earlier threads are settled, so I didn't raise them again:

  • +0000 key format: the author left this decision to Ben.
  • Windows note: fixed.
  • Version numbers: CLI v0.12.3 and agent v0.11.2 are the author's guesses. The PR stays in draft until the upstream PRs ship.

I left no new inline comments.

Review run

@github-actions

Copy link
Copy Markdown
Contributor

AI review: approve for 12d9709

AI review: approve for 12d9709

Nothing blocks this PR. The one new commit since the last review (c78416d) is 12d9709. It changes the date on the CLI v0.12.3 changelog entry from Unreleased to October 24, 2026. The entry follows the same layout as v0.12.2, and the #v0-12-3 anchor still matches the heading. The PR is also out of draft now.

The rest of the diff is the same as the last review. It touches four docs files: cspell.json, the CLI changelog, timezone-cli-version.mdx and upload.mdx.

Earlier threads are settled, so I didn't raise them again:

  • +0000 key format: the author left this decision to Ben.
  • Windows note: fixed.
  • Version numbers: CLI v0.12.3 and agent v0.11.2 are the author's guesses. Before merging, check them against the actual release tags.

I left no new inline comments.

Review run

ben-miru
ben-miru previously approved these changes Oct 24, 2026

@ben-miru ben-miru left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

Comment thread docs/snippets/file-rules/upload.mdx Outdated
Comment thread docs/snippets/file-rules/upload.mdx Outdated
@github-actions

Copy link
Copy Markdown
Contributor

AI review: approve for 9b5145f

Nothing blocks the merge. This PR only changes docs. One new commit has landed since the last review (12d9709): 9b5145f ("refactor: human touch") trims upload.mdx. I compared the current file with what the earlier review summaries describe; I couldn't open the commit's own patch. The trim removed three things: the warning about a wrong device clock, the Linux systemd TZ drop-in section with its New York example, and the note that agents before v0.11.2 render device rules in UTC. What's left is a short line saying time variables come from the file's mtime, plus the timezone ParamField. That field still explains how Linux picks the zone (TZ, then /etc/localtime), that Windows uses the system setting, and that the offset follows daylight saving time.

I checked the links again: #param-timezone and #v0-12-3 both still resolve.

I left two non-blocking inline comments:

  • Line 45: fix the typo ("us set" should be "is set"), and check whether removing the device-clock and pre-v0.11.2 agent caveats was intended.
  • Line 68 (formatting): Example: isn't indented like the other fields, and lines 51–53 have stray blank lines.

Earlier threads are settled, so I didn't raise them again:

  • +0000 key format: the author deferred the choice to Ben.
  • Windows note: fixed.
  • Version numbers: CLI v0.12.3 and agent v0.11.2 are the author's guesses.

Review run

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wxu7TtSTH5GBUwQvBCa8uH
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wxu7TtSTH5GBUwQvBCa8uH
@github-actions

Copy link
Copy Markdown
Contributor

AI review: approve for f550191

Nothing blocks this PR. The only change since the last review (9b5145f) is the earlier formatting nit in upload.mdx, and it's now fixed: Example: in the timezone ParamField is indented like the other fields, and the stray blank lines are gone. The "us set" typo was fixed in 4005c67. The PR still changes only four docs files: cspell.json, the CLI changelog, timezone-cli-version.mdx and upload.mdx. upload.mdx is still imported only in rule-definition.mdx, so the #param-timezone anchor resolves there, and #v0-12-3 still matches the changelog heading.

The earlier threads are settled, so I didn't raise them again:

  • +0000 key format: the author left this choice to Ben.
  • Removed caveats: the device-clock and pre-v0.11.2 agent caveats were cut on purpose in Ben's edit.
  • Example: utc: kept as Ben wrote it.
  • Version numbers: CLI v0.12.3 and agent v0.11.2 are the author's guesses. Check them against the actual release tags before merging.

I left no new inline comments.

Review run

@bens-agent
bens-agent changed the base branch from claude/laughing-dijkstra-rirh7n to main October 24, 2026 21:45
@bens-agent
bens-agent dismissed ben-miru’s stale review October 24, 2026 21:45

The base branch was changed.

@github-actions

Copy link
Copy Markdown
Contributor

AI review: approve for d0c7130

Nothing blocks this PR. It only changes docs. The full diff at d0c7130 matches what the last review approved at f550191. It touches four files:

  • cspell.json: adds localtime.
  • The CLI changelog: adds a v0.12.3 entry dated October 24, 2026.
  • timezone-cli-version.mdx: a new Info callout giving the CLI version that upload.timezone needs.
  • upload.mdx: says time variables are rendered from the file's mtime, adds the {timezone} variable and adds the timezone ParamField.

I couldn't list the PR's commits or compare f550191 with d0c7130 here, so I checked the current diff against the last review summary instead. I found no changes in content.

Links still work:

  • upload.mdx is imported only in rule-definition.mdx, and no other timezone ParamField is on that page, so #param-timezone points to the new field.
  • #v0-12-3 matches the new changelog heading.

Earlier threads are settled, so I didn't raise them again:

  • +0000 key format: the author left this choice to Ben.
  • Windows note: fixed.
  • Removed caveats: Ben cut the device-clock and pre-v0.11.2 agent caveats on purpose.
  • Formatting and typo: fixed.
  • Version numbers: CLI v0.12.3 and agent v0.11.2 are the author's guesses. Check them against the real release tags before merging.

I left no new inline comments.

Review run

@bens-agent
bens-agent requested a review from ben-miru October 24, 2026 21:46

@ben-miru ben-miru left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

@ben-miru
ben-miru merged commit a5c35cd into main Oct 24, 2026
8 checks passed
@ben-miru
ben-miru deleted the docs/upload-path-time-zone branch October 24, 2026 21:49
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.

3 participants