Forge is a go-between for CLI addon installation workflows. It targets MCP servers, skills, plugins, and related addons that are currently installed via fragmented copy/paste instructions from GitHub/docs.
Reference model: the CurseForge app flow for WoW addons, adapted for CLI ecosystems.
Today the common path is:
- Search the web for an addon.
- Find install instructions (if they exist and are current).
- Copy and paste commands/config by hand.
- Debug failures with low visibility.
Forge aims to replace that with a deterministic path:
- Discover addon metadata.
- Build a safe install plan.
- Install addon/config changes.
- Verify the addon is callable at runtime.
- Searchable addon catalog with normalized metadata.
- Managed install/update/remove lifecycle.
- Dependency-aware install planning.
- Profile-aware config writes for supported clients.
- Health checks, error classification, and rollback guidance.
Validated baseline (Wave 7 build report evidence):
- Discover stage: deterministic catalog ingest domain + executable ingest runner (
scripts/run-catalog-ingest.mjs) with replay-safe persistence overregistry.packages,package_aliases,package_merge_runs,package_field_lineage, andpackage_identity_conflicts, plus launch-baseline source normalization forgithub,npm, andpypi. - Discover API:
GET /v1/packages,GET /v1/packages/:package_id, andPOST /v1/packages/searchwith ranking lineage (embedding_model_version,vector_collection_version) andsemantic_fallbacksignaling. - Retrieval path: concrete Postgres BM25 retriever, Qdrant semantic retriever, and OpenAI-compatible embedding provider wired into control-plane bootstrap (
apps/control-plane/src/retrieval-bootstrap.ts). - Retrieval sync/backfill path: deterministic projection + fingerprinting + bounded batching via
packages/ranking/src/retrieval-sync.tsandscripts/run-retrieval-sync.mjs. - Startup/readiness hardening: fail-closed readiness details for DB and required retrieval bootstrap in
apps/control-plane/src/server.ts. - Plan stage: deterministic install planning with persisted
install_plans,install_plan_actions, and append-onlyinstall_plan_audit. - Apply stage:
POST /v1/install/plans/:plan_id/applywith replay-safe idempotency and persisted apply attempts. - Verify stage:
POST /v1/install/plans/:plan_id/verifywith runtime pipeline stage outcomes, persisted verify attempts, and correlation continuity. - Runtime wiring: env-driven runtime feature flags (
apps/control-plane/src/runtime-feature-flags.ts) plus remote auth +secret_refresolution + OAuth client-credentials integration (apps/control-plane/src/runtime-remote-config.ts). - Runtime startup env matrix validation (
apps/control-plane/src/startup-env-validation.ts) with deterministic non-secret validation errors. - Filesystem-backed VS Code Copilot adapter: ordered scope writes, atomic temp-write + rename, rollback-on-failure, and sidecar ownership checks.
- Outbox processing: deterministic processor modes (
dry-run/shadow/production) with replay-safe execution ledger and side-effect audit (infra/postgres/migrations/010_outbox_internal_dispatch_runs.sql,011_retrieval_sync_and_dead_letter_ops.sql). - Internal ranking sync execution from outbox (
ranking.sync.requested) with deterministic side effects and replay-safe effect dedupe. - Dead-letter operator tooling (
scripts/run-outbox-dead-letter-replay.mjs) with explicit confirmation and append-only replay audit trail. - CI baseline in
.github/workflows/forge-ci.ymlcovering typecheck/test/check/migration verification/integration-db docker flow. - Migration set: additive migrations
001..016with deterministic numeric ordering (015_catalog_source_freshness_and_reconciliation.sqlthen016_security_appeals_and_trust_gates.sql), DR-018 verification guard (scripts/verify-dr018-migration.mjs), and wave migration contract coverage. - Lifecycle expansion baseline: update/remove/rollback service + routes are implemented (
POST /v1/install/plans/:plan_id/update,POST /v1/install/plans/:plan_id/remove|uninstall,POST /v1/install/plans/:plan_id/rollback) with idempotent replay/conflict semantics (migration014_install_lifecycle_remove_rollback_states.sql). - Catalog reconciliation/freshness persistence baseline: docs-source reconciliation runner + freshness/reconciliation tables (
015_catalog_source_freshness_and_reconciliation.sql) with API visibility viaGET /v1/packages/freshness.
Wave 8 foundations (in-source, pre-report):
- Profile/bundle contract types (
packages/shared-contracts/src/profiles.ts) are exported and consumed by control-plane profile routes. - Profile API routes in control-plane:
GET/POST /v1/profiles,GET /v1/profiles/:id,GET|POST /v1/profiles/:id/export(GET preferred; POST retained for compatibility),POST /v1/profiles/import,POST /v1/profiles/:id/install,GET /v1/profiles/install-runs/:run_id. - Profile API validation: strict input validation (UUID format, bounds, enum checks,
MAX_PROFILE_PACKAGES=200), error taxonomy matching existing API style. - Profile install-run orchestration:
profile_install_run_planslinkage, status progression (running→completed/failed), aggregate counts from persisted per-plan outcomes. - Profile install execution modes:
plan_only(default) andapply_verifywith idempotent replay-safe behavior. - Postgres profile adapters (
apps/control-plane/src/profile-postgres-adapters.ts) with install-run persistence. - Additive migration
012_profile_bundle_foundations.sqlintroducingprofiles,profile_packages,profile_install_runs,profile_install_run_plans, andprofile_audit. - Integration-db profile bundle coverage (
tests/integration-db/profile-bundle.integration-db.test.ts). - Deterministic outbox dispatcher supports
security.report.accepted(plus existing lifecycle/ranking/security event families).
Wave 9 closure artifacts:
- Operational SLO rollup module (
packages/security-governance/src/slo-rollup.ts) with deterministic metric computation across 10 SLO metric families, including DR-002 funnel KPIs (TTFSC p90,cold_start.success_rate,retryless.success_rate). - Additive migration
013_operational_slo_rollup_foundations.sqlintroducingoperational_slo_rollup_runsandoperational_slo_snapshots. - SLO rollup operator runner (
scripts/run-slo-rollup.mjs) with--mode dry-run|production,--from,--to,--limit, deterministic run IDs, and structured logs. - SLO rollup unit tests (
packages/security-governance/tests/slo-rollup.test.ts) and integration-db tests (tests/integration-db/slo-rollup.integration-db.test.ts). - Event ownership matrix codified in
docs/wave9-execution-plan.mdwith producer→dispatcher→handler→side-effects mapping for all 9 supported event types plus explicitmetrics.aggregate.requestednon-support. - Hermetic local dependency stack via
docker-compose.yml(Postgres 16 + Qdrant) with bootstrap/teardown scripts. - Wave 9 execution plan (
docs/wave9-execution-plan.md) with step matrix, acceptance gates, validation commands, and event ownership matrix. - Wave 9 build report (
docs/wave9-build-report.md) and Wave 8 build report (docs/wave8-build-report.md) published with evidence and deferrals.
Current verified baseline:
npm run typecheckpasses.npm run testpasses.npm run checkpasses.npm run verify:migrations:dr018passes.npm run test:e2e-localpasses.npm run test:integration-db:dockerpasses.
Current release and pilot posture:
E9-S4distribution/upgrade policy is validated in workflow, scripts, and docs, but release evidence remainsDRAFTuntil final human sign-off and CI signature generation.E10-S1beta pilot tooling is ready for execution; the current GA readiness review is a pre-pilot baseline with zero lifecycle events.
Known open items:
E10-S1: execute closed beta pilot with cohort onboarding and collect the first non-zero KPI window.E10-S2: run beta triage workflow and close high-severity failure classes.E10-S3: complete GA launch decision package with cross-functional sign-off.
Important governance boundary:
- DR/AQ/MQ statuses remain
Proposed/Openunless explicitly approved.
- Product and architecture decisions:
application_decision_records.md - Frozen v1 contracts:
docs/contracts/v1-addon-metadata-contract.mddocs/contracts/v1-lifecycle-api-contract.md
- Compatibility matrix:
docs/compatibility-matrix.md - Execution guardrails:
OPEN_QUESTIONS_TRACKER.md,DECISION_LOG.md - Operational runbooks:
docs/runbooks/profile-lifecycle-operations.mddocs/runbooks/slo-rollup-operations.mddocs/runbooks/retrieval-sync-backfill-and-recovery.mddocs/runbooks/outbox-dead-letter-requeue.mddocs/runbooks/semantic-retrieval-incident-fallback.mddocs/runbooks/cron-failure-triage-and-replay-recovery.mddocs/runbooks/security-trust-gate-operations.md
- CI and validation contract:
docs/ci-verification.md - Wave build reports:
docs/wave3-build-report.mddocs/wave4-build-report.mddocs/wave5-build-report.mddocs/wave6-build-report.mddocs/wave7-build-report.mddocs/wave8-build-report.mddocs/wave9-build-report.mddocs/wave10-build-report.md
- Execution plans:
docs/wave6-execution-plan.md,docs/wave7-execution-plan.md,docs/wave9-execution-plan.md - Application completion backlog:
docs/application-completion-backlog.md - Immediate execution plans:
docs/immediate-execution-plans/README.md,docs/immediate-execution-plans/phase-2/README.md,docs/immediate-execution-plans/phase-3/README.md - Distribution and release policy:
docs/distribution-and-upgrade-policy.md,docs/release-checklist.md,docs/release-evidence-template.md - Beta/GA artifacts:
docs/beta-pilot-plan.md,docs/beta-triage-playbook.md,docs/ga-readiness-review-template.md,docs/ga-launch-report-template.md
The repo includes a user-facing forge command that wraps the control-plane HTTP API:
npm run forge -- search "mcp server fetch" # discover
npm run forge -- init # first-run config
npm run forge -- plan <package_id_or_exact_slug>
npm run forge -- install <plan_id> # install
npm run forge -- verify <plan_id> # verify
npm run forge -- update <plan_id> # update
npm run forge -- remove <plan_id> # remove
npm run forge -- rollback <plan_id> # rollback
npm run forge -- status <plan_id> # status
npm run forge -- profile list # profiles
npm run forge -- profile export <profile_id> --output profile.json
npm run forge -- profile import profile.json
npm run forge -- profile install <profile_id>
npm run forge -- health # healthSupport level: preview. Requires a running control-plane. forge init writes
a local solo developer config; forge plan and forge profile install also
accept explicit --org-id/--org-policy-file overrides for advanced use. Plan
creation uses catalog-declared permissions by default and fails closed when
permission metadata is missing. See docs/quickstart.md.
npm install
npm run typecheck
npm run test
npm run check
npm run verify:migrations:dr018
npm run test:integration-db
npm run test:integration-db:docker
npm run test:e2e-local
npm run run:catalog-ingest -- --mode dry-run --source docs --input <docs-source-json>
npm run run:catalog-reconciliation -- --mode dry-run --source docs --input <docs-source-json>
npm run run:retrieval-sync -- --mode dry-run --limit 25
npm run run:outbox -- --mode dry-run --limit 25
npm run run:outbox-dead-letter -- --action list --limit 25
npm run run:slo-rollup -- --mode dry-run --from 2026-02-28T00:00:00Z --to 2026-02-28T12:00:00Z --limit 100
npm run run:security-trust-gates -- --mode dry-run --action evaluate --window-from 2026-02-21T00:00:00Z --window-to 2026-02-28T00:00:00Z --trigger manual
npm run run:security-promotion -- --mode dry-run --package-id <uuid> --reviewer-id <id> --evidence-ref <ticket-id>
npm run run:beta-readiness -- --mode dry-run --from 2026-02-21T00:00:00Z --to 2026-02-28T00:00:00Z
npm run run:control-plane # requires DB env + FORGE_VSCODE_* adapter target envs unless adapter is injected in-process
scripts/local-stack-up.sh # Bootstrap Postgres + Qdrant via docker-compose
scripts/local-stack-down.sh # Tear down local stack (preserves volumes)npm run test:integration-dbrequiresFORGE_INTEGRATION_DB_URLpointing to a Postgres instance with migrations applied.npm run test:integration-db:dockerprovisions an ephemeral Docker Postgres instance, applies migrations001..016in lexical order, and runs the integration-db suite automatically.
docs/wave3-build-report.mddocs/wave4-build-report.mddocs/wave5-build-report.mddocs/wave6-build-report.mddocs/wave7-build-report.mddocs/wave8-build-report.mddocs/wave9-build-report.mddocs/wave10-build-report.md
This prompt is retained as the historical closure implementation record from 2026-02-28. Step 10 CI decisions in this prompt are now implemented.
You are an implementation agent working in /home/azureuser/ai-cli-web-funnel.
Mission:
Close Wave 9 with documentation/code parity, governance gate correctness, and explicit CI-scope decisions.
North-star loop:
1. discover
2. plan
3. install
4. verify
Every step in this build must explicitly improve one or more loop stages.
Current ground truth (do not reinterpret):
1. Governance checker script exists at `scripts/verify-governance-drift.mjs` and must be used by `npm run check`.
2. Wave 8/9 artifacts are already present: `docs/wave8-build-report.md`, `docs/wave9-build-report.md`, `docs/wave9-execution-plan.md`, profile and SLO runbooks, migration `013`.
3. Required CI checks are baseline + integration-db docker flow + `test:e2e-local` in `forge-ci.yml`; ops smoke automation is implemented as a non-blocking workflow.
4. SLO rollup runtime emits logs from `scripts/run-slo-rollup.mjs` with payload keys such as `metric_count`, `persisted`, and `failure_class`.
5. SLO snapshots schema uses `metric_key`, `ratio`, `numerator`, `denominator`, `sample_size`, and `metadata`.
Non-negotiable constraints:
1. Do not silently change AQ/MQ/DR status from Open/Proposed to Approved.
2. Keep additive forward-only migrations; include lock-risk and rollback notes in migration headers.
3. Preserve idempotency semantics everywhere: same key + same hash => replay, same key + different hash => conflict.
4. Keep privacy constraints intact (no raw IP/fingerprint/raw user-agent/raw install command persistence).
5. Never persist plaintext remote secrets; persist secret_ref only.
6. Keep compatibility bridge posture for registry.packages/public.registry_packages until explicit governance approval changes it.
7. Treat missing env/dependency blockers as explicit blockers, not silent regressions (for example missing DB URL or unavailable Qdrant).
8. Do not weaken deterministic outbox safety invariants (`dedupe_key`, replay ledger, effect dedupe).
9. Keep documentation statements bounded to verified evidence.
10. Keep unsupported-event behavior explicit for unknown event families.
Implementation steps:
Step 1: Fix governance gate wiring
1. Update `package.json` so `check:governance` calls `node scripts/verify-governance-drift.mjs`.
2. Confirm `npm run check` executes governance drift detection before typecheck/test.
Deliverables:
1. Updated `package.json`
2. Evidence from `npm run check`
Step 2: Reconcile root docs with actual state
1. Update `README.md` Wave 9 status and known gaps to remove stale “pending” language for already-implemented artifacts.
2. Keep only truly open items, especially Step 10 CI decision items.
3. Ensure Wave 8/9 reports, runbooks, migration range (`001..013`), and test ranges are accurate.
Deliverables:
1. Updated `README.md`
2. Updated `docs/README.md` and `docs/runbooks/README.md`
Step 3: Fix runbook/schema drift
1. Update SLO runbook SQL examples to match actual columns (`metric_key`, `ratio`, etc.).
2. Update log field documentation to match script payload keys (`metric_count`, `persisted`, `failure_class`, `error_message`).
3. Keep runbook examples executable against current schema.
Deliverables:
1. Updated `docs/runbooks/slo-rollup-operations.md`
Step 4: Close Step 10 CI gap explicitly
1. Decide one path and document it consistently:
- implement profile-specific e2e + ops smoke workflow now, or
- formally defer both with rationale and ownership.
2. Keep the chosen path consistent across:
- `docs/wave9-execution-plan.md`
- `docs/ci-verification.md`
- `docs/wave9-build-report.md`
Deliverables:
1. Updated plan/report/CI docs with one coherent Step 10 position
2. `DECISION_LOG.md` entry if deferring
Step 5: Re-run and capture verification evidence
1. Run:
- `npm run typecheck`
- `npm run test`
- `npm run check`
- `npm run verify:migrations:dr018`
- `npm run test:e2e-local`
2. If environment permits, run `npm run test:integration-db:docker`.
3. Record actual outcomes (PASS/FAIL/BLOCKED with exact blocker reason).
Deliverables:
1. Evidence-ready command result list for closure report
Step 6: Publish corrected Wave 9 closure report
1. Update `docs/wave9-build-report.md` using fresh command outcomes.
2. Include open/deferred items with rationale and ownership.
3. State acceptance status for Step 2/10/11/12 (satisfied or explicitly deferred).
Deliverables:
1. Updated `docs/wave9-build-report.md`
Validation checklist (must run and report):
1. npm run typecheck
2. npm run test
3. npm run check
4. npm run verify:migrations:dr018
5. npm run test:e2e-local
6. npm run test:integration-db:docker (if environment permits)
7. npm run run:slo-rollup -- --mode dry-run --from <iso> --to <iso> --limit 100 (if DB is available)
8. node scripts/verify-governance-drift.mjs
Required final report format:
1. Step-by-step implementation summary mapped to Step 1..6
2. Exact files created/updated
3. Migration list with lock-risk and rollback notes
4. Commands executed with pass/fail results
5. Deferred items with explicit rationale
6. Explicit governance statement: no silent Open/Proposed -> Approved changes
7. Updated discover/plan/install/verify coverage matrix
8. Operational readiness notes (what is production-ready vs still gated)
9. Environment requirement matrix (required vs optional env vars by command/service)
10. Acceptance criteria status for Step 2/10/11/12