> For the complete documentation index, see [llms.txt](https://faction-os.gitbook.io/faction-os-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://faction-os.gitbook.io/faction-os-docs/.spec_system/archive/phases/phase_16/session_03_automated_checks_and_build_gates.md).

# Session 03: Automated Checks And Build Gates

**Session ID**: `phase16-session03-automated-checks-and-build-gates` **Package**: public-website **Status**: Complete **Completed**: 2026-06-02 **Estimated Tasks**: \~16-22 **Estimated Duration**: 2-4 hours

***

## Objective

Make public website checks reliable from clean install, root workspace commands, and package-scoped commands.

***

## Scope

### In Scope (MVP)

* Verify `npm install` succeeds from repo root.
* Verify root `npm run format:check` includes website files.
* Verify root `npm run lint` includes website files where applicable.
* Verify root `npm run typecheck` includes website type checking or document the explicit workspace command that covers it.
* Verify `npm --workspace @factionos/public-website run typecheck`.
* Verify `npm --workspace @factionos/public-website run build`.
* Verify root `npm run build` includes the website or document why the website build remains package-scoped.
* Verify production build excludes draft content.
* Verify RSS builds.
* Verify sitemap builds.
* Verify robots references sitemap.
* Verify no analytics/tracking code is present.

### Out of Scope

* Deployment to Cloudflare Pages.
* Browser automation beyond lightweight local preview checks.
* Adding large Playwright suites unless already justified by regressions.

***

## Prerequisites

* [x] Sessions 01 and 02 completed.
* [x] Root workspace scripts understood.

***

## Deliverables

1. Passing or clearly documented root/package check commands.
2. Any needed root script adjustments.
3. Draft exclusion verification.
4. Metadata/feed/static output checks.
5. Validation notes for launch handoff.

***

## Required Commands

Run from repo root:

```bash
npm install
npm run format:check
npm run lint
npm run typecheck
npm --workspace @factionos/public-website run typecheck
npm --workspace @factionos/public-website run build
npm run build
```

Run local preview commands as needed:

```bash
npm --workspace @factionos/public-website run dev
npm --workspace @factionos/public-website run preview
```

***

## Task Expansion Guidance

When expanded with `plansession`, keep the checklist to 16-22 tasks covering:

* Root install.
* Format check.
* Lint check.
* Root typecheck.
* Website typecheck.
* Website build.
* Root build.
* Draft exclusion.
* RSS output.
* Sitemap output.
* Robots output.
* Metadata spot check.
* Analytics/tracker absence.
* Script adjustments.
* Validation notes.

***

## Success Criteria

* [ ] Package-scoped website typecheck and build pass.
* [ ] Root checks include or intentionally delegate website checks.
* [ ] Drafts are excluded from production output.
* [ ] RSS, sitemap, robots, and metadata can be verified from static output.
* [ ] No analytics/tracking code appears in built output.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://faction-os.gitbook.io/faction-os-docs/.spec_system/archive/phases/phase_16/session_03_automated_checks_and_build_gates.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
