Repository navigation
fix(nix): track unstable Typst tooling in the docs module - #1995
Merged
Merged
Conversation
Document output and hash drift, compile compatibility, formatter changes, and stable release pin controls. Refresh fast-mover descriptions and the weekly update PR notice. Refs: #1993
gerchowl
force-pushed
the
feature/1993-typst-unstable
branch
from
November 3, 2026 09:58
c0e6e46 to
c14319e
Compare
This was referenced Nov 3, 2026
gerchowl
added a commit
that referenced
this pull request
Nov 3, 2026
## Description Sync main back into dev after release 1.18.1. Merge dev into the existing sync branch, preserving dev work and the released security and uv fixes. ## Type of Change - [x] `chore` -- Release synchronization ### Modifiers - [ ] Breaking change (`!`) ## Changes Made - Retain dev agent CLI policy, including Rust coverage, and main uv metadata and scoped Vulnix fixes. - Keep the newer stable nixpkgs 08d3a975; unstable is identical on both branches. - Preserve generated issue and PR snapshots, choosing the newer snapshot for conflicts. - Order changelog sections Unreleased, 1.19.0 TBD, 1.18.1, 1.18.0 and regenerate the workspace mirror. ## Changelog Entry No new changelog entry needed for this synchronization. Preserve main's dated 1.18.1 section; remove the duplicated #1967 agent CLI and #1847 security-refresh bullets from dev Unreleased because those changes shipped in 1.18.1. The 1.19.0 section is unchanged; neither dev section contained a uv 0.13 bullet by issue-number audit. ## Testing - [x] Manual testing performed - Agent CLI policy: `nix eval --impure --json --expr 'import ./tests/agent-cli-policy.nix {}'` passed (exit 0). - `uv run check-expirations .trivyignore .vulnixignore` passed (exit 0; 11 exceptions). - Additional changelog utility tests passed: 44 tests (exit 0), two workers and isolated external basetemp. - Targeted dev-shell, uv metadata, Vulnix and changelog pytest: 250 passed, 1 skipped (exit 0); two workers and isolated external basetemp. Basetemp directories removed. All 18 checks passed on `1a1538af66f44772e7bdc66b190ff052ff320717`, including Test Summary. - Signed merge commit created inside `nix develop`; all commit hooks passed (exit 0). ### Manual Testing Details Verified main's uv test, Vulnix implementation/tests and exception register survive byte-for-byte; verified 1.19.0 section matches dev and lock timestamps select the newer stable input. This is a merge resolution of existing tested work; no new implementation requiring a separate TDD commit. ## Checklist - [x] Follow project style and perform self-review - [x] Update changelog ordering and regenerate workspace mirror - [x] Preserve main-only fixes and dev-only work - [x] Complete targeted test run and CI ## Additional Notes Merged the concurrent dev Typst tooling update (#1995) cleanly, repeated targeted tests (250 passed, 1 skipped; exit 0), and verified all CI on the final head. No release dispatch or PR merge. Architect review and merge remain required. Refs: #1991
gerchowl
added a commit
that referenced
this pull request
Nov 3, 2026
## Description
Document projects can opt into formatting, compile, package-pin, and
generated-PDF guards through the docs module. Scaffold upgrades
reconcile committed hook configs and install reproducible build recipes
while preserving consumer comments and exclusions.
## Type of Change
- [x] `feat` -- New feature
- [x] `fix` -- Bug fix
- [ ] `docs` -- Documentation only
- [ ] `chore` -- Maintenance task
- [ ] `refactor` -- Code restructuring
- [x] `test` -- Adding or updating tests
- [ ] `ci` -- CI/CD pipeline changes
- [ ] `build` -- Build system or dependency changes
- [ ] `revert` -- Reverts a previous commit
- [ ] `style` -- Code style
### Modifiers
- [ ] Breaking change (`!`)
## Changes Made
- Define four opt-in guards in nix/hooks.nix and drift-check the
portable scaffold asset against that definition.
- Select entries with whitespace-tolerant `// devkit: entry` markers,
warn about suspicious unmarked entries, smoke-compile templates, and
support DEVKIT_TYPST_SKIP globs.
- Add stamped/canonical recipes with dependency lists and fixed
epoch/timezone. Use built-in fonts by default and explicit repo-relative
DEVKIT_TYPST_FONT_PATHS for branding; always ignore system fonts. Report
resolved tool binaries and their own versions as JSON.
- Reconcile module-owned hooks inside the actual repos sequence using
existing PyYAML source spans. Preserve indentation, CRLF, final-newline
presence, comments, and original exclusions; ON/OFF restores original
bytes. Validate staged and installed output with prek and roll back on
failure. Skip existing hand-written document hooks with a notice.
- Keep docs-only committed-config shells out of generated-hook
installation. Explicit hooks = { }; still enables generated hooks.
- Require ON lint findings to have no increased count for any
rule/message under strict scaffold yamllint and consistent sequence
indentation. Catch generated PDFs case-insensitively.
### Reconciliation design decision
The docs hooks fit the existing exact feature-marker block model
(#1654). Reversible per-fixer `exclude` merges do not fit its
version-gated whole-block tables. Extract the existing
`hook_block_range`, `splice_lines`, and `delete_lines` shell functions
into `assets/preserved-hooks.sh`, used by both legacy folds/inserts and
docs. Route docs through the central preserved-hook pass and its
insert/fold/drift reporting. Remove `typst_scaffold.py` and its separate
marker matcher and position-keyed base64 protocol.
The small YAML-aware extension stages edits around those shared
primitives, uses marker-only docs lookup while retaining structural
lookup for legacy hooks, validates with prek, and rolls back on expected
or unexpected failures. Restore exclusions by repository/hook ID and
compare parsed values, allowing formatter re-quoting. Bounded state
comments preserve original field bytes; derive indentation from the
consumer structure and reuse an existing local hook sequence where
available to avoid multiplying existing lint findings. Write and restore
bytes in place to preserve the inode. Decline hand edits anywhere in the
owned block, including comments, using the existing fold ownership rule.
Failures print manual advice and let the installer continue. Existing
pre-release blocks with the old state format require manual cleanup;
they are left intact with a warning.
The installer owns `justfile.devkit-docs` to avoid collisions with
consumer `justfile.docs` files, which are never touched or imported.
Only docs ON with a managed recipe file emits the import; unmanaged
files at the reserved name are retained without importing them. Preview
reports hook and recipe/import changes. Inline comments on injected
exclusion fields are refused before any text is dropped; deleted fixers,
changed repository URLs, and relocated excludes receive precise recovery
advice. See docs/NIX.md. Extended regex comments cannot swallow the
generated-directory alternative.
## Changelog Entry
### Added
- **Opt-in Typst guards and reproducible builds**
([#1994](#1994))
- Enable module-gated formatting, warning-free compilation, package
pins, and generated-PDF guards, with reversible scaffold reconciliation.
- Add stamped/canonical just recipes, dependency lists, toolchain
probing, and built-in-font deterministic builds.
- Validate reversible hook edits across YAML layouts, retain
hand-written hooks, and keep committed-config shell entry free of
generated-hook installation.
- Support explicit project branding fonts, flexible entry markers,
resolved tool identities, and case-insensitive generated-PDF guards.
- Preserve four-space indentation and file inodes; isolate managed docs
recipe imports, report preview changes, and give safe edit-recovery
advice.
- Share preserved-hook reconciliation primitives, retain consumer recipe
files and managed-block edits, and restore exclusions by repository/hook
identity.
## Testing
- [x] 133 targeted/shared tests:
`PYTHONPATH="$PWD/packages/vig-utils/src:$PYTHONPATH" uv run --with
pytest-xdist pytest tests/test_typst_reconcile.py
tests/test_typst_docs.py tests/test_scaffold_preserved_hooks.py
packages/vig-utils/tests/test_typst_guard.py -n 2
--basetemp=$HOME/.cache/devkit-pytest/1994a-r5-final2` (exit 0). Initial
RED: 18 failed, 86 passed (exit 1); failing regressions committed first.
Five requested mutants M1/M6/M11/M12/M15 each produce pytest exit 1. Nix
shell hooks pass on all commits.
- [x] Real-tool Nix canary for all four guards and all three recipes.
- [x] Manual testing performed: typstyle 0.15.2 CLI inspection confirms
no config-file option.
- [x] Full suites passed in CI on
`7f1ea5bb6894af6ca0ed6cfdf1d83fea6ac494fe`, including Nix
render/consumer fidelity gates, consumer matrix, BATS, image/integration
tests, and Test Summary. `gh pr checks 2005 --watch` exited 0.
### Manual Testing Details
The real Nix canary rejects unformatted sources, compile errors,
compiler warnings, invalid package versions, and uppercase indexed
generated PDFs while accepting PDFs elsewhere. It exercises the actual
installer docs gate, discovered system-font exclusion with and without
project branding fonts, resolved tool identities, revision stamps,
dependency output, and canonical PDF hash stability with project
branding fonts. Ambient TYPST_FONT_PATHS points at a real font
directory. Regression cases cover the review findings and five requested
mutations: reordered hooks, re-quoting, ownership, hand edits,
indentation, extended regex comments, and unexpected rollback. A direct
nix eval also verifies that docs-only shellHook emits no
generated-config refusal or installation.
## Checklist
- [x] Code follows project style guidelines
- [x] Self-review performed
- [x] Non-obvious reconciliation behavior documented
- [x] docs/NIX.md updated
- [x] Unreleased changelog and scaffold mirror updated
- [x] Tests prove the guards execute on bad samples
- [x] Targeted tests pass locally
- [x] Toolchain prerequisite #1995 is merged
## Additional Notes
Phase 1a only. The glossary, house-style package, content guards, and
preview CI remain in their planned phases. Typstyle 0.15.2 uses its CLI
default of 80 columns; no unsupported typstyle.toml is installed. The
docs module retains the packages/env/shellHook contract: the scaffold
owns committed configuration, and mkProjectShell owns generated
configuration. Canonical documents must tolerate an absent revision
input; preview-package downloading can require network access on first
use.
Refs: #1994
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Use the locked nixpkgs-unstable Typst toolchain consistently through the fast-mover overlay. The docs capability now includes tinymist for editor diagnostics and preview.
Type of Change
fix-- Bug fixdocs-- Documentation onlytest-- Adding or updating testsbuild-- Build system or dependency changesModifiers
!)Changes Made
Changelog Entry
Changed
docsmodule andoverlays.defaultconsumers, plus anyone formatting with the image's typstyle (0.14.4 → 0.15.2), which can reformat.typfiles.generated/deliberately in its own commit and re-issue documents where the process requires it.DEVKIT_FLAKE_PIN_ADVANCE=falseto hold it: lockstep pins advance with upgrades by default (#1856), anddevkit-upgradeopens adoption PRs on a schedule.Fixed
Testing
uv run --with pytest-xdist pytest tests/test_flake_modules.py -k test_docs_toolchain_tracks_unstable -n 0 --basetemp=$HOME/.cache/devkit-pytest/1993exited 1: stable 0.14 tools and missing tinymist. Committed the failing test before implementation.uv run python docs/generate.pyexited 0; generated changes are limited to README.nix develop.gh pr checks 1995 --repo vig-os/devkit --watch --interval 30exited 0: all 18 checks passed, including the aggregateTest Summaryjob (the name used by this checkout), project pytest, flake gates, image/integration tests, lint, security scans, CodeQL, consumer matrix, and both home matrices.Manual Testing Details
nix eval(exit 0) confirms imageTools contains only typstyle from this toolchain and home configuration pkgs resolves all three unstable derivations; the home package list installs none by default. Direct module imports and mkProjectShell use the caller-supplied pkgs, so consumers apply overlays.default.nix path-info -Sagainst cache.nixos.org (exit 0, metadata only): typstyle standalone closure changes from 50,553,600 to 51,819,832 bytes (+1,266,232). Recursive cache metadata confirms all new runtime dependencies already ship through uv/gh, and all old runtime dependencies remain through just-lsp/coreutils. The actual image closure delta is +247,480 bytes (about 242 KiB); no additional runtime closure is introduced.Round 2 cache-only
nix path-info -S --recursiveexited 0: tinymist adds 258,182,512 bytes (about 258 MB) beyond the combined typst/typstyle closure on x86_64-linux. The upstream Typst 0.15 changelog and breaking-change guidance were checked. Round 2 changes are prose, comments, and scheduled PR text, so the documented TDD exception for documentation/templates applies. All commit hooks passed insidenix develop(exit 0), including Markdown, Nix and workflow syntax checks. All 18 checks passed on round 2 headc14319e67535e490abdca026bff289bf8f5083a7, including aggregateTest Summary, project pytest, flake gates, image/integration tests, lint, security scans, CodeQL, consumer matrix, and both home matrices.Checklist
Additional Notes
No merge or release dispatch. The consumer's empty project changelog is unchanged.
Refs: #1993