Skip to content

Fix the self-contradictory due_offset_days description - #36

Merged
os-warren merged 1 commit into
mainfrom
claude/issue-23-offset-description
Sep 1, 2026
Merged

os-warren merged 1 commit into
mainfrom
claude/issue-23-offset-description

Conversation

@os-warren

Copy link
Copy Markdown
Collaborator

Fixes #23

Documentation-only fix. Reading A is adjudicated (see the PM comment on #23)
and shipped in src/functions/period.ts (#1): due_offset_days counts days
from the anchor day, and 0 means the anchor day itself. That arithmetic is
untouched here — the bug was the field's own description contradicting it
("5" with a monthly period anchored to period start = due on the 5th, which
is off by one under reading A).

What changed

  1. src/objects/duty.object.ts — rewrote due_offset_days.description with a
    worked example on each anchor: period_start — 0 = first day, 4 =
    fifth day; period_end — 0 = last day, -3 = three days before the
    last. Also changed the label from Offset (days) to
    Offset (days, 0 = anchor day) so the zero-point reads without opening the
    description tooltip.
  2. src/objects/catalog-item.object.ts — the same field, the same label and
    description. It had no description at all before this PR; it now matches
    duty.object.ts verbatim, which matters because Catalog instantiation — apply a position's duty catalog to a person #5's catalog
    instantiation copies cadence fields from the catalog item onto the duty —
    a mismatch between the two would have replicated a contradiction onto
    every duty created from a catalog item.
  3. docs/product/data-model.md — the due_anchor + due_offset_days
    paragraph gets the same worked examples.

Explicitly not touched

src/functions/period.ts and test/period.test.ts — the arithmetic is
correct and adjudicated; this PR only fixes the prose that misdescribed it.
objectstack.config.ts was not touched either.

Gates (all green, at a9d15af)

pnpm validate    # ✓ Validation passed (394ms) — 5 Objects, 57 Fields
pnpm typecheck   # tsc --noEmit — no output, exit 0
pnpm test        # Test Files 5 passed (5) · Tests 175 passed (175)
pnpm build       # ✓ Build complete (589ms) — dist/objectstack.json (63.1 KB)

Generated by Claude Code

Reading A is adjudicated and shipped: due_offset_days counts days from
the anchor day, and 0 means the anchor day itself. The field's own
description contradicted this — it said "days from the anchor" and
then gave an example ("5" on a monthly period anchored to period
start = due on the 5th) that is off by one under that reading.

Rewrite the description with a worked example on each anchor in both
duty.object.ts and catalog-item.object.ts (the catalog copy must agree
with the duty copy, since #5's catalog instantiation copies this field
onto every duty it creates), and add the same worked examples to the
due_anchor + due_offset_days section of docs/product/data-model.md.

Also clarify the field label to "Offset (days, 0 = anchor day)" so the
zero-point is visible without opening the description tooltip.

No arithmetic changes: src/functions/period.ts and its pinned tests
are untouched.

Fixes #23

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SqkTcrxUFci7nqXdbBSe2p
@os-warren
os-warren marked this pull request as ready for review September 1, 2026 04:31
@os-warren
os-warren merged commit e519d94 into main Sep 1, 2026
1 check passed
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.

Fix the self-contradictory due_offset_days description (reading A adjudicated)

1 participant