# Lily

See [OPERATIONS.md](OPERATIONS.md) for command effects and prerequisites; run
`node scripts/operations.mjs describe` from this repository to inspect them.

Read [first-release acceptance](ACCEPTANCE.md) for purpose, unmet release obligations, preserved requirements and the evidence decision rule.

Lily is the ticket desk edition of the Support family on the shared Cloudflare and TanStack Start base. This repository is authoritative for its complete product source, selected components, interface, integration and local changes. Maintainers, owners and community publishers use the same source, build and verification commands.

For the current public-request and reviewed SendGrid reply pilot, follow [the installation and operating guide](docs/SUPPORT-PILOT.md). It lists the required environment values and native owner setup from an empty database.

```sh
pnpm install --frozen-lockfile
pnpm run setup -- --dry-run
pnpm run deploy
```

Deployment provisions the selected installation's resources, builds, drains mail work, applies core migrations and canonical queue backfill, then uploads and checks the Worker before restoring queue delivery. Set the guide's environment values and authenticate Wrangler before deploying. `pnpm run deploy -- --dry-run` performs a local rehearsal.

The pilot records provider acceptance separately from delivery. Full product requirements remain in [CONTRACT.md](CONTRACT.md); passing pilot checks does not mean every 1.0 clause is implemented.

Successful built CSS/JS asset responses, including 304 revalidation, do not consume the application public-request quota. Missing or failed asset probes retain the declared 240-per-minute limit; authentication, API, Help Centre, and webhook admission policies are unchanged.

## Author and publish source

Read [AUTHORING.md](AUTHORING.md). `edition.json` owns selected components;
`sources.lock.json` records effective tracked source and separately selected tooling.
Shared source is directly editable here. `composition.lock.json` is historical
605495b/Base603ee025 import provenance, not current generated-tree authority.
Use `node scripts/edition-authoring/cli.mjs check` to check source integrity and
`release /absolute/new-local-repository` for a portable local source release.
A source release preserves Git history and author inputs; it does not deploy Lily
or claim full contract acceptance.

## Customise and share improvements

The maintained edition defaults save integration and verification work. Configuration
and hooks are conveniences; editing domain internals, core schema, UI, framework
or infrastructure is ordinary authoring too. Choose the change that serves the
owner's outcome, without a required sequence of extension mechanisms. Complex
merges and adaptation are the agent's work. Preserve the owner's actual requirements
wherever recorded: `CONTRACT.md`, `DIVERGENCE.md`, owner instructions and optional
`.seed/intent.md`; no particular intent file or registry is required.

Feed useful mechanisms, defaults and verification cases back into shared source
when they would save work in another edition. Their natural home may be this
edition, a family, Base or an independent repository; no separate repository per
module or universal compatibility interface is required. Verify adoption against
the receiving product's requirements, including deliberate local differences.

Local and deployment commands apply owner SQL in `migrations/ext/` after core
migrations, using a separate ledger in the same database. See the
[migration guide](migrations/README.md) before planning a schema change.

## Shared source refactor

The edition carries editable shared SendGrid transport and authoring 1.1 source.
`node scripts/edition-authoring/cli.mjs changes` explains changed inputs;
`extract` and `compare` provide retained source and incoming comparison context.
`release` writes an adjacent `.release.json` receipt; retain that sidecar with
source distribution and use `receipt <path>` to verify another clean clone.
See [AUTHORING.md](AUTHORING.md) for arguments and source-only verification limits.

SendGrid202 is accepted with a nullable actual provider receipt. Local correlation
identifies the command, not remote delivery. Uncertain submissions are reconciled
without automatic repetition; the edition retains its own durable policy.

Owner SQL in `migrations/ext` runs after core through the actual local and deployment migration commands. Preserve applied histories; `pnpm run test:owner-migrations` tests real isolated D1 execution and recovery. See [migrations/README.md](migrations/README.md).
