Skip to content

fix(mcp): define LFD and arrival windows the way the dashboard does - #401

Open
alosec wants to merge 5 commits into
mainfrom
feat/mcp-date-window-definitions
Open

alosec wants to merge 5 commits into
mainfrom
feat/mcp-date-window-definitions

Conversation

@alosec

@alosec alosec commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Targets main. Originally stacked on #404, which closed unmerged; its dashboard definitions reached main separately, so this is now the single commit rebased onto main.

Why

customer-v2 lfd-next-3-days ("Which containers have a last free day in the next 3 days?") answered 93 against a reference of 14. On Sodor staging:

Query (actively tracked) Total
pickup_lfd today → +3 days, no status filter (what the agent did) 93
same, current_status=available,not_available,grounded 14 (reference)
past-due LFD at terminal (pickup_lfd <today) 694
arrival today → +10 days 34 (reference)

The query-guidance resource also contradicted #398's definitions: it described "discharged but not picked up" as pod_discharged_at @exists + picked_up_at @not_exists, and demurrage risk as LFD bounds instead of the Containers at Risk set.

What

  • list_containers description: next-N-day LFD = still at the terminal + pickup_lfd [">=today", "<=N.days.from_now"]; past-due is separate; arrivals use arrival with the same bounds; "next N days" includes today and day N; today is the API server's UTC date (relative and absolute dates differ after midnight UTC: 11 vs 14 when I checked), so the agent states the dates it used.
  • terminal49://docs/mcp-query-guidance: same definitions; drops the contradicting recipes.
  • New guidance test pins the definitions.

Tests

MCP 445 passed on current main (2 new). vp run check and vp run build pass.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

RetriggerView in GreptileConfidence Score: 5/5

This PR appears safe to merge.

Summary

Aligns MCP query guidance with the dashboard definitions.

  • Container status and demurrage guidance matches the dashboard.
  • LFD and arrival windows use clear date bounds and scope.

No actionable issues found. Tests were not run during this review.

Reviews (1) · Last reviewed commit: "chore: restore main's Postman collection" · Reviewed by Greptile

@vercel

vercel Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
api Ready Ready Preview Nov 9, 2026 1:02am UTC

Request Review

customer-v2 "LFD in the next 3 days" answered 93 against a reference of
14: without a status filter the window includes containers already
picked up or still on the water. The list_containers description and the
query guidance now define next-N-day LFDs as containers still at the
terminal (available, not_available, grounded) with pickup_lfd from today
through N.days.from_now, keep past-due LFDs separate, and say today is
the API server's UTC date. The guidance also drops recipes that
contradicted the dashboard definitions (discharged-not-picked-up by
milestones, demurrage risk by LFD bounds). Checked on Sodor staging:
the status-limited window gives the reference 14; arrivals in 10 days
give 34.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dodeja
dodeja force-pushed the feat/mcp-date-window-definitions branch from 3067c42 to 1bca2ee Compare October 17, 2026 06:48
@dodeja
dodeja changed the base branch from feat/mcp-tracked-default to main October 17, 2026 06:49
The force-push that rebased this branch onto main made the Postman
workflow compare against the old stacked base, which saw openapi.json
changes and regenerated the collection. That regeneration only reshuffled
generated IDs and example values. This branch does not change the spec,
so it keeps main's collection.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dodeja

dodeja commented Oct 17, 2026

Copy link
Copy Markdown
Member

Rebased the single commit onto main (signed, now 1bca2ee) and retargeted the base from feat/mcp-tracked-default (dead since #404 closed) to main. The net diff against main is the original three files. The contradicting discharged-not-picked-up recipe (pod_discharged_at @exists + picked_up_at @not_exists) stays removed, and the new guidance test asserts it is absent.

The force-push made the Postman workflow compare against the old base, so github-actions[bot] pushed b99d26d, which only reshuffled generated IDs and examples. c22b8a7 restores main's collection, so the PR does not touch it.

When merging: b99d26d's message contains [skip ci]. A squash merge copies it into the squash message, which would skip CI, Postman and release-please on main. Delete that line from the squash message before confirming.

Local on the rebased branch: vp run check, vp run build, MCP tests (445 passed, 2 new), MCP filter-schema drift (clean), eval:check and MCP lint all pass.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T01:04:00.620350Z 7f30c25 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the risk-shadow:medium Shadow-only risk signal: medium label Oct 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Shadow risk calibration

Signal Result Authority
Path classifier risk:high Deterministic advisory policy
heuristic fallback risk-shadow:medium Shadow only

Calibration result: disagreement (high vs medium).

Shadow risk never blocks or enables merge. Keep it in observation mode until roughly 50 pull requests have human-reviewed labels, then calibrate before considering any policy use.

@github-actions github-actions Bot added the risk:unknown Advisory evidence unavailable or changed; no merge permission label Oct 19, 2026
@github-actions github-actions Bot added risk:high Advisory path risk; current-head human review needed risk:unknown Advisory evidence unavailable or changed; no merge permission and removed risk:unknown Advisory evidence unavailable or changed; no merge permission risk:high Advisory path risk; current-head human review needed labels Oct 19, 2026
@github-actions github-actions Bot added risk:unknown Advisory evidence unavailable or changed; no merge permission risk:high Advisory path risk; current-head human review needed and removed risk:unknown Advisory evidence unavailable or changed; no merge permission risk:high Advisory path risk; current-head human review needed labels Oct 31, 2026
@github-actions github-actions Bot added risk:unknown Advisory evidence unavailable or changed; no merge permission and removed risk:high Advisory path risk; current-head human review needed labels Nov 9, 2026
Resolve the list_containers description conflict by keeping this
branch's LFD and arrival window sentence and main's new result-shape
sentence. Regenerate the tools/list snapshot from the merged server.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V8cPhktNpguVMk39bAstza
@github-actions github-actions Bot added risk:high Advisory path risk; current-head human review needed and removed risk:unknown Advisory evidence unavailable or changed; no merge permission labels Nov 9, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7f30c259e2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

'Like the dashboard, only actively tracked containers are returned unless include_stopped_tracking is true (use it for history such as pickups or dwell over a past period). ' +
'Use the dashboard definitions and report meta.total for that set before any narrowing: ready for pickup = current_status available; at risk of demurrage or needs attention = requires_attention true with sort attention_priority (the Containers at Risk view); discharged but not picked up = current_status available,not_available,grounded,awaiting_inland_transfer. ' +
'Add extra conditions such as LFD windows, fees or holds only when the user asks, and present them as a subset of that total. ' +
'LFD in the next N days means containers still at the terminal: current_status available,not_available,grounded with pickup_lfd [">=today", "<=N.days.from_now"]; LFDs already past are separate (pickup_lfd "<today"). Arriving in the next N days: arrival [">=today", "<=N.days.from_now"]. "Next N days" includes today and day N; today is the API server\'s UTC date, so state the dates you used. ' +

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep terminal status scope for past-due LFDs

When a user asks for past-due LFDs, this recipe specifies only pickup_lfd < today, even though active tracking does not exclude picked-up or in-transit containers whose historical LFD remains populated. Those records can therefore inflate what should be an actionable terminal worklist—the same failure mode the preceding next-N-days recipe avoids. Apply the terminal current_status restriction to the past-due recipe as well, or direct the model to the appropriate dashboard attention predicate.

Useful? React with 👍 / 👎.

This branch was successfully deployed

1 active deployment
Preview — 7f30c259 Deployed Nov 9, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:high Advisory path risk; current-head human review needed risk-shadow:medium Shadow-only risk signal: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants