Skip to content

feat: add verify-automation skill with agent-facing API feature map and control CLI - #577

Merged
enyst merged 8 commits into
mainfrom
claude/automation-api-feature-map-p9ohd8
Oct 13, 2026
Merged

enyst merged 8 commits into
mainfrom
claude/automation-api-feature-map-p9ohd8

Conversation

@enyst

@enyst enyst commented Oct 12, 2026

Copy link
Copy Markdown
Member

Requested by Engel · project thread

I'm an AI agent based on Opus 5.5, helping Engel Nyst (@enyst) with project maintenance.

Before: we had no single place that says what the Automation Service does from an API consumer's point of view, and no way to drive it the way an agent does. Unit tests check handlers. Nothing walks a real service and a real Agent Server through the whole flow: create, dispatch, callbacks, webhooks, KV, git sync, the watchdog. That flow is what agents, the automation skill and SDK callbacks actually depend on.

After: .agents/skills/verify-automation/ is a pstack-style verification skill for the service's REST surface and background actors. An agent (or a person) launches this checkout next to a real Agent Server, then replays a maintained feature map: 17 families, 257 sub-features, every one with a runnable recipe. map run --all --fresh re-proves the lot and records evidence. On this branch it gives 255 pass, 8 xfail (known product bugs), 2 blocked (real Slack app), 0 fail; see .pr/verify-automation-replay.md.

This follows the feature-map, verification and maintenance pattern from pstack and from verify-agent-server (OpenHands/software-agent-sdk#5621), adapted for an HTTP service with webhooks, schedulers and runs.

What's in it

  • control-automation (one stdlib + httpx script) is the lever:
    • launch/doctor/restart/stop: an isolated local stack. The service runs in local mode (SQLite, local file store) and the Agent Server at the release uv.lock pins, each with a private HOME, keys and ports. Loop intervals are shrunk so the scheduler, dispatcher and watchdog act within seconds.
    • api (service or --agent-server) with --expect, --check, --until-ok, --field and --save evidence.
    • run wait, llm preset deepseek (Agent Server profiles), stdlib-only fixture tarballs (callback, fail, sleep, kv, ...), fixture git-remote, an HTTP sink.
    • event send signs deliveries with hmac_sha256_hex, standard_webhooks and slack_v0, checked against the service's own verifiers in tests. kv token mints KV JWTs; state sql gives read-only DB views.
    • Secrets are redacted everywhere: known keys, Fernet tokens, generated whsec_ webhook secrets.
    • map check|coverage|run|ids|routes|diff|owners and evidence add|report keep the map honest. map coverage reports all 60 agent-facing routes owned and driven; FastAPI's docs pages are listed as deliberately unmapped.
  • Feature map (references/feature-map/F01–F17): status and API contract, auth and CORS, capabilities and validate, uploads, CRUD, presets, dispatch and runs (including a real DeepSeek-backed preset run), cron, drafts, custom webhooks, event triggers, KV, git sync, watchdog and auto-disable, telemetry consent, the run's contract with the Agent Server, Slack stream sources.
  • references/: mapping.md (how to write and prove an entry), maintenance.md (diff-driven upkeep from the baseline commit), report.md, adaptation.md.
  • tests/test_verify_automation_skill.py: 29 offline tests for the CLI and map tooling, plus map check and map coverage on the committed map.

Known product bugs the map records (xfail, each reproduced at least twice)

ID Behaviour
F05.patch-null PATCH /v1/{id} with null for a NOT NULL field answers 500 (uncaught IntegrityError)
F06.continue-keep-alive / -false presets don't enforce keep_alive for continue_conversation the way raw create does
F09.template-after-draft-test after a draft test dispatch, POST /v1 with the same template.id answers 200 with the hidden DRAFT (find_existing_template_automation ignores state)
F10.patch-null-required PATCH /v1/webhooks/{id} with null name/enabled answers 500
F12.get-path-malformed, F12.patch-empty-path, F12.jwt-unknown-automation three KV inputs that answer 500 instead of 4xx

None are fixed here; this PR only maps them, so a fix will flip its bullet to xpass.

How

Recipes are fenced sh blocks under labelled bullets. map run executes each family top to bottom in one shell on a fresh stack, carries variables between bullets, and treats known bug bullets with a # bug line as xfail/xpass. Model-backed bullets (Needs: llm) use DeepSeek Flash through the Agent Server's active profile; the full replay cost under one cent and took about 35 minutes. .pr/ holds the replay record and is removed on approval.

🤖 Generated with Claude Code

https://claude.ai/code/session_01HomwUNbB4h5yAdD1krmQLa


Generated by Claude Code

enyst and others added 5 commits October 12, 2026 03:41
control-automation launches this checkout's service in local mode next to a
real Agent Server, drives every route with assertions, signs webhook
deliveries, mints KV tokens, and records evidence. The map tooling is ported
from verify-agent-server so both maps share one format.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HomwUNbB4h5yAdD1krmQLa
…, git sync, telemetry

Also harden control-automation: launch cleanup on failure, bare /ready
probe, logs --full, state sql --save, repeatable sink read --contains.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HomwUNbB4h5yAdD1krmQLa
… sources

Redact generated whsec_ secrets and event-send secrets everywhere, carry
every top-level assignment between bullets, add logs --wait.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HomwUNbB4h5yAdD1krmQLa
…e index

run wait now keeps polling a non-terminal status until its checks hold.
All 60 agent-facing routes are owned and driven across 17 families.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HomwUNbB4h5yAdD1krmQLa
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HomwUNbB4h5yAdD1krmQLa
@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor
  ✅ **PR Artifacts Cleaned Up**

  The `.pr/` directory is no longer present.

@enyst enyst self-assigned this Oct 12, 2026
@enyst enyst changed the title Add verify-automation: agent-facing API feature map and control CLI feat: add verify-automation skill with agent-facing API feature map and control CLI Oct 12, 2026
@github-actions github-actions Bot added the type: feat A new feature label Oct 12, 2026
@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Coverage

Warning

Your comment is too long (maximum is 65536 characters), so the coverage report was not added. See the job log for how to reduce it.

@enyst
enyst marked this pull request as ready for review October 12, 2026 05:33

@all-hands-bot all-hands-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This review was posted by an AI agent (OpenHands).

I re-established the current state for head 74caacf7dd333ac3a903351fefaf1247fbe4d895 before deciding: the PR is open, non-draft, labeled type: feat, and this account had published no prior review.

Scope: this is an additive, documentation-and-harness change that lives entirely under .agents/skills/verify-automation/ (plus relative tests/ and PR-only .pr/ artifacts). It documents this repository's own REST surface and background actors, which AGENTS.md assigns to this repo, and it touches no production code. In scope.

What I verified on the workspace at the head commit:

  • tests/test_verify_automation_skill.py: 29 passed. The tests exercise real code paths - the CLI against a live local HTTP server, signatures checked with the service's own get_verifier, KV tokens checked with verify_kv_token - not mocks.
  • control-automation map check --no-routes -> ok (17 families, 257 IDs, no structural problems); map coverage -> ok (63 routes, 60 owned, 60 driven, 0 unowned, 0 undriven). This matches the PR's claim of 257 sub-features and 60 agent-facing routes.
  • ruff check, ruff format --check, pycodestyle, and pyright on the new Python all pass cleanly, consistent with the repo's pre-commit config.
  • GitHub Actions for the exact head: ci, Run tests/unit-tests, Docker, PR Artifacts, and both PR Description Check runs succeed. The one pr-title / Lint PR title failure is the superseded run from the initial title and is followed by a passing rerun at 05:26:44 after the rename, so the current head's title check is green.

Security: no credentials, tokens, or key material are committed; the .pr/ replay record contains only redacted evidence. The CLI keeps generated keys under a 0700 private/ directory, forwards only an allowlisted environment into launched services, and redacts known secrets, whsec_ values, and Fernet tokens on every output path (including the evidence and --field paths), with raw values gated behind an explicit --unsafe-unredacted opt-in.

The map's known bug entries are recorded as xfail rather than fixes, which is the intended pattern and consistent with the repo guidance against blessing broken behavior.

No material correctness, security, compatibility, or acceptance-criterion defects found on this head. Low risk, additive, and well covered by focused tests and live tooling self-checks.

✅ APPROVED

@all-hands-bot all-hands-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This review was posted by an AI agent (OpenHands).

I re-established the current state before deciding. Head is now a25e00caa8d5dbe4141a206584a9af4847491568 (it moved from the earlier commit reviewed by this account), the PR is open, non-draft, and labeled type: feat. There is one prior review on the superseded commit; no review exists on this head, so this is not a duplicate pass.

Scope: additive documentation-and-harness change confined to .agents/skills/verify-automation/ plus tests/test_verify_automation_skill.py. It documents this repository's own REST surface and background actors, which AGENTS.md assigns to this repo, and it touches no production code. In scope.

What changed since the superseded commit: only the two PR-only artifacts .pr/F07.preset-e2e.run.json and .pr/verify-automation-replay.md were removed. I confirmed with git diff limited to the source tree that there is no code difference at all between the two heads - every skill, reference, and test file is byte-identical to what I previously reviewed. The .pr/ cleanup matches the repo's PR-artifacts convention.

Verification on the workspace at this head:

  • tests/test_verify_automation_skill.py: 29 passed. The tests drive the real CLI against a live local HTTP server and validate signatures with the service's own get_verifier and KV tokens with verify_kv_token, not mocks.
  • control-automation map check --no-routes -> ok (17 families, 257 IDs, no structural problems); map coverage -> ok (63 routes, 60 owned, 60 driven, 0 unowned, 0 undriven), matching the PR's stated counts.
  • ruff check, ruff format --check, pycodestyle, and pyright pass cleanly on the new Python, consistent with the repo's pre-commit config.
  • GitHub Actions for this exact head are all green: ci, Run tests/unit-tests, Docker, PR Artifacts, PR Description Check, and the pr-title conventional-commit check now pass (the earlier title-lint failure was on the superseded commit).

Security: no credentials or key material are committed, and removing the .pr/ replay record leaves no evidence artifacts in the tree. The CLI keeps generated keys under a 0700 private/ directory, forwards only an allowlisted environment into launched services, and redacts known secrets, whsec_ values, and Fernet tokens on output and evidence paths, with raw values gated behind an explicit --unsafe-unredacted opt-in.

The recorded known bug entries stay as xfail rather than fixes, which is the intended pattern and consistent with the guidance against blessing broken behavior.

No material correctness, security, compatibility, or acceptance-criterion defects found on this head. Low risk, additive, and covered by focused tests and the tooling's own live self-checks.

✅ APPROVED

@enyst

enyst commented Oct 12, 2026

Copy link
Copy Markdown
Member Author

Review from another AI Agent:

enyst#6

- state ls fails --expect entries when the directory is missing
- state cat, run wait and http-sink --field output is redacted
- F16 sets DeepSeek profiles only in its model-backed bullets, so
  fixture-only selections run without credentials
- exec runs in its own process group; a timeout or interrupt ends
  everything it spawned

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HomwUNbB4h5yAdD1krmQLa
@enyst

enyst commented Oct 13, 2026

Copy link
Copy Markdown
Member Author

I'm an AI agent based on Opus 5.5, helping Engel Nyst (@enyst) with project maintenance.

This addresses the Codex review recorded in enyst#6. I reproduced each of the four findings on a25e00c before changing anything. All four hold up, and 8645df8 fixes them:

  1. state ls --expect on a missing directory. It returned ok: true and exit 0. A missing directory now fails whenever --expect names an entry. Without --expect it still passes.
  2. --field bypassed redaction. state cat private/session_api_key --field . printed the key. state cat, run wait and fixture http-sink now pass --field values through REDACT.obj, like api and state sql already did. No recipe relied on the clear value.
  3. F16 Preconditions needed DeepSeek. llm preset deepseek moved into the three Needs: llm bullets. With DEEPSEEK_API_KEY unset, map run --file F16 --only F16.bash-command --fresh now passes.
  4. exec timeouts left descendants running. exec now starts the program in its own session and stops the whole process group on a timeout or interrupt.

Three regression tests cover 1, 2 and 4. All three fail on a25e00c and pass now, and the skill suite is at 32 passed. Pre-commit is clean. Every family that uses state ls or exec passed again on a fresh stack: F01, F02, F04, F05, F07, F10, F12, F13, F14 and F16, with only the known-bug xfails.


Generated by Claude Code

@all-hands-bot all-hands-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This review was posted by an AI agent (OpenHands).

I re-established the current state before deciding. Head is now 8645df80b12b9b4eaee154e2d934fda84376f83d (it moved past the two commits this account previously reviewed), the PR is open, non-draft, mergeable, and labeled type: feat. There is no prior review on this head, and a comment from @enyst was posted after the earlier reviews, so this is a legitimate re-review rather than a duplicate.

Scope: additive documentation-and-harness change confined to .agents/skills/verify-automation/ plus tests/test_verify_automation_skill.py. It documents this repository's own REST surface and background actors, which AGENTS.md assigns to this repo, and touches no production code. In scope.

What changed since the previously reviewed commit: three files, addressing the four findings @enyst recorded from the Codex review in enyst#6. I verified each fix against the workspace rather than taking the summary on trust:

  1. state ls --expect on a missing directory now returns ok: false (not args.expect_exists and not args.expect), so a required entry in a directory that does not exist fails instead of silently passing. Without --expect it still passes, which is the right behavior.
  2. --field output is now redacted in state cat, run wait, and fixture http-sink (value = REDACT.obj(value)), matching what api and state sql already did. I grepped every --field print site and confirmed all five now pass through the redactor; the raw opt-in remains only on the api/event send paths, where the map deliberately uses --unsafe-unredacted for generated whsec_ secrets. No recipe reads a secret back through the newly-redacted commands, so nothing regresses.
  3. The family-level llm preset deepseek precondition in F16 moved into the three Needs: llm bullets, so the credential-free bullets no longer require an LLM to be configured. The Needs: llm, pypi markers are already present on exactly those three bullets.
  4. exec now runs the program with start_new_session=True and calls stop_process_group on timeout or any other exception, so a timed-out client no longer leaves descendants running. The except BaseException path re-raises after cleanup, which is correct.

Verification on the workspace at this head:

  • tests/test_verify_automation_skill.py: 32 passed (up from 29), including the three new regression tests for fixes 1, 2, and 4. The exec test genuinely exercises the process-group teardown against a real spawned child.
  • control-automation map check --no-routes -> ok (17 families, 257 IDs, no structural problems); map coverage -> ok (63 routes, 60 owned, 60 driven, 0 unowned, 0 undriven).
  • ruff check, ruff format --check, pycodestyle, and pyright all pass on the changed Python.
  • GitHub Actions for this exact head are all green: ci, Run tests, Docker, PR Artifacts, PR Description Check, and the pr-title conventional-commit check.

Security: no credentials or key material are committed. The redaction fix is a net improvement - it closes the one path where a stored key could be printed by state cat ... --field .. Generated keys stay under a 0700 private/ directory, launched services get only an allowlisted environment, and evidence and logs remain redacted.

No material correctness, security, compatibility, or acceptance-criterion defects found on this head. The follow-up commit strengthens both correctness and secret handling, and the added tests cover the fixes.

✅ APPROVED

exec runs its program in a new session, outside the recipe's process
group, so the SIGTERM map run sends on a recipe timeout killed only the
exec CLI. exec now turns SIGTERM into an immediate SIGKILL of its
program's group before exiting, inside the recipe runner's grace.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HomwUNbB4h5yAdD1krmQLa
@enyst

enyst commented Oct 13, 2026

Copy link
Copy Markdown
Member Author

I'm an AI agent based on Opus 5.5, helping Engel Nyst (@enyst) with project maintenance.

This answers the follow-up Codex finding on 8645df8. The finding holds up. I reproduced it with the same shape execute_recipe uses. A bash recipe ran in its own session and called exec --timeout 60 on a program that spawns a sleep child. Stopping the recipe's group with the 0.5 s grace left both the program and its child running.

d0f8fd6 fixes it. While exec waits on its program, it handles SIGTERM by SIGKILLing the program's process group, then exits. That happens well inside the runner's grace period. An exec timeout still stops the group gracefully, as before. A recipe timeout or interrupt now kills it at once.

test_recipe_timeout_ends_what_exec_started drives execute_recipe with a recipe that calls the real CLI and checks that both the program and its child stop. It fails on 8645df8 and passes now. The skill suite is at 33 passed and pre-commit is clean. F01 and F13, which use exec, pass again on a fresh stack.


Generated by Claude Code

@enyst
enyst requested a review from all-hands-bot October 13, 2026 04:47

@all-hands-bot all-hands-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This review was posted by an AI agent (OpenHands).

I re-established the current mutable state before deciding. Head is d0f8fd6371feb896af0a907a2dd3cf73552bbe19 (it moved past 8645df8, the commit this account last reviewed). The PR is open, not draft, mergeable: true, labeled type: feat, with a review request for all-hands-bot. The check runs on this head all pass, including unit-tests. There are no linked issues with a readiness or priority label to re-read (closingIssuesReferences is empty; the referenced enyst/automation#6 is an external review-recording issue). This account has not reviewed d0f8fd6, so this is not a duplicate.

Scope. Additive, agent-facing material under .agents/skills/verify-automation/ plus one test file. It documents and drives this repository's own Automation Service REST surface; it does not change service, dispatch, scheduling, or sandbox behavior, and it stays inside this repo's ownership boundary. No cross-repository move is warranted. It continues the existing skill/test pattern in this repo.

Delta since the last review. The only changed files versus 8645df8 are scripts/control_automation.py and tests/test_verify_automation_skill.py. The fix addresses the real defect from the prior round: exec runs its program in its own session/process group, so a SIGTERM that the runner sends to the recipe's group never reached it, leaving the program and its descendants running after a map run recipe timeout. cmd_exec now installs a SIGTERM handler that kills the program's group and exits, restoring the previous handler in a finally. The BaseException path also switched from stop_process_group(..., grace=2.0) to an immediate os.killpg(..., SIGKILL), which is the right call inside the caller's 0.5 s grace window. The exec-timeout path is unchanged, so a plain exec timeout still stops the group gracefully.

What I verified in the workspace at this head.

  • uv run --frozen python -m pytest tests/test_verify_automation_skill.py -q -> 33 passed. This includes the two process-lifecycle tests: test_exec_timeout_ends_the_programs_descendants (exec-timeout path) and the new test_recipe_timeout_ends_what_exec_started, which drives the real CLI through execute_recipe and asserts both the program and its child stop.
  • ruff check and ruff format --check on both changed files -> clean.
  • The control-automation wrapper resolves CONTROL_AUTOMATION_PYTHON, then .venv/bin/python, then uv run --project, so a CONTROL_AUTOMATION_PYTHON override works when only a bare Python is available; the test builds its recipe from sys.executable, which is consistent with that.
  • Redaction and --field behavior added in the prior round (state cat, run wait, fixture http-sink passing --field values through REDACT.obj) are still present and covered by tests; the --unsafe-unredacted escape hatch is correctly gated to require --field/--print-header. No secrets are committed; the only token-looking strings in the added files are deliberately fake xapp-qa/xoxb-qa Slack values.

No material correctness, security, compatibility, or acceptance-criterion defect found on this head. Remaining map entries recorded as xfail are explicitly known product bugs this PR only documents, which is out of scope for this change.

✅ APPROVED

@enyst
enyst merged commit 3d09435 into main Oct 13, 2026
12 checks passed
@openhands-release-bot openhands-release-bot Bot added the released: 1.20.0 Shipped in 1.20.0 label Oct 15, 2026
@openhands-release-bot

Copy link
Copy Markdown
Contributor

🚀 Released in 1.20.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released: 1.20.0 Shipped in 1.20.0 type: feat A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants