Skip to content

EDH-328 add Passepartout fixtures - #1

Merged
edhor1608 merged 1 commit into
mainfrom
feature/edh-328-passepartout-add-planner-fixture-harness
May 24, 2026
Merged

edhor1608 merged 1 commit into
mainfrom
feature/edh-328-passepartout-add-planner-fixture-harness

Conversation

@edhor1608

@edhor1608 edhor1608 commented May 21, 2026 •

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Tests

    • Added an integration test that validates four deterministic layout fixtures (landscape/portrait/square/border), builds a WASM artifact, and verifies runtime exports.
    • Added and integrated a test runner script into the main test flow to execute graph/check/build steps and the fixture assertions.
  • Documentation

    • Expanded docs and experiment README with fixture case descriptions, expected layout outcomes, verification steps, and current test/runner limitations.

Review Change Stack

@linear-code

linear-code Bot commented May 21, 2026 •

Copy link
Copy Markdown
EDH-328 Passepartout: Add planner fixture harness

Source

https://linear.app/edhorsagents/document/prd-zero-sense-multi-experiment-bench-edf4de601568

Branch: feature/edh-328-passepartout-add-planner-fixture-harness

Commit: e4ea580

What to build

Turn the Passepartout layout planner experiment into a fixture-driven planning slice. The experiment should verify landscape, portrait, square, and border cases without invoking ffmpeg, EXIF, pixel processing, or the target repo build.

Acceptance criteria

  • The experiment covers landscape planning as 3:2 with max canvas 2160x1440.
  • The experiment covers portrait and square planning as 3:4 with max canvas 1440x1920.
  • The experiment covers border subtraction when calculating the max content box.
  • The README names the fixture cases and keeps image processing explicitly out of scope.
  • sh scripts/check.sh passes.
  • sh scripts/graph.sh experiments/passepartout-layout-planner produces useful graph output for review.

Verification

  • sh scripts/test-passepartout-planner-fixtures.sh
  • sh scripts/check.sh
  • sh scripts/graph.sh experiments/passepartout-layout-planner
  • sh scripts/test.sh

TDD note

A native inline Zero test attempt was discovered by zero test, but the direct runner failed on the shape/enum-heavy planner expressions. This slice keeps fixture functions behind the supported check/graph gate and verifies that public graph output exposes the fixture contracts.

PR status

Implementation is complete locally, but Graphite PR submission is blocked by EDH-335 because this checkout has no Git remote configured and Graphite cannot infer the GitHub owner/name.

Review in Linear

@coderabbitai

coderabbitai Bot commented May 21, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

@edhor1608, we couldn't start this review because you've used your available PR reviews for now.

Your plan currently allows 4 reviews/hour. Refill in 11 minutes and 49 seconds.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more review capacity refills, 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 trial, open-source, and free plans. In all cases, review capacity refills continuously over time.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: ed8d4bb1-c100-4c6b-8baf-485a7c7dd37c

📥 Commits

Reviewing files that changed from the base of the PR and between a7d38e3 and 6ee3c59.

📒 Files selected for processing (6)
  • docs/branch-knowledge.md
  • experiments/passepartout-layout-planner/README.md
  • experiments/passepartout-layout-planner/src/main.0
  • scripts/test-passepartout-planner-fixtures.sh
  • scripts/test.sh
  • tests/passepartout-planner-fixtures.test.mjs
📝 Walkthrough

Walkthrough

Adds pure dimension helpers and four exported C fixture functions (landscape_fixture, portrait_fixture, square_fixture, border_fixture) plus an exported C main() that returns success when all fixtures pass. Adds a Node ESM integration test that runs zero graph/check/build, verifies fixture signatures and checker success, builds WASM, instantiates it, and asserts exported fixture functions and main() return 1. Adds a shell wrapper to run the Node test and wires it into scripts/test.sh. Updates README and branch notes to document the fixture cases and the harness validation flow.


Caution

Pre-merge checks failed

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

  • Ignore

❌ Failed checks (1 error)

Check name Status Explanation Resolution
Docstring Coverage ❌ Error Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'EDH-328 add Passepartout fixtures' clearly and directly summarizes the main change: adding fixture functions to the Passepartout layout planner.
Linked Issues check ✅ Passed All coding requirements from EDH-328 are met: landscape/portrait/square/border fixtures implemented with correct aspect ratios and dimensions, border subtraction logic added, README updated with fixture cases, and test harness created.
Out of Scope Changes check ✅ Passed All changes are directly aligned with EDH-328 requirements: fixture implementations, test infrastructure, documentation, and script updates. No out-of-scope modifications detected.

Warning

Review ran into problems

🔥 Problems

These MCP integrations need to be re-authenticated in the Integrations settings: Linear


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

edhor1608 commented May 21, 2026 •

Copy link
Copy Markdown
Owner Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e4ea58000a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/test-passepartout-planner-fixtures.sh Outdated
coderabbitai[bot]
coderabbitai Bot previously requested changes May 21, 2026

@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 `@tests/passepartout-planner-fixtures.test.mjs`:
- Around line 17-28: The test currently only checks return types via
functionsByName and that type-checking (check/zeroJson) passed; add a value
evaluation step that actually runs each fixture ("landscape_fixture",
"portrait_fixture", "square_fixture", "border_fixture") and asserts the returned
value is true. Locate where functionsByName and zeroJson are used, use the
project's test runner/eval API (or invoke the function via the runner/eval mode
or generate a probe) to execute each fixture by name (e.g., via the same
mechanism that produces check results) and assert that the result.value === true
(or equivalent success flag) for each fixture instead of relying solely on
returnType/type-check assertions.
- Line 7: The test currently falls back to a machine-specific hardcoded path via
the zeroBin constant; remove that hardcoded fallback and instead either (a)
require a ZERO_BIN env var and throw a clear, descriptive error when it's unset,
or (b) compute a repo-relative binary path (e.g., derive the repo root from
import.meta.url or process.cwd() and resolve a ./bin/zero path) so the test can
run on other machines; update any references to zeroBin accordingly and ensure
error messages mention ZERO_BIN so failures are explicit.
🪄 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

Run ID: aa67d072-dc32-47bc-9a6a-c8c6e2218f73

📥 Commits

Reviewing files that changed from the base of the PR and between bc0d33d and e4ea580.

📒 Files selected for processing (6)
  • docs/branch-knowledge.md
  • experiments/passepartout-layout-planner/README.md
  • experiments/passepartout-layout-planner/src/main.0
  • scripts/test-passepartout-planner-fixtures.sh
  • scripts/test.sh
  • tests/passepartout-planner-fixtures.test.mjs
📜 Review details
🔇 Additional comments (5)
experiments/passepartout-layout-planner/src/main.0 (1)

58-89: LGTM!

experiments/passepartout-layout-planner/README.md (1)

9-17: LGTM!

scripts/test-passepartout-planner-fixtures.sh (1)

1-6: LGTM!

scripts/test.sh (1)

9-10: LGTM!

docs/branch-knowledge.md (1)

16-20: LGTM!

Also applies to: 29-30, 36-36

Comment thread tests/passepartout-planner-fixtures.test.mjs Outdated
Comment thread tests/passepartout-planner-fixtures.test.mjs Outdated
@edhor1608
edhor1608 force-pushed the feature/edh-328-passepartout-add-planner-fixture-harness branch from e4ea580 to fab5a58 Compare May 21, 2026 15:46
coderabbitai[bot]
coderabbitai Bot previously requested changes May 21, 2026

@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: 3

♻️ Duplicate comments (1)
tests/passepartout-planner-fixtures.test.mjs (1)

18-49: ⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift

Fixture outcome checks are still disconnected from Zero fixture execution.

The value assertions are computed from a JS reimplementation (fixturePasses) rather than executing fixture functions from the Zero target, so fixture regressions in main.0 can go undetected.

Also applies to: 54-60

🤖 Prompt for 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.

In `@tests/passepartout-planner-fixtures.test.mjs` around lines 18 - 49, The test
currently computes expected fixture outcomes with local JS helpers
(selectExportSpec, contentBox) inside fixturePasses instead of invoking the
actual Zero-target fixture functions; change the test to import and call the
exported functions from the compiled Zero module (the main.0 exports used by the
test) and assert on their real return values rather than the local
reimplementation — update fixturePasses to call the Zero exports for
"landscape_fixture", "portrait_fixture", "square_fixture" and "border_fixture"
(and for the border case call the Zero contentBox/export-spec function chain) so
the assertions validate the actual Zero outputs rather than the JS duplicates.
🤖 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 `@scripts/test-passepartout-planner-fixtures.sh`:
- Line 7: The test invocation uses a cwd-dependent path ("node
tests/passepartout-planner-fixtures.test.mjs"); change it to invoke Node with a
script-relative path by computing the script directory and calling Node with the
test file located relative to that directory (so the command in
scripts/test-passepartout-planner-fixtures.sh uses the script's dir to build the
path to tests/passepartout-planner-fixtures.test.mjs instead of a plain
"tests/..." relative path).

In `@scripts/test.sh`:
- Line 10: Replace the cwd-dependent invocation of the fixture wrapper in
scripts/test.sh ("sh scripts/test-passepartout-planner-fixtures.sh") with a
script-relative call that resolves the directory of scripts/test.sh and invokes
test-passepartout-planner-fixtures.sh from that directory; locate the line
invoking test-passepartout-planner-fixtures.sh and change it to compute the
script's directory (via the script's $0/dirname equivalent) and call the fixture
wrapper from that resolved path so the script works regardless of the current
working directory.

In `@tests/passepartout-planner-fixtures.test.mjs`:
- Around line 14-16: The zeroJson helper currently calls execFileSync(zeroBin,
args, { cwd: repoRoot, encoding: "utf8" }) with no timeout, so add a timeout
option to that call to prevent CI hangs; update the options object passed to
execFileSync inside function zeroJson to include a sensible timeout (e.g.,
30_000 ms or use a shared constant) so the subprocess will be killed if it
exceeds the limit, and ensure any tests expecting longer runs are adjusted
accordingly (refer to zeroJson and zeroBin to locate the call).

---

Duplicate comments:
In `@tests/passepartout-planner-fixtures.test.mjs`:
- Around line 18-49: The test currently computes expected fixture outcomes with
local JS helpers (selectExportSpec, contentBox) inside fixturePasses instead of
invoking the actual Zero-target fixture functions; change the test to import and
call the exported functions from the compiled Zero module (the main.0 exports
used by the test) and assert on their real return values rather than the local
reimplementation — update fixturePasses to call the Zero exports for
"landscape_fixture", "portrait_fixture", "square_fixture" and "border_fixture"
(and for the border case call the Zero contentBox/export-spec function chain) so
the assertions validate the actual Zero outputs rather than the JS duplicates.
🪄 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

Run ID: 0d3f8d03-d325-4f11-a6a8-22e8d17b4fb4

📥 Commits

Reviewing files that changed from the base of the PR and between e4ea580 and fab5a58.

📒 Files selected for processing (6)
  • docs/branch-knowledge.md
  • experiments/passepartout-layout-planner/README.md
  • experiments/passepartout-layout-planner/src/main.0
  • scripts/test-passepartout-planner-fixtures.sh
  • scripts/test.sh
  • tests/passepartout-planner-fixtures.test.mjs
📜 Review details
🔇 Additional comments (3)
experiments/passepartout-layout-planner/src/main.0 (1)

58-65: LGTM!

Also applies to: 67-75, 76-84, 85-89, 91-95

experiments/passepartout-layout-planner/README.md (1)

9-17: LGTM!

docs/branch-knowledge.md (1)

16-20: LGTM!

Also applies to: 29-31, 36-37

Comment thread scripts/test-passepartout-planner-fixtures.sh Outdated
Comment thread scripts/test.sh
Comment thread tests/passepartout-planner-fixtures.test.mjs
@edhor1608
edhor1608 force-pushed the feature/edh-328-passepartout-add-planner-fixture-harness branch from fab5a58 to 5ed2479 Compare May 21, 2026 15:57
coderabbitai[bot]
coderabbitai Bot previously requested changes May 21, 2026

@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

♻️ Duplicate comments (1)
tests/passepartout-planner-fixtures.test.mjs (1)

41-56: ⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift

Harness still does not assert fixture outcomes (true) at runtime.

This only checks function signatures and checker health; it can pass even if fixture logic regresses and returns false. Add a value-level execution/probe step for landscape_fixture, portrait_fixture, square_fixture, and border_fixture.

🤖 Prompt for 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.

In `@tests/passepartout-planner-fixtures.test.mjs` around lines 41 - 56, The test
currently only checks signatures and build diagnostics; add a runtime
execution/probe after building the graph to ensure the fixtures return true by
actually invoking each fixture function: use the project's runtime invocation
helper (e.g., zeroRun/zeroInvoke or equivalent) to call "landscape_fixture",
"portrait_fixture", "square_fixture", and "border_fixture" against the same
target and assert each invocation returns a truthy/true value; place these
assertions after you construct graph/functionsByName and before the final build
assertions so regressions in fixture logic fail the test.
🤖 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 `@tests/passepartout-planner-fixtures.test.mjs`:
- Around line 36-38: The catch block in zeroBuildResult currently assumes
error.stdout exists and does JSON.parse(error.stdout.toString()), which can
throw if stdout is undefined; update the zeroBuildResult catch handler to first
check that error && error.stdout is defined (or use optional chaining like
error?.stdout), only call toString() and JSON.parse when present, and otherwise
rethrow the original error (or throw a new Error containing the original
error.message) so the original spawn/timeout failure isn't masked.

---

Duplicate comments:
In `@tests/passepartout-planner-fixtures.test.mjs`:
- Around line 41-56: The test currently only checks signatures and build
diagnostics; add a runtime execution/probe after building the graph to ensure
the fixtures return true by actually invoking each fixture function: use the
project's runtime invocation helper (e.g., zeroRun/zeroInvoke or equivalent) to
call "landscape_fixture", "portrait_fixture", "square_fixture", and
"border_fixture" against the same target and assert each invocation returns a
truthy/true value; place these assertions after you construct
graph/functionsByName and before the final build assertions so regressions in
fixture logic fail the test.
🪄 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

Run ID: 42f4efdd-852b-46eb-9647-a64e29f20035

📥 Commits

Reviewing files that changed from the base of the PR and between fab5a58 and 5ed2479.

📒 Files selected for processing (6)
  • docs/branch-knowledge.md
  • experiments/passepartout-layout-planner/README.md
  • experiments/passepartout-layout-planner/src/main.0
  • scripts/test-passepartout-planner-fixtures.sh
  • scripts/test.sh
  • tests/passepartout-planner-fixtures.test.mjs
📜 Review details
🔇 Additional comments (5)
experiments/passepartout-layout-planner/src/main.0 (1)

58-95: LGTM!

experiments/passepartout-layout-planner/README.md (1)

9-19: LGTM!

scripts/test-passepartout-planner-fixtures.sh (1)

1-10: LGTM!

scripts/test.sh (1)

4-6: LGTM!

Also applies to: 12-12

docs/branch-knowledge.md (1)

16-20: LGTM!

Also applies to: 29-31, 37-38

Comment thread tests/passepartout-planner-fixtures.test.mjs Outdated
@edhor1608
edhor1608 force-pushed the feature/edh-328-passepartout-add-planner-fixture-harness branch from 5ed2479 to a7d38e3 Compare May 21, 2026 16:10
@edhor1608

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 21, 2026

Copy link
Copy Markdown
✅ Actions performed

Review triggered.

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.

@edhor1608

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented May 21, 2026

Copy link
Copy Markdown
✅ Actions performed

Full review triggered.

coderabbitai[bot]
coderabbitai Bot previously requested changes May 21, 2026

@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 `@experiments/passepartout-layout-planner/src/main.0`:
- Around line 33-38: The content_max_w and content_max_h functions can return
negative values when border_px is too large or negative; update both functions
to first validate border_px is non-negative (reject or panic/return an error
when border_px < 0) and then compute inner = max_w(input_w,input_h) - (border_px
* 2) (and analogous for max_h) and clamp the result to a minimum of 0 (e.g.,
return max(0, inner)); apply the same change to both content_max_w and
content_max_h to ensure no negative content dimensions propagate.
🪄 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

Run ID: 7dfe3b4d-fe3b-46a3-9859-ed193add859a

📥 Commits

Reviewing files that changed from the base of the PR and between 5ed2479 and a7d38e3.

📒 Files selected for processing (6)
  • docs/branch-knowledge.md
  • experiments/passepartout-layout-planner/README.md
  • experiments/passepartout-layout-planner/src/main.0
  • scripts/test-passepartout-planner-fixtures.sh
  • scripts/test.sh
  • tests/passepartout-planner-fixtures.test.mjs
📜 Review details
🧰 Additional context used
🪛 Shellcheck (0.11.0)
scripts/test-passepartout-planner-fixtures.sh

[warning] 4-4: Remove space after = if trying to assign a value (for empty string, use var='' ... ).

(SC1007)


[warning] 5-5: Remove space after = if trying to assign a value (for empty string, use var='' ... ).

(SC1007)

scripts/test.sh

[warning] 4-4: Remove space after = if trying to assign a value (for empty string, use var='' ... ).

(SC1007)

🔇 Additional comments (6)
experiments/passepartout-layout-planner/src/main.0 (1)

1-31: LGTM!

Also applies to: 41-92

scripts/test-passepartout-planner-fixtures.sh (1)

1-10: LGTM!

scripts/test.sh (1)

4-6: LGTM!

Also applies to: 12-12

tests/passepartout-planner-fixtures.test.mjs (1)

1-60: LGTM!

docs/branch-knowledge.md (1)

16-20: LGTM!

Also applies to: 29-31, 37-37

experiments/passepartout-layout-planner/README.md (1)

3-3: LGTM!

Also applies to: 9-17

Comment thread experiments/passepartout-layout-planner/src/main.0 Outdated
@edhor1608
edhor1608 force-pushed the feature/edh-328-passepartout-add-planner-fixture-harness branch from a7d38e3 to eb22b69 Compare May 21, 2026 16:47
@edhor1608
edhor1608 dismissed stale reviews from coderabbitai[bot], coderabbitai[bot], coderabbitai[bot], and coderabbitai[bot] May 24, 2026 15:23

Dismissed after all actionable threads were addressed and resolved; checks are green.

@edhor1608
edhor1608 force-pushed the feature/edh-328-passepartout-add-planner-fixture-harness branch from eb22b69 to 67229f9 Compare May 24, 2026 15:54
@edhor1608
edhor1608 force-pushed the feature/edh-328-passepartout-add-planner-fixture-harness branch from 67229f9 to 6ee3c59 Compare May 24, 2026 15:58

edhor1608 commented May 24, 2026 •

Copy link
Copy Markdown
Owner Author

Merge activity

  • May 24, 4:00 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • May 24, 4:00 PM UTC: @edhor1608 merged this pull request with Graphite.

@edhor1608
edhor1608 merged commit dc3171b into main May 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant