Repository navigation
Add persistent human names and names-first routing #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,7 +16,7 @@ | |
| # fixed mapping logic, no heuristics and no LLM. Output is one stable, parseable, | ||
| # token-tight line firstmate can read every heartbeat: | ||
| # | ||
| # state: <working|parked|done|blocked|paused|failed|unknown> · source: <run-step|pane|status-log|remote-endpoint|none> · <detail> | ||
| # state: <working|parked|done|blocked|paused|failed|unknown> · source: <run-step|pane|status-log|remote-endpoint|none> · <detail> · identity: <callsign> (<task-id>) | ||
| # | ||
| # Logic, in order: | ||
| # 1. Resolve worktree + backend target + kind from state/<id>.meta. A meta | ||
|
|
@@ -50,7 +50,8 @@ | |
| # recorded backend's pane busy state, then the status log's last line only | ||
| # when its verb maps to a recognized run-state. Decision-only events such as | ||
| # `resolved` never become current state or detail. | ||
| # 5. Missing meta or torn-down worktree: report unknown · none. If no run is | ||
| # 5. A missing selector refuses before state inspection. A torn-down worktree | ||
| # with a still-present task record reports unknown · none. If no run is | ||
| # attributed to this crew, a dead endpoint also reports unknown · none rather | ||
| # than trusting a stale status log. | ||
| # | ||
|
|
@@ -67,15 +68,23 @@ STATE="${FM_STATE_OVERRIDE:-$FM_HOME/state}" | |
| . "$SCRIPT_DIR/fm-tmux-lib.sh" | ||
| # shellcheck source=bin/fm-backend.sh | ||
| . "$SCRIPT_DIR/fm-backend.sh" | ||
| # shellcheck source=bin/fm-identity-lib.sh | ||
| . "$SCRIPT_DIR/fm-identity-lib.sh" | ||
| # shellcheck source=bin/fm-classify-lib.sh | ||
| . "$SCRIPT_DIR/fm-classify-lib.sh" | ||
| # shellcheck source=bin/fm-busy-lib.sh | ||
| . "$SCRIPT_DIR/fm-busy-lib.sh" | ||
| # shellcheck source=bin/fm-nm-run-lib.sh | ||
| . "$SCRIPT_DIR/fm-nm-run-lib.sh" | ||
|
|
||
| ID=${1:-} | ||
| [ -n "$ID" ] || { echo "usage: fm-crew-state.sh <id>" >&2; exit 2; } | ||
| RAW_SELECTOR=${1:-} | ||
| [ -n "$RAW_SELECTOR" ] || { echo "usage: fm-crew-state.sh <task-id-or-callsign>" >&2; exit 2; } | ||
| set +e | ||
| ID=$(fm_identity_resolve_selector "$STATE" "$RAW_SELECTOR") | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggestion: Use an indexed callsign-to-task lookup or a resolver that returns the callsign together with the task id, rather than scanning and validating the entire identity registry on every state read. [custom_rule] Severity Level: Major Why it matters? ⭐For callsign selectors, fm_identity_resolve_selector iterates over every identity record and validates each candidate, and even exact task-id resolution performs a registry-wide conflict scan. This helper is used on every state read, so repeated polling can cause avoidable filesystem scans and shell processing as the number of retained identity records grows. An indexed lookup or a resolver that returns the resolved identity in one operation would reduce that repeated work while preserving the ambiguity and historical-name checks. Rule source 📖CodeAnt dashboard (rule "agent-persona-performance") Prompt for AI Agent 🤖This is a comment left during a code review.
**Path:** bin/fm-crew-state.sh
**Line:** 83:83
**Comment:**
*Custom Rule: Use an indexed callsign-to-task lookup or a resolver that returns the callsign together with the task id, rather than scanning and validating the entire identity registry on every state read.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix |
||
| IDENTITY_RC=$? | ||
| set -u | ||
| [ "$IDENTITY_RC" -eq 0 ] || exit 1 | ||
| CALLSIGN=$(fm_identity_display_callsign "$ID") | ||
|
|
||
| META="$STATE/$ID.meta" | ||
| LOG="$STATE/$ID.status" | ||
|
|
@@ -93,6 +102,7 @@ SEP=' · ' | |
| emit() { # <state> <source> [detail] | ||
| local line="state: $1${SEP}source: $2" | ||
| [ -n "${3:-}" ] && line="$line${SEP}$3" | ||
| line="$line${SEP}identity: $CALLSIGN ($ID)" | ||
| printf '%s\n' "$line" | ||
| exit 0 | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: Build an id-to-callsign lookup object once from
identities, then perform constant-time lookups incallsign_forinstead of scanning the entire identities array for every landed, in-flight, and report row. [custom_rule]Severity Level: Major⚠️
Why it matters? ⭐
The jq function scans the entire identities array for every callsign lookup. It is invoked while projecting multiple landed, in-flight, and report rows, causing repeated linear work proportional to the number of output rows times the identity count. Building an id-to-callsign object once would make each lookup constant-time and avoid this repeated computation on larger fleets.
Rule source 📖
CodeAnt dashboard (rule "agent-persona-performance")
Prompt for AI Agent 🤖