Repository navigation
feat: automations, approvals, secrets ls, run proposals (Agent Automations Phase 2, 0.1.26) - #43
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ecrets Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… awaiting_approval Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…roposal/reject Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fallbacks, actions_applied, run secrets) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ge, new); review nits - approvals inbox: /automations?tab=approvals; automation page: /automations/<id>; new: /automations/new - nan runs approve|accept names the run and points to its proposal - not-enabled 404 exits 65, not 64; reject message says automatic actions stay applied - --input help warns against secrets; exit 10 covered for nan runs logs -f Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copied verbatim from nan-cloud-api feat/automations-http-wiring (bafa111), internal/handlers/testdata/phase2. No non-test code changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…_from 2, has_diff false) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Agent Automations Phase 2, task T9 (spec: helmcode/nan-devops
AGENT-AUTOMATIONS-PHASE2.md§9.4, §7.6, §11, §13 nan-cli; issue helmcode/nan#163). Version 0.1.26. Do not merge until the Lead says so: merging publishes a release.New commands:
Changed:
nan runs showshows phase, automation, parent run, approval state and apply runs;nan runs ls --state awaiting_approval; the renderer printsapproval_requiredandactionevents;awaiting_approvalexits 10 (nan run,nan runs logs -f,nan automations run) with the hintnan runs proposal <id>, the portal run link andnan runs reject <id>.Portal-only (owner decision 10, §11.2): there is no
nan runs approve, nonan secrets set/rm, nonan automations create/edit/rm/triggers. Typing any of them exits 64 with where to do it and why (a browser sign-in is required so that nothing that can read the CLI session or a token, such as an agent in a workspace or a CI job, can do it). Help text says the same and links https://nan.builders/docs/runs.Auth:
nan auth loginnow postsclient=clion the magic-link verify, so the platform records the session ascli(T7). Automations and approvals use the existing precedence (NAN_TOKEN, --token-file, saved token, session, saved sk-);token_scope_deniedexplains how to get a token withautomations:read/automations:run.nan secrets lsalways uses the saved session (the platform refuses tokens and sk- keys there) and never sends a token.Every agent-controlled string (proposal bodies, commit messages, titles, labels, diffstat paths, the diff, delivery ids, names) goes through
runs.Sanitize/SanitizeLine;--jsongoes throughSafeJSON.Wire contract assumed (T6 not merged yet)
Coded against the spec's shapes with httptest mocks: the contract the Lead forwarded to T6: run object adds
phase,inference {source}(also readsinference_source),automation {id,name}(also readsautomation_idor a bare id),parent_run_id,apply_run_ids,approval(§7.6 object),approval_kinds,github_repo,trigger_depth,secrets [{env,exposure}],result.actions_applied [{kind,ok,ref}];/v1/approvalsitems carry the approval fields plusrun_state,workspaceandautomation(objects, orworkspace_id/automation_id); automation object is snake_case ofautomations.Automation;/api/account/secretserrors are{"error":code,"message"}. Portal links: run page/workspaces/<ws>/runs/<run>, approvals inboxhttps://cloud.nan.builders/automations(to confirm with T8a). If T6 picks other names, this PR follows before release.Tests
go build ./...,go vet ./...,gofmt -l .clean,go test ./...all pass, govulncheck: no vulnerabilities. New tests:internal/api/automations_test.go,internal/runs/proposal_test.go,cmd/automations_test.go,internal/auth(verify sendsclient=cli, noflow).Deploy notes
Release only after the platform side (T6) is deployed with the matching wire names, and before any member can reach
awaiting_approval(finding 12).🤖 Generated with Claude Code