Skip to content

test(ai-action): prove built CLI and GitHub Action forwarding end to end #667

Description

@kunaldhongade

Problem

The new AI-first command has useful source-level CLI tests, but release-risk proof is incomplete:

  • built CLI coverage checks ai --help, not a complete built ai or ai preflight workflow
  • GitHub Action tests mostly assert that shell fragments exist in action.yml
  • string-presence assertions can pass even if mode guards, argument ordering, environment forwarding, output handling, or exit propagation are broken

This is a follow-up to the broader child-repository acceptance work in #655.

Acceptance criteria

Built CLI

  • Run the packed/built CLI for ai --format json against an isolated git repository.
  • Cover Codex default profile and at least one alternate profile.
  • Cover ai preflight --task using the built artifact.
  • Cover --cwd, --output, --base, --head, task filters, and invalid input.
  • Cover --with-checks passing, failing, skipped, and safety-blocked states.
  • Prove the bundle is written before documented non-zero --fail-on or verification exits.
  • Confirm no workspace-only imports or protocol dependencies are required.

GitHub Action

  • Execute the Action argument-building shell path with a fake CLI that records argv, environment, stdout/stderr, and exit status.
  • Prove mode: ai forwards profile, refs, cwd, output, format, fail-on, and with-checks correctly.
  • Prove with-checks is not forwarded to unsupported modes.
  • Prove agent mode does not receive fail-on.
  • Prove CLI failure propagates to the Action's final status while the summary/comment path remains best effort as designed.
  • Avoid tests whose only proof is actionYaml.toContain(...) for runtime behavior.

Dependency

OSS-first note

Use a small deterministic shell harness or an existing local GitHub Action runner if already available. Do not add a heavy custom runner when a maintained OSS tool fits.

Validation

  • pnpm run lint
  • pnpm typecheck
  • focused built CLI and Action tests
  • pnpm test
  • pnpm build
  • pnpm --filter @submuxhq/codedecay pack --dry-run

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: agentAgent task bundle and user-owned agent workflowarea: cliCLI package or command behaviorarea: github-actionComposite GitHub Action wrapperarea: packagingnpm package metadata or published contentspriority: highImportant work that should be handled soonstatus: needs-testsNeeds test coverage before it should mergetype: testTest coverage, fixtures, or verification improvements

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions