Skip to content

Update docs for shape optionality and T? nullability Closes #30#31

Merged
binaek merged 2 commits into
mainfrom
30-update-docs-for-shape-optionality-and-nullability-syntax
Apr 27, 2026
Merged

Update docs for shape optionality and T? nullability Closes #30#31
binaek merged 2 commits into
mainfrom
30-update-docs-for-shape-optionality-and-nullability-syntax

Conversation

@binaek

@binaek binaek commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Aligns documentation with the language change: optionality on the binding (field?), nullability on the type (T?), and removal of !-based shape field forms.
  • Refreshes examples across reference pages, TypeScript module samples, and policy-pack structure docs so they no longer teach legacy syntax.

What this PR does

  • Rewrites the shapes reference to document the four-way matrix (field: T, field?: T, field: T?, field?: T?), absent vs null behavior, migration from old bang syntax, and an Elvis example with optional fields.
  • Adds a nullable types section to types-and-values (string?, containers, shape refs).
  • Updates facts and policy reference to describe nullable fact types (fact x: T?, fact x?: T?) instead of “facts are always non-null.”
  • Updates the language reference index shape section and fixes getting-started notes on facts.
  • Applies the same syntax conventions to fan-out examples (built-ins, rules, TypeScript module pages, etc.).

Changes by area

Core reference

  • src/content/docs/reference/shapes.md
  • src/content/docs/reference/types-and-values.md
  • src/content/docs/reference/facts.md
  • src/content/docs/reference/index.md
  • src/content/docs/reference/policies.md
  • src/content/docs/getting-started/writing-your-first-policy.md

Examples and modules

  • Arithmetic, boolean, built-in functions, rules, trinary, using-typescript, structure-of-a-policy-pack.
  • typescript_modules/index.md and per-module sentrie/*.md example snippets.

Review notes

  • Spot-check that no page still states bare T allows implicit null on shape fields.
  • Cross-link shapes ↔ types-and-values ↔ facts for consistent wording on undefined vs null where relevant.

Testing notes

  • Documentation-only; preview site build if your pipeline requires it.

Dependency changes

  • None.

@github-actions

github-actions Bot commented Apr 24, 2026

Copy link
Copy Markdown

🚀 Preview Deployment

A preview of this PR has been deployed to:

🔗 View Preview

This preview will be automatically removed when the PR is merged or closed.

🚀 Preview Deployment

✅ ** Preview removed (PR merged) **

The preview deployment for this PR has been automatically removed.

@binaek binaek added this pull request to the merge queue Apr 27, 2026
Merged via the queue into main with commit e6c1f74 Apr 27, 2026
1 check passed
@binaek binaek deleted the 30-update-docs-for-shape-optionality-and-nullability-syntax branch April 27, 2026 05: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.

Update docs for shape optionality and nullability syntax (field?: T, field: T?, field?: T?) and remove !-based forms

1 participant