Skip to content

fix(docs): harden Typst guard reconciliation - #2012

Merged
gerchowl merged 5 commits into
devfrom
bugfix/2011-typst-guard-followups
Nov 3, 2026
Merged

gerchowl merged 5 commits into
devfrom
bugfix/2011-typst-guard-followups

Conversation

@gerchowl

@gerchowl gerchowl commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Description

Address all seven follow-ups from the Typst docs guard review. Document recipes now load through a devkit-docs module so consumer typst, typst-canonical, and typst-probe recipes coexist with just devkit-docs::typst commands.

Type of Change

  • fix -- Bug fix

Modifiers

  • Breaking change (!) -- This change breaks backward compatibility

Changes Made

  • Migrate the former flat docs import to mod devkit-docs 'justfile.devkit-docs', supported by the pinned just 1.51.0 toolchain.
  • Skip the module with one recovery notice on any consumer recipe, alias, or module named devkit-docs in justfile, justfile.project, or justfile.local. Consumer docs declarations coexist.
  • Exercise remote-only four-space, three-space, and mixed-step YAML layouts, plus exact-byte rendering for indentless and wide-dash layouts.
  • Trigger docs-OFF reconciliation only on devkit markers or recorded state; preserve consumer generated exclusions and YAML anchors without warnings.
  • Qualify the docs-module glossary command as just devkit-docs::glossary-candidates.
  • Limit the yamllint guarantee to previously clean configurations.
  • Report stale docs hook removal without the recipe file and retain consumer-owned recipe files in preview.
  • Give missing-exclusion recovery advice and detect generated exclusions after deletion of the local repository containing docs state.
  • Restore original config bytes after an interrupted in-place write, including KeyboardInterrupt.

Changelog Entry

Fixed

  • Typst docs guard reconciliation (#2011)
    • Namespace document recipes under devkit-docs::, skip conflicting consumer names,
      leave docs-OFF consumer exclusions untouched, and correct preview ownership reports,
      and retain configs with recovery advice after missing managed state or interrupted writes.

Testing

  • Tests pass locally (targeted suites below)
  • Manual testing performed (describe below)

Regression tests were committed before implementation. Round one RED: 11 failed, 55 passed (exit 1). Round two RED: 24 failed, 65 passed (exit 1). Exact-byte assertions also rejected mutations to outer dash spacing, nested sequence indentation, and hook dash spacing (2, 4, and 2 assertion failures respectively).

uv run --with pytest-xdist pytest tests/test_typst_docs.py tests/test_typst_reconcile.py packages/vig-utils/tests/test_typst_guard.py tests/test_scaffold_preserved_hooks.py tests/test_seeded_hook_runner_migration.py tests/test_scaffold_drift.py -n 2 --basetemp="$HOME/.cache/devkit-pytest/2011-r2-green"

244 passed (exit 0). Tests use an isolated basetemp outside the checkout. Container and Nix-evaluation checks are left to CI as required. Documentation changes do not need executable RED tests; the indentation additions cover existing rendering behavior.

CI completed successfully on 7a923b3a61f16fa89846cc07e801931f044f6f30: all checks passed, including the final Test Summary gate and CodeQL. The CI workflow completed with success; gh run watch 41689927368 --exit-status and gh pr checks 2012 exited 0.

Manual Testing Details

Verified just 1.51.0 in nix develop; collision tests execute the real just --list, consumer recipes, and namespaced recipe lookup. Namespace tests cover consumer recipes, aliases, and modules in each of the three justfiles through docs ON → OFF → ON. Parser/lint tests verify YAML, byte-for-byte ON/OFF round trips, and unchanged configs after refused reconciliation. Existing shared-machinery suites verify non-docs preservation. Commit hooks run in the Nix development environment.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly (NIX.md is standalone)
  • I have updated CHANGELOG.md in the [Unreleased] section (and pasted the entry above)
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Additional Notes

Consumers must use the documented devkit-docs:: recipe names. Without the deleted block's recovery records, generated exclusions cannot safely be reversed: reconciliation retains the config and asks for restoration. With docs enabled, identical consumer-owned exclusions cannot be distinguished and require manual removal before retrying. With docs OFF and no managed markers/state, these configs stay untouched without warnings. In-place rollback preserves the inode; a second interrupt or I/O failure during rollback can prevent restoration, as documented. Existing configs with yamllint findings may acquire additional findings, as documented.

Refs: #2011

@gerchowl
gerchowl force-pushed the bugfix/2011-typst-guard-followups branch from 72d5e88 to 2ebceee Compare November 3, 2026 18:00
@gerchowl
gerchowl merged commit b3bc205 into dev Nov 3, 2026
16 checks passed
@gerchowl
gerchowl deleted the bugfix/2011-typst-guard-followups branch November 3, 2026 18:42
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