feat(agent-card): self-declared persisted agent card, exposed on /tabs - #43
Open
a-biskoazh wants to merge 3 commits into
Open
feat(agent-card): self-declared persisted agent card, exposed on /tabs#43a-biskoazh wants to merge 3 commits into
a-biskoazh wants to merge 3 commits into
Conversation
Foundation for the mx feature set re-homed onto modular-main: the hook-immune,
persisted agent-card schema — `assignment`, `specialty`, `orchestrator`,
`objective`, `current_task` (bounded permalog), `rounds_active`, `evaluations`
(bounded ring), `usage_count`, `conventions`, `parent_tab_id`, `rehome_status`
— plus the `RoundsActive` / `Eval{Tokens,Scores}` / `Evaluation` types. Fields
are serde-optional (old tabs.json loads clean). Readers (/tabs expo) and writers
(set-* CLIs) land in the following commits.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Second half of the mx agent-card re-home onto modular-main (fields + types landed in 432bcc0). Wires the eleven persisted, hook-immune fields — assignment, specialty, orchestrator, objective, current_task (bounded permalog), rounds_active, evaluations (bounded ring), usage_count, conventions, parent_tab_id, rehome_status — end to end: - lib.rs: append_current_task / append_evaluation / bump_usage / parse_conventions helpers (+ CURRENT_TASK_LOG_MAX / EVALUATIONS_MAX). - api.rs: CardChange enum, card_route_verb, is_rehome_state; SnapshotTab +11 fields, TabInfo +11 (camelCase currentTaskLog/roundsActive/usageCount, snake for the rest); four owner-drain queues (assignment/parent/rehome/ card) + inits; route arms (master-token only, like /context). - api/cards.rs: the assignment/parent/rehome/card_verb/evaluation/bump-usage setters (mirror into the snapshot + queue for the drain). - headless.rs & app.rs (GUI parity): the card fields on the runtime tab, restored from TabState on load, written back on persist (the ..default() would otherwise wipe them), mirrored into the snapshot builder, and drained from the four queues onto the runtime tab — so the fields are hydrated AND applied, not just persisted. - api/tabs.rs: populate the card fields on /tabs (currentTaskLog=current_task). - cli: set-assignment / set-rehome-status + the eight card verbs (shared tab_field runner), wired into mod/client/dispatch. - openapi.yaml: the eleven card routes. Round-trip tests prove built==wired: POST a card route → 200, the value is mirrored, queued for the drain, AND comes back out on /tabs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
role_of (a tab's role, derived from its assignment) and its sole dependency parse_assignment (`"[<project>:]<phase>/<role>"` → parts) belong to the agent-card foundation: downstream branches (task, aligator, catalog) each carried a private copy, and drop theirs to consume this one after rebase (coordination MAS/tichef). parse_assignment is `pub(crate)` so a branch that needs project derivation can call it directly rather than re-declaring it. Both carry a documented `#[allow(dead_code)]`: they're published ahead of their first in-tree consumer (API-before-consumer sequencing, no bug masked) — the same foundation-allow idiom upstream already uses for dashboard_url_for_role / rehome_badge. The allow comes off when a consumer lands. Canonical bodies lifted verbatim from mx api/mod.rs; unit-tested (role after optional project). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #43 +/- ##
==========================================
- Coverage 52.41% 52.38% -0.03%
==========================================
Files 92 97 +5
Lines 28268 28969 +701
==========================================
+ Hits 14816 15176 +360
- Misses 13452 13793 +341
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
What
Re-homes the mx "agent card" onto modular-main and threads it end to end. The
eleven persisted, hook-immune per-tab fields —
assignment,specialty,orchestrator,objective,current_task(bounded permalog),rounds_active,evaluations(bounded ring),usage_count,conventions,parent_tab_id,rehome_status— plus theRoundsActive/Eval{Tokens,Scores}/Evaluationtypes, are now writable (HTTP + CLI), persisted, restored across restarts,
applied to the live runtime tab, and exposed on
/tabs.Commit
432bcc0(fields + types onTabState) is unchanged; this PR adds thethreading on top (commit
1ad37b5).Layers touched
lib.rsappend_current_task/append_evaluation/bump_usage/parse_conventions(+*_MAXbounds)api.rsCardChangeenum,card_route_verb,is_rehome_state;SnapshotTab+11,TabInfo+11 (camelCasecurrentTaskLog/roundsActive/usageCount, snake for the rest); 4 owner-drain queues + inits; route arms (master-token only, like/context)api/cards.rs(new)assignment/parent/rehome/card_verb/evaluation/bump_usagesettersheadless.rsHeadlessTab; restore fromTabState; persist back (the..default()would otherwise wipe them); snapshot builder; drain of the 4 queues onto the runtime tabapp.rs(GUI parity)from_staterestore, both persist builders, snapshot builder, drainapi/tabs.rs/tabs(currentTaskLog=current_task)cli/*set-assignment,set-rehome-status+ 8 card verbs (set-specialty/-orchestrator/-objective/-current-task/-rounds-active/-conventions/-evaluation,bump-usage) via a sharedtab_fieldrunner; wired intomod/client/dispatchassets/openapi.yamlbuilt == wired (the central trap)
The card fields are not merely persisted — they are hydrated and applied:
TabStateonto the runtime tab (headless + GUI);..default());pending_assignment/parent/ rehome/card_changes) onto the runtime tab, mirroring the existingcontext/metadrain.Proven by round-trip integration tests (real TCP server via
spawn_server):POST a card route →
200, the value is mirrored into the snapshot, queuedfor the drain, and comes back out on
/tabs. Covered:assignmentround-trip,
current-taskappend +currentTaskLogsurfacing,bump-usageincrement +
usageCountsurfacing,rehome400-on-bad-state.Verification (all green)
cargo buildheadless,energy ✓ · headless,energy,catbus ✓cargo testheadless,energy,catbus → 501 passed, 0 failedcargo clippy(nursery=deny) headless,energy ✓ · headless,catbus ✓ · gui,energy,catbus ✓ (GUI parity proven — noallowadded)cargo fmt --check✓openapi.yamlparses, 11 card paths presentDeliberate deviations (flagged for review)
role_of+parse_assignmentare foundation helpers published ahead oftheir consumer (commit
82d16e1). Downstream branches (task/aligator/catalog)each carried a private copy and drop theirs to consume this one after rebase
(coordination MAS/tichef). Both carry a documented
#[allow(dead_code)]— thesame foundation-allow idiom upstream already uses for
dashboard_url_for_role/
rehome_badge; the allow comes off when the first in-tree consumer lands.is_rehome_stateinlined the 4 slugs instead of porting mx's GUI-onlyRehomeStep/REHOME_STEPSstruct (labels/badges are dashboard concerns).Same validation, no dead struct.
cargo clippy --features gui,…,petstrips asuboptimal_flopsnursery lint insrc/pet.rs:1022— byte-identical at thebase commit
432bcc0, under the unrelatedpetsfeature. Not touched.The GUI branches of
app.rsare validated via--features gui,energy,catbus.Not done here (follow-up candidates)
parent_tab_idstamping fromdispatch --new(the delegate) is not wiredto auto-POST
/parent; the route + field + CLI exist, the auto-stamp on spawnis a separate change.