Skip to content

test: cover the developer-environment contract (tests/dev-environment.test.mjs) - #350

Merged
mrbobbytables merged 1 commit into
mainfrom
quality/test-dev-environment
Sep 21, 2026
Merged

mrbobbytables merged 1 commit into
mainfrom
quality/test-dev-environment

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds one new test-only file, tests/dev-environment.test.mjs (8 tests). It is
the first test in this repository to read the Justfile,
.devcontainer/devcontainer.json, or the commands inside a fenced block in the
developer docs.

Files claimed by this PR: tests/dev-environment.test.mjs (new). Nothing
else — no production code, no workflow, no package.json, no lockfile, no new
dependency. It uses node:test, node:assert/strict, node:fs, node:path
and the yaml devDependency the repo already declares.

The gap

README.md:40 and CONTRIBUTING.md:15 document the devcontainer as a
supported way to run this site, and CONTRIBUTING.md:8 states the Node
prerequisite. Those claims point at .devcontainer/devcontainer.json, which
pins its own Node major, forwarded port and postCreateCommand — checked
against nothing. The Justfile has 7 npm run targets with no gate, and the
three developer docs another 15.

Rename a package.json script and just build, the README quickstart and the
CONTRIBUTING setup block all become instructions that fail on first
copy-paste, while every CI check stays green. Bump NODE_VERSION in the
workflows and the devcontainer silently keeps building on the old major.

What the 8 assertions cover

  1. The Justfile parses into recipes and none has an empty body.
  2. Every npm run <name> in a Justfile recipe is a defined package.json script.
  3. devcontainer.json parses (as JSON-with-comments) and pins an image and a containerUser.
  4. Every npm run <name> in a devcontainer lifecycle command is a defined script.
  5. forwardPorts contains the port just serve actually opens.
  6. Every npm run <name> in README.md, CONTRIBUTING.md, AGENTS.md is a defined script.
  7. The devcontainer Node major equals the major every workflow pins (NODE_VERSION and literal node-version).
  8. The Node prerequisite stated in the developer docs equals that same major.

Verification

  • node --test tests/dev-environment.test.mjs — 8/8 pass at 00b44df.
  • Full suite npm run test:unit: 61/61 (55 before, +6 at the time of the first
    run, +8 now).
  • Mutation-checked, not just run green. Each of the 8 assertions was
    confirmed to fail on injected drift: a bad npm run target in the Justfile,
    in postCreateCommand, and in README.md; forwardPorts: [4000]; the
    devcontainer node feature at 20; a deleted containerUser; an empty
    serve recipe; and Node.js 20+ in CONTRIBUTING.md. Working tree restored
    after every mutation (git status clean).
  • npx prettier --check clean.

Disjointness

Related Issue

Closes #349


Filed by quality agent (hold-gated mode). Human review required.

— hive: agent=quality backend=copilot model=claude-opus-5

Adds tests/dev-environment.test.mjs, asserting that the Justfile,
.devcontainer/devcontainer.json and the setup commands documented in
README.md, CONTRIBUTING.md and AGENTS.md resolve against package.json and
agree with the Node major the workflows pin.

Closes #349

Signed-off-by: kubestellar-hive[bot] <kubestellar-hive@hive.kubestellar.io>
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Important

Held for human review by the hive's ACMM level gate.

This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Non-outreach agents are held at ACMM L3–L5; the outreach agent is always held because it publishes project-facing communication.

Hive will automatically remove the hold label once current policy no longer requires a level hold for "quality". If this is an outreach PR, a human must review it and remove the label.

@hivecommons-hive hivecommons-hive Bot added hold quality Approved by a Hive merger/owner for auto-merge on green CI testing Approved by a Hive merger/owner for auto-merge on green CI agent/quality Approved by a Hive merger/owner for auto-merge on green CI hive/hosted-available-lke648397-260827-5n31 Approved by a Hive merger/owner for auto-merge on green CI labels Sep 20, 2026
@mrbobbytables
mrbobbytables added this pull request to the merge queue Sep 21, 2026
Merged via the queue into main with commit f095efb Sep 21, 2026
2 checks passed
@castrojo
castrojo deleted the quality/test-dev-environment branch September 21, 2026 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent/quality Approved by a Hive merger/owner for auto-merge on green CI hive/hosted-available-lke648397-260827-5n31 Approved by a Hive merger/owner for auto-merge on green CI hold quality Approved by a Hive merger/owner for auto-merge on green CI testing Approved by a Hive merger/owner for auto-merge on green CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[quality] Developer-environment contract is untested: Justfile, .devcontainer and the documented setup commands resolve against nothing

1 participant