Skip to content

Commit 270ea97

Browse files
authored
Merge pull request #1556 from constructive-io/feat/agents-bundled-deploy-docs
docs(agents): document bundled deploy CLI (pgpm package / deploy --fast)
2 parents 55460b8 + 9d18d65 commit 270ea97

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

AGENTS.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,30 @@ This guide helps AI agents quickly navigate the Constructive monorepo. Construct
6161
- Generate types/SDK: `cnc codegen`
6262
- Export schema SDL: `cnc get-graphql-schema`
6363

64+
## Bundled Deploy (fast, ledger-preserving migrations)
65+
66+
Every module can ship a content-addressed **bundle artifact** alongside its packaged SQL, and deploys can run from it in one shot — same speed as the old fast path, but it still writes the `pgpm_migrate` ledger. It's all driven by two CLI commands.
67+
68+
**Emit the artifact (packaging):**
69+
70+
```bash
71+
pgpm package # writes sql/<name>--<version>.sql AND sql/<name>--<version>.bundle.tar.gz (default)
72+
pgpm package --no-bundle # skip the bundle artifact
73+
```
74+
75+
The `.bundle.tar.gz` is a gzipped tarball of the module's JSON migration bundle (plan + per-change deploy/revert/verify SQL + a sha256 digest). **Commit it** beside the `.sql`.
76+
77+
**Deploy from it (fast path):**
78+
79+
```bash
80+
pgpm deploy --fast # one-shot execute + bulk pgpm_migrate ledger
81+
pgpm deploy --bundled # alias for --fast
82+
```
83+
84+
`--fast` prefers each module's committed `sql/<name>--<version>.bundle.tar.gz`: it verifies the sha256 digest, checks the artifact still matches `deploy/`, executes the module in a single round-trip, and bulk-inserts one `pgpm_migrate` row (name + hash) per change. If the artifact is missing, stale, or fails verification it **falls back** to building the bundle from `deploy/` — no behavior change, never a hard failure. Re-deploys skip changes already recorded by hash.
85+
86+
Programmatic API (only if you can't use the CLI): `writeBundleArtifact` / `readBundleArtifact` / `buildExecutableBundle` in `pgpm/core/src/bundle/artifact.ts`; see the `pgpm-migration-bundle` skill for the artifact/AST internals.
87+
6488
## Best Practices
6589

6690
### Environment Configuration

0 commit comments

Comments
 (0)