Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
1dfcf04
Refactor documentation structure and content for clarity and complete…
binaek Feb 20, 2026
5d111c7
Enhance documentation clarity and consistency across multiple sections
binaek Feb 20, 2026
ed6e839
Refactor documentation by removing redundant headers for improved cla…
binaek Feb 20, 2026
34229fc
Update documentation to replace "Parameters" headers with "Concepts" …
binaek Feb 21, 2026
07cdd2c
Enhance getting started documentation with new sections for installat…
binaek Feb 21, 2026
fd39ff1
Enhance CLI documentation with new sections and improved clarity
binaek Feb 21, 2026
6cd1b46
Add new section for writing a policy in the quick start guide
binaek Feb 21, 2026
3bb9015
Update policy documentation to clarify the requirement of the Policy …
binaek Feb 21, 2026
fb05c73
Enhance documentation clarity and consistency across multiple sections
binaek Feb 21, 2026
a0ae55d
Enhance constraints documentation with comprehensive details and exam…
binaek Feb 21, 2026
a2dc49a
Enhance documentation for arithmetic, boolean, collection, and fact o…
binaek Feb 22, 2026
145a863
Fixing issue where frontmatter contained a colon - leading to parsing…
binaek Feb 22, 2026
48688bb
Refactor descriptions in documentation to improve clarity and consist…
binaek Feb 22, 2026
4b2154c
Refactor GitHub Actions workflow for PR previews to dynamically detec…
binaek Feb 22, 2026
5c31f78
Fix syntax in GitHub Actions workflow to correctly reference environm…
binaek Feb 22, 2026
4c6d9b3
Add identifiers section to documentation and update references
binaek Feb 22, 2026
d28abea
Bring up `identifiers` docs
binaek Feb 22, 2026
7aec665
Clarify constraints documentation regarding Infinity and NaN handling…
binaek Feb 22, 2026
4b86b32
Enhance collection operations documentation by adding examples for `a…
binaek Feb 22, 2026
c1de72d
Add troubleshooting and guide docs
binaek Mar 4, 2026
53f0f58
Refine reference and service docs
binaek Mar 4, 2026
aa761a2
Merge branch 'main' into 20-restructure-documentation-for-agent-centr…
binaek Apr 18, 2026
825445a
Merge branch 'main' into 20-restructure-documentation-for-agent-centr…
binaek Apr 18, 2026
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
63 changes: 42 additions & 21 deletions .github/workflows/pr-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,55 @@ permissions:
concurrency:
group: pr-preview-${{ github.event.pull_request.number }}

env:
BUILD_PATH: "."
PREVIEW_HOST: "sentrie-pr-${{ github.event.pull_request.number }}.surge.sh"
PREVIEW_URL: "https://sentrie-pr-${{ github.event.pull_request.number }}.surge.sh"

jobs:
deploy-preview:
name: Deploy Preview
runs-on: ubuntu-latest
steps:
- name: Checkout code
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
- name: Detect package manager
id: detect-package-manager
run: |
if [ -f "${{ github.workspace }}/yarn.lock" ]; then
echo "manager=yarn" >> $GITHUB_OUTPUT
echo "command=install" >> $GITHUB_OUTPUT
echo "runner=yarn" >> $GITHUB_OUTPUT
echo "lockfile=yarn.lock" >> $GITHUB_OUTPUT
exit 0
elif [ -f "${{ github.workspace }}/package.json" ]; then
echo "manager=npm" >> $GITHUB_OUTPUT
echo "command=ci" >> $GITHUB_OUTPUT
echo "runner=npx --no-install" >> $GITHUB_OUTPUT
echo "lockfile=package-lock.json" >> $GITHUB_OUTPUT
exit 0
else
echo "Unable to determine package manager"
exit 1
fi

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache: ${{ steps.detect-package-manager.outputs.manager }}
cache-dependency-path: ${{ env.BUILD_PATH }}/${{ steps.detect-package-manager.outputs.lockfile }}

- name: Install dependencies
run: |
npm cache clean --force
rm -rf node_modules package-lock.json
npm install
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
working-directory: ${{ env.BUILD_PATH }}

- name: Build Astro site
env:
ASTRO_PREVIEW: "true"
ASTRO_SITE_URL: "https://sentrie-pr-${{ github.event.pull_request.number }}.surge.sh"
run: npm run build
- name: Build with Astro
run: |
${{ steps.detect-package-manager.outputs.runner }} astro build \
--site "${{ env.PREVIEW_URL }}"
working-directory: ${{ env.BUILD_PATH }}

- name: Install Surge
run: npm install --global surge
Expand All @@ -46,10 +70,9 @@ jobs:
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
run: |
cd dist
PREVIEW_DOMAIN="sentrie-pr-${{ github.event.pull_request.number }}.surge.sh"
for i in {1..10}; do
if surge --project . \
--domain "$PREVIEW_DOMAIN" \
--domain "${{ env.PREVIEW_HOST }}" \
-y; then
echo "Surge deploy succeeded!"
break
Expand All @@ -61,16 +84,14 @@ jobs:
exit 1
fi
done


- name: Verify deployment
timeout-minutes: 2
run: |
PREVIEW_URL="https://sentrie-pr-${{ github.event.pull_request.number }}.surge.sh"
echo "Verifying deployment at $PREVIEW_URL..."
echo "Verifying deployment at ${{ env.PREVIEW_URL }}..."
for i in {1..10}; do
if curl -fsSL -o /dev/null "$PREVIEW_URL"; then
echo "Deployment verified successfully!"
if curl -fsSL -o /dev/null "${{ env.PREVIEW_URL }}"; then
echo "Deployment verified successfully at ${{ env.PREVIEW_URL }}!"
exit 0
fi
echo "Attempt $i/10 failed, retrying in 2 seconds..."
Expand All @@ -97,8 +118,8 @@ jobs:
<!-- surge-preview -->
## 🚀 Preview Deployment

A preview of this PR has been deployed to:
A preview of this PR has been deployed to ${{ env.PREVIEW_URL }}:

🔗 **[View Preview](https://sentrie-pr-${{ github.event.pull_request.number }}.surge.sh)**
🔗 **[View Preview](${{ env.PREVIEW_URL }}) at ${{ env.PREVIEW_URL }}**

This preview will be automatically removed when the PR is merged or closed.
127 changes: 65 additions & 62 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,11 @@ export default defineConfig({
label: "Getting Started",
items: [
{
label: "What is Sentrie?",
slug: "getting-started/what-is-sentrie",
},
{
label: "What is Policy as Code?",
slug: "getting-started/what-is-policy-as-code",
},
{
label: "Why Sentrie?",
slug: "getting-started/why-sentrie",
},
{
label: "Installation",
slug: "getting-started/installation",
label: "Introduction & Core Philosophy",
slug: "getting-started/introduction",
},
{ label: "Quick Start", slug: "getting-started/quick-start" },
{ label: "Installation", slug: "getting-started/installation" },
{
label: "Writing your first Policy",
slug: "getting-started/writing-your-first-policy",
Expand All @@ -50,34 +40,37 @@ export default defineConfig({
label: "Running your Policy",
slug: "getting-started/running-your-policy",
},
{
label: "Policy Enforcement",
slug: "getting-started/enforcement",
},
{ label: "Enforcement", slug: "getting-started/enforcement" },
],
},
{
label: "Structure of a Policy Pack",
label: "Guides",
items: [
{ label: "Testing Policies", slug: "guides/testing-policies" },
{
label: "Overview",
slug: "structure-of-a-policy-pack/overview",
label: "Policy Design Best Practices",
slug: "guides/policy-design-best-practices",
},
{
label: "Pack File",
slug: "structure-of-a-policy-pack/packfile",
label: "Deployment and Security",
slug: "guides/deployment-and-security",
},
],
},
{
label: "Language Concepts",
items: [
{
label: "Program File",
slug: "structure-of-a-policy-pack/program-file",
label: "Type System & Shapes Overview",
slug: "language-concepts/type-system-shapes",
},
{
label: "TypeScript File",
slug: "structure-of-a-policy-pack/typescript-file",
label: "Policy Composition",
slug: "language-concepts/policy-composition",
},
{
label: "Example Pack",
slug: "structure-of-a-policy-pack/example-pack",
label: "Pattern Matching & Conditionals",
slug: "language-concepts/pattern-matching-conditionals",
},
],
},
Expand All @@ -101,6 +94,10 @@ export default defineConfig({
label: "Overview",
slug: "reference",
},
{
label: "Identifiers",
slug: "reference/identifiers",
},
{
label: "Types and Values",
slug: "reference/types-and-values",
Expand Down Expand Up @@ -153,6 +150,10 @@ export default defineConfig({
label: "Boolean Operations",
slug: "reference/boolean-operations",
},
{
label: "Membership Operations",
slug: "reference/membership-operations",
},
{
label: "Using Functions",
slug: "reference/functions",
Expand All @@ -173,6 +174,10 @@ export default defineConfig({
label: "Precedence",
slug: "reference/precedence",
},
{
label: "Errors",
slug: "reference/errors",
},
{
label: "Security and Permissions",
slug: "reference/security-and-permissions",
Expand All @@ -182,10 +187,7 @@ export default defineConfig({
{
label: "TypeScript Modules",
items: [
{
label: "Overview",
slug: "reference/typescript_modules",
},
{ label: "Overview", slug: "reference/typescript_modules" },
{
label: "JavaScript Globals",
slug: "reference/typescript_modules/sentrie/js",
Expand All @@ -210,14 +212,8 @@ export default defineConfig({
label: "JSON",
slug: "reference/typescript_modules/sentrie/json",
},
{
label: "JWT",
slug: "reference/typescript_modules/sentrie/jwt",
},
{
label: "Net",
slug: "reference/typescript_modules/sentrie/net",
},
{ label: "JWT", slug: "reference/typescript_modules/sentrie/jwt" },
{ label: "Net", slug: "reference/typescript_modules/sentrie/net" },
{
label: "Regex",
slug: "reference/typescript_modules/sentrie/regex",
Expand All @@ -230,38 +226,45 @@ export default defineConfig({
label: "Time",
slug: "reference/typescript_modules/sentrie/time",
},
{
label: "URL",
slug: "reference/typescript_modules/sentrie/url",
},
{ label: "URL", slug: "reference/typescript_modules/sentrie/url" },
{
label: "UUID",
slug: "reference/typescript_modules/sentrie/uuid",
},
],
},
{
label: "CLI Reference",
label: "Extensibility",
items: [
{
label: "Overview",
slug: "cli-reference",
},
{
label: "init",
slug: "cli-reference/init",
},
{
label: "exec",
slug: "cli-reference/exec",
},
{
label: "serve",
slug: "cli-reference/serve",
label: "Writing Custom TypeScript Modules",
slug: "extensibility/writing-custom-typescript-modules",
},
],
},
{
label: "CLI Reference",
items: [
{ label: "Overview", slug: "cli-reference" },
{ label: "sentrie exec", slug: "cli-reference/exec" },
{ label: "sentrie init", slug: "cli-reference/init" },
{ label: "sentrie serve", slug: "cli-reference/serve" },
{ label: "sentrie validate", slug: "cli-reference/validate" },
],
},
{
label: "Troubleshooting",
items: [
{ label: "Overview", slug: "troubleshooting" },
{ label: "Common Errors", slug: "troubleshooting/common-errors" },
],
},
{
label: "Deployment & Operations",
items: [
{
label: "validate",
slug: "cli-reference/validate",
label: "Running as a Service",
slug: "deployment-operations/running-as-service",
},
],
},
Expand Down
50 changes: 50 additions & 0 deletions docs-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# [Feature Name]

[A short, conversational paragraph explaining what this is and the exact problem it solves. Write as if you are explaining it to a colleague. Focus on the "why"—e.g., "When you need to guarantee the exact structure of an incoming payload before evaluating it, use Shapes."]

Here is the basic syntax:

```typescript
// The formal definition or type signature
```

## Configuration & Arguments

[A brief, friendly sentence setting up the table, e.g., "You can customize the behavior using the following parameters:"]

| Argument | Type | Required | What it does |
| :---------- | :----- | :------- | :-------------------------------------------- |
| `paramName` | `Type` | Yes/No | A plain-English explanation of this argument. |

**Returns:** `ReturnType` — [Explain what the developer gets back in plain English, e.g., "A validated object, or it aborts the evaluation if constraints fail."]

---

## Examples in Action

### [Scenario 1: e.g., Validating a standard user profile]

[One to two sentences explaining the real-world context of this example. Why would a developer actually write this?]

```typescript
// Clean, copy-pasteable code using realistic variable names
// like userAge or billingAddress instead of foo and bar.
```

### [Scenario 2: e.g., Handling complex nested objects]

[Context for the advanced use case. What edge case or complexity does this solve?]

```typescript
// Advanced example code showing composition or error handling.
```

---

## Good to Know

Before you implement this, keep a few boundaries in mind to ensure predictable execution:

- **[Constraint]:** [e.g., "Sentrie evaluates these strictly. If an incoming payload includes keys not defined in your Shape, the evaluation will fail."]
- **[Performance tip]:** [e.g., "If you are validating deeply nested JSON, keep your recursion depth under X for optimal performance."]
- **[Edge case]:** [e.g., "Null values are only accepted if you explicitly use the `.nullable()` modifier."]
Loading
Loading