Skip to content

direction: K-INFRA counts days, not rows - #24

Open
Cubits11 wants to merge 1 commit into
mainfrom
claude/k-infra-calendar-weeks
Open

Cubits11 wants to merge 1 commit into
mainfrom
claude/k-infra-calendar-weeks

Conversation

@Cubits11

Copy link
Copy Markdown
Owner

k_infra stepped back seven rows per window. Nine daily snapshots over eight days therefore reported "two consecutive weeks" and fired the stop rule; on a sparse series the same arithmetic runs the other way and overstates a window. research/DIRECTION.yaml says two consecutive cadence weeks.

Reproduced against the live function before changing it: nine synthetic daily rows returned span 2026-09-01 to 2026-09-09, windows 2, fired True — eight calendar days presented as two weeks.

What changed

A week is seven elapsed days. Boundaries walk back one week at a time from the newest snapshot, each measured from the boundary before it, so a missing day pushes the chain further back instead of collapsing a window. A pair that cannot be resolved that way is not computable, with the reason stated, and a rule that cannot be evaluated does not fire. The series has real gaps; an unknown must not be read as a refutation.

Semantics chosen by the owner this session, over the stricter alternative (exact 7-day boundary snapshots), because the cadence cron has never run on this host: exact boundaries would make K-INFRA "not computable" today — the 2026-09-11 row is missing — and a kill condition that is silently disabled by a missed day is worse than one that waits for the data.

Live series

span windows
before 2026-08-28 → 2026-09-18 14 days and 7 days
after 2026-09-03 → 2026-09-18 7 days and 8 days

Evidence moved in both windows; not fired either way. metrics/repo_state.jsonl is untouched.

Verification

  • tests/test_direction_k_infra.py: 18 tests — 7, 8 and 13 days cannot fire; 14 days can; evidence movement in either window blocks it; a gap shifts the chain rather than shortening a window; unordered, duplicate, invalid and missing-counter rows are not computable; year, ISO 52→1, ISO 53→1 and DST crossings are non-events because the rule counts dates.
  • Registered in the manifest CHECKS tuple, so it runs where the other checks run.
  • python3 scripts/verification_manifest.py exits 0.
  • docs/graph/repo-graph.json and .mmd regenerated, not hand-edited.
  • scripts/direction.py carries no sha256 pin in claims.yaml, so no re-pin is required.

k_infra stepped back seven rows per window, so nine daily snapshots over eight
days reported "two consecutive weeks" and fired the stop rule; with a sparse
series the same arithmetic runs the other way and overstates a window. Both
readings contradict DIRECTION.yaml, which says two consecutive cadence weeks.

A week is now seven elapsed days. Boundaries walk back one week at a time from
the newest snapshot, each measured from the boundary before it, so a missing day
pushes the chain further back rather than collapsing a window. A pair that
cannot be resolved that way is not computable, with the reason stated, and a
rule that cannot be evaluated does not fire — the series has real gaps, and an
unknown must not be read as a refutation.

On the live series the old arithmetic spanned 2026-08-28 to 2026-09-18, its two
"weeks" being 14 days and 7 days because the rows are sparse. It now reports two
seven-day windows over 2026-09-03 to 2026-09-18. Evidence moved in both; not
fired either way.

tests/test_direction_k_infra.py pins the boundaries the defect crossed: 7, 8 and
13 days cannot fire, 14 days can, evidence movement in either window blocks it,
a gap shifts the chain instead of shortening a window, and the year, ISO 52-to-1,
ISO 53-to-1 and DST crossings are non-events because the rule counts dates.
Registered in the manifest so it runs where the other checks run.

This branch has not been deployed

No deployments
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