decisions 0.1.1 Implementation Plan
plans/2026-11-24-decisions-0.1.1-plan.md
# decisions 0.1.1 Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** decisions installs and passes R CMD check with S7 1.0.0, and version 0.1.1 is ready for fmm to submit to CRAN.
**Architecture:** One change in `R/setup.R`: the property `decider` of `setup_class` becomes required, so S7 1.0.0 makes no default from the class name. Then the release files, the local and outside checks, the merge, and the steps after CRAN publishes.
**Tech Stack:** R 4.6.1, S7 (0.2.2 and 1.0.0), testthat 3, devtools, rhub v2 (GitHub Actions), win-builder, gh.
**Spec:** `replication_materials/plans/2026-11-24-decisions-0.1.1-design.md` (approved, D308).
Paths: the package is `C:/Users/megahefm/Dropbox/Miami/Code/claude/decisions` (here `decisions/`). The record is `C:/Users/megahefm/Dropbox/Miami/Code/claude/fine_tuned_jev` (here `study/`). `$SCR` is `C:/Users/megahefm/AppData/Local/Temp/claude/b8d1c381dafe19cb/a1132f63-df4a-45a2-893c-15b73325d4b3/scratchpad`. `$SCR/s7lib` holds S7 1.0.0.
## Global Constraints
- "The Imports stay (`S7 (>= 0.2.0)`)."
- "No change to the Description text, other than the version."
- "The class names, the printed output and the setup files stay the same." No snapshot in `tests/testthat/_snaps/` may change.
- "Claude Code shows the lines to fmm before it writes them (D221)." (cran-comments.md)
- "fmm submits to CRAN (D221)."
- No paid call: `DECISIONS_LIVE_TESTS` stays unset, so the live tests skip. Run no command from a folder with a `.Renviron`.
- Never commit `.env` or `.Renviron`; never print a key.
- Commit messages end with the two trailer lines `Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>` and `Claude-Session: https://claude.ai/code/session_01AF7uaTc2rrp711vmjPorDq`.
- Records (`study/replication_materials/`) go on `main` of the study in record-only commits, with the build check (`node .replication/build-site.mjs --out "$(mktemp -d)"`) before each commit.
## Review Focus
1. A setup file written by 0.1.0 (`inst/extdata/rubric_setup.json`) must read with 0.1.1 under S7 1.0.0. No test reads it today. Task 1 adds the test.
2. A user who still has S7 0.2.x must see no change. Task 1 runs the full suite with S7 0.2.2, and Task 2 runs R CMD check with it.
3. The printed decider and setup must stay the same under S7 1.0.0. The existing snapshots run under both versions in Task 1, and `git status` must show no change in `_snaps/`.
4. The vignettes must build under S7 1.0.0 (the grading vignette writes and reads a setup). Task 2 runs R CMD check, which builds them, with S7 1.0.0.
5. `decide()` with a setup (`S7::S7_inherits(decider, setup_class)`) must work under S7 1.0.0. The existing test "decide(setup) sends what decide() sends with the same pieces" runs under 1.0.0 in Task 1.
---
### Task 1: The property `decider` is required
**Files:**
- Modify: `decisions/R/setup.R:60` (the property `decider` of `setup_class`)
- Test: `decisions/tests/testthat/test-setup.R` (two new tests after the test "a setup checks its pieces when it is made", line 163)
**Interfaces:**
- Consumes: `setup_class`, `decider_class`, `read_setup()` (all in the package).
- Produces: nothing new. The constructor `setup_class()` stops with "`decider` is required." when it gets no decider.
- [ ] **Step 1: Make the branch**
Run: `git -C decisions switch -c fix-s7-1.0.0` (from `main` at e614b67).
Expected: `Switched to a new branch 'fix-s7-1.0.0'`.
- [ ] **Step 2: Write the two tests**
```r
test_that("a setup with no decider stops with a clear message", {
expect_error(setup_class(), "`decider` is required.", fixed = TRUE)
})
test_that("the setup file of version 0.1.0 still reads", {
setup <- read_setup(system.file("extdata", "rubric_setup.json", package = "decisions"))
expect_true(S7::S7_inherits(setup@decider, decider_class))
expect_equal(setup@decider@model, "jev-latest")
expect_named(setup@questions, c(
"keeps_row", "na_answers", "error_text", "others_continue", "stops_all", "drops_row"
))
})
```
- [ ] **Step 3: Run the tests with S7 0.2.2 and see the first one fail**
Run (in `decisions/`): `Rscript -e 'devtools::test(filter = "setup")'`
Expected: the first new test FAILS (the error message differs, or no error). The second test passes: it guards the file format.
- [ ] **Step 4: Make the property required in `R/setup.R`**
Replace `decider = decider_class,` with:
```r
decider = S7::new_property(
decider_class,
default = quote(stop("`decider` is required."))
),
```
Add one line to the roxygen block of `setup_class` (`@noRd`): the property is required, because S7 1.0.0 would make its default from the class name `decider`, and no object has that name.
- [ ] **Step 5: Run the full suite with S7 0.2.2 and with S7 1.0.0**
First remove the spike copy of decisions from the S7 1.0.0 library: `Rscript -e 'remove.packages("decisions", lib = file.path(Sys.getenv("SCR"), "s7lib"))'` (set `SCR` first).
Run: `Rscript -e 'devtools::test()'`, then `R_LIBS="$SCR/s7lib" Rscript -e 'cat(as.character(packageVersion("S7")), "\n"); devtools::test()'`.
Expected: S7 0.2.2, then S7 1.0.0; each run has `[ FAIL 0 | WARN 0 | SKIP 4 | PASS ...]` (the 4 skips are the live tests). `git -C decisions status --short` shows only `R/setup.R` and `tests/testthat/test-setup.R`.
- [ ] **Step 6: Commit**
```bash
git -C decisions add R/setup.R tests/testthat/test-setup.R
git -C decisions commit -m "Make the decider of a setup required, so that the package installs with S7 1.0.0"
```
### Task 2: Version 0.1.1 and the local checks
**Files:**
- Modify: `decisions/DESCRIPTION` (Version)
- Modify: `decisions/NEWS.md` (first section)
**Interfaces:**
- Consumes: the commit of Task 1.
- Produces: `decisions_0.1.1.tar.gz` (from `R CMD build`), used by Task 3 and by fmm.
- [ ] **Step 1: Set the version and the news**
`DESCRIPTION`: `Version: 0.1.1`. `NEWS.md`: replace `# decisions (development version)` with `# decisions 0.1.1` and one item: decisions installs again with S7 1.0.0; the decider of a setup is now a required property, so S7 makes no default for it from the name of its class. Nothing else changes for users.
- [ ] **Step 2: Document**
Run: `Rscript -e 'devtools::document()'`.
Expected: `git -C decisions status --short` shows no file in `man/` or `NAMESPACE`.
- [ ] **Step 3: R CMD check with S7 1.0.0**
Run (in the parent folder of `decisions/`): `R_LIBS="$SCR/s7lib" R CMD build decisions`, then `R_LIBS="$SCR/s7lib" _R_CHECK_CRAN_INCOMING_REMOTE_=true R CMD check --as-cran decisions_0.1.1.tar.gz`.
Expected: `Status: OK`, or only NOTEs that the 0.1.0 cran-comments already explain. Copy the NOTE lines for Task 4.
- [ ] **Step 4: R CMD check with S7 0.2.2**
Run (in `decisions/`): `Rscript -e 'devtools::check(args = "--as-cran", remote = TRUE, manual = TRUE)'`.
Expected: `0 errors ✔ | 0 warnings ✔` and the same NOTEs as Step 3.
- [ ] **Step 5: Commit**
```bash
git -C decisions add DESCRIPTION NEWS.md
git -C decisions commit -m "Version 0.1.1: the fix for S7 1.0.0"
```
### Task 3: The outside checks
**Interfaces:**
- Consumes: the branch `fix-s7-1.0.0` with the commits of Tasks 1 and 2.
- Produces: the result links and status lines of GitHub Actions, R-hub and win-builder, for Task 4.
- [ ] **Step 1: Push the branch and open a pull request** (R-CMD-check.yaml runs on pull requests, not on other branches)
Run: `git -C decisions push -u origin fix-s7-1.0.0`, then `gh pr create --repo fmegahed/decisions --head fix-s7-1.0.0 --base main --title "Version 0.1.1: install with S7 1.0.0"` with a body that gives the CRAN error, the cause and the fix (end with the PR trailer lines). Then `gh pr checks fix-s7-1.0.0 --repo fmegahed/decisions --watch`.
Expected: the three jobs (macOS release, Windows release, Ubuntu devel) pass.
- [ ] **Step 2: R-hub**
Run: `gh workflow run rhub.yaml --repo fmegahed/decisions --ref fix-s7-1.0.0 -f config=linux,windows,macos,macos-arm64,nosuggests`, then watch the run (`gh run list --workflow rhub.yaml --limit 1`, `gh run watch <id>`).
Expected: all five jobs pass. Keep the run URL.
- [ ] **Step 3: win-builder**
Run (in `decisions/`): `Rscript -e 'devtools::check_win_devel(quiet = TRUE); devtools::check_win_release(quiet = TRUE); devtools::check_win_oldrelease(quiet = TRUE)'`.
Expected: three uploads with no error. win-builder sends the result links to the maintainer by email in about 30 minutes. fmm pastes the three links in the chat (or authenticates the Gmail connector). Each result: `Status: OK` or `1 NOTE` that the 0.1.0 cran-comments explain.
- [ ] **Step 4: Record the checks**
Add a process row (stage `evaluate`) to `study/replication_materials/project/process.md` with the three results and the R-hub run URL. Build check, record-only commit, push.
### Task 4: cran-comments.md and the merge
**Files:**
- Modify: `decisions/cran-comments.md` (whole file)
**Interfaces:**
- Consumes: the results of Tasks 2 and 3.
- Produces: `main` of decisions at the version 0.1.1, and `decisions_0.1.1.tar.gz` for fmm.
- [ ] **Step 1: Show fmm the draft of cran-comments.md**
The draft has: a first line that this is an update that fixes the check errors on the CRAN check page (installation ERROR on 7 platforms since S7 1.0.0, "object 'decider' not found"); the fix in one sentence; `## R CMD check results` with the counts of Task 2; `## Test environments` with the local, GitHub Actions, R-hub and win-builder results; the Notes of 0.1.0 that still apply (paid APIs and `\dontrun{}`, the three URLs with HTTP 403, AutoVI). It drops "This is a new submission" and the note on the misspelled words if win-builder no longer shows it.
Expected: fmm says OK, or gives changes. Record the OK as a decision row (How `chat`).
- [ ] **Step 2: Write the file and commit**
```bash
git -C decisions add cran-comments.md
git -C decisions commit -m "cran-comments for 0.1.1: the check errors since S7 1.0.0 and the results of the checks"
git -C decisions push
```
Expected: the pull request checks pass again.
- [ ] **Step 3: Merge and build the tarball**
Run: `gh pr merge --repo fmegahed/decisions fix-s7-1.0.0 --merge --delete-branch`, then `git -C decisions switch main && git -C decisions pull`, then `Rscript -e 'devtools::build()'` (in `decisions/`).
Expected: `main` holds the three commits; `../decisions_0.1.1.tar.gz` exists.
- [ ] **Step 4: Hand over to fmm**
Tell fmm the path of the tarball and the two ways to submit: `devtools::submit_cran()` in `decisions/`, or the web form <https://cran.r-project.org/submit.html> with the tarball and the text of cran-comments.md. fmm confirms the email of CRAN. Add a process row (stage `build`) for the submission when fmm says it is done.
### Task 5: After CRAN publishes 0.1.1
Start when fmm says that CRAN published 0.1.1, or when <https://CRAN.R-project.org/package=decisions> shows 0.1.1.
**Interfaces:**
- Consumes: the merge commit on `main` (its SHA is the release commit).
- [ ] **Step 1: Tag and release**
Run: `git -C decisions tag v0.1.1 <merge SHA> && git -C decisions push origin v0.1.1`, then `gh release create v0.1.1 --repo fmegahed/decisions --title "decisions 0.1.1" --notes "<the NEWS item of 0.1.1>"`.
- [ ] **Step 2: Development version**
Run: `Rscript -e 'usethis::use_dev_version(push = FALSE)'` (in `decisions/`).
Expected: `Version: 0.1.1.9000` and `# decisions (development version)` at the top of NEWS.md. Commit and push to `main`.
- [ ] **Step 3: Refresh the copy of the record**
Run: `Rscript data-raw/record.R` (in `decisions/`). Commit "Record: refresh the copy with the release 0.1.1" and push.
- [ ] **Step 4: Close the milestone in the record**
In `study/replication_materials/`: a decision row for the CRAN release (as D299), the milestone row of 0.1.1 in `roadmap.md` set to `done`, and a process row. If the work ran with a working ledger in `.superpowers/sdd/`, copy it first (End of a milestone in the replication-materials skill). Build check, record-only commit, push. A few days later, check that the CRAN check page shows OK on all platforms.