Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/demo-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
- name: Setup Bun for demo media script
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
bun-version: '1.2.14'

- name: Install dependencies
run: npm ci
Expand Down
33 changes: 24 additions & 9 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,47 @@ on:
branches: [main, develop]
workflow_dispatch:

permissions:
contents: read

concurrency:
group: e2e-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
e2e:
runs-on: ubuntu-latest
timeout-minutes: 25

env:
CI: 'true'
NEXT_TELEMETRY_DISABLED: '1'
ADMIN_API_KEY: dev-admin-key-12345
DEVICE_WEBHOOK_SECRET: dev-secret
BACKEND_SIGNING_SECRET: dev-secret
SERVER_URL: http://localhost:3000

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v2
- name: Setup Node.js
uses: actions/setup-node@v4
with:
bun-version: latest
node-version: '22'
cache: npm
Comment on lines +32 to +36

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Install Bun before running Playwright

In this workflow I checked playwright.config.ts, where the Playwright web server is still configured as command: 'bun run dev'; after replacing the Bun setup with actions/setup-node, no step installs Bun before npm run test:e2e. On a clean GitHub runner this means Playwright cannot start the app server and the E2E job fails with bun not found before any tests run.

Useful? React with 👍 / 👎.


- name: Install dependencies
run: bun install
run: npm ci

- name: Install Playwright browsers
run: bunx playwright install --with-deps
run: npx playwright install --with-deps

- name: Build
run: bun run build
run: npm run build

- name: Run E2E tests
run: bun run test:e2e
env:
SERVER_URL: http://localhost:3000
run: npm run test:e2e

- name: Upload Playwright report
if: always()
Expand Down
33 changes: 23 additions & 10 deletions .github/workflows/web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- '.github/workflows/**'
- 'src/**'
- 'package.json'
- 'bun.lock'
- 'package-lock.json'
- 'next.config.*'
- 'tsconfig.json'
- 'postcss.config.*'
Expand All @@ -18,36 +18,49 @@ on:
- '.github/workflows/**'
- 'src/**'
- 'package.json'
- 'bun.lock'
- 'package-lock.json'
- 'next.config.*'
- 'tsconfig.json'
- 'postcss.config.*'
- 'eslint.config.*'

permissions:
contents: read

concurrency:
group: nextjs-ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 20

env:
CI: 'true'
NEXT_TELEMETRY_DISABLED: '1'

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v2
- name: Setup Node.js
uses: actions/setup-node@v4
with:
bun-version: latest
node-version: '22'
cache: npm

- name: Install dependencies
run: bun install --frozen-lockfile
run: npm ci

- name: Run ESLint
run: bun lint
run: npm run lint

- name: Run TypeScript type check
run: bun typecheck
run: npm run typecheck

- name: Build Next.js application
run: bun run build
run: npm run build

- name: Run security audit
run: bun audit --production
run: npm audit --omit=dev --audit-level=critical
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22
92 changes: 92 additions & 0 deletions docs/BUG_BASH_REPORT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# SignalGrid Bug Bash Report

Date: 2026-05-14
Scope: demo readiness, scenario verification, v1 compatibility API fail-closed behavior, dependency update triage, and buyer-demo stability.

## Executive summary

SignalGrid is demo-ready for controlled buyer walkthroughs. No P0 demo blockers were found after the validation pass. The browser demo and deterministic demo API remain safe/simulated, scenario-specific verification is available for all canonical outcomes, and the `/api/v1/*` compatibility surface now fails closed when required API keys or HMAC signing secrets are missing.

Remediation should remain described as simulated/talk-track until an audited remediation loop exists.

## Commands and checks run by Codex

- `npm ci`
- `npm run typecheck`
- `npm run lint`
- `npm run build`
- `npm run test:run`
- `npm run test:api:server`
- `npx vitest run tests/api/demo-session-start.test.ts`
- `npm run demo:media`
- `git diff --check`

`npm run demo:media` completed with deterministic storyboard fallback artifacts because Playwright browser binaries were unavailable in the validation container.

## Scenario verification

Scenario-specific verification was added to:

```text
GET /api/demo/verify?scenario=compliant
GET /api/demo/verify?scenario=non-compliant
GET /api/demo/verify?scenario=unknown
GET /api/demo/verify?scenario=all
```

Each scenario returns machine-readable PASS/FAIL checks for:

- expected outcome
- expected decision
- expected simulated HTTP status
- deterministic demo data only
- no webhook calls
- no production data mutation
- no secret exposure

The original deny-path timeline verifier remains available when no `scenario` query parameter is provided.

## P0 findings

No P0 demo blockers were found.

## P1 findings

| Finding | Status | Notes |
| --- | --- | --- |
| Scenario-specific verification was under-specified | Fixed | Added explicit verification selectors for compliant, non-compliant, unknown, and all scenarios. |
| `/api/v1/*` default API key/signing fallbacks could confuse shared-stage posture | Fixed | Runtime route now fails closed when required `ADMIN_API_KEY`, `DEVICE_WEBHOOK_SECRET`, or `BACKEND_SIGNING_SECRET` configuration is absent. |
| Toolchain drift made demo automation less reproducible | Improved | Node 22 is pinned via `.nvmrc`; demo validation workflow pins Bun for media script execution. |
| Dependency update PRs include major-version migration risk | Open | PR #92 and PR #93 should not merge as-is. |

## P2 findings / non-blockers

- Polished screenshots/video require a Playwright browser-capable environment.
- Docker build/run validation still needs a Docker-capable environment.
- Real remediation loop maturity remains future/pilot work.
- Major dependency upgrades should be split and migrated deliberately.

## Dependabot PR triage

### PR #92 — production dependency group

Recommendation: **do not merge as-is**.

Reason: `npm ci` passed, but `npm run typecheck` failed after the upgrade. The failures indicate migration work is needed, especially around Zod 4 and stricter dependency typing. Examples include Zod 4 API differences such as `ZodError.errors`, `z.string().ip()`, stricter schema calls, and unknown/object assignment issues.

### PR #93 — development dependency group

Recommendation: **do not merge as-is**.

Reason: `npm ci` passed with peer warnings, but `npm run typecheck` failed on TypeScript 6 `baseUrl` deprecation. ESLint 10 and Vitest 4 should be split into smaller updates after TypeScript/config compatibility is addressed.

## Demo readiness recommendation

Demo-ready: **yes, for controlled buyer walkthroughs**.

Use these guardrails:

- Present `/demo` and `/api/demo/*` outputs as deterministic simulated demo behavior.
- Use scenario-specific verification before demos.
- Keep remediation framed as simulated/talk-track until a real audited loop is implemented.
- Do not claim production readiness until Docker deployment, customer-selected integrations, and operational runbooks are validated in the target environment.
52 changes: 22 additions & 30 deletions docs/READINESS_HYGIENE_STATUS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Scope: repository documentation and readiness-facing checks for demo, pilot, lau

## Executive summary

SignalGrid is **demo-ready for controlled conversations** and has several hardening improvements already reflected in code, but it is **not yet pilot-ready or production-ready**. The remaining readiness gap is mostly around production-safe defaults, canonical package-manager/toolchain hygiene, Docker/environment validation, and cleanup of stale documentation that described older runtime behavior.
SignalGrid is **demo-ready for controlled conversations** and has several hardening improvements already reflected in code. It is not yet broad production-ready. The remaining readiness gap is mostly around Docker/customer-hosted validation, remediation-loop maturity, polished browser media capture, and reworked dependency major upgrades.

Use this file as the current source of truth for readiness hygiene until the open items below are closed or moved into tickets.

Expand All @@ -15,14 +15,15 @@ Use this file as the current source of truth for readiness hygiene until the ope
| --- | --- | --- |
| Browser demo | Ready | `/demo` uses deterministic simulated scenarios and is safe for walkthroughs. |
| Scripted executive demo | Ready with constraints | Canonical deny-path demo is still the safest live script. |
| Compliant allow scenario | Ready when posture fixture is seeded | Session-start now reads posture from the telemetry store; no unknown-posture bypass should be required when a fresh compliant fixture exists. |
| Scenario-specific demo verification | Complete | `/api/demo/verify?scenario=compliant|non-compliant|unknown|all` returns deterministic machine-readable PASS/FAIL checks. |
| Compliant allow scenario | Ready when posture fixture is seeded | Session-start reads posture from the telemetry store; missing or expired posture still fails closed unless explicitly overridden for local/demo use. |
| Unknown posture behavior | Complete | Unknown posture fails closed by default unless `UNKNOWN_POSTURE_MODE=allow` is explicitly set. |
| Session extension wording | Complete | Existing active sessions update `expiresAt` and `lastActivityAt` before returning `Existing session extended`. |
| API-key helper hardening | Complete for `src/lib/utils/apiKeyAuth.ts` | This helper now fails closed when `ADMIN_API_KEY` is absent. |
| Webhook dispatcher signing fallback | Complete for integration dispatcher | Webhook dispatch now fails if a signing secret cannot be resolved. |
| ITSM credential encryption fallback | Complete for ITSM store | Credential encryption now requires `ITSM_ENCRYPTION_KEY` or `ENCRYPTION_KEY`. |
| Public `/api/v1/*` compatibility defaults | Open | `src/app/api/v1/[...path]/route.ts` still has fallback `test-api-key` and `dev-secret` values. |
| Package-manager/toolchain policy | Open | README uses npm, many scripts/docs use Bun, and both lockfiles are present. |
| Public `/api/v1/*` compatibility defaults | Complete for runtime route | `/api/v1/*` now fails closed when required `ADMIN_API_KEY`, `DEVICE_WEBHOOK_SECRET`, or `BACKEND_SIGNING_SECRET` values are missing. |
| Package-manager/toolchain policy | Mostly complete | Node 22 is pinned via `.nvmrc`; npm is the primary package manager; Bun is scoped to demo/media scripts and pinned in demo CI. |
| Docker/customer-hosted validation | Open | Production runbook exists, but Docker build/run validation still needs a Docker-capable environment. |
| Business/manual cutover | Open / external | Domain, email, legal, bank, outreach, and PR cleanup tasks are founder/manual activities. |

Expand All @@ -35,52 +36,43 @@ Use this file as the current source of truth for readiness hygiene until the ope
5. **Webhook dispatcher fallback secret was removed.** The dispatcher records a failed delivery when no signing secret is configured rather than signing with a predictable default.
6. **ITSM credential encryption fallback was removed.** ITSM credential writes now require an explicit encryption key.
7. **Session extension semantics are aligned.** The active-session branch updates expiration/activity timestamps before reporting that the session was extended.
8. **Scenario-specific demo verification is implemented.** Each canonical demo scenario can be checked independently or as an aggregate `all` run.
9. **Public v1 API fallbacks are fail-closed.** Runtime v1 auth/signing paths no longer fall back to default API keys or default HMAC secrets.
10. **Toolchain policy is clearer.** Node 22 is pinned, npm remains primary, and Bun usage is scoped to existing demo/media automation.

## Not completed yet

### P0Remaining security/config defaults
### P1Demo/pilot maturity

- **Public v1 API auth fallback remains.** `src/app/api/v1/[...path]/route.ts` still falls back to `test-api-key` when `ADMIN_API_KEY` is absent. Remove this before shared staging, pilots, or production.
- **Public v1 signature fallback remains.** The same route still falls back to `dev-secret` when `DEVICE_WEBHOOK_SECRET` and `BACKEND_SIGNING_SECRET` are absent. Remove or explicitly gate this for local-only test mode.
- **Demo/test scripts still publish default keys.** Demo and test helpers intentionally seed local defaults such as `dev-admin-key-12345`; keep them isolated to local/demo workflows and do not treat them as production-safe defaults.
- **Real remediation loop is not yet implemented.** Current remediation language should remain framed as demo narrative/simulated side effects until there is an audited `attempted → re-check → final decision` workflow.
- **Pilot success metrics and operational owner model need customer-specific completion.** The pilot execution docs provide templates, but signed scope, metrics, owner, rollback, and support paths are not yet completed.
- **Polished screenshot/video capture still requires browser binaries.** `npm run demo:media` can produce deterministic storyboard artifacts when Playwright browsers are unavailable; polished screenshots/video need a browser-capable environment.

### P1 — Environment and repo reproducibility

- **Canonical package manager is unresolved.** README onboarding says npm, while active demo/test scripts and CI-style commands rely heavily on Bun. Pick one primary path, document the secondary path if needed, and keep lockfiles consistent.
- **Toolchain versions need pinning.** Add a Node/Bun version policy (`.nvmrc`, `.node-version`, `.tool-versions`, `.npmrc`, or equivalent) and avoid moving `latest` targets in automation.
- **Docker validation remains unproven in this environment.** Run production image build/run checks in a Docker-capable environment and record the exact commands/results in the production runbook or a validation report.

### P1 — Demo/pilot maturity

- **Real remediation loop is not yet implemented.** Current remediation language should remain framed as demo narrative/simulated side effects until there is an audited `attempted → re-check → final decision` workflow.
- **Scenario verification should be split by scenario.** `/api/demo/verify` is most useful for the deny-path timeline; add explicit allow/deny/unknown selectors before using it as broad demo proof.
- **Pilot success metrics and operational owner model need customer-specific completion.** The pilot execution docs provide templates, but signed scope, metrics, owner, rollback, and support paths are not yet completed.
- **Dependabot major upgrades need rework.** PR #92 and PR #93 should not merge as-is because validation exposed typecheck/tooling migration blockers.

### P2 — Documentation/source-of-truth cleanup

- **Placeholder docs remain.** `docs/CLAIM_BOUNDARIES.md`, `docs/VALUE_MAP.md`, `docs/PRODUCT_BOARD.md`, `docs/INTEGRATION_PRIORITIES.md`, and `docs/ARCHITECTURE_FUTURE_NOTES.md` still need real content or deletion if they are not intended sources of truth.
- **Old dated review docs should be treated as historical.** `docs/REPO_REVIEW_NEXT_STEPS_2026-03-30.md` and `docs/REPO_ENV_AUDIT_2026-03-31.md` contain useful backlog context, but several findings have changed and should not override this status file.
- **Manual cutover doc still references PR #72.** Confirm current GitHub state; if PR #72 is already closed or irrelevant, update or archive that checklist.
- **Manual cutover doc still references PR #72.** PR #72 is closed; archive or update that checklist when doing final launch-ops cleanup.

## Outdated or conflicting docs to reconcile
## Dependabot status

| Document | Conflict/outdated point | Current guidance |
| PR | Recommendation | Reason |
| --- | --- | --- |
| `docs/DEMO_READINESS_CHECKLIST.md` | Older text said posture adapters were hardcoded unknown and compliant/non-compliant scenarios were blocked. | Updated to state posture reads come from the telemetry store and scenarios are ready when seeded with fresh fixtures. |
| `docs/REPO_REVIEW_NEXT_STEPS_2026-03-30.md` | Lists some findings as still open even though API-key helper, webhook dispatcher, ITSM encryption, unknown posture, and session extension have been hardened. | Treat as historical backlog evidence; use this status file for current state. |
| `docs/REPO_ENV_AUDIT_2026-03-31.md` | Refers to the dated hardening backlog as still prioritized wholesale. | Keep environment/package-manager findings active, but re-check individual code findings before implementation. |
| `docs/CODEX_COMPLETE_CUTOVER_CHECKLIST.md` | Mentions PR #72 and launch-critical PR noise without current GitHub verification. | Treat as manual GitHub cleanup pending confirmation. |
| `README.md` | Says pilot readiness is tracked in roadmap docs while roadmap was previously a placeholder. | Roadmap now summarizes active readiness priorities and links to this status file. |
| #92 production dependency group | Do not merge as-is | `npm run typecheck` fails after the upgrade, especially around Zod 4 migration issues and stricter dependency types. |
| #93 development dependency group | Do not merge as-is | `npm run typecheck` fails with TypeScript 6 `baseUrl` deprecation; ESLint 10 and Vitest 4 should be split/reworked after config compatibility is resolved. |

## Next decision checklist

Before calling SignalGrid pilot-ready, all of the following should be true:

- [ ] No runtime route used in shared environments has default API keys, default HMAC secrets, or default encryption keys.
- [ ] Demo/test defaults are explicitly local-only and impossible to enable accidentally in production/shared staging.
- [ ] Package manager, lockfile, and toolchain versions are documented and pinned.
- [x] Runtime v1 routes fail closed when required API keys or signing secrets are absent.
- [x] Demo verification has independent pass/fail checks for allow, deny, and unknown scenarios.
- [x] Node version and demo CI Bun usage are pinned/documented.
- [ ] Docker production build/run/healthcheck path is validated in a Docker-capable environment.
- [ ] Demo verification has independent pass/fail checks for allow, deny, and unknown scenarios.
- [ ] Remediation claims are either implemented as an auditable loop or consistently described as simulated/demo narrative.
- [ ] Placeholder docs are filled, deleted, or marked intentionally deferred.
- [ ] Demo/test defaults are explicitly local-only and impossible to enable accidentally in production/shared staging.
- [ ] Manual business/cutover items are completed or clearly excluded from technical readiness.
2 changes: 1 addition & 1 deletion playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default defineConfig({
},
],
webServer: {
command: 'bun run dev',
command: 'npm run dev',
url: 'http://localhost:3000',
reuseExistingServer: !process.env.CI,
timeout: 120000,
Expand Down
Loading
Loading