Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,8 @@ jobs:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v6
- run: uv sync --group dev
- run: uv run ruff check src tests scripts docs/hooks.py
- run: uv run ruff format --check src tests scripts docs/hooks.py
- uses: actions/setup-node@v4
with:
node-version: "24"
- run: npm ci --ignore-scripts
- run: npm test
- run: uv run ruff check src tests scripts
- run: uv run ruff format --check src tests scripts
- run: uv run pytest -q
- run: uv build
- run: uvx --from 'twine>=6' twine check --strict dist/*
Expand Down
39 changes: 0 additions & 39 deletions .github/workflows/docs.yml

This file was deleted.

12 changes: 3 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,10 @@ jobs:
PY
git merge-base --is-ancestor HEAD origin/main
- run: python scripts/check_release.py
- run: uv sync --locked --group dev --group docs
- run: uv run ruff check src tests scripts docs/hooks.py
- run: uv run ruff format --check src tests scripts docs/hooks.py
- uses: actions/setup-node@v4
with:
node-version: "24"
- run: npm ci --ignore-scripts
- run: npm test
- run: uv sync --locked --group dev
- run: uv run ruff check src tests scripts
- run: uv run ruff format --check src tests scripts
- run: uv run pytest -q
- run: uv run mkdocs build --strict
- run: uv build
- run: uvx --from 'twine>=6' twine check --strict dist/*
- name: Verify the installed generator
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,5 @@ site/

# Documentation JavaScript tests
node_modules/

.cache/
267 changes: 16 additions & 251 deletions README.md

Large diffs are not rendered by default.

14 changes: 8 additions & 6 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ project `meds-algorithm-template`, owner `McDermottHealthAI`, repository `MEDS_a
workflow `publish.yml`, and environments `testpypi` / `pypi`. The workflow must be merged into `main`
before GitHub exposes its manual dispatch action.

The documentation site is built in `meds-algorithm`. When changing these release instructions or the
generated release/test guides, update `docs/template-source.json` in that repository to the reviewed
template commit and file checksums; its strict docs build verifies the sources. Documentation builds
and hosting are managed entirely by the core repository and Read the Docs.

## 1. Switch generated projects to the published shared package

Generator `0.4.0a2` pins the published `meds-algorithm==0.4.0a5` release. For future updates,
Expand All @@ -36,13 +41,10 @@ Validate before merging:

```bash
uv lock
uv sync --locked --group dev --group docs
uv run ruff check src tests scripts docs/hooks.py
uv run ruff format --check src tests scripts docs/hooks.py
npm ci --ignore-scripts
npm test
uv sync --locked --group dev
uv run ruff check src tests scripts
uv run ruff format --check src tests scripts
uv run pytest -q
uv run mkdocs build --strict
uv run python scripts/check_release.py
uv build
uvx --from 'twine>=6' twine check --strict dist/*
Expand Down
38 changes: 7 additions & 31 deletions TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,18 @@

These tests validate the generator and rendered repository structure. Shared runtime/contract tests have
[their own catalogue](https://github.com/McDermottHealthAI/meds-algorithm/blob/main/src/meds_algorithm/TESTING.md),
rendered from the installed package on the documentation site's Shared-package tests page.
rendered from the core checkout on the documentation site's Shared-package tests page.
Generated algorithm acceptance tests are documented separately in the next section of the site and in
`docs/TESTING.md` inside each generated repository. Keep these three scopes distinct.

## Running template tests

```bash
uv sync --group dev --group docs
uv run ruff check src tests scripts docs/hooks.py
uv run ruff format --check src tests scripts docs/hooks.py
npm ci --ignore-scripts
npm test
uv sync --group dev
uv run ruff check src tests scripts
uv run ruff format --check src tests scripts
uv run pytest -q
uv run pytest tests/test_profiles.py -q
uv run mkdocs build --strict
```

Tests use temporary renders, toy implementations and synthetic data. MEDS-DEV provisioning is mocked or
Expand All @@ -25,29 +22,8 @@ run. Parametrized functions produce several pytest cases. Helper fixtures are no

## Test inventory

### test_docs.py

| Test | What it checks | Why it exists |
|---|---|---|
| `test_prompt_builder_embeds_the_canonical_readme_prompt` | Decodes the embedded browser prompt and compares it with the README's canonical block. | Prevent the static prompt and interactive builder from drifting apart. |
| `test_prompt_source_cannot_close_its_json_script_element` | Embeds source text containing HTML script closers and checks the decoded value and element boundary. | Keep prompt text inert when included in the documentation HTML. |

### prompt_builder.test.cjs

Run with `npm test` on Node 24 after `npm ci --ignore-scripts`. jsdom is development-only; the shipped
builder uses plain JavaScript without runtime dependencies, network calls or persisted form inputs.

| Test | What it checks | Why it exists |
|---|---|---|
| All choice combinations | Exercises all 144 source/destination/profile/task/scope/ambiguity-mode combinations and common instructions. | Preserve scientific review and execution gates in both confirmation-required and exploratory modes. |
| Ambiguity-mode default and validation | Confirms omitted/false mode requires confirmation and rejects non-boolean opt-ins. | Avoid enabling exploratory assumptions through an absent or truthy string value. |
| Exploratory checkbox lifecycle | Checks unchecked defaults, explicit opt-in, stale-output invalidation, toggling back and reset in a DOM. | Require an intentional selection and restore confirmation mode on reset. |
| Invalid plans | Rejects missing sources, destination, manual profiles or prepared-bundle metadata. | Avoid an apparently ready prompt with incomplete required inputs. |
| Task subsets and literal text | Retains existing task identifiers and arbitrary input text without recursive replacement. | Keep the user's supplied scope and constraints intact. |
| Conditional form fields | Exercises visibility, required fields and multi-profile generation in a DOM. | Prevent hidden fields or single-profile defaults from overriding the selected options. |
| Edits, copy, download and reset | Copies/downloads the exact edited text, invalidates stale output after input changes and clears state on reset. | Avoid handing the agent outdated or unreviewed prompt text. |
| Clipboard fallback | Simulates denied clipboard access and checks that the complete prompt is selected. | Keep the offline preview usable when browser clipboard permissions are unavailable. |
| Inert HTML and repeated initialization | Supplies HTML-like source text and initializes the form again. | Prevent text injection and avoid losing edits when docs navigation reinitializes scripts. |
Documentation and prompt-builder tests now live in
[meds-algorithm](https://meds-algorithm.readthedocs.io/en/latest/documentation-tests/).

### test_generator.py

Expand Down Expand Up @@ -91,7 +67,7 @@ builder uses plain JavaScript without runtime dependencies, network calls or per
| `test_example_signal_dataset_has_no_length_or_position_leak` | Checks that labels match signal-code presence, with variable history lengths and both classes. | Sanity-check the example signal fixture; this is not a statistical proof that all shortcuts are absent. |
| `test_primary_behavior_is_a_required_failing_placeholder` | Checks the generated test requires real signal binding and a shuffled-label control. | Do not let an unimplemented scientific behavior test pass by default. |
| `test_predicates_are_external_not_a_rendered_semantic_format` | Renders without predicates and checks the descriptor and absence of a semantics file. | Avoid inventing an algorithm feature representation in the template. |
| `test_implementation_prompt_belongs_to_template_readme_not_rendered_repo` | Checks the copyable implementation prompt exists only in the template README. | Avoid shipping duplicate agent instructions into each generated project. |
| `test_implementation_prompt_links_to_core_docs_not_rendered_repo` | Checks the README links to the core prompt and generated repositories do not duplicate it. | Avoid shipping duplicate agent instructions into each generated project. |
| `test_spec_has_one_template_source_and_renders_to_root` | Checks the generated SPEC uses the single template source. | Prevent competing copies of generated specification guidance. |
| `test_prediction_keys_are_compared_directly` | Parametrizes reordered, missing, extra and duplicate prediction rows. | Judge cohort coverage by keys rather than row count or row order. |
| `test_meds_dev_predicates_capability_is_explicit` | Checks MEDS-DEV capability detection for predicate passthrough. | Fail unsupported integrations instead of silently dropping dataset semantics. |
Expand Down
19 changes: 0 additions & 19 deletions docs/assets/prompt-builder.css

This file was deleted.

Loading
Loading