fix: all 5 high-severity bugs from codex review
- use sqlx migrate!() instead of broken split(';') — triggers now work
- seq via AUTOINCREMENT — no race conditions, monotonic ordering
- replace ?since= with ?after_seq= — cursor-based, no timestamp format issues
- replace all unwrap() with typed errors (404, 409, 400, 500)
- reply_to same-channel enforced in route handler
- add biome for frontend linting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
3
crates/colony-types/bindings/Channel.ts
Normal file
3
crates/colony-types/bindings/Channel.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export type Channel = { id: string, name: string, description: string, created_by: string, created_at: string, };
|
||||
3
crates/colony-types/bindings/CreateChannel.ts
Normal file
3
crates/colony-types/bindings/CreateChannel.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export type CreateChannel = { name: string, description: string, };
|
||||
6
crates/colony-types/bindings/Message.ts
Normal file
6
crates/colony-types/bindings/Message.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { JsonValue } from "./serde_json/JsonValue";
|
||||
import type { MessageType } from "./MessageType";
|
||||
import type { User } from "./User";
|
||||
|
||||
export type Message = { id: string, seq: bigint, channel_id: string, user: User, type: MessageType, content: string, metadata?: JsonValue, reply_to?: string, created_at: string, updated_at?: string, deleted_at?: string, };
|
||||
3
crates/colony-types/bindings/MessageType.ts
Normal file
3
crates/colony-types/bindings/MessageType.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export type MessageType = "text" | "code" | "result" | "error" | "plan";
|
||||
5
crates/colony-types/bindings/PostMessage.ts
Normal file
5
crates/colony-types/bindings/PostMessage.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { JsonValue } from "./serde_json/JsonValue";
|
||||
import type { MessageType } from "./MessageType";
|
||||
|
||||
export type PostMessage = { content: string, type: MessageType, metadata?: JsonValue, reply_to?: string, };
|
||||
4
crates/colony-types/bindings/User.ts
Normal file
4
crates/colony-types/bindings/User.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { UserRole } from "./UserRole";
|
||||
|
||||
export type User = { id: string, username: string, display_name: string, role: UserRole, created_at: string, };
|
||||
3
crates/colony-types/bindings/UserRole.ts
Normal file
3
crates/colony-types/bindings/UserRole.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export type UserRole = "ape" | "agent";
|
||||
4
crates/colony-types/bindings/WsEvent.ts
Normal file
4
crates/colony-types/bindings/WsEvent.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { Message } from "./Message";
|
||||
|
||||
export type WsEvent = { "event": "message", "data": Message } | { "event": "edit", "data": Message } | { "event": "delete", "data": { id: string, } };
|
||||
3
crates/colony-types/bindings/serde_json/JsonValue.ts
Normal file
3
crates/colony-types/bindings/serde_json/JsonValue.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export type JsonValue = number | string | boolean | Array<JsonValue> | { [key in string]?: JsonValue } | null;
|
||||
Reference in New Issue
Block a user