Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .agents/skills/firstmate-orca/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ It does not replace `AGENTS.md`, `docs/orca-backend.md`, or `harness-adapters`.

Orca is a runtime backend, not an agent harness.
The runtime backend owns the task endpoint and, for Orca, the task worktree.
The harness is the agent process launched inside that endpoint, such as `claude`, `codex`, `opencode`, `pi`, `grok`, or the crewmate-only `cursor`.
The harness is the agent process launched inside that endpoint, such as `claude`, `codex`, `opencode`, `pi`, `pi-signed`, `grok`, `kimi`, or the crewmate-only `cursor`.
Load `harness-adapters` for harness-specific launch, interrupt, resume, trust-dialog, and skill-invocation facts.

Implementation details, metadata fields, teardown guarantees, and limitations live in `docs/orca-backend.md`.
Expand Down
122 changes: 90 additions & 32 deletions .agents/skills/harness-adapters/SKILL.md

Large diffs are not rendered by default.

63 changes: 63 additions & 0 deletions .agents/skills/quota-array-dispatch/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
name: quota-array-dispatch
description: >-
Agent-only decision procedure for resolving a matched crew-dispatch profile
array from current quota-axi output, including quota-window pace signals.
Load when a dispatch rule or default resolves to more than one profile candidate.
user-invocable: false
metadata:
internal: true
---

# quota-array-dispatch

This skill is the single owner of the pace-aware profile-array selection procedure.
`AGENTS.md` section 4 owns the always-loaded intake boundary, load trigger, malformed-config refusal, every-candidate accounting, and strongest-reasoning/tie safety rules.
`harness-adapters` owns harness verification, model/provider discovery, and effort fallback.
`quota-axi` remains data-only and never recommends a route.
Do not add a daemon, opaque composite score, routing wrapper, hard-coded model-specific policy, or producer-side route recommendation.

## Collect facts

Run `quota-axi --json` once per intake and reuse that snapshot for every candidate.
For each candidate, establish the harness/model/provider relationship from `harness-adapters`, then record only inspectable facts:

- task/profile fit and required reasoning class
- raw applicable headroom (`effectivePercentRemaining` or the tightest applicable remaining percentage)
- effective pace status, signed reserve per applicable window, and worst applicable reserve (`worstReservePercentPoints` when present, else the minimum signed reserve)
- whether any applicable window or effective summary is ahead of reset, or any applicable pace is `unknown`
- schema note when pace fields are absent

Stale raw windows are diagnostic only, never current headroom.
Read every bounding window named by `boundedBy`, `limitingWindowIds`, `aheadWindowIds`, `behindWindowIds`, `onPaceWindowIds`, and `unknownWindowIds`.

## Pace semantics

`reservePercentPoints = percentRemaining - timeRemainingPercent`.
Negative reserve means usage is ahead of reset pace and creates conservation pressure.
Positive reserve means usage is behind reset pace.
`on_pace` is neutral.
Conservation pressure is present when effective pace status is `ahead`, effective pace status is `mixed` and any `aheadWindowIds` remain, or any applicable bounding window itself has pace status `ahead`.
`unknown` is valid explicit uncertainty from quota-axi, not a parser failure and not permission to assume the window is healthy or exhausted.

## Selection order

Apply only among candidates that already satisfy required fit and the strongest reasoning class the request needs.
Never use pace or raw headroom to silently replace that reasoning class.

1. Unresolved relationship or quota data: stop and report the blocked candidate.
2. All-tight: keep the strongest-reasoning class; dispatch inside it or stop and report that the tight choice cannot proceed.
3. When fit and reasoning are comparable, prefer a candidate without ahead-of-reset conservation pressure over one with conservation pressure, even when the pressured candidate has somewhat higher raw remaining percentage.
4. Among pressured candidates, prefer the least-negative worst applicable reserve.
5. Among sustainable candidates, use known behind/on-pace evidence plus raw headroom transparently.
Prefer known sustainable evidence over `unknown` pace when otherwise comparable.
Do not collapse those facts into an opaque composite score.
6. If the dispatch choice materially hinges on unresolved pace, report the uncertainty rather than inventing a conclusion.
7. Absent pace or older schema: do not crash, fabricate pace, or silently reinterpret absence as healthy/`on_pace`.
Compare raw applicable headroom only, state that pace is unavailable, and keep every other safety rule.
8. Genuine ties: stop and report every tied candidate for captain choice.
Do not select by array order, harness name, or another arbitrary identity ordering.
Report duplicate concrete profiles as a configuration error.

Name the inspectable facts used for every candidate.
Never conclude with an unexplained "best quota" label.
4 changes: 2 additions & 2 deletions .claude/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@
"hooks": [
{
"type": "command",
"command": "\"$CLAUDE_PROJECT_DIR\"/bin/fm-turnend-guard.sh --claude"
"command": "[ -z \"${GROK_AGENT:-}\" ] || exit 0; exec \"$CLAUDE_PROJECT_DIR\"/bin/fm-turnend-guard.sh --claude"
},
{
"type": "command",
"command": "\"$CLAUDE_PROJECT_DIR\"/bin/fm-claude-stop-autoarm.sh",
"command": "[ -z \"${GROK_AGENT:-}\" ] || exit 0; exec \"$CLAUDE_PROJECT_DIR\"/bin/fm-claude-stop-autoarm.sh",
"asyncRewake": true,
"timeout": 28800
}
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,14 @@ jobs:
esac
/bin/bash --version | head -1
command -v jq >/dev/null || { echo "::error::jq is required"; exit 1; }
/bin/bash -n bin/fm-fleet-snapshot.sh

shell_inventory="$RUNNER_TEMP/fm-shell-inventory"
bin/fm-lint.sh --list-files > "$shell_inventory"
parse_fail=0
while IFS= read -r f; do
/bin/bash -n "$f" || { echo "::error::stock macOS Bash 3.2 failed to parse $f"; parse_fail=1; }
done < "$shell_inventory"
[ "$parse_fail" -eq 0 ] || { echo "::error::stock macOS Bash 3.2 parse sweep failed"; exit 1; }

snapshot_output=$(/bin/bash tests/fm-fleet-snapshot-view.test.sh)
printf '%s\n' "$snapshot_output"
Expand Down
4 changes: 2 additions & 2 deletions .pi/extensions/fm-calm.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Firstmate's home-persistent Pi transcript presentation toggle.
//
// Compatibility boundary: Pi 0.81.1 exposes built-in ToolDefinitions, per-slot
// Compatibility boundary: Pi 0.81.1 and 0.82.0 expose built-in ToolDefinitions, per-slot
// renderers, renderShell: "self", session_start replacement reasons,
// ExtensionUIContext.setToolsExpanded(), setWorkingVisible(), and
// setHiddenThinkingLabel(). The focused tests pin those assumptions. Exact-version
// setHiddenThinkingLabel(). The focused tests pin those assumptions. Version-bounded
// presentation adapters cover collapsed assistant thinking and operational user rows;
// Pi still exposes no global renderer for arbitrary built-in or custom rows.
// docs/configuration.md owns the home-local Calm preference contract.
Expand Down
Loading
Loading