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
6 changes: 3 additions & 3 deletions .github/workflows/build-and-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ jobs:
echo "binary_path=${{ steps.stage.outputs['binary-path'] }}"
echo "man_path=${{ steps.stage.outputs['man-path'] }}"
echo "license_path=${{ steps.stage.outputs['license-path'] }}"
echo "artifact_dir=${{ steps.stage.outputs['artifact-dir'] }}"
echo "artefact_dir=${{ steps.stage.outputs['artifact-dir'] }}"
echo "powershell_help_dir=${{ steps.stage.outputs.powershell_help_dir }}"
} >>"$GITHUB_OUTPUT"

Expand Down Expand Up @@ -206,7 +206,7 @@ jobs:
with:
name: ${{ inputs['artifact-name'] }}
path: |
${{ steps.stage_paths.outputs.artifact_dir }}
${{ steps.stage_paths.outputs.artefact_dir }}
${{ steps.package_windows.outputs['msi-path'] }}

- name: Upload macOS artefacts
Expand All @@ -216,5 +216,5 @@ jobs:
with:
name: ${{ inputs['artifact-name'] }}
path: |
${{ steps.stage_paths.outputs.artifact_dir }}
${{ steps.stage_paths.outputs.artefact_dir }}
dist/${{ inputs['bin-name'] }}-${{ inputs.version }}-${{ inputs['artifact-suffix'] }}.pkg
13 changes: 11 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,19 @@ jobs:
with:
python-version: '3.13'
enable-cache: true
- name: Cache shared spelling dictionary
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: |
.typos-oxendict-base.json
.typos-oxendict-base.toml
key: oxendict-${{ runner.os }}-${{ matrix.rust }}-${{ hashFiles('typos.local.toml') }}-${{ github.run_id }}
restore-keys: |
oxendict-${{ runner.os }}-${{ matrix.rust }}-${{ hashFiles('typos.local.toml') }}-
- name: Spelling
run: make spelling
- name: Workflow contract tests
run: make test-workflow-contracts
- name: Typos config drift test
run: make test-typos-config
- name: Test
run: make test
- name: Test and Measure Coverage
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,11 @@ jobs:
matrix:
include:
- target: x86_64-unknown-linux-gnu
artifact: linux-amd64
artefact: linux-amd64
package_arch: amd64
target_key: linux-x86_64
- target: aarch64-unknown-linux-gnu
artifact: linux-arm64
artefact: linux-arm64
package_arch: arm64
target_key: linux-aarch64
uses: ./.github/workflows/build-and-package.yml
Expand All @@ -138,7 +138,7 @@ jobs:
target: ${{ matrix.target }}
bin-name: ${{ needs.metadata.outputs.bin_name }}
version: ${{ needs.metadata.outputs.version }}
artifact-name: ${{ needs.metadata.outputs.repo_name }}-${{ matrix.artifact }}
artifact-name: ${{ needs.metadata.outputs.repo_name }}-${{ matrix.artefact }}
should-upload-workflow-artifacts: ${{ fromJSON(needs.metadata.outputs.should_upload_workflow_artifacts) }}
package-arch: ${{ matrix.package_arch }}
stage-target: ${{ matrix.target_key }}
Expand Down Expand Up @@ -186,11 +186,11 @@ jobs:
include:
- target: x86_64-apple-darwin
runner: macos-15-intel
artifact_suffix: macos-x86_64
artefact_suffix: macos-x86_64
target_key: macos-x86_64
- target: aarch64-apple-darwin
runner: macos-15
artifact_suffix: macos-arm64
artefact_suffix: macos-arm64
target_key: macos-aarch64
uses: ./.github/workflows/build-and-package.yml
with:
Expand All @@ -199,10 +199,10 @@ jobs:
target: ${{ matrix.target }}
bin-name: ${{ needs.metadata.outputs.bin_name }}
version: ${{ needs.metadata.outputs.version }}
artifact-name: ${{ needs.metadata.outputs.repo_name }}-${{ matrix.artifact_suffix }}
artifact-name: ${{ needs.metadata.outputs.repo_name }}-${{ matrix.artefact_suffix }}
should-upload-workflow-artifacts: ${{ fromJSON(needs.metadata.outputs.should_upload_workflow_artifacts) }}
stage-target: ${{ matrix.target_key }}
artifact-suffix: ${{ matrix.artifact_suffix }}
artifact-suffix: ${{ matrix.artefact_suffix }}

release:
if: needs.metadata.outputs.should_publish == 'true'
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ build.ninja
/graph.dot
/graph.html
__pycache__/
.uv-cache/
.uv-tools/
.typos-oxendict-base.json
.typos-oxendict-base.toml
12 changes: 6 additions & 6 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,12 +316,12 @@ project:
en-GB-oxendict (Oxford) spelling over Markdown prose with
[`typos`](https://github.com/crate-ci/typos), pinned by the Makefile
`TYPOS_VERSION` variable and run through `uv tool run`.
- `typos.toml` is generated; never edit its entries by hand. Change
`scripts/generate_typos_config.py` and regenerate with
`uv run scripts/generate_typos_config.py`. When the gate flags a legitimate
Oxford `-ize` word, add its stem to the generator's `STEMS`; for identifiers
or API names that must keep upstream spelling, prefer backticks (which the
gate ignores) over widening the accepted-word list. See the
- `typos.toml` is generated from the shared estate dictionary and the narrow
repository policy in `typos.local.toml`; never edit generated entries by
hand. Change the local overlay and regenerate with
`uv run scripts/generate_typos_config.py`. For identifiers or API names that
must keep upstream spelling, prefer backticks (which the gate ignores) over
widening the accepted-word list. See the
[developers' guide](docs/developers-guide.md) for the full workflow.
- Run `make fmt` after any documentation changes to format all Markdown
files and fix table markup.
Expand Down
39 changes: 32 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: help all clean test test-workflow-contracts test-typos-config build release lint lint-clippy lint-whitaker fmt check-fmt typecheck markdownlint nixie install-kani kani-check kani-full kani-ir install-verus verus formal-pr
.PHONY: help all clean test test-workflow-contracts test-typos-config build release lint lint-clippy lint-whitaker fmt check-fmt typecheck markdownlint spelling spelling-config spelling-helper-test nixie install-kani kani-check kani-full kani-ir install-verus verus formal-pr

APP ?= netsuke
CARGO ?= $(shell command -v cargo 2>/dev/null || printf '%s' "$$HOME/.cargo/bin/cargo")
Expand All @@ -14,7 +14,20 @@ NIXIE ?= nixie
# Single source of truth for the typos version; the markdownlint target and CI
# both consume it, so the Makefile and CI cannot drift apart.
TYPOS_VERSION ?= 1.48.0
TYPOS ?= uv tool run typos@$(TYPOS_VERSION)
UV ?= uv
UV_ENV = UV_CACHE_DIR=.uv-cache UV_TOOL_DIR=.uv-tools
RUFF_VERSION ?= 0.15.12
SPELLING_HELPER_COVERAGE = --cov=generate_typos_config --cov=typos_rollout_check --cov=typos_rollout \
--cov=typos_rollout_cache --cov=typos_rollout_http
SPELLING_HELPER_FILES = scripts/generate_typos_config.py \
scripts/typos_rollout_check.py \
scripts/typos_rollout.py scripts/typos_rollout_cache.py \
scripts/typos_rollout_http.py scripts/tests/conftest.py \
scripts/tests/test_typos_rollout.py \
scripts/tests/test_typos_rollout_check.py \
scripts/tests/test_typos_rollout_hardening.py \
scripts/tests/test_typos_rollout_refresh.py \
scripts/tests/typos_rollout_test_support.py
# Markdown files, excluding build output and tool caches. CRUSH.md is a symlink
# to AGENTS.md, so `-type f` skips it and avoids double-checking the same prose.
MD_FILES_FIND = find . -type f -name '*.md' \
Expand Down Expand Up @@ -44,8 +57,7 @@ test: ## Run tests with warnings treated as errors
test-workflow-contracts: ## Validate the mutation-testing caller contract
uv run --with 'pytest>=8' --with 'pyyaml>=6' pytest tests/workflow_contracts -q

test-typos-config: ## Verify typos.toml matches its generator
uv run --with 'pytest>=8' --with 'hypothesis>=6' pytest scripts/tests -q
test-typos-config: spelling-helper-test ## Verify the shared spelling-policy integration
Comment thread
coderabbitai[bot] marked this conversation as resolved.

target/%/$(APP): ## Build binary in debug or release mode
$(CARGO) build $(BUILD_JOBS) $(if $(findstring release,$(@)),--release) --bin $(APP)
Expand All @@ -69,10 +81,23 @@ check-fmt: ## Verify formatting
typecheck: ## Typecheck all targets and features
RUSTFLAGS="-D warnings" $(CARGO) check --all-targets --all-features $(BUILD_JOBS)

markdownlint: ## Lint Markdown and enforce en-GB-oxendict spelling
markdownlint: spelling ## Lint Markdown and enforce en-GB-oxendict spelling
$(MDLINT) "**/*.md"
@printf 'typos: version=%s config=typos.toml\n' '$(TYPOS_VERSION)' >&2
$(MD_FILES_FIND) | xargs -0 $(TYPOS) --config typos.toml --force-exclude

spelling: spelling-config ## Enforce en-GB-oxendict spelling in Markdown prose
@PYTHONPATH=scripts $(UV_ENV) $(UV) run --no-project --python 3.13 scripts/typos_rollout_check.py --repository .
@$(MD_FILES_FIND) | xargs -0 -r env $(UV_ENV) \
$(UV) tool run typos@$(TYPOS_VERSION) --config typos.toml --force-exclude

spelling-config: spelling-helper-test ## Generate and validate the spelling configuration
@$(UV_ENV) $(UV) run scripts/generate_typos_config.py
@git ls-files --error-unmatch typos.toml >/dev/null
@git diff --exit-code -- typos.toml

spelling-helper-test: ## Validate the shared spelling-policy integration
@$(UV_ENV) $(UV) tool run ruff@$(RUFF_VERSION) format --isolated --target-version py313 --check $(SPELLING_HELPER_FILES)
@$(UV_ENV) $(UV) tool run ruff@$(RUFF_VERSION) check --isolated --target-version py313 $(SPELLING_HELPER_FILES)
@PYTHONPATH=scripts $(UV_ENV) $(UV) run --no-project --python 3.13 --with pytest==9.0.2 --with pytest-cov==7.0.0 python -m pytest scripts/tests/test_typos_rollout*.py -c /dev/null --rootdir=. -p no:cacheprovider $(SPELLING_HELPER_COVERAGE) --cov-fail-under=90

nixie: ## Validate Mermaid diagrams
nixie --no-sandbox
Expand Down
62 changes: 34 additions & 28 deletions docs/developers-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,37 +114,42 @@ For documentation changes, also run:
`make markdownlint` enforces en-GB-oxendict (Oxford) spelling over the
repository's Markdown prose with [`typos`](https://github.com/crate-ci/typos),
as required by the [documentation style guide](documentation-style-guide.md).
The configuration lives in the repository-root `typos.toml` and works in two
layers:

1. The `en-gb` locale corrects American spellings (`color` to `colour`,
`behavior` to `behaviour`, `analyzed` to `analysed`).
2. Generated `extend-words` entries restore Oxford spelling, which the locale
alone would not enforce: identity entries accept `-ize` inflections that the
locale would otherwise "correct" to `-ise`, and `-ise` entries are corrected
to `-ize`. Stems taking `-yse` (`analyse`, `paralyse`) are left to the
locale, which already enforces them.

`typos.toml` is a generated file. Never edit its entries by hand; change
`scripts/generate_typos_config.py` and regenerate:
The repository-root `typos.toml` is deterministically generated output assembled
from two policy layers:

1. The shared estate dictionary in `leynos/agent-helper-scripts` supplies
generally valid Oxford forms, accepted technical terms, corrections, and
exclusions. The generator conditionally refreshes this authority into an
untracked local cache and reuses a valid cache when working offline.
2. `typos.local.toml` contains only Netsuke-specific names, identifiers,
fixtures, and exclusions. It cannot replace a conflicting shared correction.

Comment thread
coderabbitai[bot] marked this conversation as resolved.
`scripts/typos_rollout_http.py` owns shared-cache freshness, HTTPS transport
security and persistence coordination. Only `scripts/typos_rollout.py` may
compose it with dictionary validation; application and release code must not
reuse these spelling-policy internals.

Pull-request CI restores the untracked dictionary and metadata before the
spelling gate. The helper still performs a conditional freshness check, then
saves refreshed state for later runs; a transient outage can therefore reuse a
validated stale cache.

The generated policy sets the `en-gb` locale to correct American spellings
(`color` to `colour`, `behavior` to `behaviour`, `analyzed` to `analysed`). It
also restores Oxford spelling through generated entries that accept `-ize`
inflections and correct their plain-British `-ise` equivalents. Stems taking
`-yse` (`analyse`, `paralyse`) remain governed by the locale.

Never edit `typos.toml` by hand. Change `typos.local.toml` and regenerate:

```bash
uv run scripts/generate_typos_config.py
```

The generator owns three maintainer-facing lists:

- `STEMS` — word stems that take Oxford `-ize`. When the gate flags a
legitimate `-ize` word (or silently accepts its `-ise` variant) because the
stem is missing, add the stem here and regenerate. Do not add genuinely
`-ise`-only words (`advise`, `revise`, `exercise`, `supervise`).
- `EXTRA_ACCEPTED_WORDS` — words accepted verbatim, such as suffix fragments
quoted in prose (`yse`, `mis`) and non-English example text (`inventario`).
- `extend-ignore-re` patterns in `HEADER` — regions exempt from spelling
checks: inline code spans, fenced code blocks, tool and target names that
keep their upstream spelling (`rust-analyzer`, `release-artifact`), and the
ExecPlan template heading. Quoted APIs keep US spelling per the documentation
style guide, so put them in backticks rather than adding accepted words.
If a legitimate Oxford form is missing estate-wide, update the shared
dictionary rather than duplicating it locally. Keep proper names and deliberate
fixtures in `typos.local.toml`. Quoted APIs keep upstream spelling, so put them
in backticks rather than adding accepted words.

`make markdownlint` runs the gate with `--force-exclude`, so the `typos.toml`
excludes also apply to explicitly passed paths. To fix findings mechanically,
Expand All @@ -161,8 +166,9 @@ touch code samples, API names, or quoted material.

The `typos` version is pinned once in the Makefile `TYPOS_VERSION` variable and
run through `uv tool run typos@$(TYPOS_VERSION)`, so the local gate and CI
cannot drift. `make test-typos-config` (also run in CI) asserts that the
committed `typos.toml` matches the generator output, so the two never diverge.
cannot drift. `make spelling` validates the helper implementation, regenerates
the policy, rejects tracked drift, and scans every tracked Markdown file.
`make test-typos-config` remains an alias for the focused helper tests.

## Release help tooling

Expand Down
2 changes: 1 addition & 1 deletion docs/execplans/3-10-1-guarantee-status-message-ordering.md
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ If a stage fails:
3. If within tolerances, fix and retry.
4. If tolerances exceeded, escalate with documented context.

## Artifacts and notes
## Artefacts and notes

Key code locations:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ If a stage fails halfway:
- If BDD tests are not picked up after feature-file edits, run
`touch tests/bdd_tests.rs` before `make test`.

## Artifacts and notes
## Artefacts and notes

Expected new files:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ If a stage fails partway through, fix the issue and re-run from the start of
that stage. No rollback is needed because no destructive operations are
performed.

## Artifacts and notes
## Artefacts and notes

### File change summary (expected)

Expand Down
2 changes: 1 addition & 1 deletion docs/execplans/3-12-1-define-design-tokens.md
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ The planned edits are safe to repeat.
- If the implementation breaches a tolerance, stop, update `Decision Log`, and
wait for explicit direction rather than improvising a broader redesign.

## Artifacts and notes
## Artefacts and notes

Useful evidence to keep while implementing:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ The planned edits are safe to repeat.
- If `make fmt` rewrites unrelated Markdown files, inspect `git diff` and
restore only formatter-introduced changes outside the 3.12.2 scope.

## Artifacts and notes
## Artefacts and notes

Useful evidence to keep while implementing:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ pub(super) fn is_command_available(

No public Rust API outside `src/stdlib/which/` changes.

## Artifacts and notes
## Artefacts and notes

Reference artefacts from the 3.14.2 work, all of which can be inspected with
`leta show`:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1020,7 +1020,7 @@ Quality criteria for the final commit:
if a stage produces partial work, push the work-in-progress to the remote and
reopen the draft PR for review before continuing.

## Artifacts and notes
## Artefacts and notes

Sample HTML structure (illustrative; final wording is localized):

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ All commands are run from the repository root (`/root/repo`). Use `tee` with
- If localization keys conflict with existing entries, rename them with a unique
prefix.

## Artifacts and notes
## Artefacts and notes

Keep the following transcripts for evidence:

Expand Down
2 changes: 1 addition & 1 deletion docs/execplans/3-7-1-externalize-user-facing-strings.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ Quality criteria (done means all of these are true):
- If a gate fails, fix the underlying issue and re-run the same command,
overwriting the log file to keep evidence current.

## Artifacts and notes
## Artefacts and notes

Keep these logs as evidence of success:

Expand Down
2 changes: 1 addition & 1 deletion docs/execplans/3-8-1-add-accessible-output-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ adds animated output.
If a step fails partway through, fix the issue and re-run the validation
command. No rollback is needed beyond `git checkout` of the affected files.

## Artifacts and notes
## Artefacts and notes

Key files created:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ rm -rf tools/kani scripts/install-kani.sh scripts/check-kani-version.sh
Do not use destructive rollback commands after user or other-agent edits appear
in the same files; inspect `git diff` first and preserve unrelated changes.

## Artifacts and notes
## Artefacts and notes

Firecrawl research confirmed these external facts:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1252,7 +1252,7 @@ subtasks remain independent. If `make kani-full` regresses, narrow with
`cargo kani --harness ...` to identify the offending harness, and either reduce
its bound or add a `#[kani::unwind(N)]` override.

## Artifacts and notes
## Artefacts and notes

Captured `/tmp` logs from Stage B onward must be referenced in the PR
description when summarizing validation evidence. Each command's log lives at
Expand Down
Loading
Loading