Skip to content

docs: asset history items are stays, not scans (TRA-1265) - #221

Draft
mikestankavich wants to merge 1 commit into
mainfrom
docs/tra-1265-asset-movement-timeline-shows-one-entry
Draft

mikestankavich wants to merge 1 commit into
mainfrom
docs/tra-1265-asset-movement-timeline-shows-one-entry

Conversation

@mikestankavich

Copy link
Copy Markdown
Contributor

HOLD — draft until app v1.6.0 is on prod. Merging publishes to customers. Prod runs v1.5.0 without this behaviour; preview (v1.6.0-dev-preview+645) has it.

What changed

GET /api/v1/assets/{asset_id}/history now returns one item per stay (trakrf/platform#679): an unbroken run of observations at one location, not one item per recorded minute.

  • API changelog: new top entry #history-stays. It covers the new item meaning, total_count/limit/offset counting stays, from/to selecting stays without clipping them (no false "ongoing" on a past window), and a gap in reads staying inside a stay.
  • Date fields → duration_seconds: rewritten for stays, including how to clip window edges when summing. Anchor unchanged.
  • Data model, Pagination (time range + history example), Quickstart, Resource identifiers: "scan events / rows" wording changed to stays.

Docs correction included. The duration_seconds section said it measured time at the previous location and was null on the earliest row. The code has always used LEAD: time at the item's own location, null on the newest. The changelog entry says so.

Still open: whether a long silence should end a stay. That's the same age-out question dwell has. The docs describe today's behaviour.

The v1.6.0 version in the changelog entry is an assumption. Confirm it at release. App release notes are left for the release PR, as with v1.5.0.

Validation

pnpm lint, pnpm typecheck, pnpm build (against the preview spec): green.

Closes TRA-1265

🤖 Generated with Claude Code

https://claude.ai/code/session_01KRNEVkxF5rYpoebNmLBgNg

GET /api/v1/assets/{asset_id}/history now returns one item per unbroken
run of observations at a location (platform #679). The API changelog
records the new item meaning, total_count/paging over stays, the
from/to no-clipping rule and gaps inside a stay. The history prose in
date-fields, data-model, pagination, quickstart and resource-identifiers
is rewritten to match.

The duration_seconds section was also backwards: it described time at
the previous location with null on the earliest row. It has always been
time at the item's own location, null on the newest. Corrected in the
rewrite and called out in the changelog.

Refs: TRA-1265

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KRNEVkxF5rYpoebNmLBgNg
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6abf4b7
Status: ✅  Deploy successful!
Preview URL: https://6fc550df.docs-4n7.pages.dev
Branch Preview URL: https://docs-tra-1265-asset-movement.docs-4n7.pages.dev

View logs

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