Skip to content

fix: Keep tasks in their project and run Postgres and UI tests in CI - #182

Merged
yahyafakhroji merged 3 commits into
mainfrom
fix/project-isolation-and-ci-tests
Nov 18, 2026
Merged

yahyafakhroji merged 3 commits into
mainfrom
fix/project-isolation-and-ci-tests

Conversation

@yahyafakhroji

Copy link
Copy Markdown
Contributor

Problem
CI ran every Postgres store and migration test as a skip, including the history compaction path, and published the consumer UI plugin image without testing it. A2A SendMessage with a task id continued another project's task, GetTask and CancelTask allowed tasks with no owner, and the project API client built paths from unvalidated model input.

Solution
CI starts a checksum-pinned Postgres 17, since the runner has no Docker, and in that job a Postgres test with no database fails instead of skipping, while the shared ci-basic workflow still skips. A new UI job tests and builds the plugin before its image publishes. The server refuses any task whose owner is missing or another project, and the project API client validates and escapes every path segment and never follows a redirect on a write.

The UI typecheck passes only on six known errors: the plugin calls assistant-chat-kit 0.2.1 APIs (onApprovePlan, onChoose, onChangePlan), but npm only has 0.2.0, so those plan card handlers are likely missing in the deployed dock until chat-kit publishes. A foreign task id gets a 403 rather than not found.

Closes #179

CI ran go test with no database, so every Postgres store and migration
test skipped, including the history compaction path, and the consumer
UI plugin image published without its tests running. The runner pod
has no Docker, so a checksum-pinned embedded Postgres 17 now starts as
a step, and in that job a Postgres test with no database fails instead
of skipping. A new UI job installs, tests and builds the plugin before
its image publishes, and typecheck passes only on the six known errors
from the unpublished assistant-chat-kit 0.2.1.
A2A SendMessage with a task id continued a stored task without checking
its project, and GetTask and CancelTask allowed tasks with no owner, so
a caller could read or extend another project's task. The project API
client built paths from unvalidated group, version, name and namespace.
The server now refuses any task whose stored owner is missing or not
the caller's project, and the client validates and escapes every path
segment and never follows a redirect on a write.
ecv
ecv previously approved these changes Nov 17, 2026

@ecv ecv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approve.

Cross-project task access is closed at the server and again in the executor. The Postgres tests now run in CI, and the typecheck allowlist fails when it goes stale.

  • Tenant isolation holds. authorize() routes SendMessage and SendStreamingMessage through checkContinuation and GetTask and CancelTask through checkTaskAccess. Every other method, ListTasks, subscribe and push config included, gets Method not permitted. Both a store error (503) and an ownerless task fail closed, and the 403 does not name the owner. The four HTTP routes all check project access, and history is keyed on project plus context. I removed each guard in turn, and TestSendMessage_RefusesAnotherProjectsTask, TestTaskReads_RefuseTaskWithNoOwner and TestExecute_RefusesStoredTaskOfAnotherProject each failed.
  • The Postgres tests run in CI. In run 44003116422 the test job sets TEST_DATABASE_URL and TEST_DATABASE_REQUIRED: true, and testdb.URL turns a missing URL into Fatalf, so the ok lines are real runs. The job runs without -v, so no log line names an individual Postgres test.
  • typecheck-known-errors.sh matches only TS2339 on three props in chat-dock.tsx, fails on any other error, and fails when the count is not exactly 6.

Follow-ups:

  • When the typecheck comes back clean, the script exits 0 and only tells you to delete it. Make that case fail so the allowlist cannot outlive the fix.
  • The count is per pattern, not per line. Fixing one of the 6 while adding a new onChoose error elsewhere in chat-dock.tsx would still pass. Pin the exact list.

The typecheck allowlist counted matches per pattern, so fixing one known
error while adding another of the same kind still passed, and a clean
typecheck exited 0, so the allowlist could outlive the fix. It now
compares the exact six positions and fails on any difference, and fails
when the typecheck comes back clean so the script gets deleted.

@ecv ecv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approve.

Both earlier follow-ups are fixed. A clean typecheck now fails the job, and the allowlist pins each of the 6 errors by file, line, column and prop, so fixing one while adding another fails.

  • Any non-TS2339 error stays whole in the comparison and fails it, and the job passed at this head.

@yahyafakhroji
yahyafakhroji merged commit 9ef1f08 into main Nov 18, 2026
11 of 14 checks passed
@yahyafakhroji
yahyafakhroji deleted the fix/project-isolation-and-ci-tests branch November 18, 2026 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working security

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI skips Postgres and UI tests, and project isolation has two gaps

2 participants