Skip to content

Release 0.3.3#1043

Merged
Wirasm merged 17 commits intomainfrom
dev
Apr 10, 2026
Merged

Release 0.3.3#1043
Wirasm merged 17 commits intomainfrom
dev

Conversation

@Wirasm
Copy link
Copy Markdown
Collaborator

@Wirasm Wirasm commented Apr 10, 2026

Release 0.3.3

Binary distribution improvements, new workflow node type, and a batch of bug fixes.

Added

Fixed


Merging this PR releases 0.3.3 to main.

coleam00 and others added 17 commits April 7, 2026 16:20
The useQuery for workflow definitions required both workflowName and
codebaseCwd to be truthy. For CLI-triggered runs or "No project" web
runs where codebase_id is null, codebaseCwd stays undefined and the
query never fires — showing "Loading graph..." forever. The server
already handles missing cwd by falling back to bundled defaults, so
the client gate only needs workflowName.

Fixes #958

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update inline comment to accurately describe the two-step server fallback:
when cwd is absent the server first tries the first registered codebase
before falling back to bundled defaults. The previous comment skipped the
intermediate step, which could confuse developers debugging unexpected
workflow resolution for "No project" runs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…I timeout

On CI (Ubuntu), fetch to gitlab.example.com resolves to a real IP and the
TCP connection hangs, causing the "detects mention at end of string" test
to time out after 5s. Locally on Windows, DNS fails fast so it passes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add ScriptNode schema and type guards (US-001)

Implements US-001 from the script-nodes PRD.

Changes:
- Add scriptNodeSchema with script, runtime (bun|uv), deps, and timeout fields
- Add ScriptNode type with never fields for mutual exclusivity
- Add isScriptNode type guard
- Add SCRIPT_NODE_AI_FIELDS constant (same as BASH_NODE_AI_FIELDS)
- Update dagNodeSchema superRefine and transform to handle script: nodes
- Update DagNode union type to include ScriptNode
- Add script node dispatch stub in dag-executor.ts (fails fast until US-003)
- Export all new types and values from schemas/index.ts
- Add comprehensive schema tests for ScriptNode parsing and validation

* feat: script discovery from .archon/scripts/

Implements US-002 from PRD.

Changes:
- Add ScriptDefinition type and discoverScripts() in script-discovery.ts
- Auto-detect runtime from file extension (.ts/.js->bun, .py->uv)
- Handle duplicate script name conflicts across extensions
- Add bundled defaults infrastructure (empty) for scripts
- Add tests for discovery, naming, and runtime detection

* feat: script execution engine (inline + named)

Implements US-003 from PRD.

Changes:
- Add executeScriptNode() in dag-executor.ts following executeBashNode pattern
- Support inline bun (-e) and uv (run python -c) execution
- Support named scripts via bun run / uv run
- Wire ScriptNode dispatch replacing 'not yet implemented' stub
- Capture stdout as node output, stderr as warning
- Handle timeout and non-zero exit
- Pass env vars for variable substitution
- Add tests for inline/named/timeout/failure cases

* feat: runtime availability validation at load time

Implements US-004 from PRD.

Changes:
- Add checkRuntimeAvailable() utility for bun/uv binary detection
- Extend validator.ts with script file and runtime validation
- Integrate script validation into parseWorkflow flow in loader.ts
- Add tests for runtime availability detection

* feat: dependency installation for script nodes

Implements US-005 from PRD.

Changes:
- Support deps field for uv nodes: uvx --with dep1... for inline
- Support uv run --with dep1... for named uv scripts
- Bun deps are auto-installed at runtime via bun's native mechanism
- Empty/omitted deps field produces no extra flags
- Add tests for dep injection into both runtimes

* test: integration tests and validation for script nodes

Implements US-006 from PRD.

Changes:
- Fill test coverage gaps for script node feature
- Add script + command mutual exclusivity schema test
- Add env var substitution tests ($WORKFLOW_ID, $ARTIFACTS_DIR in scripts)
- Add stderr handling test (stderr sent to user as platform message)
- Add missing named script file validation tests to validator.test.ts
- Full bun run validate passes

* fix: address review findings in script nodes

- Extract isInlineScript to executor-shared.ts (was duplicated in
  dag-executor.ts and validator.ts)
- Remove dead warnMissingScriptRuntimes from loader.ts (validator
  already covers runtime checks)
- Remove path traversal fallback in executeScriptNode — error when
  named script not found instead of executing arbitrary file paths
- Memoize checkRuntimeAvailable to avoid repeated subprocess spawns
- Add min(1) to scriptNodeSchema.script field for consistency
- Replace dynamic import with static import in validator.ts

* fix(workflows): address review findings for script node implementation

Critical fixes:
- Wrap discoverScripts() in try-catch inside executeScriptNode to prevent
  unhandled rejections when script discovery fails (e.g. duplicate names)
- Add isScriptNode to isNonAiNode check in loader.ts so AI-specific fields
  on script nodes emit warnings (activates SCRIPT_NODE_AI_FIELDS)

Important fixes:
- Surface script stderr in user-facing error messages on non-zero exit
- Replace uvx with uv run --with for inline uv scripts with deps
- Add z.string().min(1) validation on deps array items
- Remove unused ScriptDefinition.content field and readFile I/O
- Add logging in discoverAvailableScripts catch block
- Warn when deps is specified with bun runtime (silently ignored)

Simplifications:
- Merge BASH_DEFAULT_TIMEOUT and SCRIPT_DEFAULT_TIMEOUT into single
  SUBPROCESS_DEFAULT_TIMEOUT constant
- Use scriptDef.runtime instead of re-deriving from extname()
- Extract shared formatValidationResult helper, deduplicate section comments

Tests:
- Add isInlineScript unit tests to executor-shared.test.ts
- Add named-script-not-found executor test to dag-executor.test.ts
- Update deps tests to expect uv instead of uvx

Docs:
- Add script: node type to CLAUDE.md node types and directory structure
- Add script: to .claude/rules/workflows.md DAG Node Types section
* Investigate issues #1001, #1002, #1003: interactive-prd workflow bugs

* fix: interactive-prd workflow — capture responses, fix output path, reuse conversations (#1001, #1002, #1003)

The archon-interactive-prd workflow was completely non-functional due to three bugs:
approval gates didn't capture user responses (missing capture_response: true),
the generate node wrote to .claude/ which the Claude SDK blocks, and CLI
approve/reject created new conversations instead of reusing the original.

- Add capture_response: true to all three approval gates in the YAML
- Change output path from .claude/PRPs/prds/ to $ARTIFACTS_DIR/prds/
- Add conversationId to ApprovalOperationResult and RejectionOperationResult
- Look up and pass through original conversation ID in CLI approve/reject commands
- Add getConversationById mock to CLI workflow tests

Fixes #1001, #1002, #1003

* fix: guard conversation lookups, add tests, document approval node type

- Wrap getConversationById calls in try-catch in CLI approve/reject
  commands to prevent crashes when DB errors occur after approval is
  already recorded (falls back to new conversation ID)
- Log when conversation lookup fails or returns null for observability
- Add happy-path tests verifying platform conversation ID is passed
  through in both approve and reject commands
- Add JSDoc comments clarifying conversationId is a DB UUID (not
  platform ID) in operation result interfaces and WorkflowRunOptions
- Document approval: node type in CLAUDE.md DAG node types list
…set (#1009)

The inline comment stated ports 3100-3999 (implying basePort=3000) but the
actual basePort is 3090, making the true range 3190-4089, which already
matched the JSDoc. Update the inline comment to agree with both the JSDoc
and the arithmetic.

Closes #1008
)

* Investigate issues #1001, #1002, #1003: interactive-prd workflow bugs

* fix: replace Promise.any with Promise.all in validator script check (#1007)

Promise.any resolves with the first fulfilled promise regardless of value.
Since fileExists always fulfills (never rejects), Promise.any could return
false even when a later extension check would return true — a race condition
that flaked on Windows CI.

Fixes #1007
On Windows, path.join() produces backslashes which caused 3 test
failures in script-discovery on the Windows CI runner.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The reject command only read `--reason` flag but ignored positional
arguments. Running `bun run cli workflow reject <id> "feedback"` passed
undefined to rejectWorkflow(), defaulting to "Rejected". Now mirrors
the approve command pattern: reads both flag and positional args.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Investigate issue #978: one-command web UI install via archon serve

* feat: add `archon serve` command for one-command web UI install (#978)

Extract `startServer(opts)` from server's monolithic `main()` into an
exported function with `ServerOptions` (webDistPath, port,
skipPlatformAdapters). Add `import.meta.main` guard so the file still
works as a standalone script for `bun dev`.

Create `archon serve` CLI command that lazily downloads a pre-built
web UI tarball from GitHub releases on first run, verifies SHA-256
checksum, extracts atomically, then starts the full server. Cached
per version in `~/.archon/web-dist/<version>/`.

Update release CI to build the web UI, package it as
`archon-web.tar.gz`, and include in release checksums.

* fix: address review findings for archon serve command

- Validate --port range (1-65535) and reject NaN before any other checks
- Capture tar stderr for actionable extraction error messages
- Add structured logging (download_started/download_failed/server_start_failed)
- Post-extraction sanity check for index.html
- Wrap renameSync with error context and tmpDir cleanup
- Wrap fetch() calls to preserve URL context on network errors
- Validate parseChecksum returns 64 hex chars
- Set skipPlatformAdapters: true for standalone web UI mode
- Improve ServerOptions/ServeOptions JSDoc
- Move consoleErrorSpy cleanup to afterEach in tests
- Add tests for port validation and malformed hash rejection
- Update CLAUDE.md: CLI section, directory tree, package descriptions
- Update README.md: mention archon serve for binary installs
- Update docs-web: CLI reference, archon-directories

* refactor: simplify serve command implementation

- Use BUNDLED_IS_BINARY directly instead of version === 'dev' sentinel
- Extract toError() helper for repeated error normalization
- Use dirname() instead of manual substring/lastIndexOf
- Extract cleanupAndThrow() for repeated rmSync + throw pattern
- Add missing assertion on port 0 test for consistency
* feat: add automatic update check notification for binary users

Cache-based update check triggered by CLI commands and Web UI page load.
Fetches latest release from GitHub API with 24h cache staleness and 3s
timeout. CLI prints one-liner to stderr (suppressed by --quiet, skipped
for source builds). Web UI shows pulsing badge in TopNav linking to
release page. Also fixes release skill asset count (6 -> 7).

* fix: address review findings for update check notification

- Add BUNDLED_IS_BINARY guard to /api/update-check server route to
  prevent unintended GitHub API calls from source/dev builds
- Replace hand-crafted UpdateCheckResult interface with generated
  OpenAPI type (components['schemas']['UpdateCheckResponse'])
- Add staleness + checkedAt validation to getCachedUpdateCheck,
  matching readCache behavior
- Add debug-level logging to all bare catch blocks in update-check.ts
  for --verbose diagnostics
- Add releaseUrl guard in TopNav to prevent empty href links
- Fix SKILL.md: correct CI scope claim (Step 10 only, not 10-11) and
  clarify merge commit sync note
- Add tests: non-200 HTTP response, stale cache for getCachedUpdateCheck,
  missing checkedAt, and cache content verification
- Document /api/update-check endpoint and update-check.json cache file
  in CLAUDE.md and docs-web
- Regenerate api.generated.d.ts with UpdateCheckResponse schema

* refactor: simplify update check code

- Deduplicate getCachedUpdateCheck by delegating to readCache
- Extract shared noUpdate fallback object in server route
- Move guard clause outside try block in printUpdateNotice
- Fix cachePath variable scoping in readCache catch block
bun build --compile cannot resolve deep subpath imports through
wildcard export maps. Adding explicit entries for gitea and gitlab
adapter paths fixes binary builds.
* Investigate issue #978: one-command web UI install via archon serve

* fix: fail fast when Codex is used from compiled binary (#995)

The @openai/codex-sdk uses createRequire(import.meta.url) to resolve its
native platform binary, which breaks in bun --compile builds where
import.meta.url is frozen to the build host's path. Instead of a cryptic
createRequire crash, throw an actionable error directing users to install
from source or switch to the Claude provider.

Fixes #995

* fix: move binary guard to top of sendQuery, add beforeEach mock clear

Addresses code review: guard now fires before env-leak scanner to avoid
confusing error ordering, and MockCodex.mockClear() prevents cumulative
call counts across tests.

* feat: auto-resolve Codex native binary in compiled builds (#995)

Replace the fail-fast guard with full Codex binary resolution using the
SDK's codexPathOverride constructor option. In compiled binary mode, the
resolver checks (in order): CODEX_BIN_PATH env var, config
assistants.codex.codexBinaryPath, ~/.archon/vendor/codex/ cache, then
auto-downloads from npm registry.

In dev mode (bun link), returns undefined so the SDK uses its normal
node_modules-based resolution.

Adds codexBinaryPath config option so users can point to their own
Codex CLI install location.

Fixes #995

* fix: check env/config paths before platform detection for Windows CI

Move CODEX_BIN_PATH and config codexBinaryPath checks ahead of platform
detection so user-supplied paths work on any platform. Add win32-x64 and
win32-arm64 to the platform map for auto-download support.

* fix: normalize path separators in vendor test for Windows CI

* fix: remove auto-download, simplify resolver, fix review findings

- Remove ~100 lines of auto-download/checksum/extraction code from
  codex-binary-resolver.ts. Binary mode now throws with clear install
  instructions instead of silently downloading ~112 MB from npm.
- Fix init-promise leak: clear codexInitPromise on rejection so next
  call can retry after user installs Codex.
- Simplify Codex constructor call (remove conditional spread).
- Replace PLATFORM_BINARY_SUBPATH map with getVendorBinaryName() function
  that encodes the simple rule: Windows gets .exe, everything else gets
  codex. Rejects unsupported architectures explicitly.
- Restore specific log event name for env-leak gate config failure.
- Move codex-binary-resolver-dev.test.ts to its own bun test batch
  (mock.module isolation).
- Add tests: rejected-promise recovery, undefined-resolver result,
  binary-not-found-anywhere.
- Document CODEX_BIN_PATH in .env.example, codexBinaryPath in CLAUDE.md
  config example, vendor/codex/ in directory tree.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 10, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 642cf77f-457e-4255-87f7-74417bafb77e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Wirasm Wirasm merged commit c7d1281 into main Apr 10, 2026
4 of 7 checks passed
Tyone88 pushed a commit to Tyone88/Archon that referenced this pull request Apr 16, 2026
joaobmonteiro pushed a commit to joaobmonteiro/Archon that referenced this pull request Apr 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants