Skip to content

Commit a1e1aff

Browse files
taoeffectclaude
andcommitted
Address Copilot review comments on PR #7
- Rename PAWTHS to PATHS in src/quickjs/dune for readability - Use curl -fsSL in CI workflow for fail-fast downloads - Remove side-effecting block from tests/dune that clobbered strings/french.strings in the repo root on every test run - Fix DEVELOPMENT.md to accurately describe hermetic test behavior - Fix ARCHITECTURE.md test tooling description (ppx_inline_test, not ppx_expect; separate SZXX/Angstrom for HTML vs Pug) Co-authored-by: Claude Opus 4.6 (via Crush) <noreply@anthropic.com>
1 parent b79779e commit a1e1aff

18 files changed

Lines changed: 265 additions & 23 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Project Knowledge - Feedback Task
2+
3+
## Key Gotchas
4+
5+
- The `lwt` branch uses `Angstrom_lwt_unix.parse` which takes `Lwt_io.input_channel`, not strings or Eio flows.
6+
- `Strings.parse` on lwt returns `string Core.String.Table.t Lwt.t` (wrapped in Lwt).
7+
- The lwt `exec_parser_lwt` error handler signature is `~unparsed:string -> 'a option -> 'b Lwt.t` (different from Eio's).
8+
- `exec_parser` (non-Lwt, non-Eio) works on raw strings and is synchronous — the JS/HTML/Pug tests use this and should work without changes on both branches.
9+
- The test-suite branch was 6 commits ahead of master (Eio). Rebasing onto lwt was impractical due to heavy divergence — instead we reset the branch to `origin/lwt` and recreated all PR changes from scratch, adapted for Lwt.
10+
- `ppx_inline_test` tests using `%test_unit` work fine with Lwt as long as we use `Lwt_main.run` inside the test body.
11+
- `Lwt_io.of_bytes ~mode:Lwt_io.Input` can create an in-memory input channel from `Lwt_bytes.t` for testing `Strings.parse` without touching the filesystem.
12+
- The lwt quickjs/dune keeps `lwt` and `lwt.unix` in library deps (the Eio port removed them).
13+
- The lwt `src/cli/dune` uses `angstrom-lwt-unix`, `lwt`, `lwt.unix` (not `eio_main`, `angstrom-eio`).
14+
- CI workflow branches should reference `lwt` (not `main` or `master`) since that's the active build branch.
15+
- There was no `link_flags.linux.dev.dune` on the lwt branch — we created it with `()` (empty flags, same as the Eio PR did).
16+
- The `default_error_handler` signature differs between branches: lwt uses `~unparsed -> 'a`, Eio uses `?unparsed ~msg -> unit -> 'a`.
17+
- The `DEVELOPMENT.md` already exists on lwt and references lwt-compatible setup — no changes needed.

.agents/tasks/feedback/PLAN.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Plan - Feedback Task
2+
3+
## Goal
4+
5+
Retarget PR #7 from `master` (Eio) to `lwt` branch, rewriting all Eio-specific code to use Lwt, and updating documentation accordingly.
6+
7+
## Approach
8+
9+
1. **Rebase the `test-suite` branch onto `origin/lwt`** instead of `origin/master`. This will bring the lwt source code as the base, and our PR additions (tests, CI, docs) on top. Conflicts are expected in files we modified that differ between Eio and Lwt — we'll resolve them to match lwt.
10+
11+
2. **Rewrite `tests/test_runner.ml` for Lwt**: The `.strings` parsing tests use `Eio_posix.run` and `Eio.Flow.string_source`. These need to use `Lwt_main.run` and `Lwt_io` instead. JS/HTML/Pug tests that don't use Eio should be unaffected.
12+
13+
3. **Update `tests/dune`**: Replace `eio_main` with `lwt`, `lwt.unix`, and `angstrom-lwt-unix` in the test library dependencies.
14+
15+
4. **Update `AGENTS.md`**: Replace all Eio references with Lwt equivalents.
16+
17+
5. **Update `ARCHITECTURE.md`**: Replace all Eio references with Lwt equivalents.
18+
19+
6. **Update CI workflow** if needed: Branch triggers should target `lwt` instead of `main`/`master`.
20+
21+
7. **Change PR base branch** from `master` to `lwt` using `gh pr edit`.
22+
23+
8. **Verify**: Ensure tests pass or at least the code compiles correctly for the lwt branch.

.agents/tasks/feedback/STEP-1.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Rebase test-suite onto origin/lwt and recreate PR changes
2+
3+
Status: COMPLETED
4+
5+
## Sub tasks
6+
7+
1. [x] Reset `test-suite` branch to `origin/lwt` base
8+
2. [x] Recreate all PR file additions adapted for Lwt
9+
10+
## NOTES
11+
12+
Instead of rebasing (which would produce many conflicts in files we didn't change due to heavy divergence between master/Eio and lwt), we reset the branch to `origin/lwt` and recreated all PR changes from scratch:
13+
14+
- `dune` — added `flow` to `data_only_dirs`
15+
- `.gitignore` — added `tests/integration_test_run/`
16+
- `src/cli/link_flags.linux.dev.dune` — created with `()` (empty flags)
17+
- `src/quickjs/dune` — replaced fragile libomp.a cp chain with robust path search loop
18+
- `tests/fixtures/` — created demo.html, demo.js, demo.pug, demo.vue
19+
- `tests/dune` — created with lwt/lwt.unix/angstrom-lwt-unix deps (instead of eio_main)
20+
- `tests/test_runner.ml` — rewritten for Lwt (see STEP-2)
21+
- `.github/workflows/test.yml` — targets `lwt` branch instead of `main`
22+
- `AGENTS.md` — created, references Lwt (not Eio)
23+
- `ARCHITECTURE.md` — created, references Lwt (not Eio)
24+
- `DEVELOPMENT.md` — added Testing section

.agents/tasks/feedback/STEP-10.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Form a list of the good comments and resolve them
2+
3+
Status: COMPLETED
4+
5+
## Valid Comments Resolved
6+
7+
| # | File | Issue | Resolution |
8+
|---|------|-------|------------|
9+
| 1 | `src/quickjs/dune:59` | `PAWTHS` typo | Renamed to `PATHS` |
10+
| 2 | `.github/workflows/test.yml:33` | `curl` without fail-fast flags | Changed to `curl -fsSL ... -o quickjs.tar.xz` |
11+
| 3 | `tests/dune:41-53` | Side-effecting block clobbers `strings/french.strings` in repo root | Removed the entire "populate root strings/" block |
12+
| 4 | `DEVELOPMENT.md:72-81` | Claims `dune runtest` populates `strings/` dir | Rewritten to accurately describe hermetic test behavior |
13+
| 5 | `ARCHITECTURE.md:73-76` | Says `ppx_expect`; conflates SZXX+Angstrom for Pug | Fixed to `ppx_inline_test` + `ppx_assert`; separated SZXX (HTML) from Angstrom (Pug) |
14+
15+
## Sub tasks
16+
17+
1. [x] Implement fix 1: Rename `PAWTHS``PATHS` in `src/quickjs/dune`
18+
2. [x] Implement fix 2: Use `curl -fsSL` in `.github/workflows/test.yml`
19+
3. [x] Implement fix 3: Remove side-effecting block from `tests/dune`
20+
4. [x] Implement fix 4: Update `DEVELOPMENT.md` testing section
21+
5. [x] Implement fix 5: Fix `ARCHITECTURE.md` test tooling description
22+
6. [x] Run tests — all pass
23+
24+
## NOTES
25+
26+
All 5 Copilot comments were valid and resolved. Tests pass after changes. The most substantive fix was removing the side-effecting block from `tests/dune` that would clobber `strings/french.strings` on every test run.

.agents/tasks/feedback/STEP-2.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Rewrite test_runner.ml for Lwt
2+
3+
Status: COMPLETED
4+
5+
## Sub tasks
6+
7+
1. [x] Replace `Eio_posix.run` with `Lwt_main.run`
8+
2. [x] Replace `Eio.Flow.string_source` with `Lwt_io.of_bytes ~mode:Lwt_io.input`
9+
3. [x] Use `Lwt.Syntax` `let+` for Lwt promise handling
10+
4. [x] Keep JS/HTML/Pug tests unchanged (they use synchronous `exec_parser`)
11+
12+
## NOTES
13+
14+
Key changes in test_runner.ml:
15+
- `strings_parsing` and `french_strings_parsing` tests now use `Lwt_main.run` instead of `Eio_posix.run`
16+
- Created `Lwt_io` input channels from in-memory byte strings using `Lwt_io.of_bytes ~mode:Lwt_io.input @@ Lwt_bytes.of_string content`
17+
- Used `let+` from `Lwt.Syntax` since `Strings.parse` returns `Lwt.t`
18+
- JS, HTML, and Pug tests are unchanged as they use the synchronous `Basic.exec_parser`
19+
- Initially wrote `Lwt_io.Input` (uppercase) — corrected to `Lwt_io.input` (lowercase value) after verifying against Lwt's own test suite via Sourcegraph

.agents/tasks/feedback/STEP-3.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Update tests/dune dependencies (eio_main → lwt)
2+
3+
Status: COMPLETED
4+
5+
## Sub tasks
6+
7+
1. [x] Replace `eio_main` with `lwt lwt.unix angstrom-lwt-unix` in library deps
8+
9+
## NOTES
10+
11+
The test library in `tests/dune` was created with Lwt dependencies from the start (since we recreated all files from scratch on the lwt base in STEP-1). Final deps: `parsing utils core lwt lwt.unix angstrom-lwt-unix`.

.agents/tasks/feedback/STEP-4.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Update AGENTS.md to reference Lwt instead of Eio
2+
3+
Status: COMPLETED
4+
5+
## Sub tasks
6+
7+
1. [x] Replace "Eio (concurrency)" with "Lwt (concurrency)" in Key Libraries
8+
2. [x] Replace Eio concurrency description with Lwt (`Lwt_list`, `Lwt_pool`, `Lwt_preemptive`)
9+
3. [x] Remove `Fiber.List.iter` / `Eio.Executor_pool` references
10+
11+
## NOTES
12+
13+
Created AGENTS.md from scratch on the lwt base. All references use Lwt terminology: `Lwt_pool`, `Lwt_list`, `Lwt_preemptive`.

.agents/tasks/feedback/STEP-5.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Update ARCHITECTURE.md to reference Lwt instead of Eio
2+
3+
Status: COMPLETED
4+
5+
## Sub tasks
6+
7+
1. [x] Replace "Eio runtime" with "Lwt runtime" in Project Entry Point
8+
2. [x] Update Control Flow section (Eio → Lwt, `Lwt_list` and `Lwt_pool`)
9+
3. [x] Update `Parsing.Strings.parse` API description to mention `Lwt_io.input_channel`
10+
4. [x] Update Testing Setup section to reference `Lwt_main.run` and `Lwt_io`
11+
12+
## NOTES
13+
14+
Created ARCHITECTURE.md from scratch on the lwt base. Key differences from Eio version:
15+
- Control flow references `Lwt` cooperative concurrency via `Lwt_list` and `Lwt_pool`
16+
- `Strings.parse` documented as taking `Lwt_io.input_channel` returning `Lwt.t`
17+
- Testing section notes `.strings` tests use `Lwt_main.run`

.agents/tasks/feedback/STEP-6.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Update CI workflow for lwt dependencies
2+
3+
Status: COMPLETED
4+
5+
## Sub tasks
6+
7+
1. [x] Change branch triggers from `main`/`master` to `lwt`
8+
2. [x] Keep opam deps the same (lwt branch opam already has correct deps)
9+
10+
## NOTES
11+
12+
CI workflow `.github/workflows/test.yml` created with `lwt` and `test-suite` as push branches, and `lwt` as PR branch. The opam install step uses `--update-invariant` for flambda compatibility.

.agents/tasks/feedback/STEP-7.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Change PR #7 base branch from master to lwt
2+
3+
Status: COMPLETED
4+
5+
## Sub tasks
6+
7+
1. [x] Run `gh pr edit 7 --base lwt`
8+
2. [x] Update PR body to reference Lwt instead of Eio
9+
10+
## NOTES
11+
12+
- Changed base from `master` to `lwt` using `gh pr edit 7 --base lwt`
13+
- Updated PR description to reference Lwt-specific testing (Lwt_main.run, Lwt_io)

0 commit comments

Comments
 (0)