Skip to content
Draft
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
7 changes: 7 additions & 0 deletions TERMINOLOGY.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ Canonical words used across Junior's code and documentation.
- **Session record**: the persisted read model for one resumable turn.
- **Conversation execution**: mutable operational state for a conversation,
such as mailbox state, worker lease, checkpoints, and activity status.
- **Agent binding**: a named reference, scoped to one parent agent
conversation, that reuses one child conversation and its history.
- **Agent invocation**: one retry-safe delegated task sent from a parent agent
conversation to a child conversation, including its durable terminal result.
- **Reasoning level**: the configured or selected amount of model reasoning for
a turn: `none`, `low`, `medium`, `high`, or `xhigh`.
- **Reply**: a destination-visible message owned by delivery or reply-policy
Expand All @@ -54,6 +58,9 @@ Canonical words used across Junior's code and documentation.
## Naming Guidance

- Use `turn`, `run`, and `slice` only with the meanings above.
- Use `agent invocation` for delegated child work; do not shorten it to
`invocation` where it could be confused with a model or serverless
invocation.
- Use `message` for platform chat content. Use `user_message`,
`assistant_message`, and `tool_result` for replayable agent history.
- Use `agent history item` when referring to those three native event types as
Expand Down
36 changes: 36 additions & 0 deletions packages/junior/migrations/0012_sour_vargas.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
CREATE TABLE "junior_agent_bindings" (
"parent_conversation_id" text NOT NULL,
"name" text NOT NULL,
"child_conversation_id" text NOT NULL,
"reasoning_level" text,
CONSTRAINT "junior_agent_bindings_parent_conversation_id_name_pk" PRIMARY KEY("parent_conversation_id","name")
);
--> statement-breakpoint
CREATE TABLE "junior_agent_invocations" (
"invocation_id" text PRIMARY KEY NOT NULL,
"parent_conversation_id" text NOT NULL,
"child_conversation_id" text NOT NULL,
"agent_name" text,
"input" text NOT NULL,
"actor_json" jsonb NOT NULL,
"credential_context_json" jsonb,
"source_json" jsonb NOT NULL,
"destination_json" jsonb NOT NULL,
"destination_visibility" text,
"reasoning_level" text,
"status" text NOT NULL,
"mailbox_status" text NOT NULL,
"result" text,
"error_message" text,
"created_at" timestamp with time zone NOT NULL,
"updated_at" timestamp with time zone NOT NULL,
"terminal_at" timestamp with time zone
);
--> statement-breakpoint
ALTER TABLE "junior_agent_bindings" ADD CONSTRAINT "junior_agent_bindings_parent_conversation_id_junior_conversations_conversation_id_fk" FOREIGN KEY ("parent_conversation_id") REFERENCES "public"."junior_conversations"("conversation_id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "junior_agent_bindings" ADD CONSTRAINT "junior_agent_bindings_child_conversation_id_junior_conversations_conversation_id_fk" FOREIGN KEY ("child_conversation_id") REFERENCES "public"."junior_conversations"("conversation_id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "junior_agent_invocations" ADD CONSTRAINT "junior_agent_invocations_parent_conversation_id_junior_conversations_conversation_id_fk" FOREIGN KEY ("parent_conversation_id") REFERENCES "public"."junior_conversations"("conversation_id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "junior_agent_invocations" ADD CONSTRAINT "junior_agent_invocations_child_conversation_id_junior_conversations_conversation_id_fk" FOREIGN KEY ("child_conversation_id") REFERENCES "public"."junior_conversations"("conversation_id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
CREATE UNIQUE INDEX "junior_agent_bindings_child_idx" ON "junior_agent_bindings" USING btree ("child_conversation_id");--> statement-breakpoint
CREATE INDEX "junior_agent_invocations_child_idx" ON "junior_agent_invocations" USING btree ("child_conversation_id");--> statement-breakpoint
CREATE INDEX "junior_agent_invocations_mailbox_idx" ON "junior_agent_invocations" USING btree ("mailbox_status","created_at");
Loading
Loading