Leaving / Reaching {altitude} {instruction}#873
Open
Jud6969 wants to merge 28 commits into
Open
Conversation
Spec for mmp#438: controller-issued "leaving {alt}, do X" and "reaching {alt}, do X" commands. Follows the existing A{fix}/... typed- dispatch precedent. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Implements ConditionalDirectFix with Execute (calls public DirectFix, discarding the intent since conditional firing is silent) and Render (emits direct/left-direct/right-direct fragments). Adds Execute and Render tests using a route-bearing Nav helper. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…ough Execute Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Implements the exported trigger predicate that checks whether a pending LV/RC conditional command should fire based on the aircraft's current altitude and vertical rate. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Extract fireConditionalIfTriggered helper so the per-second update loop runs ConditionalTriggered and, when true, silently executes the deferred action and clears the slot. The slot clears before Execute so that a follow-on conditional installed from within Execute doesn't fire on the same tick. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Review noted the guard protects against a follow-on conditional installed by Execute rather than a mis-parse. Match the ConditionalAction interface doc which describes this as intentional re-entrancy safety. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Registers conditional-leaving patterns for heading, direct-fix, speed,
and mach inner commands. Each template mirrors the phraseology of its
non-conditional sibling.
Implementation notes:
- "leaving" is a fillerWords entry (prevents fuzzy match with "heading"),
so two companion fixes are required:
- parse.go: check for leaving|passing + altitude BEFORE the filler-skip
loop, same pattern as the existing "then" and "at {altitude}" checks
- matcher.go: literalMatcher filler-skip loop now exempts a token that
exactly matches one of the matcher's own target keywords, so the
"leaving|passing" literal can match its own keyword even though
"leaving" is in fillerWords
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Adds subtests for left-direct, right-direct, maintain-speed, and mach — four templates registered in fabd822 that lacked explicit coverage. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…t}/{inner}
Mirror of the LV section. "reaching", "level", "on", "at" are not filler
words, so no parse.go or matcher.go changes are needed.
The plan's single combined template "reaching|level at|on reaching" cannot
be expressed as one template string because the parser splits alternations
on spaces — multi-word phrases like "level at" decompose into two separate
required matchers. Instead each inner command is registered twice:
- "[on] reaching {altitude} ..." — covers "reaching X" and "on reaching X"
- "level [at] {altitude} ..." — covers "level X" and "level at X"
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
When "leaving|passing|reaching {alt} direct|proceed {fix}" matches through
direct/proceed but the fix isn't in the aircraft's Fixes map, the template
would previously fail silently and fall through to the standalone_altitude
handler, producing a misleading A{alt} output (e.g., "reaching 7000 direct
DANNY" → A70 when DANNY isn't on the route).
Add WithSayAgainOnFail() to the 9 LV/RC direct-fix handlers so they emit
SAYAGAIN/FIX instead. Guard with WithSayAgainMinTokens(3) to require
keyword + altitude + direct/proceed to all match before triggering —
prevents false positives where "leave" fuzzy-matches unrelated words in
transcripts like "leave in november" without a following altitude.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…commands # Conflicts: # sim/control.go # sim/sim.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #438
Added "Leaving / Passing {altitude} {instruction}" -> LVALT/INSTRUCTION
Added "Reaching {altitude} {instruction}" -> "RC100/DAAC"