Files
archie/prompts/organisation-automation/01-execution-identities.md
T
2026-11-17 17:53:58 +11:00

3.8 KiB

Implement live database execution identities

Read 00-start-here.md and GUIDELINES.md. Work against archie-core-kgxw.13; read and claim it before editing.

Outcome

A bot or service account created and assigned through the dashboard can execute a repository-free workflow without a configuration-file entry or process restart. The database is the lifecycle and identity authority. A database identity cannot silently acquire the root forge account, model authority or container grants.

Source investigation

Trace internal/domain/identity, organisation agent assignment, State Store identity RPC and principal assembly, internal/app/archied/bootstrap.go, internal/app/archied/main.go, internal/daemon/workflow_identity.go, internal/daemon/workflow_org.go, and identity-dependent paths in daemon.go and kit_task.go. Inspect ui/src/workflows/WorkflowSettings.vue and the organisation agent screen. Inspect every caller of declaredIdentity, identityMayAct, identityFor, publisherIdentity, configFor, forgeFor, treesFor and repoFor.

At handoff, the UI offered database IDs but execution used startup-built IdentityRunner objects from cfg.Identities. Forge/worktree NATS registrations were also startup-only. Verify these facts. Changing just the identity lookup while keeping root fallback paths would create a credential exposure.

Required behaviour

  1. Resolve a workflow's execution reference to a durable active agent identity. Canonical references use stable IDs, independent of editable display names. Refuse human, suspended, retired, missing and unassigned identities.
  2. Establish the identity's organisation from authoritative assignment. Refuse cross-organisation use even when a caller knows the other identity ID. Retain checks for both workflow invocation and execution, including binding context.
  3. Keep the persisted requesting actor distinct from the executing principal. Check the record and worker handoff, not just in-memory task mutation.
  4. New dashboard identities work live. Lifecycle or assignment changes affect subsequent attempts. An unavailable identity authority causes an explicit local refusal/dependency error, not permissive fallback.
  5. Audit all resource and RPC resolution. Database agents must not inherit root forge tokens, repository permissions or container credential grants. Do not create a second cached identity authority to patch over the split.
  6. Preserve existing configured identities through a narrowly scoped migration into their actual owning organisation. Do not delete settings or silently assign every identity to the system organisation. Preserve effective grants without granting anything to newly created agents by default.
  7. Keep repository authentication separate. A repository-free agent needs no forge connection. Until the connection slice is implemented, reject unsupported repository access explicitly rather than borrowing root credentials.
  8. Make workflow identity selection use eligible identities of the active organisation and display their names while saving stable IDs. Show loading, unavailable and empty states truthfully.

Do not invent new meanings for root or replace it with another organisation's agent automatically. Migrate existing references only with a deterministic, organisation-correct mapping; surface genuinely ambiguous records for resolution.

Acceptance evidence

Show a dashboard-created agent running a repository-free workflow through the actual daemon path. Cover refused human, inactive, unassigned and cross-org identities; authority outages; retry rechecks; and absence of root credential inheritance. Verify a renamed agent still resolves by ID. Verify existing mapped identities retain their permissions. Run the project gate and record evidence and any remaining limitations in the issue before closing it.