chore: add execute command to cli - #418
Merged
Merged
Conversation
Closed
nlopes
force-pushed
the
nlopes-add-acdc-execute
branch
from
July 11, 2026 15:52
2567e4b to
c34545c
Compare
nlopes
force-pushed
the
nlopes-add-acdc-execute
branch
from
September 26, 2026 15:38
c34545c to
f9d7159
Compare
nlopes
pushed a commit
to jdc-pub/acdc
that referenced
this pull request
Sep 26, 2026
Add the acdc-execute workspace library crate and replace the PR nlopes#418 execution scaffold's todo!() placeholders with working behavior behind the acdc-cli `execute` feature. acdc-execute discovers command blocks - listing or source blocks carrying the `command` role and an explicit id - from a parsed document, including blocks nested in sections, admonitions, container delimited blocks, and list items, and blocks reached through `include::`. Commands declare prerequisites with `deps="a, b"`; the command graph reports duplicate ids, unknown dependencies, cycles, missing ids, non-listing command blocks, and invalid ids, and yields execution queues in topological order that preserves document order for independent commands. Scripts run as parser-verbatim listing content written to a temporary file passed to the interpreter named by the block's `[source, <lang>]` header (default `sh`), in the caller's working directory and environment. A non-zero exit is a command failure; an unwritable script or unspawning interpreter is an infrastructure failure. `acdc execute` selects commands with exact `--id` and `--id-regex` selectors (a union that includes transitive dependencies, each command run at most once; no selectors selects everything), supports `--dry-run`, `--exit-on-failure`, and `-S` parser safe mode, and reports missing selectors and malformed command blocks as normal CLI diagnostics. Assisted-by: Goose:glm-5.3-flash
nlopes
force-pushed
the
nlopes-add-acdc-execute
branch
from
September 26, 2026 16:51
f9d7159 to
16ba007
Compare
nlopes
pushed a commit
to jdc-pub/acdc
that referenced
this pull request
Sep 26, 2026
Add the acdc-execute workspace library crate and replace the PR nlopes#418 execution scaffold's todo!() placeholders with working behavior behind the acdc-cli `execute` feature. acdc-execute discovers command blocks - listing or source blocks carrying the `command` role and an explicit id - from a parsed document, including blocks nested in sections, admonitions, container delimited blocks, and list items, and blocks reached through `include::`. Commands declare prerequisites with `deps="a, b"`; the command graph reports duplicate ids, unknown dependencies, cycles, missing ids, non-listing command blocks, and invalid ids, and yields execution queues in topological order that preserves document order for independent commands. Scripts run as parser-verbatim listing content written to a temporary file passed to the interpreter named by the block's `[source, <lang>]` header (default `sh`), in the caller's working directory and environment. A non-zero exit is a command failure; an unwritable script or unspawning interpreter is an infrastructure failure. `acdc execute` selects commands with exact `--id` and `--id-regex` selectors (a union that includes transitive dependencies, each command run at most once; no selectors selects everything), supports `--dry-run`, `--exit-on-failure`, and `-S` parser safe mode, and reports missing selectors and malformed command blocks as normal CLI diagnostics. Assisted-by: Goose:glm-5.3-flash
nlopes
pushed a commit
to jdc-pub/acdc
that referenced
this pull request
Sep 27, 2026
Add the acdc-execute workspace library crate and replace the PR nlopes#418 execution scaffold's todo!() placeholders with working behavior behind the acdc-cli `execute` feature. acdc-execute discovers command blocks - listing or source blocks carrying the `command` role and an explicit id - from a parsed document, including blocks nested in sections, admonitions, container delimited blocks, and list items, and blocks reached through `include::`. Commands declare prerequisites with `deps="a, b"`; the command graph reports duplicate ids, unknown dependencies, cycles, missing ids, non-listing command blocks, and invalid ids, and yields execution queues in topological order that preserves document order for independent commands. Scripts run as parser-verbatim listing content written to a temporary file passed to the interpreter named by the block's `[source, <lang>]` header (default `sh`), in the caller's working directory and environment. A non-zero exit is a command failure; an unwritable script or unspawning interpreter is an infrastructure failure. `acdc execute` selects commands with exact `--id` and `--id-regex` selectors (a union that includes transitive dependencies, each command run at most once; no selectors selects everything), supports `--dry-run`, `--exit-on-failure`, and `-S` parser safe mode, and reports missing selectors and malformed command blocks as normal CLI diagnostics. Assisted-by: Goose:glm-5.3-flash
nlopes
force-pushed
the
nlopes-add-acdc-execute
branch
from
September 27, 2026 15:45
16ba007 to
129d5d8
Compare
nlopes
pushed a commit
to jdc-pub/acdc
that referenced
this pull request
Sep 27, 2026
Add the acdc-execute workspace library crate and replace the PR nlopes#418 execution scaffold's todo!() placeholders with working behavior behind the acdc-cli `execute` feature. acdc-execute discovers command blocks - listing or source blocks carrying the `command` role and an explicit id - from a parsed document, including blocks nested in sections, admonitions, container delimited blocks, and list items, and blocks reached through `include::`. Commands declare prerequisites with `deps="a, b"`; the command graph reports duplicate ids, unknown dependencies, cycles, missing ids, non-listing command blocks, and invalid ids, and yields execution queues in topological order that preserves document order for independent commands. Scripts run as parser-verbatim listing content written to a temporary file passed to the interpreter named by the block's `[source, <lang>]` header (default `sh`), in the caller's working directory and environment. A non-zero exit is a command failure; an unwritable script or unspawning interpreter is an infrastructure failure. `acdc execute` selects commands with exact `--id` and `--id-regex` selectors (a union that includes transitive dependencies, each command run at most once; no selectors selects everything), supports `--dry-run`, `--exit-on-failure`, and `-S` parser safe mode, and reports missing selectors and malformed command blocks as normal CLI diagnostics. Assisted-by: Goose:glm-5.3-flash
Add the acdc-execute workspace library crate and replace the PR #418 execution scaffold's todo!() placeholders with working behavior behind the acdc-cli `execute` feature. acdc-execute discovers command blocks - listing or source blocks carrying the `command` role and an explicit id - from a parsed document, including blocks nested in sections, admonitions, container delimited blocks, and list items, and blocks reached through `include::`. Commands declare prerequisites with `deps="a, b"`; the command graph reports duplicate ids, unknown dependencies, cycles, missing ids, non-listing command blocks, and invalid ids, and yields execution queues in topological order that preserves document order for independent commands. Scripts run as parser-verbatim listing content written to a temporary file passed to the interpreter named by the block's `[source, <lang>]` header (default `sh`), in the caller's working directory and environment. A non-zero exit is a command failure; an unwritable script or unspawning interpreter is an infrastructure failure. `acdc execute` selects commands with exact `--id` and `--id-regex` selectors (a union that includes transitive dependencies, each command run at most once; no selectors selects everything), supports `--dry-run`, `--exit-on-failure`, and `-S` parser safe mode, and reports missing selectors and malformed command blocks as normal CLI diagnostics. Assisted-by: Goose:glm-5.3-flash
Rename command metadata and source parsing terminology from shell or language to interpreter while documenting the direct executable contract. Preserve dry-run blank lines and improve command graph diagnostics and coverage. Assisted-by: Goose:glm-5 Assisted-by: Goose:gpt-5.6-luna
Read the source interpreter from the parser's language attribute and handle fallible options construction in the safe-mode test. The current parser already preserves malformed command IDs. Its replacement attribute scanner also makes the old grammar workaround unnecessary once command discovery uses the language attribute.
Retain block bodies after preprocessing and before inline substitutions. Expose block metadata and locations through inherent methods, removing the private Locateable trait. Resolve locations to original files and retain source recovery diagnostics after warnings are consumed, so execution can reject incomplete input. Fix escaped attribute references and empty values in textual substitution. Reduce allocations in conditional parsing and substitution checks. Co-authored-by: Codex <noreply@openai.com>
Discover commands in source order across nested blocks and table cells. Prepare owned scripts from retained source, expanding attributes only when enabled and using the values in scope at each command. Reject incomplete input, missing attributes, duplicate IDs, unknown dependencies, and cycles before execution. Build deterministic plans that include prerequisites and borrow command data from the graph. Return structured outcomes, skip failed dependents, and stop on infrastructure errors or signal termination. Support child-specific working directories and environment overrides. Adapt existing CLI calls to the new library API to keep this commit buildable; integrate execution reports and CLI options separately. Co-authored-by: Codex <noreply@openai.com>
Use dependency-aware execution plans and structured outcomes in the CLI. Keep exact-ID and regex selector unions and automatic prerequisites, and add command listings, child working directories, and environment overrides. Dry-run shows prepared scripts; failed prerequisites block dependents, and stop-on-failure halts the remaining plan. Report errors at their original source locations and cache source reads across diagnostic batches. Document script substitution and execution trust boundaries. Forward parser features consistently and add execute library, execute-only, and feature-unification coverage to CI. Co-authored-by: Codex <noreply@openai.com>
Rename adoc to discovery and expose DiscoveryError directly. Keep each module's implementation and tests in mod.rs, with error definitions in a private error.rs. Use direct parser imports and update the README and changelog.
Render --list entries as bullets with labeled ids, effective interpreters, direct prerequisites, descriptions, and nearest section titles. Quote metadata and escape control characters to keep each entry on one line. Preserve section context through nested blocks and includes, and restore the outer title after leaving a section inside a table cell.
Owner
Author
nlopes
pushed a commit
that referenced
this pull request
Sep 27, 2026
Add the acdc-execute workspace library crate and replace the PR #418 execution scaffold's todo!() placeholders with working behavior behind the acdc-cli `execute` feature. acdc-execute discovers command blocks - listing or source blocks carrying the `command` role and an explicit id - from a parsed document, including blocks nested in sections, admonitions, container delimited blocks, and list items, and blocks reached through `include::`. Commands declare prerequisites with `deps="a, b"`; the command graph reports duplicate ids, unknown dependencies, cycles, missing ids, non-listing command blocks, and invalid ids, and yields execution queues in topological order that preserves document order for independent commands. Scripts run as parser-verbatim listing content written to a temporary file passed to the interpreter named by the block's `[source, <lang>]` header (default `sh`), in the caller's working directory and environment. A non-zero exit is a command failure; an unwritable script or unspawning interpreter is an infrastructure failure. `acdc execute` selects commands with exact `--id` and `--id-regex` selectors (a union that includes transitive dependencies, each command run at most once; no selectors selects everything), supports `--dry-run`, `--exit-on-failure`, and `-S` parser safe mode, and reports missing selectors and malformed command blocks as normal CLI diagnostics. Assisted-by: Goose:glm-5.3-flash
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.

This is just the skeleton/harness for building #396.

Closes #396.