Skip to content

(adr-0001) Parse one GNU Makefile into versioned JSON facts - #6

Merged
leynos merged 29 commits into
mainfrom
adr-0001-single-file-gnu-make-parse
Aug 1, 2026
Merged

(adr-0001) Parse one GNU Makefile into versioned JSON facts#6
leynos merged 29 commits into
mainfrom
adr-0001-single-file-gnu-make-parse

Conversation

@leynos

@leynos leynos commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Summary

This branch carries the pre-implementation plan for parsing one explicit GNU
Makefile into deterministic, versioned JSON without evaluating Make syntax or
executing source-selected commands.

ExecPlan: docs/execplans/adr-0001-single-file-gnu-make-parse.md

The plan defines approval-gated milestones for the owned schema, parser port,
source ranges, recovered parses, CLI and stream behaviour, security evidence,
and layered unit, property, snapshot, behavioural and end-to-end testing. It
also imports the local OrthoConfig 0.8.0 user guide used to design the CLI boundary.

No feature implementation is included. Implementation remains blocked until
the plan, including the exact makefile-lossless = "=0.3.40" exception, is
explicitly approved.

Review walkthrough

  • Start with the ExecPlan for constraints, decisions, milestones, acceptance evidence and the approval record.
  • Then review the updated technical design for the frozen location, parser-boundary, determinism, security, failure and observability contracts.
  • Review the imported OrthoConfig user guide for the CLI and ArgMatches guidance signposted by the plan.
  • Finish with the documentation index and repository layout for discoverability and ownership changes.

Validation

  • git diff --check: passed.
  • make markdownlint: passed, including Oxford spelling checks.
  • make nixie: passed.
  • make check-fmt: passed.
  • make typecheck: passed with Polonius and warnings denied.
  • make lint: passed, including rustdoc, Clippy and Whitaker.
  • make test: passed, including nextest and doctests.
  • coderabbit review --agent: three completed rounds; all 27 actionable concerns were resolved. The final post-fix retry was rate-limited before analysis and emitted no new findings, so a clean follow-up remains pending after the service window resets.

Notes

Wyvern reconnaissance mapped the scaffold and test seams. A full Logisphere
community review revised the architecture and contracts before delivery.
Firecrawl research checked the authoritative makefile-lossless 0.3.40 source
and API surface.

References

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sorry @leynos, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Summary

  • Implement deterministic, versioned JSON parsing for one GNU Makefile without evaluating syntax, executing recipes, or following includes.
  • Add schema-v1 domain models, source locations, diagnostics, recovered-parse handling, exact raw values, multiline define support, and a lossless makefile-lossless adapter.
  • Add bounded, injected source reading and an OrthoConfig-backed CLI with stdin support, stable exit codes, JSON output, and explicit failure diagnostics.
  • Add unit, property, BDD, schema, snapshot, corpus, and black-box CLI tests, including security and output-failure cases.
  • Document the accepted ADR and new implementation plan, with updated design, developer, user, repository, and OrthoConfig guides.
  • Add the schema, pinned dependencies, project-owned spelling configuration, provenance checks, and Makefile validation targets.

Walkthrough

The pull request replaces the placeholder crate with a GNU Makefile parser that emits schema-v1 JSON, supports file and stdin input, preserves source locations, reports recovery and fatal errors, and adds parser, CLI, schema, snapshot, BDD, end-to-end, documentation, and tooling coverage.

Changes

GNU Makefile parsing

Layer / File(s) Summary
Report contracts and domain model
Cargo.toml, schemas/..., src/domain/..., src/ports.rs, src/lib.rs
Define the schema-v1 report, parser port, source-location model, ordered facts, diagnostics, dependencies, and public exports.
Parser adapter and report assembly
src/adapters/makefile.rs, src/application.rs
Parse losslessly, collect syntax observations, map locations, calculate hashes, and assemble reports.
Bounded source input
src/adapters/source.rs, tests/source_adapter.rs
Read paths and stdin through injected capabilities with stable read, open, and size-limit errors.
CLI input, output, and exit handling
src/adapters/cli.rs, src/main.rs, docs/users-guide.md
Implement makeutil parse, stdin filename rules, fatal diagnostics, JSON output, and exit codes.
Schema, fixture, and behaviour validation
tests/*, schemas/..., tests/fixtures/...
Validate complete and recovered parsing, locations, ordering, inertness, schema compatibility, snapshots, BDD flows, and output failures.
Architecture and execution documentation
docs/design.md, docs/execplans/*, docs/developers-guide.md, docs/repository-layout.md
Record the accepted ADR, implementation plan, module boundaries, determinism rules, failure contract, and repository structure.
Reference and tooling guides
README.md, docs/ortho-config-users-guide.md, docs/rstest-bdd-users-guide.md, typos.toml, data/*, scripts/*, Makefile
Add project and OrthoConfig guidance, refine rstest-bdd guidance, and update spelling and provenance tooling.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant CLI
  participant SourceReader
  participant MakefileLosslessParser
  participant parse_source
  User->>CLI: makeutil parse input
  CLI->>SourceReader: read path or stdin
  SourceReader-->>CLI: source bytes
  CLI->>MakefileLosslessParser: parse UTF-8 source
  MakefileLosslessParser-->>parse_source: syntax observations
  parse_source-->>CLI: schema-v1 ParseReport
  CLI-->>User: newline-terminated JSON and exit code
Loading

Possibly related PRs

  • leynos/concordat#62: Directly concerns the makeutil parse report contract and recovered-parse semantics.
  • leynos/theoremc#16: Adds related structured, source-located parser diagnostics and regression coverage.
  • leynos/ortho-config#382: Modifies related spelling-policy generation and configuration tooling.

Suggested labels: Roadmap

Poem

Makefiles hum, their facts align,
Bytes find their paths in line.
Rules and vars through JSON flow,
Stdin joins the parsing show.
Errors speak, while shells stay still—
A tidy report by parser’s will.


Caution

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

  • Ignore

❌ Failed checks (1 error, 2 warnings, 2 inconclusive)

Check name Status Explanation Resolution
Testing (Overall) ❌ Error Rust parser and CLI tests are substantive, but no tests exercise the changed Python dictionary workflow or Makefile provenance/validate-makefile targets. Add focused tests for DEFAULT_BASE_SOURCE cache generation, dictionary error paths, and the Makefile provenance and validation targets.
Domain Architecture ⚠️ Warning src/domain directly derives serde::Serialize and uses JSON-specific renames, while ParseReport embeds parser identity; this leaks serialization and vendor details into the domain model. Move JSON/Serde annotations and parser/tool metadata into adapter-owned DTOs. Map pure domain facts to those DTOs before serialization, and keep domain types free of format and vendor dependencies.
Performance And Resource Use ⚠️ Warning The CLI caps reads at 16 MiB, but public parse_source accepts unbounded bytes; nested facts deep-clone full condition ancestry, and no 10 MiB or output-growth benchmark exists. Enforce a bound at the public parsing boundary or cap ancestry/output growth. Add a realistic 10 MiB and deep-nesting regression with measured time and memory limits.
Security And Privacy ❓ Inconclusive Initial evidence shows explicit-path reads, inert parsing, bounded input, and escaped diagnostics, but the full dependency and filesystem permission semantics need one final cross-check. Cross-check the pinned parser and cap-std authority behaviour, then decide whether the ambient file capability is justified by the explicit-input contract.
Architectural Complexity And Maintainability ❓ Inconclusive Investigation is still in progress; no final assessment has been made. Inspect the parser adapter and the documented architecture before deciding whether the abstractions are justified.
✅ Passed checks (15 passed)
Check name Status Explanation
Title check ✅ Passed The title identifies ADR-0001 and accurately summarises the main change: parsing one GNU Makefile into versioned JSON facts.
Description check ✅ Passed The description covers the ExecPlan, parser scope, JSON contract, CLI behaviour, tests, documentation, and validation that match the changeset.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
User-Facing Documentation ✅ Passed The user guide documents file and stdin commands, JSON scope, inertness, size limits, locations, diagnostics, and exit codes; README signposts usage and the migration guide covers the removed greet...
Developer Documentation ✅ Passed Accept this check: developers-guide.md documents parser, source, CLI, feature, dependency, and workflow boundaries; design/ADR record decisions; the ExecPlan marks milestones complete.
Module-Level Documentation ✅ Passed All Rust modules, including nested test modules, begin with //! documentation; the Python modules have docstrings. The text states each module's purpose and, where needed, its component relations...
Testing (Unit And Behavioural) ✅ Passed Unit and contract tests cover edge cases, errors, limits, spans, recovery, ordering, and schema invariants; BDD and assert_cmd tests exercise CLI, stdin, inertness, diagnostics, and exit codes.
Testing (Property / Proof) ✅ Passed The ExecPlan recommends proptest for LocationIndex, Cargo.toml declares proptest, and tests/domain_contract.rs generates sources and spans with monotonicity and range assertions; no proof theorem i...
Testing (Compile-Time / Ui) ✅ Passed No compile-time UI or compile-fail contract is present; public API examples use doctests. Meaningful insta JSON snapshots cover complete and recovered reports with stable schema fields and locations.
Unit Architecture ✅ Passed PASS: domain parsing is pure and fallible, source I/O uses explicit Result APIs, and CLI-only streams and ambient filesystem access are injected at the boundary; tests cover these seams and side-ef...
Observability ✅ Passed Stable operation IDs cover CLI, source, parse, serialization, and output failures; recovered parses retain positioned JSON diagnostics, and focused tests cover these boundaries for the one-shot CLI.
Concurrency And State ✅ Passed No async tasks, locks, channels, atomics, globals, or spawned work exist; state is invocation-local, and explicit traversal/ordinal ordering is covered by contract and nested-condition tests.
Rust Compiler Lint Integrity ✅ Passed No Rust lint suppressions or artificial usage anchors exist; test support is harness-local and used by each importing harness, while the five clones have clear ownership or diagnostic-copy purposes.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch adr-0001-single-file-gnu-make-parse

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

@pandalump
pandalump marked this pull request as ready for review July 13, 2026 22:42
@coderabbitai coderabbitai Bot added the Roadmap label Jul 13, 2026
coderabbitai[bot]

This comment was marked as resolved.

@leynos

This comment was marked as resolved.

@coderabbitai

This comment was marked as resolved.

@pandalump

Copy link
Copy Markdown
Collaborator

@coderabbitai resume

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== src/adapters/source.rs ==="
cat -n src/adapters/source.rs

echo "=== src/adapters/cli.rs ==="
cat -n src/adapters/cli.rs

echo "=== git log for these files ==="
git log --oneline -- src/adapters/source.rs src/adapters/cli.rs | head -20

Length of output: 13699


@leynos All four checks are now resolved.

Check Status Evidence
Unit Architecture ✅ Resolved Commit b4f909a ("Inject source-reader capability at CLI boundary") fixes the last gap. src/adapters/source.rs's read_path now takes reader: &(impl SourceReader + ?Sized) and no longer calls ambient_authority() itself. src/adapters/cli.rs constructs AmbientSourceReader (wrapping cap_std::ambient_authority() and File::open_ambient) exactly once inside run_from, then threads it through ProcessCapabilities into run_from_with_readerrun_parseread_inputread_path. Orchestration remains split across extract_explicit_arguments, produce_report, emit_report, and read_input.
User-Facing Documentation ✅ Resolved README.md states makeutil parses GNU Makefiles into JSON and links to docs/users-guide.md.
Developer Documentation ✅ Resolved Execplan revision note reflects completed implementation; docs/design.md assigns hashing ownership to parse_source.
Domain Architecture ✅ Resolved src/adapters/makefile.rs no longer trims variable.raw_value().

No outstanding work remains from this list; no follow-up issue is needed.

(੭ ˘ ᵕ˘)੭ nice one, all green now

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
✅ Action performed

Reviews resumed.

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Caution

Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.

Error details
putComment timed out

@pandalump

Copy link
Copy Markdown
Collaborator

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

coderabbitai[bot]

This comment was marked as resolved.

@leynos

leynos commented Jul 14, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai the library surface is for testing only

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

@leynos Noted — I'll treat the pub mod/pub use surface in src/lib.rs (adapters, application, domain, ports, and the parse_source/ParseApplicationError/ParseReport re-exports) as internal test-support plumbing rather than a stability-guaranteed public API going forward. I won't flag it for semver/API-stability concerns in future reviews.

(=^・ω・^=) ✧


✏️ Learnings added
Learnt from: leynos
URL: https://github.com/leynos/makeutil/pull/6

Timestamp: 2026-07-14T11:33:05.014Z
Learning: In the makeutil repository, the public library surface exposed by src/lib.rs (the `pub mod adapters;`, `pub mod application;`, `pub mod domain;`, `pub mod ports;` declarations, and the `pub use application::{ParseApplicationError, parse_source};` / `pub use domain::ParseReport;` re-exports) exists solely to support the integration/BDD test suite (e.g. tests/*.rs). It is not a stable, externally-consumed public API, so do not raise semver/API-stability concerns about changes to this surface.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

@leynos

leynos commented Jul 16, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai Have the following failed checks now been resolved?

If further work is required, please provide an AI agent prompt for the remaining work to be done to address these failures.

Do not treat warnings as optional or aspirational. Where a change is out of scope for this PR, propose a GitHub issue unless one exists already. (Treat documentation and validation coverage as in scope).

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
User-Facing Documentation ⚠️ Warning README and users-guide cover the CLI, but the public library API (parse_source/ParseReport) is left undocumented and no n+1 migration note exists. Add a library-facing guide/API section for parse_source and ParseReport, and add a minor-version migration note for the CLI/API transition.
Observability ⚠️ Warning src/adapters/cli.rs still writes raw clap errors at lines 132-137; no logging, metrics, or tracing APIs were added, so one failure boundary lacks a stable operation field. Send all clap failures through fatal(operation="cli"), and add bounded trace or metric events at parse/read/report failure boundaries if operators need production diagnosis.

@pandalump

Copy link
Copy Markdown
Collaborator

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

This comment was marked as resolved.

@leynos
leynos force-pushed the adr-0001-single-file-gnu-make-parse branch from 03df0e0 to 381edd4 Compare July 16, 2026 11:00
@pandalump

Copy link
Copy Markdown
Collaborator

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

coderabbitai[bot]

This comment was marked as resolved.

@leynos

leynos commented Jul 16, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai resume

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
✅ Action performed

Reviews resumed.

@pandalump

Copy link
Copy Markdown
Collaborator

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="leynos/agent-template-python"
title="Replace the undeclared mbake validation command"
body="$(cat <<'EOF'
## Summary

Replace the undeclared `mbake` validation command referenced by repository documentation or validation guidance.

## Rationale

The repository `Makefile` is the public validation entrypoint and exposes the supported project commands. It does not declare an `mbake` target or provide an installation/provisioning path for an `mbake` executable. Documentation validation must use reproducible project commands.

## Required changes

- Replace `mbake` with an appropriate declared `make` target; **or**
- Document and provision `mbake`, including a reproducible installation path and its relationship to the repository validation workflow.
- Keep documentation and validation instructions aligned with the repository's public `Makefile` entrypoints.
- Update validation coverage or documentation checks where needed to prevent references to undeclared validation commands.

## Acceptance criteria

- Every documented validation command is either a declared `Makefile` target or has explicit, reproducible provisioning documentation.
- No unsupported `mbake` invocation remains unless `mbake` is documented and provisioned by the project.
- Documentation validation uses reproducible project commands.

## Triage

`[type:docstyle]`

## Backlinks

- Requester: `@leynos`
- Raised during review of [leynos/makeutil#6](https://github.com/leynos/makeutil/pull/6).
- Source request: https://github.com/leynos/makeutil/pull/6#issuecomment-0
EOF
)"

issue_url="$(gh issue create \
  --repo "$repo" \
  --title "$title" \
  --body "$body" \
  --assignee leynos)"

printf '%s\n' "$issue_url"

Length of output: 1928


🏁 Script executed:

#!/bin/bash
set -euo pipefail

pr_repo="leynos/makeutil"
target_repo="leynos/agent-template-python"
issue_number="46"

comment_url="$(
  gh api "repos/${pr_repo}/issues/6/comments?per_page=100" --paginate \
    --jq '.[] | select(.user.login == "leynos" and (.body | contains("against `leynos/agent-template-python`")) and (.body | contains("undeclared `mbake`"))) | .html_url' \
  | tail -n 1
)"

if [ -z "$comment_url" ]; then
  echo "Could not locate the exact source comment permalink; leaving the issue unchanged." >&2
  exit 1
fi

body="$(cat <<EOF
## Summary

Replace the undeclared \`mbake\` validation command referenced by repository documentation or validation guidance.

## Rationale

The repository \`Makefile\` is the public validation entrypoint and exposes the supported project commands. It does not declare an \`mbake\` target or provide an installation/provisioning path for an \`mbake\` executable. Documentation validation must use reproducible project commands.

## Required changes

- Replace \`mbake\` with an appropriate declared \`make\` target; **or**
- Document and provision \`mbake\`, including a reproducible installation path and its relationship to the repository validation workflow.
- Keep documentation and validation instructions aligned with the repository's public \`Makefile\` entrypoints.
- Update validation coverage or documentation checks where needed to prevent references to undeclared validation commands.

## Acceptance criteria

- Every documented validation command is either a declared \`Makefile\` target or has explicit, reproducible provisioning documentation.
- No unsupported \`mbake\` invocation remains unless \`mbake\` is documented and provisioned by the project.
- Documentation validation uses reproducible project commands.

## Triage

\`[type:docstyle]\`

## Backlinks

- Requester: `@leynos`
- Raised during review of [leynos/makeutil#6](https://github.com/leynos/makeutil/pull/6).
- [Source request](${comment_url})
EOF
)"

gh issue edit "$issue_number" --repo "$target_repo" --body "$body"
printf 'Updated https://github.com/%s/issues/%s\n' "$target_repo" "$issue_number"

Length of output: 2399


@leynos Created and assigned leynos/agent-template-python#46.

The issue includes the required remediation, rationale, acceptance criteria, [type:docstyle] triage, and verified backlinks to the PR and source request.

Resolve only source lines referenced by fallback diagnostics so newline-heavy
input cannot allocate one span per physical line. Preserve diagnostic order,
span calculation, and end-of-source fallback behaviour.

Expose reproducible Makefile validation through make, correct the imported
upstream links and repository layout, and restore single-line table rows in
the vendored guide.
@leynos

leynos commented Jul 29, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai Have the following now been resolved?

docs/rstest-bdd-users-guide.md (1)

1088-1100: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Keep each comparison row on one physical line.
Reformat this table without wrapped cells. GitHub-flavoured Markdown treats the

continuation lines as separate rows, so the vendored and published API mappings

are misaligned.
Triage: [type:syntax/md]
As per coding guidelines, do not wrap tables; as per path instructions, use

standard GitHub-flavoured Markdown table syntax.

🤖 Detailed instructions

Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @docs/rstest-bdd-users-guide.md around lines 1088 - 1100, Reformat the
comparison table in the documentation so each complete row, including all cell
contents, appears on one physical line. Preserve the existing vendored and
published API mappings and standard GitHub-flavoured Markdown table syntax,
including the header and separator rows.

Sources: Coding guidelines, Path instructions

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '=== Target table region ==='
sed -n '1078,1110p' docs/rstest-bdd-users-guide.md

echo
echo '=== Numbered target table region ==='
nl -ba docs/rstest-bdd-users-guide.md | sed -n '1080,1105p'

echo
echo '=== Markdown table-row shape check ==='
python3 - <<'PY'
from pathlib import Path

path = Path("docs/rstest-bdd-users-guide.md")
lines = path.read_text(encoding="utf-8").splitlines()
start, end = 1080, 1105

for number in range(start, end + 1):
    line = lines[number - 1]
    if line.strip():
        print(f"{number}: pipes={line.count('|')} starts_pipe={line.startswith('|')} {line}")
PY

Length of output: 3021


@leynos This finding is resolved.

Keep the current table unchanged. In docs/rstest-bdd-users-guide.md, the header, separator, and all four comparison rows are each on one physical line using standard GitHub-flavoured Markdown table syntax. The vendored and published gpui API mappings remain intact and aligned.

The line-number utility was unavailable in the sandbox, but direct inspection of the target section confirmed there are no wrapped cells or continuation rows.

@pandalump

Copy link
Copy Markdown
Collaborator

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

coderabbitai[bot]

This comment was marked as resolved.

Name the checked-in `cli_e2e` integration target so the documented focused
test command is directly runnable.
@pandalump

Copy link
Copy Markdown
Collaborator

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Makefile`:
- Around line 91-92: Update the validate-makefile target to provision and invoke
a pinned mbake version rather than relying on an unqualified system binary. Add
the required version to the repository’s dependency or tool configuration and
document that version alongside the validate-makefile target, preserving its
existing validation behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 017af915-99c1-404f-a3ce-69041d9e0080

📥 Commits

Reviewing files that changed from the base of the PR and between a9a2465 and 0e51b34.

📒 Files selected for processing (7)
  • Makefile
  • docs/developers-guide.md
  • docs/execplans/adr-0001-single-file-gnu-make-parse.md
  • docs/ortho-config-users-guide.md
  • docs/repository-layout.md
  • docs/rstest-bdd-users-guide.md
  • src/adapters/makefile.rs

Comment thread Makefile
@leynos

leynos commented Jul 31, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai Have the following now been resolved?

docs/execplans/adr-0001-single-file-gnu-make-parse.md (1)

746-749: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Use the actual CLI integration-test target.
The checked-in black-box test is tests/cli_e2e.rs, but this plan runs cargo test --test parse_cli; Cargo will look for tests/parse_cli.rs and fail. Replace it with cargo test --test cli_e2e --all-features.

🤖 Detailed instructions

Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @docs/execplans/adr-0001-single-file-gnu-make-parse.md around lines 746 -
749, Update the test command list in the ADR to run the checked-in CLI
integration target: replace the parse_cli command with cargo test --test cli_e2e
--all-features, while leaving the other test commands unchanged.

@leynos

leynos commented Jul 31, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai Have the following now been resolved?

docs/rstest-bdd-users-guide.md (1)

1088-1100: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Keep each comparison row on one physical line.
Reformat this table without wrapped cells. GitHub-flavoured Markdown treats the

continuation lines as separate rows, so the vendored and published API mappings

are misaligned.
Triage: [type:syntax/md]
As per coding guidelines, do not wrap tables; as per path instructions, use

standard GitHub-flavoured Markdown table syntax.

🤖 Detailed instructions

Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @docs/rstest-bdd-users-guide.md around lines 1088 - 1100, Reformat the
comparison table in the documentation so each complete row, including all cell
contents, appears on one physical line. Preserve the existing vendored and
published API mappings and standard GitHub-flavoured Markdown table syntax,
including the header and separator rows.

Sources: Coding guidelines, Path instructions

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '=== Target section ==='
sed -n '1080,1108p' docs/rstest-bdd-users-guide.md

echo
echo '=== Numbered physical lines ==='
nl -ba docs/rstest-bdd-users-guide.md | sed -n '1084,1104p'

echo
echo '=== Table-row shape ==='
python3 - <<'PY'
from pathlib import Path

path = Path("docs/rstest-bdd-users-guide.md")
lines = path.read_text(encoding="utf-8").splitlines()
for number in range(1088, 1101):
    line = lines[number - 1]
    print(f"{number}: starts_pipe={line.startswith('|')} pipes={line.count('|')} :: {line}")
PY

Length of output: 2738


@leynos This finding is resolved.

Keep the table unchanged.

The target section contains one physical line for the header, separator, and each of the four comparison rows. Each row uses standard GitHub-flavoured Markdown table syntax. The escaped \| characters inside code snippets preserve the intended cell structure.

The sandbox does not provide nl, but direct inspection of the current file confirms that no cell has a continuation line.

You are interacting with an AI system.

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '=== ExecPlan integration-test commands ==='
rg -n -C 3 --fixed-strings \
  -e 'cargo test --test parse_cli' \
  -e 'cargo test --test cli_e2e --all-features' \
  docs/execplans/adr-0001-single-file-gnu-make-parse.md || true

echo
echo '=== Matching integration-test files ==='
fd -t f -d 2 '^(cli_e2e|parse_cli)\.rs$' tests || true

echo
echo '=== All stale parse_cli references in the ExecPlan ==='
rg -n -C 2 --fixed-strings 'parse_cli' \
  docs/execplans/adr-0001-single-file-gnu-make-parse.md || true

Length of output: 622


@leynos: Retry the repository check. Repository setup failed before the inspection ran, so I cannot verify whether the ExecPlan now uses cargo test --test cli_e2e --all-features.

Keep the finding unresolved until the retry confirms both conditions:

  • docs/execplans/adr-0001-single-file-gnu-make-parse.md contains cargo test --test cli_e2e --all-features.
  • The ExecPlan contains no remaining cargo test --test parse_cli command.

You are interacting with an AI system.

Escape control characters in fatal diagnostics so caller-controlled paths
cannot forge stderr lines. Expand black-box coverage for inert Make constructs,
include non-traversal, exact path identity, and configuration isolation.

Replace recursive conditional collection with an iterative event stack and
prove the 256-level resource guardrail. Add the 0.2.0 migration guide and
document the Makefile validation tooling.
@buzzybee-df12

Copy link
Copy Markdown
Collaborator

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/design.md`:
- Around line 462-464: Add the missing comma before “so” in the
control-character escaping sentence at docs/design.md lines 462-464,
docs/users-guide.md lines 55-56, and docs/developers-guide.md lines 87-91,
preserving the existing wording and behavior.

In `@docs/v0-2-0-migration-guide.md`:
- Around line 34-37: Reword the exit-status description in the migration guide
so the statuses `0`, `1`, and `2` are described in one sentence with a shared
structure, avoiding three consecutive sentences that begin with “Exit status.”
Preserve the existing meanings for each status and the schema_version
requirement.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 7a103cdb-2ef4-4ba8-91c5-8295a37e01be

📥 Commits

Reviewing files that changed from the base of the PR and between 0e51b34 and 6e907eb.

📒 Files selected for processing (10)
  • docs/contents.md
  • docs/design.md
  • docs/developers-guide.md
  • docs/execplans/adr-0001-single-file-gnu-make-parse.md
  • docs/users-guide.md
  • docs/v0-2-0-migration-guide.md
  • src/adapters/cli.rs
  • src/adapters/makefile.rs
  • src/adapters/makefile_tests.rs
  • tests/cli_e2e.rs

Comment thread docs/design.md
Comment thread docs/v0-2-0-migration-guide.md Outdated
@leynos

leynos commented Aug 1, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai please create new GitHub issues for the following:

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Domain Architecture ⚠️ Warning src/domain directly derives serde::Serialize and uses JSON-specific renames, while ParseReport embeds parser identity; this leaks serialization and vendor details into the domain model. Move JSON/Serde annotations and parser/tool metadata into adapter-owned DTOs. Map pure domain facts to those DTOs before serialization, and keep domain types free of format and vendor dependencies.
Performance And Resource Use ⚠️ Warning The CLI caps reads at 16 MiB, but public parse_source accepts unbounded bytes; nested facts deep-clone full condition ancestry, and no 10 MiB or output-growth benchmark exists. Enforce a bound at the public parsing boundary or cap ancestry/output growth. Add a realistic 10 MiB and deep-nesting regression with measured time and memory limits.

Add the missing punctuation to the control-escaping contract and describe
all migration exit statuses in one parallel sentence.
@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="leynos/makeutil"
pr_number="6"

echo "=== Existing open issues with matching terms ==="
gh issue list --repo "$repo" --state open --limit 100 \
  --search 'in:title,body (serde OR parse_source OR performance OR nesting OR output growth)' \
  --json number,title,url \
  --jq '.[] | "\(.number)\t\(.title)\t\(.url)"' || true

echo "=== Source comment permalink ==="
gh api "repos/${repo}/issues/${pr_number}/comments?per_page=100" --paginate \
  --jq '.[] | select(.user.login == "leynos" and (.body | contains("src/domain") and contains("public parse_source accepts unbounded bytes"))) | .html_url' \
  | tail -n 1

Length of output: 872


🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="leynos/makeutil"
pr_url="https://github.com/leynos/makeutil/pull/6"
requester="leynos"

domain_body="$(cat <<EOF
## Summary

Separate the pure parsing domain model from JSON serialisation and parser/tool identity metadata.

## Rationale

The current \`src/domain\` types derive \`serde::Serialize\` and use JSON-specific serde renames. \`ParseReport\` also embeds parser identity. These format and vendor details couple the domain model to one output adapter.

## Affected areas

- \`src/domain/\`
- \`src/application.rs\`
- JSON output code in \`src/adapters/\`
- Report-schema and consumer compatibility tests

## Required changes

- Remove JSON/Serde annotations from pure domain facts.
- Move JSON field names and serialisation behaviour into adapter-owned DTOs.
- Move parser and tool identity metadata out of \`ParseReport\` and into the output DTO or output adapter.
- Map domain facts to the versioned JSON DTO before serialisation.
- Preserve the existing schema-v1 JSON contract unless an explicit schema migration is introduced.
- Update documentation and tests for the new boundary.

## Acceptance criteria

- Domain types do not import or derive serde serialisation traits.
- Domain types do not contain JSON-specific rename attributes.
- Parser and tool identity metadata is owned by the output boundary, not by pure domain facts.
- The JSON adapter maps domain facts to a versioned DTO.
- Schema validation, consumer-shaped deserialisation, and existing report behaviour remain covered by tests.
- Documentation describes the revised domain and adapter ownership.

## Backlinks

- Originating PR: ${pr_url}
- Source request: The GitHub API did not expose a permalink for the request comment at issue creation time.
- Requester: @${requester}
EOF
)"

performance_body="$(cat <<EOF
## Summary

Bound public parsing resource use and add regression coverage for large input, deep conditional nesting, and output growth.

## Rationale

The CLI limits source reads to 16 MiB, but public \`parse_source\` accepts unbounded byte slices. Nested facts clone full condition ancestry. The repository has no realistic 10 MiB regression or output-growth measurement to prevent resource regressions.

## Affected areas

- \`src/application.rs\`
- \`src/domain/\`
- \`src/adapters/source.rs\`
- \`src/adapters/makefile.rs\`
- Parser and integration test modules
- Resource-limit documentation

## Required changes

- Enforce a source-size bound at the public parsing boundary, or define and enforce equivalent bounds for condition ancestry and report/output growth.
- Keep CLI and library behaviour consistent for bounded input.
- Reduce or cap repeated condition-ancestry allocation where required by the selected limit.
- Add a realistic approximately 10 MiB input regression.
- Add a deep-nesting regression.
- Define measurable time and memory limits, or use deterministic bounded-output assertions that detect unbounded growth.
- Document public resource limits and failure behaviour.

## Acceptance criteria

- \`parse_source\` cannot process unbounded input without an explicit documented resource contract.
- Large input at the supported limit has regression coverage.
- Deep conditional nesting has regression coverage.
- Tests detect excessive output or ancestry growth.
- Tests specify and enforce measurable resource limits or deterministic bounded-growth limits.
- CLI diagnostics and existing source-size error behaviour remain stable.
- Documentation states the public parsing and output resource limits.

## Backlinks

- Originating PR: ${pr_url}
- Source request: The GitHub API did not expose a permalink for the request comment at issue creation time.
- Requester: @${requester}
EOF
)"

domain_url="$(gh issue create \
  --repo "$repo" \
  --title "Separate the parsing domain model from JSON output metadata" \
  --body "$domain_body" \
  --assignee "$requester")"

performance_url="$(gh issue create \
  --repo "$repo" \
  --title "Bound public parsing resource use and add scale regressions" \
  --body "$performance_body" \
  --assignee "$requester")"

printf 'Domain issue: %s\nPerformance issue: %s\n' "$domain_url" "$performance_url"

Length of output: 4457


@leynos Created and assigned both GitHub issues.

Each issue includes the required changes, affected areas, acceptance criteria, and a backlink to PR #6. GitHub did not expose a permalink for this request comment during issue creation.

You are interacting with an AI system.

Align the guide filename, title, content, and documentation links with the
first unpublished release version.
@leynos
leynos merged commit f998a42 into main Aug 1, 2026
4 checks passed
@leynos
leynos deleted the adr-0001-single-file-gnu-make-parse branch August 1, 2026 10:45
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.

3 participants