census: agent login by link re-proposed (readPendingLogins)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/superpowers/notes/census-proposal-agent-login-link.md+3 −3internal/provision/testdata/plan14-root-reads-agent-login-link.tsv+5 −5internal/provision/testdata/plan14-root-reads-chain.tsv+1 −1
Intent
<task-notification> <task-id>a860323caa5890f17</task-id> <tool-use-id>toolu_01P6MVwY9Q6PCZZEmCL13yWt</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/a1de5273-c148-49b8-8267-3dee9d49c9c1/tasks/a860323caa5890f17.output</output-file> <status>completed</status> <summary>Agent "Implement Task 4: CLI link + relay" finished</summary> <note>A task-notification fires each time this agent stops with no live background children of its own. The user can send it another message and resume it, so the same task-id may notify more than once.</note> <result>Status: DONE Commit: 1201ebcc "carlos auth login: never delete another attempt's pending file" **Tests:** `go test . -run 'TestAuth|TestPendingLogin|TestAgentLabel' -count=1` passes (25s). gofmt and go vet are clean, and the darwin and windows builds pass. **Change:** - `savePendingLogin` now writes only its own file. It then removes attempt files whose stored `ExpiresAt` has passed, and nothing else. - A new helper, `readPendingLogins(sweep)`, lists the unexpired attempts and removes expired ones by exact path. - `loadPendingLogin` uses that helper and returns the newest unexpired attempt. A zero `ExpiresAt` counts as unexpired. - `clearPendingLoginIf` is unchanged: it removes only its own exact path. - I updated the "already expired does not poll" test, because an already-expired attempt is now swept on load and `--wait` says "no login waiting". An attempt that expires mid-wait still gets the expired message and is cleared. - New tests: `TestPendingLoginConcurrentWritersKeepBoth` (both files survive, load picks B) and `TestPendingLoginExpiredFilesAreSweptOthersKept` (save and load each sweep expired files and keep unexpired ones). No test asserted that a new `--no-wait` removes older attempts, so none needed replacing. **Census:** `go test ./internal/provision -run TestPlan14RootReadCensus -count=1` fails with 6 discrepancies, so the overlay must be re-proposed. I did not edit census files. - changed root read: `savePendingLogin` - stale root read: `loadPendingLogin` - unclassified root read: `readPendingLogins` (`ReadDir`, `ReadFile`) - changed root source envelope - changed legacy declaration: `loadPendingLogin` and `savePendingLogin` Report (fix wave 2 section appended; `.superpowers` is gitignored, so it is on disk only): /home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-agent-login-link/.superpowers/sdd/2026-11-07-agent-login-link/task-4-report.md</result> <usage><subagent_tokens>82510</subagent_tokens><tool_uses>4</tool_uses><duration_ms>90387</duration_ms></usage> </task-notification>
diff --git a/docs/superpowers/notes/census-proposal-agent-login-link.md b/docs/superpowers/notes/census-proposal-agent-login-link.md| index 9d5287500..385e97080 100644 |
| --- a/docs/superpowers/notes/census-proposal-agent-login-link.md |
| +++ b/docs/superpowers/notes/census-proposal-agent-login-link.md |
| @@ -8,9 +8,9 @@ Review: a model from the other family than the author reads the branch's diff ag |
| New dispositions, which census-propose wrote and the reviewer checks against the unit's reads and the diff: |
| -- new `authpending.go:loadPendingLogin`: reads +file:ReadDir, +file:ReadFile; written legacy, accepted-legacy, frozen |
| -- new `authpending.go:savePendingLogin`: reads +file:CreateTemp, +file:ReadDir; written legacy, accepted-legacy, frozen |
| +- new `authpending.go:readPendingLogins`: reads +file:ReadDir, +file:ReadFile; written legacy, accepted-legacy, frozen |
| +- new `authpending.go:savePendingLogin`: reads +file:CreateTemp; written legacy, accepted-legacy, frozen |
| -Seal: `7247af7f4de84593d83c6f60c0147d0a04836146197dd60c2ed2bf78919cad22` → `ba92f1aaa53d17ca26f8f8032b6d1d78eaa4720b8a3c9967f7eca55efe69addf`. |
| +Seal: `7247af7f4de84593d83c6f60c0147d0a04836146197dd60c2ed2bf78919cad22` → `b7935cb5de27be9d3d8abd10911ed0312ec889ad4dc0b50d4ed9dcaca5e15cbd`. |
| Overlay: `internal/provision/testdata/plan14-root-reads-agent-login-link.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`. |
diff --git a/internal/provision/testdata/plan14-root-reads-agent-login-link.tsv b/internal/provision/testdata/plan14-root-reads-agent-login-link.tsv| index 63d8c6337..3f81b1f3d 100644 |
| --- a/internal/provision/testdata/plan14-root-reads-agent-login-link.tsv |
| +++ b/internal/provision/testdata/plan14-root-reads-agent-login-link.tsv |
| @@ -1,8 +1,8 @@ |
| # Census overlay agent-login-link, written by census-propose (#369). census-ruling-agent-login-link, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-agent-login-link.md. |
| # 0 body, 0 sites, 1 envelope: each changed unit re-frozen at its existing disposition with its claim appended. |
| # 2 new dispositions: 0 reads re-frozen at their disposition with the claim, 2 new units frozen accepted-legacy, 0 quiet units retired while they read nothing, 0 other. |
| -@legacy 197524f5f785b60fe96d18c962ce391e52bc4c077a09fe23bb1f3b5d76467d1b authpending.go loadPendingLogin legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-login-link;basis=new: reads the newest unexpired attempt file under login-pending.d/ beside the CLI credentials file for carlos auth login --wait; user-run CLI path, same directory and pattern as loadCredentials file:ReadDir@66,file:ReadFile@321 bae631810e22226c009bcf699e730e02eca94ca0da4035b57e4b0b06d116cc97 |
| -@legacy 29cdb9d9ebb9840795d01b8cfac1b2a98287f06728c3ee324b3339785f2ec92d authpending.go savePendingLogin legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-login-link;basis=new: writes one attempt file under login-pending.d/ atomically (CreateTemp + chmod 0600 + rename) beside the credentials file for carlos auth login --no-wait and removes other attempts; same pattern as credentialFile.save file:CreateTemp@257,file:ReadDir@675 b9a0d113e296a6e013427a8b312eaf8a19db33885b386cd91bfd9a4cfa5064f4 |
| -authpending.go loadPendingLogin legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-login-link;basis=new: reads the newest unexpired attempt file under login-pending.d/ beside the CLI credentials file for carlos auth login --wait; user-run CLI path, same directory and pattern as loadCredentials file:ReadDir@66,file:ReadFile@321 bae631810e22226c009bcf699e730e02eca94ca0da4035b57e4b0b06d116cc97 |
| -authpending.go savePendingLogin legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-login-link;basis=new: writes one attempt file under login-pending.d/ atomically (CreateTemp + chmod 0600 + rename) beside the credentials file for carlos auth login --no-wait and removes other attempts; same pattern as credentialFile.save file:CreateTemp@257,file:ReadDir@675 b9a0d113e296a6e013427a8b312eaf8a19db33885b386cd91bfd9a4cfa5064f4 |
| -@coverage . ccf5af22c7f7144d115a5e44e3c2a7952bc276f64d92c276c7aa82561b829261 |
| +@legacy 8c041c2731437fddfe69896ac8af61a3da72e3a211484818be8f1fe935943cf4 authpending.go readPendingLogins legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-login-link;basis=new: lists login-pending.d/ beside the CLI credentials file and reads each attempt file file:ReadDir@105,file:ReadFile@404 6551b22b2ccf9ec9b2fd705a3980856af45e3cf678939758ad2f04563344af8d |
| +@legacy 02a09284e001222ccb12e15602065490046b3452a7194758b6b1d713ad412540 authpending.go savePendingLogin legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-login-link;basis=changed: writes only its own attempt file, never lists or deletes other unexpired attempts file:CreateTemp@257 e0ec5e37e2ee9e1cb59550f4a54031d94e60d0401054a7ca05e4c8cc8c867c12 |
| +authpending.go readPendingLogins legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-login-link;basis=new: lists login-pending.d/ beside the CLI credentials file and reads each attempt file file:ReadDir@105,file:ReadFile@404 6551b22b2ccf9ec9b2fd705a3980856af45e3cf678939758ad2f04563344af8d |
| +authpending.go savePendingLogin legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-login-link;basis=changed: writes only its own attempt file, never lists or deletes other unexpired attempts file:CreateTemp@257 e0ec5e37e2ee9e1cb59550f4a54031d94e60d0401054a7ca05e4c8cc8c867c12 |
| +@coverage . 76766c2373ed18657eb1898db1078f63a90cea151739be5ec5b692d20ab3bcbd |
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv| index ef1c705ab..b4bc73ab0 100644 |
| --- a/internal/provision/testdata/plan14-root-reads-chain.tsv |
| +++ b/internal/provision/testdata/plan14-root-reads-chain.tsv |
| @@ -118,4 +118,4 @@ plan14-root-reads-claim-ux-edge.tsv 889ce9f72f93b581b29527e5c5d4410b47732424ce8c |
| plan14-root-reads-region-ha-g3-fixes.tsv cd001bf3a9a8871f12d1ca9cfa0a925760c1fc345dc911246ffaabc235dfabf6 |
| plan14-root-reads-claim-countdown.tsv 5b31785441c6a48ddae93e9f3c0f8962f7983b55d89b3acb90d9a6b505647b36 |
| plan14-root-reads-region-ha-dr2.tsv 7247af7f4de84593d83c6f60c0147d0a04836146197dd60c2ed2bf78919cad22 |
| -plan14-root-reads-agent-login-link.tsv ba92f1aaa53d17ca26f8f8032b6d1d78eaa4720b8a3c9967f7eca55efe69addf |
| +plan14-root-reads-agent-login-link.tsv b7935cb5de27be9d3d8abd10911ed0312ec889ad4dc0b50d4ed9dcaca5e15cbd |