paperclip/scripts
Devin Foley ad74fb5450
Add a feature catalog build artifact derived from the experimental settings schema (#10055)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work
> - Instances expose ~23 experimental feature settings, all declared in
one shared zod schema and toggled per instance
> - Deployment tooling and hosting control planes have no
machine-readable list of those feature keys for a given release — the
schema is only reachable from code that imports the package
> - Any external system that references feature keys therefore does so
as free text, and typos drift silently
> - This pull request derives a versioned `feature-catalog.json` build
artifact from the schema, with a compiler-checked metadata map so the
schema stays the single source of truth
> - The benefit is a stable contract external tooling can validate
feature-key references against, with zero runtime behavior change

## Linked Issues or Issue Description

No public issue exists; `feature_request` template fields:

**Problem or motivation:**
External deployment tooling cannot enumerate or validate an instance's
feature keys per release; free-text references fail silently when keys
are renamed or removed.

**Proposed solution:**
A metadata map keyed by the settings schema's own keys (compiler flags
drift) plus a build step emitting `feature-catalog.json` (keys, tiers,
defaults, `catalogVersion`) as a release artifact.

**Alternatives considered:**
A hand-maintained catalog file (drifts from the schema); serving the
schema from a runtime API (requires a running instance at validation
time — a build artifact works offline and pins to a release).

**Roadmap alignment:**
Supports the in-progress "Cloud deployments" milestone in `ROADMAP.md`.

## What Changed

Adds a metadata map (title, description, tier, cloud/self-hosted
defaults) keyed by the keys of `instanceExperimentalSettingsSchema`, so
the schema stays the single source of truth and the compiler flags any
drift. A new build step (`build:feature-catalog --version <v>`) emits
`feature-catalog.json` — all 23 feature keys, their tiers, and a
`catalogVersion` — as a release artifact that managed-hosting control
planes can validate feature-flag writes against. No runtime behavior
changes.

- New `packages/shared/src/feature-catalog.ts`: per-flag metadata map
keyed by a type derived from the settings schema
(adding/removing/renaming a flag without updating the map is a compile
error), plus `featureCatalogArtifactSchema` and
`buildFeatureCatalogArtifact`/`renderFeatureCatalogArtifact` for the
artifact
- New `scripts/generate-feature-catalog.ts` wired as `pnpm
build:feature-catalog --version <v>`
- `scripts/create-github-release.sh` generates the artifact and uploads
it as a GitHub Release asset (with a dry-run preview line)
- Tests in `packages/shared/src/feature-catalog.test.ts`

## Verification

- `vitest run packages/shared/src/feature-catalog.test.ts` — 9 tests:
schema-key coverage, drift detection, artifact shape
- `pnpm --filter @paperclipai/shared typecheck`
- Artifact generation run end-to-end: `pnpm build:feature-catalog
--version 0.0.0-test` emits 23 keys with `catalogVersion`

## Risks

Low risk — no runtime behavior changes; the change is metadata, a build
script, and a release-artifact emission step only.

## Model Used

Claude Fable 5 (`claude-fable-5`), extended thinking, agentic tool use;
independently peer-reviewed by a second AI agent before push

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [ ] All Paperclip CI gates are green
- [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge

---------

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-07-22 18:12:56 -07:00
..
__tests__ fix(ci): preserve required e2e check for sharded runs (#9923) 2026-07-20 16:40:19 -07:00
mcp-fixtures fix(acpx): support Windows agent spawning (#9980) 2026-07-22 10:22:29 -05:00
smoke feat(mcp) [split 1/8]: add fixture demo servers (#9556) 2026-07-14 12:56:21 -05:00
acpx-patch-packaging.test.mjs fix(release): publish bundled packages with trusted npm staging (#10047) 2026-07-22 17:01:11 -05:00
backfill-issue-reference-mentions.ts
…
backup-db.sh
…
bootstrap-npm-package.mjs Make ACP the default engine for local adapters (#9238) 2026-07-08 19:05:03 -07:00
bootstrap-npm-package.test.mjs Make ACP the default engine for local adapters (#9238) 2026-07-08 19:05:03 -07:00
build-npm.sh
…
build-standalone-public-packages.mjs
…
capture-pap-2351-binding-picker.mjs
…
check-docker-deps-stage.mjs
…
check-forbidden-tokens.mjs
…
check-no-git-push.mjs
…
check-no-git-push.test.mjs
…
check-release-package-bootstrap.mjs
…
check-release-package-bootstrap.test.mjs
…
check-token-gates.mjs feat(ui): single-source design tokens, visual regression suite, and theme retune (#9134) 2026-07-07 16:22:16 -05:00
clean-onboard-git.sh
…
clean-onboard-npm.sh
…
clean-onboard-ref.sh
…
cli-bundled-npm-dependencies.mjs fix(acpx): support Windows agent spawning (#9980) 2026-07-22 10:22:29 -05:00
codemod-extract-colors.mjs feat(ui): single-source design tokens, visual regression suite, and theme retune (#9134) 2026-07-07 16:22:16 -05:00
codemod-extract-misc.mjs feat(ui): single-source design tokens, visual regression suite, and theme retune (#9134) 2026-07-07 16:22:16 -05:00
codemod-extract-sizes.mjs feat(ui): single-source design tokens, visual regression suite, and theme retune (#9134) 2026-07-07 16:22:16 -05:00
codemod-extract-type.mjs feat(ui): single-source design tokens, visual regression suite, and theme retune (#9134) 2026-07-07 16:22:16 -05:00
codemod-type-ladder.mjs feat(ui): single-source design tokens, visual regression suite, and theme retune (#9134) 2026-07-07 16:22:16 -05:00
create-github-release.sh Add a feature catalog build artifact derived from the experimental settings schema (#10055) 2026-07-22 18:12:56 -07:00
dev-runner-output.mjs
…
dev-runner-output.ts
…
dev-runner-paths.mjs
…
dev-runner-snapshot.mjs
…
dev-runner.mjs
…
dev-runner.ts
…
dev-service-profile.ts
…
dev-service.ts
…
discord-daily-digest.sh
…
docker-build-test.sh
…
docker-entrypoint.sh
…
docker-onboard-smoke.sh
…
e2e-mcp-user-stories.mjs feat(mcp) [split 8/8]: add e2e coverage and operator docs (#9563) 2026-07-14 15:48:57 -05:00
e2e-shard-durations.json fix(ci): preserve required e2e check for sharded runs (#9923) 2026-07-20 16:40:19 -07:00
e2e-shard.mjs fix(ci): preserve required e2e check for sharded runs (#9923) 2026-07-20 16:40:19 -07:00
ensure-plugin-build-deps.mjs
…
ensure-workspace-package-links.ts
…
extract-proposed-events.mjs Add telemetry proposal extractor (#9544) 2026-07-13 23:47:27 -07:00
extract-proposed-events.test.mjs Add telemetry proposal extractor (#9544) 2026-07-13 23:47:27 -07:00
general-server-shard-durations.json perf(ci): balance general-server test shards by recorded suite duration (#9516) 2026-07-13 12:25:54 -07:00
general-server-shard.mjs perf(ci): balance general-server test shards by recorded suite duration (#9516) 2026-07-13 12:25:54 -07:00
generate-company-assets.ts
…
generate-feature-catalog.ts Add a feature catalog build artifact derived from the experimental settings schema (#10055) 2026-07-22 18:12:56 -07:00
generate-npm-package-json.mjs fix(acpx): support Windows agent spawning (#9980) 2026-07-22 10:22:29 -05:00
generate-org-chart-images.ts
…
generate-org-chart-satori-comparison.ts
…
generate-plugin-package-json.mjs
…
generate-ui-package-json.mjs
…
ingest-app-definitions.mjs feat(connections): add AppDefinition Wave 1 catalog (#9981) 2026-07-21 15:57:12 -05:00
kill-agent-browsers.sh
…
kill-dev.sh
…
kill-vitest.sh
…
kill-workspaces.sh
…
link-plugin-dev-sdk.mjs
…
link-plugin-dev-sdk.test.js
…
measure-issue-chat-long-thread.mjs
…
migrate-inline-env-secrets.ts
…
paperclip-commit-metrics.ts
…
paperclip-issue-update.sh
…
prepare-bundled-package.mjs fix(release): publish bundled packages with trusted npm staging (#10047) 2026-07-22 17:01:11 -05:00
prepare-server-ui-dist.sh
…
provision-worktree.sh feat(mcp) [split 5/8]: integrate adapters and deployment runtime (#9560) 2026-07-14 15:15:43 -05:00
release-lib.sh fix(release): add npm publish crash diagnostics (#10041) 2026-07-22 14:48:54 -05:00
release-lib.test.mjs fix(release): publish bundled packages with trusted npm staging (#10047) 2026-07-22 17:01:11 -05:00
release-package-manifest.json feat(mcp) [split 1/8]: add fixture demo servers (#9556) 2026-07-14 12:56:21 -05:00
release-package-map.mjs
…
release-package-map.test.mjs [codex] Add built-in Hermes adapters (#8543) 2026-06-26 16:04:58 -05:00
release-registry-versions.mjs perf(release): batch npm registry version queries (#9202) 2026-07-08 08:04:39 -07:00
release-registry-versions.test.mjs perf(release): batch npm registry version queries (#9202) 2026-07-08 08:04:39 -07:00
release.sh fix(release): use trusted publishing npm for bundled packages (#10030) 2026-07-22 13:19:15 -05:00
request-hot-restart.ts fix(server): restore hot-restart run adoption (#9647) 2026-07-16 02:46:09 -05:00
rollback-latest.sh
…
run-typecheck-build-gaps.mjs Add runtime asset build-gap guard 2026-07-13 08:35:30 -07:00
run-vitest-stable.mjs perf(ci): balance general-server test shards by recorded suite duration (#9516) 2026-07-13 12:25:54 -07:00
screenshot-blocked-inbox.mjs
…
screenshot-file-viewer.mjs
…
screenshot-fork-flow.mjs Skill Studio: three-pane skill IDE with sandboxed test runs (#9241) 2026-07-09 13:08:56 -05:00
screenshot-one.mjs
…
screenshot-pap2373.mjs
…
screenshot-recovery-card.cjs
…
screenshot-subissues.mjs
…
screenshot-verdicts.mjs feat: add attention queue and Decisions surface (#9380) 2026-07-10 17:09:57 -05:00
screenshot.cjs
…
serve-storybook-static.mjs [codex] Document Storybook visual baseline platform lock (#9216) 2026-07-08 07:23:02 -05:00
storybook-visual-baseline.mjs feat(ui): single-source design tokens, visual regression suite, and theme retune (#9134) 2026-07-07 16:22:16 -05:00
verify-release-registry-state.mjs
…
verify-release-registry-state.test.mjs
…