Skip to content

Move src/core, src/quarto-core and src/config file operations to deno_ral - #15418

Open
cderv wants to merge 21 commits into
mainfrom
rt/10-codemod-fs-core
Open

cderv wants to merge 21 commits into
mainfrom
rt/10-codemod-fs-core

Conversation

@cderv

@cderv cderv commented Nov 23, 2026

Copy link
Copy Markdown
Member

Part of the runtime migration (#15133). #15223 added file, temp-file and error functions in src/deno_ral/, and a codemod to move callers to them. This runs the codemod on src/core, src/quarto-core and src/config: a call like Deno.readTextFileSync(path) becomes readTextFileSync(path) imported from deno_ral/fs.ts. The layer still calls Deno underneath, so the CLI behaves the same.

Most of the diff is the codemod output, in its own commit (f10919d). The rest was done by hand: two name clashes in copy.ts and qualified-path.ts, console.ts writing a file to stdout, and instanceof Deno.errors.X checks replaced by the layer helpers (isNotFound(), ...).

The runtime boundary check now also says which deno_ral function to use when a PR adds a Deno.* call the layer covers.

Checklist

I have (if applicable):

  • referenced the GitHub issue this PR closes
  • updated the appropriate changelog in the PR
  • ensured the present test suite passes
  • added new tests
  • created a separate documentation PR in Quarto's website repo and linked it to this PR
AI-assisted PR
  • AI tool used: Kimi K3 / K3.1 Pro (in Pi and Posit Assistant) for the implementation, Claude Code (Opus, Sonnet) for the rest
  • Codebase grounding: local clone
  • Human review: I have reviewed, tested, and verified the AI-generated content before submitting.

Note: autonomous AI agents submitting PRs without human oversight are not permitted — see the Code of Conduct.

cderv added 21 commits November 19, 2026 17:27
Set PR 10 to in progress and record the step 0 check against main in
the plan's new execution log. The codemod dry run matches the
2026-11-16 audit (57 files, 153 replacements); three cited lines
moved, none changed or disappeared.

Add Task 6, applying the 2026-11-17 decision that PR 10 adds the fs
and temp keys PR 09 left out of kRalDenoReplacements, and the errors
keys as well. The keys cover src and package/src only: a covered API
is an error that --accept-increase cannot clear, and tests keeps
deliberate Deno.* fixtures. A README row records the amendment.
The fs/temp codemod step runs deno fmt on every file it rewrites. Five of
them were not fmt-clean on main, so the codemod commit also carried
whitespace and line-wrapping changes unrelated to the migration. Applying
that formatting here, before the codemod, keeps the codemod commit to the
Deno.* rewrites and lets reviewers skip this one. No behavior change.
The plan's type-check commands lacked --allow-import, which the
"Any plan that type-checks src/quarto.ts" row requires and the
execution log already uses; following the checklist as written fails
on the remote yaml import.

The FsFile readSync row was superseded by the console.ts row the same
day but stayed active, so a PR 27 executor reading it at step 0 would
add the method PR 10 removed. The plan's execution log keeps the
history.

The sequence row now says 57 files, matching the step 0 audit.
…late refs

The Task 1 and Task 2 expectations still said 56 rewritten files, while the
step 0 measurement on cda4102 and both executed runs gave 57. Task 2's type
check is not clean until Task 3 while PR 08 is not on main, so a merge-day
re-run of the codemod would stop on the expected console.ts error; the step
now names it and keeps every other error a failure. The README console.ts
decision row pointed at PR 08 Task 2 step 6; writeFileToStdout is in Task 4
step 6. The template note on repeating tasks rendered as part of Step 5.
A covered API is an error no baseline acceptance clears, so a hint the
author cannot follow blocks the PR outright.

src/resources/tools is counted in the src scope, but ast-diagram/main.ts
runs through `deno run` without the import map and ast-tracing runs in
the browser: neither can import deno_ral, and the codemod already skips
ast-diagram. The path joins src/core/lib in the warning-only list, now
named kNoRalImportPaths since it is no longer only browser-shared code.

The monkey patch makes a new Deno.realPathSync call behave like
normalizePath, while canonicalPathSync resolves symlinks and throws on a
missing path, so the hint names both. The four connection-error hints say
isConnectionError matches all five classes, so a single-class check knows
to add its own predicate instead of silently widening.
Decided 2026-11-17 (README "Open decisions", landing-order row): PRs
10-13 and 14 land before PR 08 and PR 22. The plan header, the landing
order section and the Plan preamble still described 08 -> 22 -> 10-13 ->
14 and assumed console.ts no longer opens files, which no longer holds.
The one-task-per-session rule stops every session at a task boundary,
and the continuation prompt only resumes numbered tasks, so after the
last task nobody owned the plan's Verification, its review checklist or
the whole-branch checks. PR 10 is the live case: its log lists the
acceptance grep, the type check and three renders as still owed after
Task 6. The coordinator's wrap-up session now owns them.

The same rule assumed every task ends in a commit (PR 11 Task 1 is a dry
run with no commit step) and that files survive between sessions (PR 06
Task 2 saves the pre-upgrade baselines that Task 5 compares against in
/tmp/rt06).
PR 06's last task contains `gh pr create`, which the executor leaves to
the maintainer, so "after the last task" could put the whole-branch
checks after the PR is open. The wrap-up now starts at the first
maintainer-only step when one comes earlier.

A durable artifact is no use if a later task's commands still name the
old path (PR 06 Task 5 reads /tmp/rt06), so later tasks read it from the
location the execution log records.
PR 05 pushes and dispatches the parseHtml timing workflow in Task 7,
then updates the ratchet baseline in Task 8. Starting the wrap-up at
the first maintainer-only step would run the whole-branch checks there,
before the timing results and the final baseline exist.

A push or workflow dispatch mid-plan is now a handoff: the maintainer
runs it and execution resumes. The wrap-up runs once the last task's
executor steps are done, still ahead of gh pr create (PR 06's last task
contains it).
Tying the wrap-up to a point relative to gh pr create did not fit the
plans as written. PR 05 Task 7 records the timing results in the same
step as the workflow dispatch, so resuming "at the next task" skipped
that recording. PR 06 opens a draft PR in Task 6 Step 3, uses its number
in the changelog step that follows, and its Verification lists CI checks
on the open PR, so nothing can complete before gh pr create.

A push, workflow dispatch or gh pr create is now a handoff: execution
resumes at the first unticked step. The wrap-up runs after the last
executor step and marks the checks that need the open PR as pending in
the PR description. A PR opened earlier stays a draft until then, which
keeps the whole-branch checks ahead of review.
Reruns the acceptance checks, the Task 5 tests and the manual renders
at the branch tip and ticks the review checklist.

The six smoke failures are R tests failing to spawn Rscript from the
local rig environment, which was re-created without Rscript.exe; stable
Quarto fails the same way there, so they are not caused by this branch.
The empty fileReads performance report is the same on main.
The mechanical-diff command compared against the working tree, so it
printed nothing on a clean checkout; it now diffs against main and
allows the deno fmt commit. The src/core/lib item now states the branch
invariant (no new deno_ral import), since level-one-headings.ts already
imports deno_ral/path.ts on main.
@posit-snyk-bot

posit-snyk-bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

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.

2 participants