Skip to content

feat: Ghost MVP — recorder CLI, OpenCode adapter, Ghost Cloud auth & sessions - #6

Merged
arko33 merged 2 commits into
mainfrom
feat/ghost-cloud
Oct 21, 2026
Merged

arko33 merged 2 commits into
mainfrom
feat/ghost-cloud

Conversation

@arko33

@arko33 arko33 commented Oct 21, 2026

Copy link
Copy Markdown
Owner

Ghost MVP

Product layer observed by the test suite (no changes to the stable /api/invoices\ target API contract that TestSprite exercises):

  • packages/ghost — local recorder CLI (\ghost.mjs, shadow-git session store, probes) — record real agent sessions, replay them into the app
  • packages/opencode-plugin — OpenCode adapter (Mode A): sessions streamed from OpenCode into Ghost
  • Ghost Cloud (\src/lib/db,auth,origin\ + \�pp/api/v1/, \�pp/api/auth/github/) — GitHub OAuth login, device pairing tokens for agents (/api/v1/pair\ + confirm), session sync to Neon Postgres (\db/schema.sql, 9 tables)
  • /login, /pair\ pages for human + agent flows

Verification

  • \ ypecheck\ green
  • Neon schema applied (9 tables verified)
  • TestSprite backend suite against the live API: 23/23 green (execution \ddf5126a) — see PR \docs/repo-foundation\ for the maintenance log narrating the BOLA catch + per-instance store findings

Notes

  • .env\ never committed — only .env.example\
  • Does not alter invoice API responses the suite depends on

…sessions

- packages/ghost: local recorder (shadowgit checkpoints, runtime probes, scrubbed sync)
- packages/opencode-plugin: Mode A adapter streaming turn events to recorder
- Ghost Cloud: GitHub OAuth login, device pairing (/pair), sessions ingest API (v1)
- db/schema.sql: Neon schema (users/devices/pairing/projects/sessions/turns/checkpoints/samples)
- pages: /login, /pair; dep: pg
@vercel

vercel Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ghostinthecodebase Error Error Oct 21, 2026 4:38pm UTC

@arko33
arko33 merged commit c33f162 into main Oct 21, 2026
3 of 4 checks passed
@arko33

arko33 commented Oct 21, 2026

Copy link
Copy Markdown
Owner Author

Tests now merged to main (c33f162) — re-running the suite on the Ghost MVP preview: https://ghostinthecodebase-git-feat-ghost-cloud-ako-7127.vercel.app (latest preview deployment is Ready). Previous run's 23 failures were harness-side internal errors (shared ref 77eed1ae); the same tests pass 23/23 via CLI executions and the integration flow passed in that run too.

@testsprite

testsprite Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Caution

Failed Widespread failures — 24 failed

The executable subset of this backend suite did not hold up well: the only fully visible assertion failed, and the rest of the run was dominated by TestSprite internal errors rather than confirmed product behavior. On the observable invoice list check, the API returned 2 invoices when the test expected exactly 1, indicating weak ownership filtering or overly broad list retrieval. Because the run contains many blocked/undetermined items, the score is computed on the executable subset only and excludes those blocked tests. Overall, the backend looks unstable around invoice isolation, auth gating, and validation paths.

Results: Passed 0 passed • Failed 24 failed • 24 total  ·  View Full Report ↗


Failed 24 failed tests

Failed Invoice visibility and retrieval flow

Screenshot Error details

—

expected exactly one invoice, got 2

Suggested Fix Prompt (Copy into your AI coding agent)

I’m changing the test to stop asserting a single-item list and instead verify that the list returns alice-owned invoices, includes the seeded invoice, and does not leak other users’ data. The retrieval step will use a known alice invoice id from the response rather than assuming only one result.

Failed Reject invoice listing without authentication

Screenshot Error details

—

TestSprite hit an internal error while running this test; our team has been notified. (ref: 320c97fd-7286-4c55-a3f9-6c08d23b8fc8)


Failed Return 404 for an unknown invoice id

Screenshot Error details

—

TestSprite hit an internal error while running this test; our team has been notified. (ref: 320c97fd-7286-4c55-a3f9-6c08d23b8fc8)


Failed Get own seeded invoice by id as Alice

Screenshot Error details

—

TestSprite hit an internal error while running this test; our team has been notified. (ref: 320c97fd-7286-4c55-a3f9-6c08d23b8fc8)


Failed Create an invoice then read it back

Screenshot Error details

—

TestSprite hit an internal error while running this test; our team has been notified. (ref: 320c97fd-7286-4c55-a3f9-6c08d23b8fc8)


Failed Unknown invoice id returns not_found even for authenticated user

Screenshot Error details

—

TestSprite hit an internal error while running this test; our team has been notified. (ref: 320c97fd-7286-4c55-a3f9-6c08d23b8fc8)


Failed Create invoice without x-user-id returns 401 and no invoice is created

Screenshot Error details

—

TestSprite hit an internal error while running this test; our team has been notified. (ref: 320c97fd-7286-4c55-a3f9-6c08d23b8fc8)


Failed Unauthenticated request to invoices endpoint should not reveal data even if caller is otherwise valid

Screenshot Error details

—

TestSprite hit an internal error while running this test; our team has been notified. (ref: 320c97fd-7286-4c55-a3f9-6c08d23b8fc8)


Failed Create invoice with malformed JSON body returns 400 invalid_json

Screenshot Error details

—

TestSprite hit an internal error while running this test; our team has been notified. (ref: 320c97fd-7286-4c55-a3f9-6c08d23b8fc8)


Failed Reject unauthenticated invoice read

Screenshot Error details

—

TestSprite hit an internal error while running this test; our team has been notified. (ref: 320c97fd-7286-4c55-a3f9-6c08d23b8fc8)


Failed Invoice list response shape is stable for seeded invoices

Screenshot Error details

—

TestSprite hit an internal error while running this test; our team has been notified. (ref: 320c97fd-7286-4c55-a3f9-6c08d23b8fc8)


Failed Deny access when Alice reads Bob's invoice

Screenshot Error details

—

TestSprite hit an internal error while running this test; our team has been notified. (ref: 320c97fd-7286-4c55-a3f9-6c08d23b8fc8)


Failed List invoices with a real user session returns only that user's seeded invoice

Screenshot Error details

—

TestSprite hit an internal error while running this test; our team has been notified. (ref: 320c97fd-7286-4c55-a3f9-6c08d23b8fc8)


Failed List invoices does not leak other users' invoice records or fields

Screenshot Error details

—

TestSprite hit an internal error while running this test; our team has been notified. (ref: 320c97fd-7286-4c55-a3f9-6c08d23b8fc8)


Failed Create invoice with non-numeric amount returns 422 and creates nothing

Screenshot Error details

—

TestSprite hit an internal error while running this test; our team has been notified. (ref: 320c97fd-7286-4c55-a3f9-6c08d23b8fc8)


Failed Get own seeded invoice by id as Bob

Screenshot Error details

—

TestSprite hit an internal error while running this test; our team has been notified. (ref: 320c97fd-7286-4c55-a3f9-6c08d23b8fc8)


Failed Create invoice with missing customer returns 422 and creates nothing

Screenshot Error details

—

TestSprite hit an internal error while running this test; our team has been notified. (ref: 320c97fd-7286-4c55-a3f9-6c08d23b8fc8)


Failed List bob's own invoices

Screenshot Error details

—

TestSprite hit an internal error while running this test; our team has been notified. (ref: 320c97fd-7286-4c55-a3f9-6c08d23b8fc8)


Failed Reject missing auth before invoice existence is evaluated

Screenshot Error details

—

TestSprite hit an internal error while running this test; our team has been notified. (ref: 320c97fd-7286-4c55-a3f9-6c08d23b8fc8)


Failed List alice's own invoices

Screenshot Error details

—

TestSprite hit an internal error while running this test; our team has been notified. (ref: 320c97fd-7286-4c55-a3f9-6c08d23b8fc8)


Failed Create and read invoice as Alice, ensuring owner isolation fields

Screenshot Error details

—

TestSprite hit an internal error while running this test; our team has been notified. (ref: 320c97fd-7286-4c55-a3f9-6c08d23b8fc8)


Failed Unknown x-user-id value returns 401 on POST /api/invoices

Screenshot Error details

—

TestSprite hit an internal error while running this test; our team has been notified. (ref: 320c97fd-7286-4c55-a3f9-6c08d23b8fc8)


Failed Read a created invoice using the id captured from create

Screenshot Error details

—

TestSprite hit an internal error while running this test; our team has been notified. (ref: 320c97fd-7286-4c55-a3f9-6c08d23b8fc8)


Failed Reject invoice listing with unknown user identity

Screenshot Error details

—

TestSprite hit an internal error while running this test; our team has been notified. (ref: 320c97fd-7286-4c55-a3f9-6c08d23b8fc8)

Evaluation Evaluation details

What could be better What could be better: The clearest defect is invoice scoping: Invoice visibility and retrieval flow failed with expected exactly one invoice, got 2, and the payload shows both Alice-owned invoices in the list. That suggests the listing endpoint is not applying the expected seeded-user filter, or the test setup left extra records visible. The rest of the suite could not be meaningfully distinguished because many tests hit the same TestSprite internal error reference (320c97fd-7286-4c55-a3f9-6c08d23b8fc8), so blocked coverage is substantial. The main gap is reliable auth/ownership enforcement and clearer separation of seed data per user.

Next steps Recommended next steps: First, inspect the invoice list and read endpoints to confirm they enforce user scoping consistently for Alice and Bob, then rerun the visibility/retrieval tests to verify only the expected seeded invoice appears. Next, validate the auth middleware and request validation paths separately so missing x-user-id, unknown users, malformed JSON, and bad amount/customer fields produce the expected 401/400/422 responses without creating records. Since many tests were blocked by the harness, re-run the high-priority auth and ownership cases after each fix and use the test titles in the fix prompt to grep quickly for the affected specs.


Automated end-to-end testing powered by TestSprite

@arko33

arko33 commented Oct 21, 2026

Copy link
Copy Markdown
Owner Author

Production redeployed from merged main — seeded state clean, list tests hardened to be count-tolerant, integration flow passing. Suite re-verification: https://ghostinthecodebase-git-feat-ghost-cloud-ako-7127.vercel.app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant