Skip to content

fix(board): Resolve-Board resolves identity via the account map; -Lang es boards get the canonical Status (#793, #794) - #802

Merged
CSalcedoDataBI merged 4 commits into
nextfrom
issue-793-owner-to-token-map-is-hardcoded-to-two
Oct 24, 2026
Merged

CSalcedoDataBI merged 4 commits into
nextfrom
issue-793-owner-to-token-map-is-hardcoded-to-two

Conversation

@CSalcedoDataBI

Copy link
Copy Markdown
Owner

Closes #793
Closes #794

Summary

#793 — a third account is configuration, not a plugin edit. The owner→token map already lives in ~/.agentic-board/accounts.json (#762), and Get-GhAccount -Account already validates against that map. What was still missing was Resolve-Board.ps1: it used whatever $env:GH_TOKEN held. It now takes -TokenVar and resolves through Get-GhTokenForContext, like New-BoardPR and Board-Depend. So /board init reaches any account in the map, and an explicit -TokenVar that is unset fails before any gh call. Brake-armed behaviour is unchanged: only the agent identity is accepted.

#794 — -Lang es boards get the canonical Status.

  • Apply-FieldPreset.ps1: a localized preset field that the board already has under its canonical name (es Estado vs the built-in Status) is reconciled with the canonical fields.en.json definition instead of being skipped. The result is Todo → Backlog (renamed in place, so assignments are kept) plus In Review and Blocked. This applies only to fields with a canonical vocabulary (Status/Priority/Size).
  • Resolve-Board.ps1 prints "born on the canonical vocabulary (no legacy 'Todo')" only after reading the live Status options back. Otherwise it warns and lists the legacy and missing options.
  • The other es field names (Prioridad, Tamaño…) are left as they are. Resolve-Board prints a note about them, and the fields.es.json description documents the difference from the standard schema.

Test plan

  • New Pester: identity through the map (third account, explicit -TokenVar, unset var fails closed, braked run refuses); the Status read-back verdict; es preset renames Todo→Backlog with the same option id and never creates Estado.
  • Resolve-Board tests are now isolated from the developer's own account map (ABIOS_ACCOUNTS_FILE → TestDrive, dummy GH_TOKEN).
  • Locally: Resolve-Board, Resolve-Board.Link, Apply-FieldPreset, Resolve-GhTokenVar and Get-AbiosAccounts all pass (84/84). Update-Docs.ps1 -Check OK. CI runs the full suite.

Do not merge while the plugin is under directory review.

🤖 Generated with Claude Code

…g es boards get the canonical Status (#793, #794)

- Resolve-Board takes -TokenVar and picks its token through Get-GhTokenForContext, like
  New-BoardPR and Board-Depend: a third account is a line in accounts.json, never a hand-set
  GH_TOKEN. Brake-armed runs still accept only the agent identity.
- Apply-FieldPreset: a localized field the board already has under its canonical name (es
  'Estado' vs 'Status') is reconciled with the canonical definition instead of skipped, so
  Todo -> Backlog plus In Review and Blocked.
- Resolve-Board prints "born on the canonical vocabulary" only after reading Status back; it
  warns with the legacy/missing options otherwise, and notes the es field names.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@claude

claude Bot commented Oct 24, 2026

Copy link
Copy Markdown

Sin hallazgos bloqueantes. Revisé el diff completo.

  • Resolve-Board usa Get-GhTokenForContext igual que New-BoardPR y Board-Depend. Se aplica la restricción del brake y hay tests de fail-before-gh.
  • Apply-FieldPreset reemplaza el campo localizado por la definición canónica solo cuando existe vocabulario canónico. Las funciones usadas están definidas antes del bloque.
  • El mensaje "born canonical" ahora se decide leyendo Status de vuelta.

Nits opcionales, no bloquean:

  1. Resolve-Board.ps1: Get-StatusVerdict se calcula antes del chequeo -not $status. Funciona, pero conviene mover el cálculo dentro de la rama else.
  2. Resolve-Board.ps1: $env:GH_TOKEN se sobrescribe en el proceso del caller cuando se invoca con &. Lo cubren los tests y es consistente con otros scripts. Basta con documentarlo.

…er canonical verdict (#793, #794)

Review round 1:
- Resolve-Board lends the resolved token to gh for its own run only and restores the caller's
  GH_TOKEN in a finally, so an in-process call no longer leaks the chosen identity.
- The "born canonical" verdict also fails on Status options the vocabulary does not know.
- Tests: armed run without -TokenVar uses the agent identity, a missing agent token stops before
  any gh call, the agent var named explicitly is accepted; the token is captured at gh-call time.
- Field-Vocabulary test updated: -Lang es no longer skips Status, it reconciles it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@claude

claude Bot commented Oct 24, 2026

Copy link
Copy Markdown

Sin bugs bloqueantes. La lógica es correcta: el swap al preset canónico en Apply-FieldPreset, la restauración de GH_TOKEN en finally y el veredicto de Status leído del board. Los tests cubren los caminos principales.

Menores, ninguno bloquea:

  • Resolve-Board.ps1: el comentario "Identity (Owner-to-token map is hardcoded to two accounts; a third own account needs a plugin edit #793)…" quedó encima de Get-StatusVerdict, y el código de identidad está más abajo. Muévelo junto al bloque $ctx.
  • Apply-FieldPreset.ps1: Get-OptName en el Write-Host se evalúa sobre $useCanon.options. Si el preset en tiene un campo sin options, la línea imprime vacío. Es inofensivo, pero conviene protegerlo.
  • Tests: falta uno para Get-StatusVerdict con opciones extra y legacy (rama WARN), y otro para Apply-FieldPreset cuando fields.en.json no existe (Test-Path falso, cae al skip antiguo).

…the create path's identity (#793)

Review round 2: the resolver finds a brake marker from the current directory upwards, so both
Resolve-Board test files now run from a clean TestDrive folder. A new test proves create, link and
the nested Apply-FieldPreset all run on the explicitly chosen token and the caller's is restored.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@claude

claude Bot commented Oct 24, 2026

Copy link
Copy Markdown

Review: sin bugs bloqueantes. La lógica es correcta: las firmas de Get-CanonicalOptionName(s) coinciden con los usos, el finally restaura GH_TOKEN en todos los caminos de salida, y el token no se filtra ni se loguea.

Sugerencias menores (no bloquean):

  1. Resolve-Board.ps1: el comentario "Identity (Owner-to-token map is hardcoded to two accounts; a third own account needs a plugin edit #793)…" quedó separado de su código por Get-StatusVerdict, que se insertó entre ambos. Mueve la función arriba del comentario.
  2. $env:ABIOS_TOKENVAR_DOTSOURCE = $prevT: si $prevT era $null, la variable queda definida pero vacía en vez de eliminarse. Usa [Environment]::SetEnvironmentVariable(..., $null) o Remove-Item Env: para restaurar el estado original.
  3. El try { sin re-indentar es una deuda de legibilidad. Aceptable por el diff, pero conviene extraer el cuerpo a una función en un follow-up.
  4. Tests: faltan casos de -TokenVar explícito y de rechazo dentro de un run armado con el brake. El comentario del script dice que se "juzga", pero ningún test lo cubre. Tampoco hay test del camino Get-StatusVerdict no-ok (WARN con legacy/missing/extra).

@CSalcedoDataBI

Copy link
Copy Markdown
Owner Author

External review - claude-review (Claude API, clean context)

Reviewed commit: 66a3388dae242ff54fef7fb8e395b376a6f4ec70

Three xhigh rounds on the full diff. R1: caller GH_TOKEN leaked after the in-process call (fixed with try/finally restore), missing armed-run tests without -TokenVar (added), verdict accepted unknown Status options (now fails). R2: tests not isolated from an ambient brake marker (now run from a clean TestDrive cwd), create path identity untested (test added: create, link and nested Apply-FieldPreset all on the chosen token). R3: no findings. Every finding verified in source before fixing.

@CSalcedoDataBI

Copy link
Copy Markdown
Owner Author

On hold: waiting for the Anthropic plugin directory review. Do not merge yet.

The agentic-board plugin is in its first review in the Anthropic plugin directory, and the directory tracks main. Every merge to main becomes a new version that replaces the one under review and restarts the queue. This PR stays on its branch until the plugin leaves review, or until the owner decides to merge the whole batch at once.

Batch waiting together: #799, #800, #801, #802, #803, #804.

@claude

claude Bot commented Oct 24, 2026

Copy link
Copy Markdown

Review (sha 0156a41) — En general sólido: identidad vía Get-GhTokenForContext, restauración de GH_TOKEN en finally, y el mensaje "born canonical" ahora se lee del board. Sin bugs bloqueantes. Menores:

  1. Comentario huérfano (Resolve-Board.ps1, ~l.66): el bloque "Identity (Owner-to-token map is hardcoded to two accounts; a third own account needs a plugin edit #793): the owner's account…" quedó encima de Get-StatusVerdict en vez de encima del bloque Get-GhTokenForContext. Muévelo; hoy confunde.
  2. -Lang es + Status ya renombrado: si el board ya tiene Status con opciones personalizadas, Apply-FieldPreset ahora las migra (Todo→Backlog, +In Review/Blocked) y Get-StatusVerdict marca extra como no canónico. Es coherente, pero conviene un test que cubra opciones desconocidas (que no se borren) en el camino es.
  3. Fallo silencioso del canonical preset: si fields.en.json no existe (Test-Path falso) se cae a $pf sin aviso, reintroduciendo el skip del Resolve-Board -Lang es leaves Status on GitHub defaults (Todo/In Progress/Done) yet reports "no legacy 'Todo'" #794. Un Write-Warning ahí facilitaría el diagnóstico.
  4. Mantenibilidad: envolver todo el script en un try sin re-indentar es entendible por el diff, pero deja una deuda; considera re-indentar en un commit aparte.

Seguridad: no veo secrets expuestos; el token solo se presta a gh durante el run y se restaura en todos los caminos de salida.

@CSalcedoDataBI
CSalcedoDataBI merged commit 3131e8f into next Oct 24, 2026
5 checks passed
@CSalcedoDataBI
CSalcedoDataBI deleted the issue-793-owner-to-token-map-is-hardcoded-to-two branch October 24, 2026 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

on-hold-directory Waiting for the Anthropic plugin directory review before merging

Projects

None yet

1 participant