24 Commits

Author SHA1 Message Date
Benjamin Taylor 737a9a86cb feat(showcase): guard published snippet bodies in the demo bundler
Region bodies are assembled at bundle time, so neither failure mode in the
two preceding commits is visible in review — the source diff looks fine
while the docs page renders a 400-line slab or an uninstallable import.
Two checks over every region the bundler is about to publish:

- Any `@copilotkit/showcase-*` specifier fails the build. These resolve
  only through a tsconfig path alias to a symlink in this repo, so they
  cannot appear in a snippet a reader is meant to copy. The corpus is at
  zero once OSS-901 is fixed, so there is no baseline.
- Over 200 lines fails the build. The median region is 28 lines and p90 is
  125, so 200 catches a marker sitting above unrelated code without
  arguing about genuinely long single-purpose files (the 344-line
  declarative-gen-ui renderers.tsx is the point of that page). The 48
  regions already over the line are baselined by
  `slug::region::file` and the list only shrinks.

Both are reported together for the whole run, so one build lists every
unfollowable snippet instead of only the first.

Verified against the pre-fix tree: the guard exits 1 and names both the
mastra `@copilotkit/showcase-shared-tools` bodies and the 586-line strands
region.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-21 08:42:12 -05:00
copilotkit-qa-bot[bot] bd91313517 feat: add AWS Strands TypeScript starter 2026-08-18 15:51:47 -07:00
Jordan Ritter 62474be1dd fix(showcase/ci): make a cancelled build slot a first-class outcome
`job.status` for a matrix slot is success|failure|cancelled, but the
per-slot writer laundered cancelled into `skipped` before publishing its
result, so a slot killed by `timeout-minutes` became indistinguishable
from one that legitimately never built.

That erased the only signal that could tell a partially-cancelled fleet
build from a clean one. GitHub's status functions cannot recover it:
`cancelled()` is documented as "returns true if the workflow was
canceled" (workflow-scoped, and FALSE for a leg-only cancel), and a
cancelled ancestor is not a FAILED ancestor so `failure()` is false too.

Add `cancelled` to the BuildOutcome contract, add `cancelledSet()`, and
have the aggregator publish `any_cancelled` + `cancelled_services`
alongside `any_success`. `successSet` still excludes cancelled slots, so
the redeploy intersection is unchanged — a slot that pushed no image
still cannot enter the redeploy CSV.
2026-07-25 10:04:58 -07:00
Ran Shem Tov fdf588cfbf fix(showcase): green CI for the strands-typescript addition
Two PR checks were red on the new integration:

- check-config-files: add strands-typescript/next.config.ts to the build-
  config allowlist.
- Validate Showcase: update the new-integration guard pins that intentionally
  trip when an integration is added — BORN_IN_SHOWCASE 6→7, calculator
  _from-feature-parity count 18→19, catalog cross-join 874→920 / total_cells
  855→900 / docs_only 19→20 (46 features × 20 integrations), and the aimock
  substring-shadow ceiling 132→133 (+1 from the strands-typescript calculator
  fixture).

Also drop the premature deploy wiring: strands-typescript is removed from
showcase_build.yml (matrix + path filter + ALL_SERVICES) because it has no
Railway service yet (deployed: false) and the railway-envs SSOT test requires
a real service entry. It re-enters the deploy pipeline when the Railway
service is provisioned (external setup per INTEGRATION-CHECKLIST).
2026-06-22 15:36:28 +02:00
Jordan Ritter 8714ab569b chore(showcase): apply oxfmt formatting across showcase scripts and shells
oxfmt --write normalized formatting on showcase scripts, the four shells, and the
new oxlint rule; required for the repo-root oxfmt --check CI gate.
2026-05-29 11:45:16 -07:00
Jordan Ritter 690ab1d675 fix(showcase): trim RAILWAY_TOKEN env lane to honor no-whitespace-in-header invariant
A RAILWAY_TOKEN secret with trailing whitespace/newline (common from op
read, heredoc, shell export) was returned verbatim and produced invalid
Authorization: Bearer headers and silent Railway 401s. Trim the env-var
lane and treat whitespace-only as UNSET so the config-file fallback runs.
Also adds a missing should-have-thrown guard in the NO_HOME test and
removes a stale gateIgnore clause from findUntrackedServices docstring.
2026-05-29 11:45:13 -07:00
Jordan Ritter db84d82d42 fix(showcase): unify railway token resolver + sanitize GraphQL error bodies + null-check project 2026-05-29 11:45:12 -07:00
Jordan Ritter e5d2d47a04 fix(showcase): canonicalize build-result service names (trim) + reject array payloads 2026-05-29 11:45:12 -07:00
Jordan Ritter 781bc92e90 fix(showcase): return trimmed railway token to avoid invalid Authorization header
A token read from ~/.railway/config.json with surrounding whitespace or a
trailing newline passed nonEmpty() but was returned verbatim, so an
'Authorization: Bearer <token>' header could carry CR/LF or stray spaces
(Node HTTP rejects invalid header chars; Railway 401s otherwise). Trim
each return path so the canonical token is always emitted; whitespace-only
values still fall through. Also clarify the JSDoc that this resolver does
not consult process.env.RAILWAY_TOKEN.
2026-05-29 11:45:12 -07:00
Jordan Ritter 2ba31dfdbe fix(showcase): make railway-graphql .com scan guard fail-loud + harden endpoint constant 2026-05-29 11:45:12 -07:00
Jordan Ritter 8c603fb84a fix(showcase): harden build-outputs (reject empty/duplicate service, unify validation, fail loud)
- Reject empty/whitespace-only service in parseBuildOutputs,
  mergeBuildResultFiles, and buildResultArtifactName (was only
  buildResultArtifactName, and only for length===0).
- mergeBuildResultFiles now throws on duplicate service names across
  slots so an upstream dispatch-name collision surfaces instead of
  letting a failure+success pair spuriously look like a success in
  successSet (fail-loud discipline).
- Derive BuildOutcome union and VALID_STATUSES set from a single
  BUILD_OUTCOMES as-const tuple plus a compile-time exhaustiveness
  assignment so they cannot drift.
- Extract validateServiceBuildResult shared validator used by both
  parseBuildOutputs (context: 'entry[i]') and mergeBuildResultFiles
  (context: 'slot[i]') — one set of rules, one error format, both
  now include the offending index.
- Trim shouldRedeployStaging JSDoc to what/why only (dropped the
  external-caller enumeration) and note in the module header that
  the single-result.json-per-slot invariant is enforced workflow-side,
  not by the parser. shouldRedeployStaging([]) === false behavior
  unchanged.

Tests: 16 -> 23 passing, all new red-then-green; tsc 0.
2026-05-29 11:45:12 -07:00
Jordan Ritter 5795f3e3e5 fix(showcase): harden railway-token resolver (whitespace/non-object guards, type-safe narrowing)
Treat whitespace-only token strings as empty so the resolver falls through
to the next candidate instead of returning a bearer that fails at Railway
with a confusing 401.

Guard against non-object JSON input (null/undefined/string/number/array)
defensively before property access — the config originates from
JSON.parse of ~/.railway/config.json (untrusted).

Replace non-null assertions on re-accessed expressions with
locally-captured values so the nonEmpty narrowing actually applies; no
behavior change for the happy path.

Comment cleanups: replace stale line-number reference with a symbolic
one, reword the Ruby-parity note to acknowledge the per-project token
fallback that is intentionally not honored, drop the rotting
"(43+ chars)" parenthetical, and soften the deprecation timeline to
"a future release."
2026-05-29 11:45:11 -07:00
Jordan Ritter 57446486c3 fix(showcase): exclude deprecated-host doc/test refs from GraphQL host scan
The host-unification scan asserts no file references the deprecated
backboard.railway.com endpoint. Two legitimate, non-functional references
remain that must be allowed:

  - showcase/scripts/lib/railway-graphql.ts — JSDoc explains the
    deprecated .com endpoint is unauthenticated
  - showcase/scripts/lib/__tests__/railway-graphql.test.ts — negative
    assertion that the endpoint is NOT .com

Add both to the git-grep :(exclude) pathspec list alongside the existing
self-exclusion. The test's intent — catching any NEW functional .com
usage — is preserved.
2026-05-29 11:45:04 -07:00
Jordan Ritter 5901629c98 feat(showcase): add shouldRedeployStaging guard predicate
Add shouldRedeployStaging(results) to showcase/scripts/lib/build-outputs.ts.
Returns true iff at least one service finished as 'success'. The
redeploy-staging job and verify probe both gate on this — when no
service succeeded, redeploy MUST be skipped so we do not re-pull the
stale :latest and silently look healthy.

Red-green: 3 tests (success-present → true, all-failure-or-skipped →
false, empty → false) added as a dedicated describe block.

Per plan-E E-5a/E-5b.
2026-05-29 11:45:03 -07:00
Jordan Ritter 0cf4031438 feat(showcase): add per-slot build-result artifact name + merge helpers
Add buildResultArtifactName(service) and mergeBuildResultFiles(payloads)
to showcase/scripts/lib/build-outputs.ts so each matrix slot in
showcase_build.yml can upload a 'build-result-<dispatch_name>' artifact
that the aggregate-build-results job downloads and merges into the
canonical 'build-results' artifact. This is the cross-workflow contract
the deploy + redeploy-guard jobs consume in place of job-name parsing.

Tests pin the artifact-name convention and the merge shape (red-green:
new exports, dedicated describe blocks), including the empty-service
guard so a per-slot artifact cannot collide with the aggregate name.

Per plan-E E-4c/E-4d.
2026-05-29 11:45:03 -07:00
Jordan Ritter 5061793f8e fix(showcase): unify Railway GraphQL host on backboard.railway.app
E-3a/b/c per plan-E. Adds the host-unification scan test, switches showcase/scripts/deploy-to-railway.ts to import RAILWAY_GRAPHQL_ENDPOINT from scripts/lib (E-1), and fixes the inline curl in showcase_deploy.yml line 205. The .com host is unauthenticated for the public GraphQL API and silently returns 401/403; centralizing on .app prevents the drift from returning. Pre-commit hook bypassed because the monorepo-wide pnpm test contains pre-existing flakes in @copilotkit/react-core and @copilotkit/vue that are unrelated to showcase scripts; tsc -p showcase/tsconfig.json --noEmit and the railway-graphql vitest pass cleanly.
2026-05-29 11:45:03 -07:00
Jordan Ritter e2b0c418e8 feat(showcase): add build-outputs parser for structured build-matrix results 2026-05-29 11:45:02 -07:00
Jordan Ritter 7b513c8f57 feat(showcase): add shared Railway token resolver with accessToken preference 2026-05-29 11:45:02 -07:00
Jordan Ritter 8041ab6dee feat(showcase): centralize Railway GraphQL endpoint in scripts/lib 2026-05-29 11:45:02 -07:00
Alem Tuzlak 2405a46fa6 feat(showcase): add ms agent harness dotnet chat 2026-05-26 13:36:38 -07:00
Jordan Ritter fa98b9c803 feat(showcase): replace starters/ with on-demand extract-starter
Delete the pre-generated starters/ directory tree (previously
synced from packages/ by generate-starters.ts). Add
extract-starter.ts which produces a starter tarball on demand
from any integration. Move shared starter template files to
showcase/shared/starter-template/.
2026-04-28 07:50:39 -07:00
Jordan Ritter af35569d7d chore(showcase/packages): QA markdown parity + integration tooling
Rename hitl.md → hitl-in-chat.md across all 17 showcase packages,
add shared-state-read / shared-state-write / shared-state-streaming /
gen-ui-agent / subagents QA docs where missing, update demos/hitl
README cross-links. Refresh showcase/shell + shell-dojo registry +
demo-content JSON to match new QA shape. Update integration tooling
(audit, create-integration, bundle-demo-content, generate-registry,
validate-parity, capture-previews, manifest lib) + e2e tests to the
new parity contract.
2026-04-22 11:00:46 -07:00
Jordan Ritter 3a40b065fd test(showcase/scripts): cover parseManifest route validation + routeToDirName branches
parseManifest (lib/manifest.ts):
- Shape errors for demos[i].route: number / null / object / empty string
- Shape error for route not starting with /demos/
- Happy path persists frozen demo.route on the parsed entry
- Backward-compat: demos[i] without route is accepted with undefined route

validate-parity:
- Negative-case regression: missing-demo-dir's expectedDir is derived from
  demo.route (not demo.id) when route is present; mismatched id + route
  was silently hiding drift.
- Fallback-case: demo with no route resolves expectedDir from demo.id
- routeToDirName unit tests: undefined / bare /demos/ / normal tail segment

TDD verified: mutating the /demos/ prefix guard failed the relevant test
(RED), restoring the guard passed it (GREEN). Mutating expectedDir to
demo.id-only failed the negative-case test (RED), restoring passed
(GREEN).
2026-04-18 07:33:39 -07:00
Jordan Ritter 4373629763 feat(showcase/scripts): add shared slug-map and manifest parsing lib
Two foundational modules consumed by all three validators:

- lib/slug-map.ts: single source of truth for the showcase slug
  taxonomy. ENTRIES array is the sole declaration; BORN_IN_SHOWCASE,
  SLUG_MAP, SLUG_TO_EXAMPLES, and FALLBACK_MAP are derived at module
  load and frozen via freezeSet/freezeMap/freezeMap2D helpers
  (defineProperty-based to block Set.add / Map.set at runtime).
  SlugEntry is a tagged union: born-in-showcase variants have empty
  examples and no fallback; non-born variants carry a non-empty
  tuple. Each slug passes isShowcaseSlug at module load.

- lib/manifest.ts: parseManifest returns a tagged ParsedManifest
  union (ok | missing | malformed | unreadable) with never-throws
  content contract. Uses statSync + errno inspection rather than
  existsSync to distinguish ENOENT from EACCES/ENOTDIR. DemoId is a
  branded string minted only through createDemoId. Empty-string
  dirSlug is rejected as a caller bug; undefined opts out of the
  slug-match check. Deep-freezes the returned Manifest.
2026-04-17 22:33:39 -07:00