bug(analytics): flow metrics ignore since/window when retrieving transitions (transitionLimit exhaustion) #57

Open
opened 2026-05-10 14:20:01 +02:00 by pdurlej · 1 comment
Owner

Source

3+3 review on PR #46 (feat(analytics): add flow metrics v0), merged 2026-05-10 via chain drain #52.

"flow metrics ignore the requested since/window while retrieving transitions; old ascending history can exhaust transitionLimit and omit current-window completions. Fetch/window transitions correctly before computing metrics."

Problem

Flow metrics computation (lead time, cycle time, throughput) currently fetches transition history without applying the since/window filter at fetch time. Instead it fetches up to transitionLimit ascending and only filters in memory.

For boards with long history:

  • transitionLimit is exhausted by old transitions
  • Current-window completions are missing from input
  • Metrics return wrong/empty values for recent windows

Scope

  • Apply since/until filters at the database/repository fetch layer, not in-memory
  • Confirm behavior with fixture: long history + recent window → metrics see only recent transitions
  • Add edge-case tests: empty window, window straddling old + recent, transitionLimit exceeded

Acceptance criteria

  • Flow metrics for "last 7 days" return correct numbers regardless of total board history
  • transitionLimit no longer affects window correctness, only acts as safety cap
  • Test asserts metrics for fixture board with 1000+ historic transitions + 5 recent

Refs

  • PR #46 (chain drain via #52)
  • Issue #22 (closed as resolved-by-#46)
  • 3+3 review comment id 3194
## Source 3+3 review on PR #46 (`feat(analytics): add flow metrics v0`), merged 2026-05-10 via chain drain #52. > "flow metrics ignore the requested since/window while retrieving transitions; old ascending history can exhaust transitionLimit and omit current-window completions. Fetch/window transitions correctly before computing metrics." ## Problem Flow metrics computation (lead time, cycle time, throughput) currently fetches transition history **without** applying the `since`/`window` filter at fetch time. Instead it fetches up to `transitionLimit` ascending and only filters in memory. For boards with long history: - `transitionLimit` is exhausted by old transitions - Current-window completions are missing from input - Metrics return wrong/empty values for recent windows ## Scope - Apply `since`/`until` filters at the database/repository fetch layer, not in-memory - Confirm behavior with fixture: long history + recent window → metrics see only recent transitions - Add edge-case tests: empty window, window straddling old + recent, `transitionLimit` exceeded ## Acceptance criteria - Flow metrics for "last 7 days" return correct numbers regardless of total board history - `transitionLimit` no longer affects window correctness, only acts as safety cap - Test asserts metrics for fixture board with 1000+ historic transitions + 5 recent ## Refs - PR #46 (chain drain via #52) - Issue #22 (closed as resolved-by-#46) - 3+3 review comment id 3194
Collaborator

{
"confidence": 5,
"effort_hint": "medium",
"escalation": {
"kind": "none",
"reason": ""
},
"evidence_refs": [
{
"note": "Issue reports flow metrics ignoring since or window filters when retrieving transitions.",
"type": "forgejo",
"value": "issue-title-body-labels-and-target-snapshot"
},
{
"note": "Body states old ascending history can exhaust transitionLimit and omit current-window completions.",
"type": "forgejo",
"value": "issue-body-problem"
},
{
"note": "Scope applies since and until filters at the database fetch layer and adds long-history recent-window fixtures.",
"type": "forgejo",
"value": "issue-body-scope"
}
],
"impact": 4,
"judge_actor": {
"name": "iskra",
"runtime": "openclaw"
},
"judged_at": "2026-06-09T01:08:00Z",
"labels_to_apply": [
"judge/p1",
"judge/codex-candidate"
],
"piotr_fit": "high",
"priority": "p1",
"rationale_summary": "This is P1 Codex-ready analytics correctness work because recent-window flow metrics can be silently wrong when old history exhausts the transition limit.",
"reach": 4,
"recommended_next_action": "codex_candidate",
"rerun_reason": "no_prior_judgment",
"schema": "openclaw.judge.v0",
"target": {
"kind": "issue",
"number": 57,
"repo": "pdurlej/kan-ductor"
},
"target_snapshot": {
"body_hash": "sha256:35f96e36ca2f745b190c2e3af45a09571e3b5b4b3ceebbd32d3aa3d41b0c4a60",
"commit_count": null,
"evidence_hash": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"head_sha": null,
"labels": [
"3plus3-followup",
"priority:p1"
],
"labels_hash": "sha256:eae246ad0747d73dd2fb96aea169d7d74574e5b2de03312edce7ec9f6d87a8f0",
"state": "open",
"title_hash": "sha256:6d6c3c12ad1180e459ab42457bfe6799a55ca904297825203d83c5dc1aef574f",
"updated_at": "2026-05-28T01:20:42+02:00"
},
"top_caveat": "Keep the fix focused on fetch-window correctness and regression coverage, not broader analytics redesign."
}

<!-- openclaw.judge.v0 --> { "confidence": 5, "effort_hint": "medium", "escalation": { "kind": "none", "reason": "" }, "evidence_refs": [ { "note": "Issue reports flow metrics ignoring since or window filters when retrieving transitions.", "type": "forgejo", "value": "issue-title-body-labels-and-target-snapshot" }, { "note": "Body states old ascending history can exhaust transitionLimit and omit current-window completions.", "type": "forgejo", "value": "issue-body-problem" }, { "note": "Scope applies since and until filters at the database fetch layer and adds long-history recent-window fixtures.", "type": "forgejo", "value": "issue-body-scope" } ], "impact": 4, "judge_actor": { "name": "iskra", "runtime": "openclaw" }, "judged_at": "2026-06-09T01:08:00Z", "labels_to_apply": [ "judge/p1", "judge/codex-candidate" ], "piotr_fit": "high", "priority": "p1", "rationale_summary": "This is P1 Codex-ready analytics correctness work because recent-window flow metrics can be silently wrong when old history exhausts the transition limit.", "reach": 4, "recommended_next_action": "codex_candidate", "rerun_reason": "no_prior_judgment", "schema": "openclaw.judge.v0", "target": { "kind": "issue", "number": 57, "repo": "pdurlej/kan-ductor" }, "target_snapshot": { "body_hash": "sha256:35f96e36ca2f745b190c2e3af45a09571e3b5b4b3ceebbd32d3aa3d41b0c4a60", "commit_count": null, "evidence_hash": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "head_sha": null, "labels": [ "3plus3-followup", "priority:p1" ], "labels_hash": "sha256:eae246ad0747d73dd2fb96aea169d7d74574e5b2de03312edce7ec9f6d87a8f0", "state": "open", "title_hash": "sha256:6d6c3c12ad1180e459ab42457bfe6799a55ca904297825203d83c5dc1aef574f", "updated_at": "2026-05-28T01:20:42+02:00" }, "top_caveat": "Keep the fix focused on fetch-window correctness and regression coverage, not broader analytics redesign." } <!-- /openclaw.judge.v0 -->
Sign in to join this conversation.
No labels
3plus3-followup
agent/claude-code
agent/codex
agent/hermes
agent/iskra
agent/ollama
agent/patchwarden
analytics
api
cockpit
dependency/blocked
dependency/blocks-others
dependency/cross-repo
dependency/needs-confirmation
docs
domain:agents
domain:ci
domain:docs
domain:forgejo
domain:infra
domain:memory
domain:runtime
domain:signal
domain:ux
flow/architecture
flow/blocked
flow/deployed
flow/done
flow/implementation
flow/intake
flow/maintained
flow/observed
flow/ready
flow/refining
flow/retired
flow/review
gemini-flash
judge/codex-candidate
judge/hermes-candidate
judge/low-confidence
judge/needs-refinement
judge/operator-needed
judge/p0
judge/p1
judge/p2
judge/p3
judge/park
judge/patchwarden-candidate
judge/stale-priority
kind/adr
kind/bug
kind/chore
kind/feature
kind/infra
kind/ops
kind/refactor
kind/research
leviathan
mcp
merge/auto
merge/manual
merge/manual-dependency-conflict
merge/manual-failing-tests
merge/manual-merge-conflict
merge/manual-missing-review
merge/manual-operator-preference
merge/manual-red-zone
merge/manual-security-sensitive
merge/manual-unclear-scope
merge/manual-unknown
mode:operator-only
mode:patchwarden-iskra-approved
mode:safe-auto
observed/erroring
observed/needs-followup
observed/pending
observed/retire-candidate
observed/unused
observed/used
ops
priority:p0
priority:p1
priority:p2
priority:p3
review:claude-reviewed
review:codex-reviewed
review:dziadek-reviewed
review:needs-human
safety
safety:external-write
safety:no-prod-mutation
safety:prod-impact
safety:secret-touch
scout
security
size/large
size/medium
size/small
size/tiny
size/unknown
small-task
source/adr
source/agent-generated
source/manual
source/operator-chat
source/voice-note
status:blocked
status:codex-ready
status:merged:pending-evidence
status:needs-evidence
status:operator-needed
status:parked
tests
tier:0-platform-substrate
tier:1-iskra-value-layer
tier:2-tools-products-modules
type:bug
type:chore
type:docs
type:feat
type:policy
type:research
ui
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pdurlej/kan-ductor#57
No description provided.