Skip to content
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@
## Rust Specific Guidance

This repository is written in Rust and uses Cargo for building and dependency
management. Contributors should follow these best practices when working on the
project:
management. Contributors should follow these best practices when working on
the project:

- Run `make fmt`, `make lint`, and `make test` before committing. These targets
wrap `cargo fmt`, `cargo clippy`, and `cargo test` with the appropriate flags.
Expand Down
670 changes: 497 additions & 173 deletions docs/behavioural-testing-in-rust-with-cucumber.md

Large diffs are not rendered by default.

15 changes: 7 additions & 8 deletions docs/netsuke-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,10 @@ Each entry in the `rules` list is a mapping that defines a reusable action.
field (defaulting to `/bin/sh -e`). For `/bin/sh` scripts, each interpolation
is automatically passed through the `shell_escape` filter unless a `| raw`
filter is applied. Future versions will allow configurable script languages
with their own escaping rules.
On Windows, scripts default to `powershell -Command` unless the manifest's
`interpreter` field overrides the setting. Exactly one of `command` or
`script` must be provided. The manifest parser enforces this rule to prevent
invalid states.
with their own escaping rules. On Windows, scripts default to `powershell
-Command` unless the manifest's `interpreter` field overrides the setting.
Exactly one of `command` or `script` must be provided. The manifest parser
enforces this rule to prevent invalid states.
Comment thread
coderabbitai[bot] marked this conversation as resolved.

Internally, these options deserialize into a shared `Recipe` enum tagged with
a `kind` field. Serde aliases ensure manifests that omit the tag continue to
Expand Down Expand Up @@ -1388,9 +1387,9 @@ possibilities for future enhancements beyond the initial scope.

## Section 10: Example Manifests

The repository includes several complete Netsuke manifests in the
`examples/` directory. They demonstrate how the YAML schema can be applied
to real-world projects.
The repository includes several complete Netsuke manifests in the `examples/
` directory. They demonstrate how the YAML schema can be applied to real-world
projects.

- [`basic_c.yml`](../examples/basic_c.yml): a minimal C project compiling two
object files and linking them into a small application.
Expand Down
49 changes: 25 additions & 24 deletions docs/roadmap.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Netsuke Implementation Roadmap

This roadmap translates the [netsuke-design.md](http://netsuke-design.md) document into a phased,
actionable implementation plan. Each phase has a clear objective and a checklist
of tasks that must be completed to meet the success criteria.
This roadmap translates the [netsuke-design.md](netsuke-design.md) document into
a phased, actionable implementation plan. Each phase has a clear objective and a
checklist of tasks that must be completed to meet the success criteria.

## Phase 1: The Static Core 🏗️

Expand All @@ -17,10 +17,10 @@ compilation pipeline from parsing to execution.
document.

- [ ] Define the core Abstract Syntax Tree (AST) data structures
(NetsukeManifest, Rule, Target, StringOrList, Recipe) in
src/[ast.rs](http://ast.rs).
(NetsukeManifest, Rule, Target, StringOrList, Recipe) in `src/ast.rs`.

- [ ] Annotate AST structs with #[derive(Deserialize)] and #[serde(deny_unknown_fields)]
- [ ] Annotate AST structs with #[derive(Deserialize)] and
#[serde(deny_unknown_fields)]
to enable serde_yaml parsing.

- [ ] Implement parsing for the netsuke_version field and validate it using
Expand All @@ -37,7 +37,7 @@ compilation pipeline from parsing to execution.
- [ ] **Intermediate Representation (IR) and Validation:**

- [ ] Define the IR data structures (BuildGraph, Action, BuildEdge) in
src/[ir.rs](http://ir.rs), keeping it backend-agnostic as per the design.
`src/ir.rs`, keeping it backend-agnostic as per the design.

- [ ] Implement the ir::from_manifest transformation logic to convert the
AST into the BuildGraph IR.
Expand All @@ -53,25 +53,25 @@ compilation pipeline from parsing to execution.

- [ ] **Code Generation and Execution:**

- [ ] Implement the Ninja file synthesizer in src/ninja_[gen.rs](http://gen.rs) to traverse
the BuildGraph IR.
- [ ] Implement the Ninja file synthesizer in
[src/ninja_gen.rs](src/ninja_gen.rs) to traverse the BuildGraph IR.

- [ ] Write logic to generate Ninja rule statements from ir::Action structs
and build statements from ir::BuildEdge structs.

- [ ] Implement the process management logic in [main.rs](http://main.rs) to invoke the ninja
executable as a subprocess using std::process::Command.
- [ ] Implement the process management logic in `main.rs` to invoke the ninja
executable as a subprocess using `std::process::Command`.

- **Success Criterion:**

- [ ] Netsuke can successfully take a Netsukefile without any Jinja
syntax, compile it to a [build.ninja](http://build.ninja) file, and execute it via the ninja
subprocess to produce the correct build artifacts.
- [ ] Netsuke can successfully take a Netsukefile without any Jinja syntax,
compile it to a `build.ninja` file, and execute it via the ninja subprocess
to produce the correct build artifacts.

## Phase 2: The Dynamic Engine ✨

Objective: To integrate the minijinja templating engine, enabling dynamic
build configurations with variables, control flow, and custom functions.
Objective: To integrate the minijinja templating engine, enabling dynamic build
configurations with variables, control flow, and custom functions.

- [ ] **Jinja Integration:**

Expand All @@ -86,8 +86,8 @@ build configurations with variables, control flow, and custom functions.

- [ ] **Dynamic Features and Custom Functions:**

- [ ] Implement support for basic Jinja control structures ({% if %}, {% for %})
and the foreach key for target generation.
- [ ] Implement support for basic Jinja control structures ({% if %}, {% for
%}) and the foreach key for target generation.

- [ ] Implement the essential custom Jinja function env(var_name) to read
system environment variables.
Expand All @@ -101,14 +101,14 @@ build configurations with variables, control flow, and custom functions.
- **Success Criterion:**

- [ ] Netsuke can successfully build a manifest that uses variables,
conditional logic, the foreach loop, custom macros, and the glob()
function to discover and operate on source files.
conditional logic, the foreach loop, custom macros, and the glob() function
to discover and operate on source files.

## Phase 3: The "Friendly" Polish 🛡️

Objective: To implement the advanced features that deliver a superior,
secure, and robust user experience, focusing on security, error reporting, the
standard library, and CLI ergonomics.
Objective: To implement the advanced features that deliver a superior, secure,
and robust user experience, focusing on security, error reporting, the standard
library, and CLI ergonomics.

- [ ] **Security and Shell Escaping:**

Expand Down Expand Up @@ -142,7 +142,8 @@ standard library, and CLI ergonomics.
- [ ] Implement the path and file filters (basename, dirname, with_suffix,
realpath, contents, hash, etc.).

- [ ] Implement the generic collection filters (`uniq`, `flatten`, `group_by`).
- [ ] Implement the generic collection filters (`uniq`, `flatten`,
`group_by`).

- [ ] Implement the network and command functions/filters (fetch, shell,
grep), ensuring shell marks templates as impure to disable caching.
Expand Down
Loading