Skip to content

Document what projectUri actually contributes - #98

Open
davidanthoff wants to merge 1 commit into
mainfrom
docs/project-uri-semantics
Open

Document what projectUri actually contributes#98
davidanthoff wants to merge 1 commit into
mainfrom
docs/project-uri-semantics

Conversation

@davidanthoff

Copy link
Copy Markdown
Member

Doc audit prompted by #97, where a user put a Project.toml + Manifest.toml in test/special/, deved the package into it, added Aqua, and expected using Aqua to work in the test items under it.

The behaviour is correct — projectUri supplies version pins, and the test environment is built from the package's test target — but this repo never said so. project_uri was described as "a custom project" and nothing more, which reads as "a custom project supplies the dependencies".

Changes

  • src/datatypes.jlproject_uri now states that it supplies the manifest's version pins, that nothing means the package folder is the source, and that its [deps] do not become importable because the environment comes from the package's test target.
  • docs/src/jsonrpc-api.md — same wording for projectUri; the TestEnvironment table had empty description cells for packageName, packageUri, projectUri and envContentHash, and was missing color (which is on the wire at src/json_protocol.jl:22).
  • docs/src/internals.md — the process-state table and the wire-protocol table both said the child "activates the package environment". That is exactly what it does not do: it mirrors the source environment into a nameless scratch environment, and TestEnv then replaces the active project with a sandbox of its own. Also added an Environment activation section — stage 3 of the run lifecycle was a single clause, and TestEnv appeared in the manual once, as a name in the vendoring list.
  • docs/src/internals.md — the ProcessEnv field list omitted check_bounds and color, both part of process identity per src/testenvironment.jl:35-37.
  • scratch_env.jl — "resolves against exactly the versions the user has pinned" overstates it; sandbox_preserve prunes the manifest to the test target's closure, so pins outside it have no effect.
  • TestItemServer.jl — the "Unable to load the Test package" message named only Project.toml, sending a user who has a test/Project.toml to the wrong file.

The user-facing explanation of the selection rules lives on the docs site; see julia-testitems/julia-testitems.github.io#9, which adds the nested-project section this links to.

Checks

julia --project=docs docs/make.jl exits 0 with only the pre-existing "141 docstrings not included in the manual" warning. Suite is 229/229 — one run hit a transient depot-level IOError: stat(...registries\$0HIR.pid.deleted): permission denied (EACCES) during activation, unrelated to these changes, and passed on rerun.

🤖 Generated with Claude Code

`project_uri`/`projectUri` was described only as "a custom project", and in the
JSON-RPC `TestEnvironment` table not at all — four description cells were empty
and `color` was missing entirely. That leaves the load-bearing fact undocumented:
the project supplies version pins, never dependencies, because the test
environment is built from the package's test target. A reader is left to conclude
that adding a dependency to a custom project makes it importable, which is the
misunderstanding behind #97.

Also corrected:

- `internals.md` said the child process "activates the package environment", in
  the state table and in the wire-protocol table. That is precisely what it goes
  out of its way not to do; it mirrors the source environment into a nameless
  scratch environment and then lets TestEnv replace the active project again.
- The `ProcessEnv` field list omitted `check_bounds` and `color`, both of which
  are part of process identity.
- `scratch_env.jl` claimed the copied manifest makes the environment resolve
  "against exactly the versions the user has pinned" — true only within the test
  target's closure, which is all `sandbox_preserve` keeps.
- The "Unable to load the `Test` package" message named only `Project.toml`,
  sending a user who has a `test/Project.toml` to the wrong file.

`internals.md` gained an "Environment activation" section: stage 3 of the run
lifecycle was one clause of prose, and TestEnv appeared in the whole manual once,
as a name in the vendoring list.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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