Skip to content

Document YAML-first templating pipeline#116

Merged
leynos merged 5 commits intomainfrom
codex/refactor-yaml-and-jinja-parser-interaction
Aug 15, 2025
Merged

Document YAML-first templating pipeline#116
leynos merged 5 commits intomainfrom
codex/refactor-yaml-and-jinja-parser-interaction

Conversation

@leynos
Copy link
Copy Markdown
Owner

@leynos leynos commented Aug 15, 2025

Summary

  • describe six-stage YAML-first build pipeline with deferred Jinja rendering
  • clarify foreach/when semantics and prohibition on structural Jinja
  • refresh roadmap for data-first parsing and iteration context

Testing

  • make fmt
  • make lint
  • make test
  • make markdownlint
  • make nixie (fails: Runtime error while rendering diagram)

https://chatgpt.com/codex/tasks/task_e_689e835a8678832297752b53416887f0

Summary by Sourcery

Document the transition to a six-stage YAML-first templating pipeline, clarify Jinja usage constraints, and update the development roadmap accordingly.

New Features:

  • Introduce documentation for the six-stage YAML-first build pipeline with deferred Jinja rendering

Enhancements:

  • Clarify the semantics of the foreach and when keys and prohibit structural Jinja control blocks
  • Update the roadmap to reflect data-first parsing, iteration context preservation, and the two-pass expansion model

Documentation:

  • Revise design documentation to describe the new pipeline stages and the prohibition of structural templating
  • Refresh roadmap entries to align with the enhanced parsing and rendering workflow

@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented Aug 15, 2025

Reviewer's Guide

This PR revises the Netsuke documentation to introduce a six-stage YAML-first build pipeline with deferred Jinja rendering, clarifies templating and iteration semantics (including prohibition of structural Jinja), and updates the roadmap to reflect the new data-first parsing approach.

Flow diagram for the six-stage YAML-first build pipeline

flowchart TD
    A[Stage 1: Manifest Ingestion]
    B[Stage 2: Initial YAML Parsing]
    C[Stage 3: Template Expansion]
    D[Stage 4: Deserialisation & Final Rendering]
    E[Stage 5: IR Generation & Validation]
    F[Stage 6: Ninja Synthesis & Execution]
    A --> B --> C --> D --> E --> F
Loading

Flow diagram for foreach/when expansion and Jinja rendering restrictions

flowchart TD
    A[Initial YAML Value]
    B[Expand foreach/when keys with Jinja]
    C[Preserve iteration context]
    D[Deserialise to Rust structs]
    E[Render Jinja only in string fields]
    F[Prohibit structural Jinja]
    A --> B --> C --> D --> E
    B --> F
Loading

File-Level Changes

Change Details Files
Update build pipeline to a six-stage YAML-first process
  • Renumber pipeline stages from five to six
  • Revise stage 2-4 descriptions to reflect initial YAML parsing, template expansion, and final rendering
  • Adjust references in summaries and command docs to the six-stage pipeline
docs/netsuke-design.md
Clarify templating semantics and forbid structural Jinja
  • Describe initial parse into serde_yml::Value before any templating
  • Specify Jinja expressions render only within string fields
  • Prohibit use of {% %} blocks for control flow in YAML structure
docs/netsuke-design.md
Refine foreach and when iteration behavior
  • Change example to use bare expressions for foreach and add optional when
  • Explain that each iteration preserves its environment for later rendering
  • Emphasize generated build graph remains fully static
docs/netsuke-design.md
Refresh roadmap for data-first parsing and iteration context
  • Replace two-pass parsing item with data-first parsing description
  • Update control-structure support to forbid structural tags
  • Add pending item for foreach and when carrying iteration context
docs/roadmap.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Aug 15, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Warning

Rate limit exceeded

@leynos has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 5 minutes and 44 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between a347513 and 6148a07.

📒 Files selected for processing (7)
  • Makefile (1 hunks)
  • docs/behavioural-testing-in-rust-with-cucumber.md (1 hunks)
  • docs/netsuke-design.md (8 hunks)
  • docs/roadmap.md (2 hunks)
  • scripts/assert-file-absent.sh (1 hunks)
  • src/cli.rs (1 hunks)
  • tests/runner_tests.rs (3 hunks)

Summary by CodeRabbit

  • New Features

    • Documentation now covers foreach/when semantics and a glob() function for file matching.
  • Documentation

    • Updated design to a six-stage build pipeline with revised stage semantics.
    • Clarified data-first parsing and templating limited to string values.
    • Replaced sequence diagram with a six-stage flowchart.
    • Refreshed CLI/error examples and narrative; standardised spelling to “artifact”.
  • Chores

    • Normalised script error messages to use “artifact” spelling.
  • Notes

    • No changes to public APIs.

Walkthrough

Summarise the docs and script edits that switch Netsuke to a six-stage, YAML-first pipeline: parse manifest to an untyped YAML Value, expand foreach/when and macros over the Value, then deserialize to typed structs and render string fields; add glob() semantics and normalise spelling to "artifact."

Changes

Cohort / File(s) Summary
Design pipeline overhaul
docs/netsuke-design.md
Renumber pipeline to six stages; move initial parse before templating; define Template Expansion over serde_yaml::Value; restrict Jinja to string fields; formalise foreach/when semantics and per-iteration environment; update examples, flowchart, CLI wording and spelling.
Roadmap alignment
docs/roadmap.md
Replace two-pass approach with parse→expand→deserialize flow; document foreach/when keys and preserved iteration context; add glob(pattern) with sorted results; restrict structural Jinja; update success criteria and examples.
Behavioural testing wording
docs/behavioural-testing-in-rust-with-cucumber.md
Normalise spelling from "artefact" to "artifact" and expand wording about structured, executable specs (living documentation).
Assertion scripts
scripts/assert-file-absent.sh, scripts/assert-file-exists.sh
Normalise comments and runtime messages from "artefact" to "artifact"; no functional changes to argument handling or checks.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant Netsuke
  participant YAML as "YAML Parser"
  participant Tmpl as "Template Expander"
  participant Deser as "Deserialiser"
  participant IR as "IR Validator"
  participant Ninja as "Ninja Synth/Exec"

  User->>Netsuke: Provide manifest
  Netsuke->>YAML: Parse to serde_yaml::Value
  YAML-->>Netsuke: Untyped YAML Value
  Netsuke->>Tmpl: Expand foreach/when and macros (Value walk)
  Tmpl-->>Netsuke: Expanded Value
  Netsuke->>Deser: Deserialize into typed structs
  Deser-->>Netsuke: Typed model (strings still templated)
  Netsuke->>IR: Generate and validate IR/graph
  IR-->>Netsuke: Valid IR
  Netsuke->>Ninja: Synthesize build.ninja and execute
Loading
sequenceDiagram
  participant Value as "YAML Value"
  participant Exp as "Template Expander"
  participant Env as "Jinja Env"

  Value->>Exp: Encounter foreach: glob("assets/svg/*.svg")
  Exp->>Env: Evaluate glob(), when filters
  Env-->>Exp: Return sorted paths
  loop For each item
    Exp->>Exp: Preserve per-iteration environment
    Exp-->>Value: Insert expanded entries into Value tree
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~18 minutes

Possibly related PRs

Suggested reviewers

  • codescene-delta-analysis

Poem

March six stages, tidy, bright,
Parse the tree and keep the sight.
Expand each foreach, preserve the scope,
Render strings later, keep structure’s hope.
Glob in order; let the graph sleep tight.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch codex/refactor-yaml-and-jinja-parser-interaction

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes - here's some feedback:

  • Update the CLI summary under “Netsuke build” to list all six pipeline stages (using the new stage names) instead of referencing the old five-stage flow.
  • Unify spelling conventions across the document (e.g. artifact vs artefact, synthesize vs synthesise) for consistency.
  • Refresh the pipeline diagram to include the sixth stage and resolve the nixie rendering error so the visualization matches the documented flow.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Update the CLI summary under “Netsuke build” to list all six pipeline stages (using the new stage names) instead of referencing the old five-stage flow.
- Unify spelling conventions across the document (e.g. artifact vs artefact, synthesize vs synthesise) for consistency.
- Refresh the pipeline diagram to include the sixth stage and resolve the nixie rendering error so the visualization matches the documented flow.

## Individual Comments

### Comment 1
<location> `docs/netsuke-design.md:37` </location>
<code_context>
 The process of transforming a user's `Netsukefile` manifest into a completed
-build artifact follows a distinct, five-stage pipeline. This multi-stage data
-flow ensures that dynamic configurations are fully resolved into a static plan
+build artefact now follows a six-stage pipeline. This data flow validates the
+manifest as YAML first, then resolves all dynamic logic into a static plan
 before execution, a critical requirement for compatibility with Ninja.
</code_context>

<issue_to_address>
'artefact' should be spelled 'artifact' per en-oxendic spelling.

Please change 'artefact' to 'artifact' to conform to en-oxendic spelling standards.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread docs/netsuke-design.md
codescene-delta-analysis[bot]

This comment was marked as outdated.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 8

🔭 Outside diff range comments (3)
docs/netsuke-design.md (3)

66-76: Stage 5 text reads well; ensure “validation” is consistently referenced earlier.

Keep “IR Generation & Validation” wording consistent in earlier mentions and diagrams.


867-873: Remove structural Jinja example; it violates the new prohibition.

This example uses {% if %} blocks. The updated design forbids structural Jinja. Replace with a string-only conditional example or move it to a “prior model (deprecated)” note.

Suggest replacing with a string-level conditional example:

{{ ("config.yaml" | contents) if ("config.yaml" is file and "config.yaml" is readable) else "" }}

1078-1114: Fix malformed Ninja code fences in docs/netsuke-design.md

Pinpoint and correct broken fences at lines 1078–1114:

  • Replace the opening and closing ```````ninjafences around therule cc` snippet with a single matching pair:

    # Generated from an ir::Action
    rule cc
      command     = gcc -c -o $out $in
      description = CC $out
      depfile     = $out.d
      deps        = gcc
  • Wrap the ir::BuildEdge example in its own properly closed fence and inline the implicit dependency:

    # Generated from an ir::BuildEdge
    build foo.o: cc foo.c
    build bar.o: cc bar.c
    build my_app: link foo.o bar.o | lib_dependency.a
  • Remove stray backticks and ensure each code block opens with ninja and closes with before the “Write Build Edges” heading.

Verify with:

  • make markdownlint
  • make nixie
📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

💡 Knowledge Base configuration:

  • Jira integration is disabled

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 888fc6b and 849411a.

📒 Files selected for processing (2)
  • docs/netsuke-design.md (5 hunks)
  • docs/roadmap.md (2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.md

📄 CodeRabbit Inference Engine (AGENTS.md)

**/*.md: Markdown files must use en-GB-oxendict ("-ize" / "-yse" / "-our") spelling and grammar. (EXCEPTION: the naming of the "LICENSE" file, which is to be left unchanged for community consistency.)
Validate Markdown files using make markdownlint.
Run make fmt after any documentation changes to format all Markdown files and fix table markup.
Validate Mermaid diagrams in Markdown files by running make nixie.
Markdown paragraphs and bullet points must be wrapped at 80 columns.
Code blocks must be wrapped at 120 columns.
Tables and headings must not be wrapped.
Use dashes (-) for list bullets.
Use GitHub-flavoured Markdown footnotes ([^1]) for references and footnotes.

Files:

  • docs/roadmap.md
  • docs/netsuke-design.md

⚙️ CodeRabbit Configuration File

**/*.md: * Avoid 2nd person or 1st person pronouns ("I", "you", "we")

  • Use en-GB-oxendict (-ize / -our) spelling and grammar
  • Headings must not be wrapped.
  • Documents must start with a level 1 heading
  • Headings must correctly increase or decrease by no more than one level at a time
  • Use GitHub-flavoured Markdown style for footnotes and endnotes.
  • Numbered footnotes must be numbered by order of appearance in the document.

Files:

  • docs/roadmap.md
  • docs/netsuke-design.md
docs/**/*.md

📄 CodeRabbit Inference Engine (AGENTS.md)

docs/**/*.md: Reference: Use the markdown files within the docs/ directory as a knowledge base and source of truth for project requirements, dependency choices, and architectural decisions.
Update: When new decisions are made, requirements change, libraries are added/removed, or architectural patterns evolve, proactively update the relevant file(s) in the docs/ directory to reflect the latest state. Ensure the documentation remains accurate and current.

Files:

  • docs/roadmap.md
  • docs/netsuke-design.md
🔍 Remote MCP (Deepwiki)

Here are a few concrete facts that will help when reviewing this PR:

  1. Existing pipeline (pre-PR #116) is a five-stage flow in docs/netsuke-design.md:

    1. Stage 1: Manifest Ingestion
    2. Stage 2: Jinja Evaluation
    3. Stage 3: YAML Parsing & Deserialization
    4. Stage 4: IR Generation & Validation
    5. Stage 5: Ninja Synthesis & Execution
  2. That file also includes a Mermaid sequence diagram block showing these five stages, e.g.:

    sequenceDiagram
      participant USER as "User"
      participant JINJA as "minijinja::Environment"
      …  
      Note over JINJA: "Stage 2: Template rendering with glob(), env() functions"
      …  
      Note over NINJA_GEN: "Stage 5: Ninja synthesis & execution"
    
    Loading

    This will need updating to reflect the six-stage pipeline.

  3. The repository’s Makefile defines a nixie target (and AGENTS.md recommends make nixie) to validate Mermaid diagrams in Markdown. The reported “make nixie” failure means the updated diagram isn’t rendering correctly under nixie.

With this context, you can ensure that the new six-stage pipeline descriptions, the Mermaid diagram, and the nixie validation steps are all updated and in sync.

⏰ Context from checks skipped due to timeout of 120000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build-test
🔇 Additional comments (4)
docs/netsuke-design.md (4)

34-40: Good: Six-stage pipeline introduction landed cleanly.

The six-stage framing and “artefact”/“synthesises” en-GB spelling are correct.


59-66: Correct: Stage 4 is string-only rendering and forbids structural tags.

The restriction to string fields and prohibition of {% %} blocks aligns with the YAML-first model.


77-84: LGTM: Stage 6 wording uses en-GB (“synthesises”).

No changes required.


356-360: Reinforce prohibition: avoid implying structural templating.

Keep emphasising that only YAML values carry templating; the structure must remain static.

Comment thread docs/netsuke-design.md
Comment thread docs/netsuke-design.md
Comment thread docs/netsuke-design.md
Comment thread docs/netsuke-design.md Outdated
Comment thread docs/roadmap.md
Comment thread docs/roadmap.md
Comment thread docs/roadmap.md Outdated
Comment thread docs/roadmap.md
codescene-delta-analysis[bot]

This comment was marked as outdated.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 6

🔭 Outside diff range comments (2)
docs/behavioural-testing-in-rust-with-cucumber.md (1)

21-26: Correct British spelling of “artefact” in narrative text

Replace “artifact” with “artefact” in Markdown narrative (do not alter code literals such as actions/upload-artifact). Wrap lines at 80 columns.

  • docs/behavioural-testing-in-rust-with-cucumber.md (line 21)
    -The tangible artifact of these conversations is a set of specifications written
    +The tangible artefact of these conversations is a set of specifications written
  • docs/netsuke-design.md (line 37)
    -build artifact now follows a six-stage pipeline. These data flow validates the
    +build artefact now follows a six-stage pipeline. These data flow validates the
  • docs/netsuke-design.md (line 1570)
    -build caching, Netsuke could implement a higher-level artifact caching layer.
    +build caching, Netsuke could implement a higher-level artefact caching layer.
docs/netsuke-design.md (1)

34-97: Align Jinja documentation with the six-stage YAML-first pipeline

Remove two-pass rendering references and structural Jinja examples; rename and rewrite the data-flow sections:

  • Section 3.3 (≈ lines 535–539):
    • Rename to “Three-Phase Data Flow”
    • Replace content with:

    1. Parse raw YAML into serde_yml::Value
    2. Expand templates on the Value (foreach/when + string expressions only)
    3. Deserialize into the Rust AST and perform final string rendering
  • Section 4.2 (≈ lines 663–668):
    • Delete the “lenient first render” paragraph
    • Forbid structural {% %} blocks; state that all templating occurs on YAML values and string fields only

  • Jinja structural example (≈ lines 859–863):
    • Remove the {% if … %}/{% endif %} snippet

  • Integration instructions (≈ lines 1510–1513 & 1518–1520):
    • Update “two-pass parsing” to describe a single, YAML-first template-expansion pass on the Value followed by strict deserialization
    • Remove references to parsing-stage control-flow blocks

This aligns every reference to the deterministic, byte-for-byte reproducible six-stage pipeline.

♻️ Duplicate comments (4)
docs/roadmap.md (4)

82-86: Adopt en‑GB spelling and label the six‑stage pipeline phases explicitly.

Use “deserialise” and embed Stage names to align with the six‑stage model.

-  - [x] Implement data-first parsing: parse the manifest into a
-    `serde_yml::Value`, expand `foreach` and `when` entries with a Jinja
-    environment, then deserialize the expanded tree into the typed AST and
-    render remaining string fields.
+  - [x] Implement data-first parsing: parse the manifest into a
+    `serde_yml::Value` (Stage 2: Initial YAML Parsing), expand `foreach`
+    and `when` entries with a Jinja environment (Stage 3: Template Expansion),
+    then deserialise the expanded tree into the typed AST and render remaining
+    string fields (Stage 4: Deserialisation & Final Rendering).

92-97: Wrap at 80 columns and keep the structural templating prohibition crisp.

Retain the rule; enforce wrapping and “deserialise” spelling elsewhere.

-  - [x] Evaluate Jinja expressions only within string values, forbidding
-        structural tags such as `{% if %}` and `{% for %}`.
+  - [x] Evaluate Jinja expressions only within string values, forbidding
+        structural tags such as `{% if %}` and `{% for %}`.

Note: Content is correct; run formatters to enforce wrapping.

#!/bin/bash
set -euo pipefail
make fmt
make markdownlint

95-97: Document the per‑iteration context contract for foreach/when.

Specify bound names and merge order to avoid ambiguity.

   - [ ] Implement the `foreach` and `when` keys for target generation, carrying
-        the iteration context into subsequent rendering phases.
+        the iteration context into subsequent rendering phases.
+        Per‑iteration context:
+        - item: current element
+        - index: 0‑based index (optional)
+        - vars: resolved in order globals < target.vars < per‑iteration locals

109-113: Align success‑criteria language with en‑GB and Stage naming.

Switch to “deserialise” and ensure the criteria reference the six‑stage names consistently.

-  - [ ] Netsuke can successfully build a manifest that uses variables,
-    conditional logic within string values, the `foreach` and `when` keys,
-    custom macros, and the `glob()` function to discover and operate on source
-    files.
+  - [ ] Netsuke can successfully build a manifest that uses variables,
+    conditional logic within string values, the `foreach` and `when` keys,
+    custom macros, and the `glob()` function to discover and operate on source
+    files.

Note: Content is fine; enforce en‑GB spelling (“deserialise”) elsewhere in this file.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

💡 Knowledge Base configuration:

  • Jira integration is disabled

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 849411a and a347513.

📒 Files selected for processing (5)
  • docs/behavioural-testing-in-rust-with-cucumber.md (1 hunks)
  • docs/netsuke-design.md (8 hunks)
  • docs/roadmap.md (3 hunks)
  • scripts/assert-file-absent.sh (2 hunks)
  • scripts/assert-file-exists.sh (2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.md

📄 CodeRabbit Inference Engine (AGENTS.md)

**/*.md: Markdown files must use en-GB-oxendict ("-ize" / "-yse" / "-our") spelling and grammar. (EXCEPTION: the naming of the "LICENSE" file, which is to be left unchanged for community consistency.)
Validate Markdown files using make markdownlint.
Run make fmt after any documentation changes to format all Markdown files and fix table markup.
Validate Mermaid diagrams in Markdown files by running make nixie.
Markdown paragraphs and bullet points must be wrapped at 80 columns.
Code blocks must be wrapped at 120 columns.
Tables and headings must not be wrapped.
Use dashes (-) for list bullets.
Use GitHub-flavoured Markdown footnotes ([^1]) for references and footnotes.

Files:

  • docs/behavioural-testing-in-rust-with-cucumber.md
  • docs/roadmap.md
  • docs/netsuke-design.md

⚙️ CodeRabbit Configuration File

**/*.md: * Avoid 2nd person or 1st person pronouns ("I", "you", "we")

  • Use en-GB-oxendict (-ize / -our) spelling and grammar
  • Headings must not be wrapped.
  • Documents must start with a level 1 heading
  • Headings must correctly increase or decrease by no more than one level at a time
  • Use GitHub-flavoured Markdown style for footnotes and endnotes.
  • Numbered footnotes must be numbered by order of appearance in the document.

Files:

  • docs/behavioural-testing-in-rust-with-cucumber.md
  • docs/roadmap.md
  • docs/netsuke-design.md
docs/**/*.md

📄 CodeRabbit Inference Engine (AGENTS.md)

docs/**/*.md: Reference: Use the markdown files within the docs/ directory as a knowledge base and source of truth for project requirements, dependency choices, and architectural decisions.
Update: When new decisions are made, requirements change, libraries are added/removed, or architectural patterns evolve, proactively update the relevant file(s) in the docs/ directory to reflect the latest state. Ensure the documentation remains accurate and current.

Files:

  • docs/behavioural-testing-in-rust-with-cucumber.md
  • docs/roadmap.md
  • docs/netsuke-design.md
🔍 Remote MCP (Deepwiki)

Relevant context from the existing repository that will inform your review:

  1. Current docs describe a five-stage pipeline (no code enum exists for stages)

    • Stage 1: Manifest Ingestion
    • Stage 2: Jinja Evaluation
    • Stage 3: YAML Parsing & Deserialization
    • Stage 4: IR Generation & Validation
    • Stage 5: Ninja Synthesis & Execution
      (These are purely conceptual and not backed by a Rust enum.)
  2. All structural Jinja constructs (e.g. {% if %}, {% for %}) are explicitly allowed in the existing design doc—Netsuke uses Minijinja to fully render control structures before YAML parsing.

  3. There is no in-code enum or single type representing “pipeline stages”; the five-stage model is documented only in Markdown.

Implications for PR #116:

  • Ensure that references to a “six-stage” pipeline don’t leave behind calls to a missing stage‐enum in code or tests.
  • Verify that code/tests don’t rely on structural Jinja tags being applied after YAML parsing (since the PR now prohibits structural templating outside string fields).
  • Update any CI/docs scripts or examples (e.g., Mermaid/flowchart generation) to reflect the new stage count and templating restrictions.
⏰ Context from checks skipped due to timeout of 120000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build-test
🔇 Additional comments (4)
scripts/assert-file-absent.sh (1)

2-3: Spelling normalisation to “artifact” is fine in scripts; no functional change.

Retain this in shell scripts; en‑GB spelling rules apply to Markdown, not scripts. Logic and diagnostics remain correct.

Also applies to: 15-15

scripts/assert-file-exists.sh (1)

2-3: Non-functional spelling tweak acknowledged.

Keep “artifact” here for consistency with other scripts. Behaviour, exit codes, and manifest dump remain correct.

Also applies to: 15-15

docs/netsuke-design.md (2)

46-50: Keep YAML‑first phrasing precise.

The phrasing is correct. No action needed beyond enforcing en‑GB spelling consistently elsewhere.


90-97: Fix Mermaid diagram rendering; remove escaped newlines in labels

Remove all \n escapes from the node labels in docs/netsuke-design.md and switch to single-line labels to stabilise the Mermaid renderer.

Pinpoint location:

  • docs/netsuke-design.md (around lines 90–97)

Proposed diff:

```mermaid
-flowchart TD
-    A[Stage 1:\nManifest Ingestion] --> B[Stage 2:\nInitial YAML Parsing]
-    B --> C[Stage 3:\nTemplate Expansion]
-    C --> D[Stage 4:\nDeserialisation & Final Rendering]
-    D --> E[Stage 5:\nIR Generation & Validation]
-    E --> F[Stage 6:\nNinja Synthesis & Execution]
+flowchart TD
+    A[Stage 1: Manifest Ingestion] --> B[Stage 2: Initial YAML Parsing]
+    B --> C[Stage 3: Template Expansion]
+    C --> D[Stage 4: Deserialisation & Final Rendering]
+    D --> E[Stage 5: IR Generation & Validation]
+    E --> F[Stage 6: Ninja Synthesis & Execution]

Manually preview the diagram in your local or Live Editor to confirm labels render correctly.

Comment thread docs/netsuke-design.md Outdated
Comment thread docs/netsuke-design.md
Comment thread docs/netsuke-design.md
Comment thread docs/netsuke-design.md
Comment thread docs/netsuke-design.md Outdated
Comment thread docs/roadmap.md Outdated
codescene-delta-analysis[bot]

This comment was marked as outdated.

codescene-delta-analysis[bot]

This comment was marked as outdated.

@leynos leynos merged commit 1280df6 into main Aug 15, 2025
4 checks passed
@leynos leynos deleted the codex/refactor-yaml-and-jinja-parser-interaction branch August 15, 2025 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant