feat: edit a registered member's project dir from the app - #581
Conversation
join.sh only ever ADDS a registration, so a team or agent whose project dir was mistyped (or whose repo moved) could only be fixed by leaving and re-joining. Add scripts/set-project.sh to repoint registrations in place (all of them, or one type via --type), and surface it in the desktop app as a "Change project directory..." context-menu item on team rows and member rows. - core: set-project.sh follows join.sh's locking (fujibee#141) and SQL-literal escaping (fujibee#87) conventions; normalizes legacy {type,project} records via full-replacement (json_patch would leave the old top-level keys behind) and collapses registrations that land on an existing identical one - api.sh: get_members now also emits a registrations [{type,project}] array so the app can read a specific type's project instead of the first registration's - app: the team-row flow always pins --type agmsg-app and takes its current value from the app-user registration, never Member.project (first registration) - moving a same-named agent's other registrations along with the team dir was flagged in adversarial review. Member rows deliberately move all of that agent's registrations. Both items are feature-gated on the installed core having set-project.sh - tests: 18 bats cases (incl. the agmsg-app + claude-code cross-type scenario), 2 Windows-gated Rust regression tests for the fujibee#315 MSYS-path handling Co-Authored-By: Claude <noreply@anthropic.com>
|
Thank you for this, and for the write-up — the summary states the part that matters before anyone has to go looking for it. When we talked on X I had this filed as an app-side change. Reading the PR, the core half is the substantive one, and your first line is why: That is worth being deliberate about, because a registration's So: we are reviewing it as a core change, not an app one. I am not going to attach a date to that, because a date I cannot keep is worse than no date. If we come back with anything it will be specific. The |
|
Following up with what the read turned up, because it changed our view of the problem rather than of the patch. What repointing touches beyond the config.
Your tests pin the config-level behaviour well — including the failure path leaving the config untouched, which is the one we would have asked for. The gap is not in them; it is that the state which would need to move alongside does not live in the config at all. The part we think is actually ours. Following that through, The same conflation runs into the app: what the New Team dialog presents as the team's project dir is the app-user's registration ( So: we think the We do not have an answer to that yet and are not going to invent one in a hurry. Meanwhile the Thank you for the push — the design question was sitting there before your PR, and it took your PR to make anyone look at it. |
Summary
join.shonly ever adds a registration, so a team or agent whose project dir was mistyped (or whose repo moved) could only be fixed by leaving and re-joining. This PR adds a sanctioned way to repoint registrations in place, and surfaces it in the desktop app.scripts/set-project.sh <team> <agent_id> <new_project> [--type <type>]— rewrites the matching registrations'project(all of them, or one type via--type). Followsjoin.sh's per-team locking (Team registry read-modify-write updates lose concurrent changes #141) and SQL-literal escaping (Harden SQLite query construction and parameter handling #87) conventions; normalizes legacy{type,project}records via full-replacement (ajson_patchmerge would leave the old top-level keys behind); collapses registrations that land on an existing identical one.get teams <team> membersnow also emits aregistrations: [{type, project}]array (existingname/types/projectfields unchanged), so consumers can read a specific type's project instead of the first registration's.--type agmsg-appand takes its current value from the app-user registration — neverMember.project(first registration) — so a same-named agent's other registrations can't be dragged along with the team dir (found in adversarial review). Member rows deliberately move all of that agent's registrations (othersalready excludes the app-user type). Both items are feature-gated on the installed core actually havingset-project.sh, so an older core never shows an action that would fail. i18n keys added to all 9 locales.Tests
test_team.bats(repoint,--typescoping, theagmsg-app+claude-codecross-type scenario, dedup, single-quote names/paths, lock release on success and failure paths, whoami resolution at the new path) + 1 intest_api.bats— full suites pass (85/85, 19/19)agmsg_set_project—cargo test60 passedvitest183 passed,tsc/vite buildcleanNote: the app-side feature stays dormant until a core release ships
set-project.shandapp/AGMSG_CORE_REFis bumped accordingly.Co-Authored-By: Claude noreply@anthropic.com