Skip to content

docs: make the example scores run when copied into a fresh repository - #509

Merged
BeomSeogKim merged 2 commits into
mainfrom
docs/examples-run-on-a-fresh-repo
Sep 28, 2026
Merged

BeomSeogKim merged 2 commits into
mainfrom
docs/examples-run-on-a-fresh-repo

Conversation

@BeomSeogKim

Copy link
Copy Markdown
Owner

Concern: the example scores run when copied into a fresh repository.

A smoke test of v0.2.0 copied examples/solo into a fresh one-package package main Go module, changed only the instruction, and hit four points of friction. This PR fixes each one in the examples themselves.

Friction fixed

  1. go build ./... failed the attempt. When ./... matches a single main package, go build writes a binary named after the module into the tree, so the attempt failed with acceptance_mutated_workspace although the command exited 0. Every build criterion in solo/, solo-gated/, and gated/ is now ["go", "build", "-o", "/dev/null", "./..."], and the README states the rule behind it as rule 6: an acceptance criterion must not write into the workspace. No example instruction tells the writer to run go build, so no instruction wording changed.
  2. run refused a dirty repository. The README said only "copy, edit, run". A new "Before the first run" section gives the exact steps: partitur init (which writes .partitur/.gitignore and never overwrites an existing partitur.yaml, so the example's score is kept), copy the two files, then commit partitur.yaml, .partitur/.gitignore, and .partitur/cast.yaml before the first run. The cast is listed too: it lives under .partitur/ but is not ignored, so an uncommitted cast also makes the repository dirty.
  3. The example's labels leaked into status. The README now says name: and every movement id: are free to rename (and that needs: / final_movement must follow a renamed id, and part names must match the cast).
  4. Claude-only hosts were not told how to rewrite the cast. A short "On a Claude-only host" note shows a cast with two claude performers (so the binding keeps a fallback) and explains why each keeps allow_advisory_enforcement: true: the claude adapter reports network_grants: false.

Verification

  • go test -count=1 ./examples/... passes (every example still compiles as a score and binds as a cast).
  • gofmt -l examples is empty; go build ./... and go vet ./... pass.
  • go build -o /dev/null ./... also passes on this multi-package repository, so the examples' criteria still work where their instructions point.
  • Reproduced end to end with binaries built from this branch and a Claude-only host: a throwaway one-package package main module, the README's "Before the first run" steps followed verbatim with the fixed examples/solo score (instruction changed to add a Greet function, name: and movement id: renamed), and the Claude-only cast from the new note. validate exited 0 with the expected unmet=["network_grants"] advisories; run reached SUCCEEDED on the first attempt with all three criteria verified; status reported the renamed movement; apply landed the change in main.go and main_test.go with no stray build output in the tree.

The whole-repository test battery was not run: this change touches only examples/ (three YAML criteria and the README), and examples_test.go is the test that covers them.

🤖 Generated with Claude Code

@BeomSeogKim
BeomSeogKim merged commit dfa77ac into main Sep 28, 2026
6 checks passed
@BeomSeogKim
BeomSeogKim deleted the docs/examples-run-on-a-fresh-repo branch September 28, 2026 14:50
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