mirror of
https://github.com/openai/codex.git
synced 2026-12-02 00:31:03 +00:00
feat(review-story): add reusable review story api
This commit is contained in:
+109
@@ -0,0 +1,109 @@
|
||||
# Codex Review Experience
|
||||
|
||||
Language for features that help people understand and navigate code changes in Codex.
|
||||
|
||||
## Implemented Language
|
||||
|
||||
**Review Story**:
|
||||
A structured explanation of a change that organizes the diff into a small number of ordered, cohesive steps for reviewer understanding. A **Review Story** is a navigation and explanation artifact, not a finding engine or correctness verdict.
|
||||
_Avoid_: Review module, PR story, change story
|
||||
|
||||
**Story Source**:
|
||||
The change set that a **Review Story** explains. A **Story Source** may be a branch comparison, uncommitted changes, or a single commit; it is not limited to a hosted pull request.
|
||||
_Avoid_: Pull request, GitHub PR
|
||||
|
||||
**Concrete Story Source**:
|
||||
A **Story Source** that resolves to a deterministic diff and **Source Fingerprint**, such as a branch comparison, uncommitted changes, or a single commit. Review Story creation requires a **Concrete Story Source**.
|
||||
_Avoid_: Custom instructions
|
||||
|
||||
**Source Fingerprint**:
|
||||
A deterministic hash of the selected source and its collected diff. It is stored with the snapshot so future refresh or staleness behavior can compare source identity without depending on model output.
|
||||
_Avoid_: Model context hash
|
||||
|
||||
**Story Step**:
|
||||
One ordered unit inside a **Review Story**. A **Story Step** has a title, goal, summary, dependency rationale, review focus, and references to the changed evidence that supports it.
|
||||
_Avoid_: Cohort, layer, phase
|
||||
|
||||
**Step Goal**:
|
||||
The reason a **Story Step** belongs in the story. A goal explains the role of that step; its summary explains what changed.
|
||||
|
||||
**Review Focus**:
|
||||
Non-verdict guidance on what a reviewer should pay attention to while reading a **Story Step**. It may highlight assumptions or dependencies, but it is not a finding.
|
||||
_Avoid_: Finding, issue, warning
|
||||
|
||||
**Change Anchor**:
|
||||
A system-created piece of changed evidence referenced by a **Story Step**. The current implementation creates one anchor for each file diff and stores its raw patch, path, and detected change kind.
|
||||
_Avoid_: Model-invented location
|
||||
|
||||
**Anchor Id**:
|
||||
A stable identifier assigned by Codex to a **Change Anchor** before model story generation begins. The model may group only provided anchor ids; unknown references are discarded and missing anchors are appended for complete coverage.
|
||||
|
||||
**Story Snapshot**:
|
||||
A persisted version of a **Review Story** associated with one thread and source fingerprint. The current generator writes a completed snapshot after model grouping and validation or fallback construction.
|
||||
_Avoid_: Transcript output
|
||||
|
||||
**Snapshot Status**:
|
||||
The stored lifecycle result of a snapshot. Current creation produces `ready` for fully validated output or an empty diff, and `partial` when generation falls back or the model omits or invents anchors. `building` and `failed` remain protocol values reserved for future asynchronous generation.
|
||||
|
||||
**Step Readiness**:
|
||||
The per-step readiness value included in the shared API shape. Current story creation emits `ready` steps; `outline`, `enriching`, and `failed` are reserved for future progressive work.
|
||||
|
||||
**Snapshot Update**:
|
||||
A full snapshot notification emitted when the app-server writes a story snapshot. Current generation emits one update for the completed snapshot; a future progressive workflow may emit additional replacements.
|
||||
_Avoid_: Delta event
|
||||
|
||||
**Story Store**:
|
||||
The structured persistence location for **Story Snapshots**, keyed for lookup by thread and snapshot id and listable by thread. It stores canonical snapshot JSON plus indexed summary columns.
|
||||
|
||||
**Story Database**:
|
||||
The SQLite database managed by the shared state layer that backs the **Story Store**. It is separate from thread metadata storage so story-specific persistence can evolve independently.
|
||||
|
||||
**Story Schema**:
|
||||
The strict structured-output contract used by the model call that creates a **Review Story**. It ensures the server can validate step fields and anchor assignments before persisting a snapshot.
|
||||
|
||||
**Partial Story**:
|
||||
A complete stored snapshot that remains usable but required fallback or coverage correction. In the current implementation, a **Partial Story** is not a streaming or unfinished state.
|
||||
|
||||
**Story Surface**:
|
||||
A product surface that presents a **Story Snapshot** to a reviewer. The reusable app-server API exists so TUI and App UI surfaces can share the same artifact without generating their own story shape.
|
||||
|
||||
**Story API**:
|
||||
The app-server v2 contract used to create and retrieve **Story Snapshots**. It exposes `reviewStory/start`, `reviewStory/read`, `reviewStory/list`, and `reviewStory/snapshot/updated`.
|
||||
_Avoid_: TUI API, local story service
|
||||
|
||||
**reviewStory**:
|
||||
The app-server v2 API namespace for **Story API** methods. It is separate from the findings-oriented `review` namespace because its artifact explains rather than judges a change.
|
||||
|
||||
## Deferred Concepts
|
||||
|
||||
These terms describe intended follow-up work, not behavior delivered by the current API/backend implementation.
|
||||
|
||||
**Stale Story** and **Snapshot Lineage**:
|
||||
Future refresh behavior may compare stored source fingerprints and link newly generated snapshots to earlier versions. Current snapshots set `stale` to false and do not link a previous snapshot.
|
||||
|
||||
**Evidence Graph**:
|
||||
A possible future evidence model that adds hunk anchors, commit relationships, or dependency signals. Current evidence is the set of deterministic file-level anchors from a git diff.
|
||||
|
||||
**Progressive Story Snapshot** and **Step Enrichment**:
|
||||
A future asynchronous generation workflow in which an ordered outline is usable before every step has complete explanatory prose. Current generation uses one blocking model grouping call and stores one completed snapshot.
|
||||
|
||||
**Story Overlay** and **/story**:
|
||||
A future TUI surface and entry point over the shared API. They are intentionally implemented in a stacked UI change rather than in the reusable backend base layer.
|
||||
|
||||
## Example Dialogue
|
||||
|
||||
Dev: "Does Review Story find bugs?"
|
||||
|
||||
Domain expert: "No. It explains and orders changed evidence for reviewer understanding; findings remain part of the review workflow."
|
||||
|
||||
Dev: "Can a model invent file locations for a story step?"
|
||||
|
||||
Domain expert: "No. Codex creates file-diff anchors first, and the model may only group those anchor ids."
|
||||
|
||||
Dev: "Does story generation stream step updates today?"
|
||||
|
||||
Domain expert: "No. It persists a completed ready or partial snapshot. The notification and readiness fields leave room for future progressive generation."
|
||||
|
||||
Dev: "Can the TUI and App UI render different story models?"
|
||||
|
||||
Domain expert: "No. Both surfaces should consume the shared `reviewStory` snapshot contract."
|
||||
@@ -2671,6 +2671,61 @@
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"ReviewStoryListParams": {
|
||||
"properties": {
|
||||
"cursor": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"limit": {
|
||||
"format": "uint32",
|
||||
"minimum": 0.0,
|
||||
"type": [
|
||||
"integer",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"threadId": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"threadId"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"ReviewStoryReadParams": {
|
||||
"properties": {
|
||||
"storySnapshotId": {
|
||||
"type": "string"
|
||||
},
|
||||
"threadId": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"storySnapshotId",
|
||||
"threadId"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"ReviewStoryStartParams": {
|
||||
"properties": {
|
||||
"target": {
|
||||
"$ref": "#/definitions/ReviewTarget"
|
||||
},
|
||||
"threadId": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"target",
|
||||
"threadId"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"ReviewTarget": {
|
||||
"oneOf": [
|
||||
{
|
||||
@@ -5425,6 +5480,78 @@
|
||||
"title": "Review/startRequest",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"id": {
|
||||
"$ref": "#/definitions/RequestId"
|
||||
},
|
||||
"method": {
|
||||
"enum": [
|
||||
"reviewStory/start"
|
||||
],
|
||||
"title": "ReviewStory/startRequestMethod",
|
||||
"type": "string"
|
||||
},
|
||||
"params": {
|
||||
"$ref": "#/definitions/ReviewStoryStartParams"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"method",
|
||||
"params"
|
||||
],
|
||||
"title": "ReviewStory/startRequest",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"id": {
|
||||
"$ref": "#/definitions/RequestId"
|
||||
},
|
||||
"method": {
|
||||
"enum": [
|
||||
"reviewStory/read"
|
||||
],
|
||||
"title": "ReviewStory/readRequestMethod",
|
||||
"type": "string"
|
||||
},
|
||||
"params": {
|
||||
"$ref": "#/definitions/ReviewStoryReadParams"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"method",
|
||||
"params"
|
||||
],
|
||||
"title": "ReviewStory/readRequest",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"id": {
|
||||
"$ref": "#/definitions/RequestId"
|
||||
},
|
||||
"method": {
|
||||
"enum": [
|
||||
"reviewStory/list"
|
||||
],
|
||||
"title": "ReviewStory/listRequestMethod",
|
||||
"type": "string"
|
||||
},
|
||||
"params": {
|
||||
"$ref": "#/definitions/ReviewStoryListParams"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"method",
|
||||
"params"
|
||||
],
|
||||
"title": "ReviewStory/listRequest",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"id": {
|
||||
|
||||
@@ -2946,6 +2946,294 @@
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"ReviewStoryAnchor": {
|
||||
"properties": {
|
||||
"anchorId": {
|
||||
"type": "string"
|
||||
},
|
||||
"changeKind": {
|
||||
"$ref": "#/definitions/ReviewStoryAnchorKind"
|
||||
},
|
||||
"diff": {
|
||||
"type": "string"
|
||||
},
|
||||
"filePath": {
|
||||
"type": "string"
|
||||
},
|
||||
"summary": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"anchorId",
|
||||
"changeKind",
|
||||
"diff",
|
||||
"filePath",
|
||||
"summary"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"ReviewStoryAnchorKind": {
|
||||
"enum": [
|
||||
"added",
|
||||
"modified",
|
||||
"deleted",
|
||||
"renamed",
|
||||
"copied",
|
||||
"unknown"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"ReviewStorySnapshot": {
|
||||
"properties": {
|
||||
"anchors": {
|
||||
"items": {
|
||||
"$ref": "#/definitions/ReviewStoryAnchor"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"createdAt": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
},
|
||||
"overview": {
|
||||
"type": "string"
|
||||
},
|
||||
"previousStorySnapshotId": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"sourceFingerprint": {
|
||||
"type": "string"
|
||||
},
|
||||
"stale": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"status": {
|
||||
"$ref": "#/definitions/ReviewStorySnapshotStatus"
|
||||
},
|
||||
"steps": {
|
||||
"items": {
|
||||
"$ref": "#/definitions/ReviewStoryStep"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"storySnapshotId": {
|
||||
"type": "string"
|
||||
},
|
||||
"target": {
|
||||
"$ref": "#/definitions/ReviewTarget"
|
||||
},
|
||||
"threadId": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"anchors",
|
||||
"createdAt",
|
||||
"overview",
|
||||
"sourceFingerprint",
|
||||
"stale",
|
||||
"status",
|
||||
"steps",
|
||||
"storySnapshotId",
|
||||
"target",
|
||||
"threadId",
|
||||
"title",
|
||||
"updatedAt"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"ReviewStorySnapshotStatus": {
|
||||
"enum": [
|
||||
"building",
|
||||
"ready",
|
||||
"partial",
|
||||
"failed"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"ReviewStorySnapshotUpdatedNotification": {
|
||||
"properties": {
|
||||
"snapshot": {
|
||||
"$ref": "#/definitions/ReviewStorySnapshot"
|
||||
},
|
||||
"threadId": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"snapshot",
|
||||
"threadId"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"ReviewStoryStep": {
|
||||
"properties": {
|
||||
"anchorIds": {
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"dependencyRationale": {
|
||||
"type": "string"
|
||||
},
|
||||
"error": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"goal": {
|
||||
"type": "string"
|
||||
},
|
||||
"index": {
|
||||
"format": "uint32",
|
||||
"minimum": 0.0,
|
||||
"type": "integer"
|
||||
},
|
||||
"readiness": {
|
||||
"$ref": "#/definitions/ReviewStoryStepReadiness"
|
||||
},
|
||||
"reviewFocus": {
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"stepId": {
|
||||
"type": "string"
|
||||
},
|
||||
"summary": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"anchorIds",
|
||||
"dependencyRationale",
|
||||
"goal",
|
||||
"index",
|
||||
"readiness",
|
||||
"reviewFocus",
|
||||
"stepId",
|
||||
"summary",
|
||||
"title"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"ReviewStoryStepReadiness": {
|
||||
"enum": [
|
||||
"outline",
|
||||
"enriching",
|
||||
"ready",
|
||||
"failed"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"ReviewTarget": {
|
||||
"oneOf": [
|
||||
{
|
||||
"description": "Review the working tree: staged, unstaged, and untracked files.",
|
||||
"properties": {
|
||||
"type": {
|
||||
"enum": [
|
||||
"uncommittedChanges"
|
||||
],
|
||||
"title": "UncommittedChangesReviewTargetType",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"type"
|
||||
],
|
||||
"title": "UncommittedChangesReviewTarget",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"description": "Review changes between the current branch and the given base branch.",
|
||||
"properties": {
|
||||
"branch": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"baseBranch"
|
||||
],
|
||||
"title": "BaseBranchReviewTargetType",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"branch",
|
||||
"type"
|
||||
],
|
||||
"title": "BaseBranchReviewTarget",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"description": "Review the changes introduced by a specific commit.",
|
||||
"properties": {
|
||||
"sha": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"description": "Optional human-readable label (e.g., commit subject) for UIs.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"commit"
|
||||
],
|
||||
"title": "CommitReviewTargetType",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"sha",
|
||||
"type"
|
||||
],
|
||||
"title": "CommitReviewTarget",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"description": "Arbitrary instructions, equivalent to the old free-form prompt.",
|
||||
"properties": {
|
||||
"instructions": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"custom"
|
||||
],
|
||||
"title": "CustomReviewTargetType",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"instructions",
|
||||
"type"
|
||||
],
|
||||
"title": "CustomReviewTarget",
|
||||
"type": "object"
|
||||
}
|
||||
]
|
||||
},
|
||||
"SandboxPolicy": {
|
||||
"oneOf": [
|
||||
{
|
||||
@@ -5557,6 +5845,26 @@
|
||||
"title": "Turn/completedNotification",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"method": {
|
||||
"enum": [
|
||||
"reviewStory/snapshot/updated"
|
||||
],
|
||||
"title": "ReviewStory/snapshot/updatedNotificationMethod",
|
||||
"type": "string"
|
||||
},
|
||||
"params": {
|
||||
"$ref": "#/definitions/ReviewStorySnapshotUpdatedNotification"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"method",
|
||||
"params"
|
||||
],
|
||||
"title": "ReviewStory/snapshot/updatedNotification",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"method": {
|
||||
|
||||
+465
@@ -1429,6 +1429,78 @@
|
||||
"title": "Review/startRequest",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"id": {
|
||||
"$ref": "#/definitions/v2/RequestId"
|
||||
},
|
||||
"method": {
|
||||
"enum": [
|
||||
"reviewStory/start"
|
||||
],
|
||||
"title": "ReviewStory/startRequestMethod",
|
||||
"type": "string"
|
||||
},
|
||||
"params": {
|
||||
"$ref": "#/definitions/v2/ReviewStoryStartParams"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"method",
|
||||
"params"
|
||||
],
|
||||
"title": "ReviewStory/startRequest",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"id": {
|
||||
"$ref": "#/definitions/v2/RequestId"
|
||||
},
|
||||
"method": {
|
||||
"enum": [
|
||||
"reviewStory/read"
|
||||
],
|
||||
"title": "ReviewStory/readRequestMethod",
|
||||
"type": "string"
|
||||
},
|
||||
"params": {
|
||||
"$ref": "#/definitions/v2/ReviewStoryReadParams"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"method",
|
||||
"params"
|
||||
],
|
||||
"title": "ReviewStory/readRequest",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"id": {
|
||||
"$ref": "#/definitions/v2/RequestId"
|
||||
},
|
||||
"method": {
|
||||
"enum": [
|
||||
"reviewStory/list"
|
||||
],
|
||||
"title": "ReviewStory/listRequestMethod",
|
||||
"type": "string"
|
||||
},
|
||||
"params": {
|
||||
"$ref": "#/definitions/v2/ReviewStoryListParams"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"method",
|
||||
"params"
|
||||
],
|
||||
"title": "ReviewStory/listRequest",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"id": {
|
||||
@@ -4227,6 +4299,26 @@
|
||||
"title": "Turn/completedNotification",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"method": {
|
||||
"enum": [
|
||||
"reviewStory/snapshot/updated"
|
||||
],
|
||||
"title": "ReviewStory/snapshot/updatedNotificationMethod",
|
||||
"type": "string"
|
||||
},
|
||||
"params": {
|
||||
"$ref": "#/definitions/v2/ReviewStorySnapshotUpdatedNotification"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"method",
|
||||
"params"
|
||||
],
|
||||
"title": "ReviewStory/snapshot/updatedNotification",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"method": {
|
||||
@@ -14411,6 +14503,379 @@
|
||||
"title": "ReviewStartResponse",
|
||||
"type": "object"
|
||||
},
|
||||
"ReviewStoryAnchor": {
|
||||
"properties": {
|
||||
"anchorId": {
|
||||
"type": "string"
|
||||
},
|
||||
"changeKind": {
|
||||
"$ref": "#/definitions/v2/ReviewStoryAnchorKind"
|
||||
},
|
||||
"diff": {
|
||||
"type": "string"
|
||||
},
|
||||
"filePath": {
|
||||
"type": "string"
|
||||
},
|
||||
"summary": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"anchorId",
|
||||
"changeKind",
|
||||
"diff",
|
||||
"filePath",
|
||||
"summary"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"ReviewStoryAnchorKind": {
|
||||
"enum": [
|
||||
"added",
|
||||
"modified",
|
||||
"deleted",
|
||||
"renamed",
|
||||
"copied",
|
||||
"unknown"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"ReviewStoryListParams": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"cursor": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"limit": {
|
||||
"format": "uint32",
|
||||
"minimum": 0.0,
|
||||
"type": [
|
||||
"integer",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"threadId": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"threadId"
|
||||
],
|
||||
"title": "ReviewStoryListParams",
|
||||
"type": "object"
|
||||
},
|
||||
"ReviewStoryListResponse": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"data": {
|
||||
"items": {
|
||||
"$ref": "#/definitions/v2/ReviewStorySnapshotSummary"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"nextCursor": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"data"
|
||||
],
|
||||
"title": "ReviewStoryListResponse",
|
||||
"type": "object"
|
||||
},
|
||||
"ReviewStoryReadParams": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"storySnapshotId": {
|
||||
"type": "string"
|
||||
},
|
||||
"threadId": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"storySnapshotId",
|
||||
"threadId"
|
||||
],
|
||||
"title": "ReviewStoryReadParams",
|
||||
"type": "object"
|
||||
},
|
||||
"ReviewStoryReadResponse": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"snapshot": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/definitions/v2/ReviewStorySnapshot"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"title": "ReviewStoryReadResponse",
|
||||
"type": "object"
|
||||
},
|
||||
"ReviewStorySnapshot": {
|
||||
"properties": {
|
||||
"anchors": {
|
||||
"items": {
|
||||
"$ref": "#/definitions/v2/ReviewStoryAnchor"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"createdAt": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
},
|
||||
"overview": {
|
||||
"type": "string"
|
||||
},
|
||||
"previousStorySnapshotId": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"sourceFingerprint": {
|
||||
"type": "string"
|
||||
},
|
||||
"stale": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"status": {
|
||||
"$ref": "#/definitions/v2/ReviewStorySnapshotStatus"
|
||||
},
|
||||
"steps": {
|
||||
"items": {
|
||||
"$ref": "#/definitions/v2/ReviewStoryStep"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"storySnapshotId": {
|
||||
"type": "string"
|
||||
},
|
||||
"target": {
|
||||
"$ref": "#/definitions/v2/ReviewTarget"
|
||||
},
|
||||
"threadId": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"anchors",
|
||||
"createdAt",
|
||||
"overview",
|
||||
"sourceFingerprint",
|
||||
"stale",
|
||||
"status",
|
||||
"steps",
|
||||
"storySnapshotId",
|
||||
"target",
|
||||
"threadId",
|
||||
"title",
|
||||
"updatedAt"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"ReviewStorySnapshotStatus": {
|
||||
"enum": [
|
||||
"building",
|
||||
"ready",
|
||||
"partial",
|
||||
"failed"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"ReviewStorySnapshotSummary": {
|
||||
"properties": {
|
||||
"createdAt": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
},
|
||||
"previousStorySnapshotId": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"sourceFingerprint": {
|
||||
"type": "string"
|
||||
},
|
||||
"status": {
|
||||
"$ref": "#/definitions/v2/ReviewStorySnapshotStatus"
|
||||
},
|
||||
"stepCount": {
|
||||
"format": "uint32",
|
||||
"minimum": 0.0,
|
||||
"type": "integer"
|
||||
},
|
||||
"storySnapshotId": {
|
||||
"type": "string"
|
||||
},
|
||||
"target": {
|
||||
"$ref": "#/definitions/v2/ReviewTarget"
|
||||
},
|
||||
"threadId": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"createdAt",
|
||||
"sourceFingerprint",
|
||||
"status",
|
||||
"stepCount",
|
||||
"storySnapshotId",
|
||||
"target",
|
||||
"threadId",
|
||||
"title",
|
||||
"updatedAt"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"ReviewStorySnapshotUpdatedNotification": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"snapshot": {
|
||||
"$ref": "#/definitions/v2/ReviewStorySnapshot"
|
||||
},
|
||||
"threadId": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"snapshot",
|
||||
"threadId"
|
||||
],
|
||||
"title": "ReviewStorySnapshotUpdatedNotification",
|
||||
"type": "object"
|
||||
},
|
||||
"ReviewStoryStartParams": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"target": {
|
||||
"$ref": "#/definitions/v2/ReviewTarget"
|
||||
},
|
||||
"threadId": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"target",
|
||||
"threadId"
|
||||
],
|
||||
"title": "ReviewStoryStartParams",
|
||||
"type": "object"
|
||||
},
|
||||
"ReviewStoryStartResponse": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"snapshot": {
|
||||
"$ref": "#/definitions/v2/ReviewStorySnapshot"
|
||||
},
|
||||
"storySnapshotId": {
|
||||
"type": "string"
|
||||
},
|
||||
"turn": {
|
||||
"$ref": "#/definitions/v2/Turn"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"snapshot",
|
||||
"storySnapshotId",
|
||||
"turn"
|
||||
],
|
||||
"title": "ReviewStoryStartResponse",
|
||||
"type": "object"
|
||||
},
|
||||
"ReviewStoryStep": {
|
||||
"properties": {
|
||||
"anchorIds": {
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"dependencyRationale": {
|
||||
"type": "string"
|
||||
},
|
||||
"error": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"goal": {
|
||||
"type": "string"
|
||||
},
|
||||
"index": {
|
||||
"format": "uint32",
|
||||
"minimum": 0.0,
|
||||
"type": "integer"
|
||||
},
|
||||
"readiness": {
|
||||
"$ref": "#/definitions/v2/ReviewStoryStepReadiness"
|
||||
},
|
||||
"reviewFocus": {
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"stepId": {
|
||||
"type": "string"
|
||||
},
|
||||
"summary": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"anchorIds",
|
||||
"dependencyRationale",
|
||||
"goal",
|
||||
"index",
|
||||
"readiness",
|
||||
"reviewFocus",
|
||||
"stepId",
|
||||
"summary",
|
||||
"title"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"ReviewStoryStepReadiness": {
|
||||
"enum": [
|
||||
"outline",
|
||||
"enriching",
|
||||
"ready",
|
||||
"failed"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"ReviewTarget": {
|
||||
"oneOf": [
|
||||
{
|
||||
|
||||
+465
@@ -2155,6 +2155,78 @@
|
||||
"title": "Review/startRequest",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"id": {
|
||||
"$ref": "#/definitions/RequestId"
|
||||
},
|
||||
"method": {
|
||||
"enum": [
|
||||
"reviewStory/start"
|
||||
],
|
||||
"title": "ReviewStory/startRequestMethod",
|
||||
"type": "string"
|
||||
},
|
||||
"params": {
|
||||
"$ref": "#/definitions/ReviewStoryStartParams"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"method",
|
||||
"params"
|
||||
],
|
||||
"title": "ReviewStory/startRequest",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"id": {
|
||||
"$ref": "#/definitions/RequestId"
|
||||
},
|
||||
"method": {
|
||||
"enum": [
|
||||
"reviewStory/read"
|
||||
],
|
||||
"title": "ReviewStory/readRequestMethod",
|
||||
"type": "string"
|
||||
},
|
||||
"params": {
|
||||
"$ref": "#/definitions/ReviewStoryReadParams"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"method",
|
||||
"params"
|
||||
],
|
||||
"title": "ReviewStory/readRequest",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"id": {
|
||||
"$ref": "#/definitions/RequestId"
|
||||
},
|
||||
"method": {
|
||||
"enum": [
|
||||
"reviewStory/list"
|
||||
],
|
||||
"title": "ReviewStory/listRequestMethod",
|
||||
"type": "string"
|
||||
},
|
||||
"params": {
|
||||
"$ref": "#/definitions/ReviewStoryListParams"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"method",
|
||||
"params"
|
||||
],
|
||||
"title": "ReviewStory/listRequest",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"id": {
|
||||
@@ -10940,6 +11012,379 @@
|
||||
"title": "ReviewStartResponse",
|
||||
"type": "object"
|
||||
},
|
||||
"ReviewStoryAnchor": {
|
||||
"properties": {
|
||||
"anchorId": {
|
||||
"type": "string"
|
||||
},
|
||||
"changeKind": {
|
||||
"$ref": "#/definitions/ReviewStoryAnchorKind"
|
||||
},
|
||||
"diff": {
|
||||
"type": "string"
|
||||
},
|
||||
"filePath": {
|
||||
"type": "string"
|
||||
},
|
||||
"summary": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"anchorId",
|
||||
"changeKind",
|
||||
"diff",
|
||||
"filePath",
|
||||
"summary"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"ReviewStoryAnchorKind": {
|
||||
"enum": [
|
||||
"added",
|
||||
"modified",
|
||||
"deleted",
|
||||
"renamed",
|
||||
"copied",
|
||||
"unknown"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"ReviewStoryListParams": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"cursor": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"limit": {
|
||||
"format": "uint32",
|
||||
"minimum": 0.0,
|
||||
"type": [
|
||||
"integer",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"threadId": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"threadId"
|
||||
],
|
||||
"title": "ReviewStoryListParams",
|
||||
"type": "object"
|
||||
},
|
||||
"ReviewStoryListResponse": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"data": {
|
||||
"items": {
|
||||
"$ref": "#/definitions/ReviewStorySnapshotSummary"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"nextCursor": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"data"
|
||||
],
|
||||
"title": "ReviewStoryListResponse",
|
||||
"type": "object"
|
||||
},
|
||||
"ReviewStoryReadParams": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"storySnapshotId": {
|
||||
"type": "string"
|
||||
},
|
||||
"threadId": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"storySnapshotId",
|
||||
"threadId"
|
||||
],
|
||||
"title": "ReviewStoryReadParams",
|
||||
"type": "object"
|
||||
},
|
||||
"ReviewStoryReadResponse": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"snapshot": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/definitions/ReviewStorySnapshot"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"title": "ReviewStoryReadResponse",
|
||||
"type": "object"
|
||||
},
|
||||
"ReviewStorySnapshot": {
|
||||
"properties": {
|
||||
"anchors": {
|
||||
"items": {
|
||||
"$ref": "#/definitions/ReviewStoryAnchor"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"createdAt": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
},
|
||||
"overview": {
|
||||
"type": "string"
|
||||
},
|
||||
"previousStorySnapshotId": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"sourceFingerprint": {
|
||||
"type": "string"
|
||||
},
|
||||
"stale": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"status": {
|
||||
"$ref": "#/definitions/ReviewStorySnapshotStatus"
|
||||
},
|
||||
"steps": {
|
||||
"items": {
|
||||
"$ref": "#/definitions/ReviewStoryStep"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"storySnapshotId": {
|
||||
"type": "string"
|
||||
},
|
||||
"target": {
|
||||
"$ref": "#/definitions/ReviewTarget"
|
||||
},
|
||||
"threadId": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"anchors",
|
||||
"createdAt",
|
||||
"overview",
|
||||
"sourceFingerprint",
|
||||
"stale",
|
||||
"status",
|
||||
"steps",
|
||||
"storySnapshotId",
|
||||
"target",
|
||||
"threadId",
|
||||
"title",
|
||||
"updatedAt"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"ReviewStorySnapshotStatus": {
|
||||
"enum": [
|
||||
"building",
|
||||
"ready",
|
||||
"partial",
|
||||
"failed"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"ReviewStorySnapshotSummary": {
|
||||
"properties": {
|
||||
"createdAt": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
},
|
||||
"previousStorySnapshotId": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"sourceFingerprint": {
|
||||
"type": "string"
|
||||
},
|
||||
"status": {
|
||||
"$ref": "#/definitions/ReviewStorySnapshotStatus"
|
||||
},
|
||||
"stepCount": {
|
||||
"format": "uint32",
|
||||
"minimum": 0.0,
|
||||
"type": "integer"
|
||||
},
|
||||
"storySnapshotId": {
|
||||
"type": "string"
|
||||
},
|
||||
"target": {
|
||||
"$ref": "#/definitions/ReviewTarget"
|
||||
},
|
||||
"threadId": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"createdAt",
|
||||
"sourceFingerprint",
|
||||
"status",
|
||||
"stepCount",
|
||||
"storySnapshotId",
|
||||
"target",
|
||||
"threadId",
|
||||
"title",
|
||||
"updatedAt"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"ReviewStorySnapshotUpdatedNotification": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"snapshot": {
|
||||
"$ref": "#/definitions/ReviewStorySnapshot"
|
||||
},
|
||||
"threadId": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"snapshot",
|
||||
"threadId"
|
||||
],
|
||||
"title": "ReviewStorySnapshotUpdatedNotification",
|
||||
"type": "object"
|
||||
},
|
||||
"ReviewStoryStartParams": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"target": {
|
||||
"$ref": "#/definitions/ReviewTarget"
|
||||
},
|
||||
"threadId": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"target",
|
||||
"threadId"
|
||||
],
|
||||
"title": "ReviewStoryStartParams",
|
||||
"type": "object"
|
||||
},
|
||||
"ReviewStoryStartResponse": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"snapshot": {
|
||||
"$ref": "#/definitions/ReviewStorySnapshot"
|
||||
},
|
||||
"storySnapshotId": {
|
||||
"type": "string"
|
||||
},
|
||||
"turn": {
|
||||
"$ref": "#/definitions/Turn"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"snapshot",
|
||||
"storySnapshotId",
|
||||
"turn"
|
||||
],
|
||||
"title": "ReviewStoryStartResponse",
|
||||
"type": "object"
|
||||
},
|
||||
"ReviewStoryStep": {
|
||||
"properties": {
|
||||
"anchorIds": {
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"dependencyRationale": {
|
||||
"type": "string"
|
||||
},
|
||||
"error": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"goal": {
|
||||
"type": "string"
|
||||
},
|
||||
"index": {
|
||||
"format": "uint32",
|
||||
"minimum": 0.0,
|
||||
"type": "integer"
|
||||
},
|
||||
"readiness": {
|
||||
"$ref": "#/definitions/ReviewStoryStepReadiness"
|
||||
},
|
||||
"reviewFocus": {
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"stepId": {
|
||||
"type": "string"
|
||||
},
|
||||
"summary": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"anchorIds",
|
||||
"dependencyRationale",
|
||||
"goal",
|
||||
"index",
|
||||
"readiness",
|
||||
"reviewFocus",
|
||||
"stepId",
|
||||
"summary",
|
||||
"title"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"ReviewStoryStepReadiness": {
|
||||
"enum": [
|
||||
"outline",
|
||||
"enriching",
|
||||
"ready",
|
||||
"failed"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"ReviewTarget": {
|
||||
"oneOf": [
|
||||
{
|
||||
@@ -11493,6 +11938,26 @@
|
||||
"title": "Turn/completedNotification",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"method": {
|
||||
"enum": [
|
||||
"reviewStory/snapshot/updated"
|
||||
],
|
||||
"title": "ReviewStory/snapshot/updatedNotificationMethod",
|
||||
"type": "string"
|
||||
},
|
||||
"params": {
|
||||
"$ref": "#/definitions/ReviewStorySnapshotUpdatedNotification"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"method",
|
||||
"params"
|
||||
],
|
||||
"title": "ReviewStory/snapshot/updatedNotification",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"method": {
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"cursor": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"limit": {
|
||||
"format": "uint32",
|
||||
"minimum": 0.0,
|
||||
"type": [
|
||||
"integer",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"threadId": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"threadId"
|
||||
],
|
||||
"title": "ReviewStoryListParams",
|
||||
"type": "object"
|
||||
}
|
||||
@@ -0,0 +1,177 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"definitions": {
|
||||
"ReviewStorySnapshotStatus": {
|
||||
"enum": [
|
||||
"building",
|
||||
"ready",
|
||||
"partial",
|
||||
"failed"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"ReviewStorySnapshotSummary": {
|
||||
"properties": {
|
||||
"createdAt": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
},
|
||||
"previousStorySnapshotId": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"sourceFingerprint": {
|
||||
"type": "string"
|
||||
},
|
||||
"status": {
|
||||
"$ref": "#/definitions/ReviewStorySnapshotStatus"
|
||||
},
|
||||
"stepCount": {
|
||||
"format": "uint32",
|
||||
"minimum": 0.0,
|
||||
"type": "integer"
|
||||
},
|
||||
"storySnapshotId": {
|
||||
"type": "string"
|
||||
},
|
||||
"target": {
|
||||
"$ref": "#/definitions/ReviewTarget"
|
||||
},
|
||||
"threadId": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"createdAt",
|
||||
"sourceFingerprint",
|
||||
"status",
|
||||
"stepCount",
|
||||
"storySnapshotId",
|
||||
"target",
|
||||
"threadId",
|
||||
"title",
|
||||
"updatedAt"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"ReviewTarget": {
|
||||
"oneOf": [
|
||||
{
|
||||
"description": "Review the working tree: staged, unstaged, and untracked files.",
|
||||
"properties": {
|
||||
"type": {
|
||||
"enum": [
|
||||
"uncommittedChanges"
|
||||
],
|
||||
"title": "UncommittedChangesReviewTargetType",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"type"
|
||||
],
|
||||
"title": "UncommittedChangesReviewTarget",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"description": "Review changes between the current branch and the given base branch.",
|
||||
"properties": {
|
||||
"branch": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"baseBranch"
|
||||
],
|
||||
"title": "BaseBranchReviewTargetType",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"branch",
|
||||
"type"
|
||||
],
|
||||
"title": "BaseBranchReviewTarget",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"description": "Review the changes introduced by a specific commit.",
|
||||
"properties": {
|
||||
"sha": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"description": "Optional human-readable label (e.g., commit subject) for UIs.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"commit"
|
||||
],
|
||||
"title": "CommitReviewTargetType",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"sha",
|
||||
"type"
|
||||
],
|
||||
"title": "CommitReviewTarget",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"description": "Arbitrary instructions, equivalent to the old free-form prompt.",
|
||||
"properties": {
|
||||
"instructions": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"custom"
|
||||
],
|
||||
"title": "CustomReviewTargetType",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"instructions",
|
||||
"type"
|
||||
],
|
||||
"title": "CustomReviewTarget",
|
||||
"type": "object"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"data": {
|
||||
"items": {
|
||||
"$ref": "#/definitions/ReviewStorySnapshotSummary"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"nextCursor": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"data"
|
||||
],
|
||||
"title": "ReviewStoryListResponse",
|
||||
"type": "object"
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"storySnapshotId": {
|
||||
"type": "string"
|
||||
},
|
||||
"threadId": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"storySnapshotId",
|
||||
"threadId"
|
||||
],
|
||||
"title": "ReviewStoryReadParams",
|
||||
"type": "object"
|
||||
}
|
||||
@@ -0,0 +1,292 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"definitions": {
|
||||
"ReviewStoryAnchor": {
|
||||
"properties": {
|
||||
"anchorId": {
|
||||
"type": "string"
|
||||
},
|
||||
"changeKind": {
|
||||
"$ref": "#/definitions/ReviewStoryAnchorKind"
|
||||
},
|
||||
"diff": {
|
||||
"type": "string"
|
||||
},
|
||||
"filePath": {
|
||||
"type": "string"
|
||||
},
|
||||
"summary": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"anchorId",
|
||||
"changeKind",
|
||||
"diff",
|
||||
"filePath",
|
||||
"summary"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"ReviewStoryAnchorKind": {
|
||||
"enum": [
|
||||
"added",
|
||||
"modified",
|
||||
"deleted",
|
||||
"renamed",
|
||||
"copied",
|
||||
"unknown"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"ReviewStorySnapshot": {
|
||||
"properties": {
|
||||
"anchors": {
|
||||
"items": {
|
||||
"$ref": "#/definitions/ReviewStoryAnchor"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"createdAt": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
},
|
||||
"overview": {
|
||||
"type": "string"
|
||||
},
|
||||
"previousStorySnapshotId": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"sourceFingerprint": {
|
||||
"type": "string"
|
||||
},
|
||||
"stale": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"status": {
|
||||
"$ref": "#/definitions/ReviewStorySnapshotStatus"
|
||||
},
|
||||
"steps": {
|
||||
"items": {
|
||||
"$ref": "#/definitions/ReviewStoryStep"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"storySnapshotId": {
|
||||
"type": "string"
|
||||
},
|
||||
"target": {
|
||||
"$ref": "#/definitions/ReviewTarget"
|
||||
},
|
||||
"threadId": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"anchors",
|
||||
"createdAt",
|
||||
"overview",
|
||||
"sourceFingerprint",
|
||||
"stale",
|
||||
"status",
|
||||
"steps",
|
||||
"storySnapshotId",
|
||||
"target",
|
||||
"threadId",
|
||||
"title",
|
||||
"updatedAt"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"ReviewStorySnapshotStatus": {
|
||||
"enum": [
|
||||
"building",
|
||||
"ready",
|
||||
"partial",
|
||||
"failed"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"ReviewStoryStep": {
|
||||
"properties": {
|
||||
"anchorIds": {
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"dependencyRationale": {
|
||||
"type": "string"
|
||||
},
|
||||
"error": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"goal": {
|
||||
"type": "string"
|
||||
},
|
||||
"index": {
|
||||
"format": "uint32",
|
||||
"minimum": 0.0,
|
||||
"type": "integer"
|
||||
},
|
||||
"readiness": {
|
||||
"$ref": "#/definitions/ReviewStoryStepReadiness"
|
||||
},
|
||||
"reviewFocus": {
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"stepId": {
|
||||
"type": "string"
|
||||
},
|
||||
"summary": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"anchorIds",
|
||||
"dependencyRationale",
|
||||
"goal",
|
||||
"index",
|
||||
"readiness",
|
||||
"reviewFocus",
|
||||
"stepId",
|
||||
"summary",
|
||||
"title"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"ReviewStoryStepReadiness": {
|
||||
"enum": [
|
||||
"outline",
|
||||
"enriching",
|
||||
"ready",
|
||||
"failed"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"ReviewTarget": {
|
||||
"oneOf": [
|
||||
{
|
||||
"description": "Review the working tree: staged, unstaged, and untracked files.",
|
||||
"properties": {
|
||||
"type": {
|
||||
"enum": [
|
||||
"uncommittedChanges"
|
||||
],
|
||||
"title": "UncommittedChangesReviewTargetType",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"type"
|
||||
],
|
||||
"title": "UncommittedChangesReviewTarget",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"description": "Review changes between the current branch and the given base branch.",
|
||||
"properties": {
|
||||
"branch": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"baseBranch"
|
||||
],
|
||||
"title": "BaseBranchReviewTargetType",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"branch",
|
||||
"type"
|
||||
],
|
||||
"title": "BaseBranchReviewTarget",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"description": "Review the changes introduced by a specific commit.",
|
||||
"properties": {
|
||||
"sha": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"description": "Optional human-readable label (e.g., commit subject) for UIs.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"commit"
|
||||
],
|
||||
"title": "CommitReviewTargetType",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"sha",
|
||||
"type"
|
||||
],
|
||||
"title": "CommitReviewTarget",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"description": "Arbitrary instructions, equivalent to the old free-form prompt.",
|
||||
"properties": {
|
||||
"instructions": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"custom"
|
||||
],
|
||||
"title": "CustomReviewTargetType",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"instructions",
|
||||
"type"
|
||||
],
|
||||
"title": "CustomReviewTarget",
|
||||
"type": "object"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"snapshot": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/definitions/ReviewStorySnapshot"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"title": "ReviewStoryReadResponse",
|
||||
"type": "object"
|
||||
}
|
||||
+292
@@ -0,0 +1,292 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"definitions": {
|
||||
"ReviewStoryAnchor": {
|
||||
"properties": {
|
||||
"anchorId": {
|
||||
"type": "string"
|
||||
},
|
||||
"changeKind": {
|
||||
"$ref": "#/definitions/ReviewStoryAnchorKind"
|
||||
},
|
||||
"diff": {
|
||||
"type": "string"
|
||||
},
|
||||
"filePath": {
|
||||
"type": "string"
|
||||
},
|
||||
"summary": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"anchorId",
|
||||
"changeKind",
|
||||
"diff",
|
||||
"filePath",
|
||||
"summary"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"ReviewStoryAnchorKind": {
|
||||
"enum": [
|
||||
"added",
|
||||
"modified",
|
||||
"deleted",
|
||||
"renamed",
|
||||
"copied",
|
||||
"unknown"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"ReviewStorySnapshot": {
|
||||
"properties": {
|
||||
"anchors": {
|
||||
"items": {
|
||||
"$ref": "#/definitions/ReviewStoryAnchor"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"createdAt": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
},
|
||||
"overview": {
|
||||
"type": "string"
|
||||
},
|
||||
"previousStorySnapshotId": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"sourceFingerprint": {
|
||||
"type": "string"
|
||||
},
|
||||
"stale": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"status": {
|
||||
"$ref": "#/definitions/ReviewStorySnapshotStatus"
|
||||
},
|
||||
"steps": {
|
||||
"items": {
|
||||
"$ref": "#/definitions/ReviewStoryStep"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"storySnapshotId": {
|
||||
"type": "string"
|
||||
},
|
||||
"target": {
|
||||
"$ref": "#/definitions/ReviewTarget"
|
||||
},
|
||||
"threadId": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"anchors",
|
||||
"createdAt",
|
||||
"overview",
|
||||
"sourceFingerprint",
|
||||
"stale",
|
||||
"status",
|
||||
"steps",
|
||||
"storySnapshotId",
|
||||
"target",
|
||||
"threadId",
|
||||
"title",
|
||||
"updatedAt"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"ReviewStorySnapshotStatus": {
|
||||
"enum": [
|
||||
"building",
|
||||
"ready",
|
||||
"partial",
|
||||
"failed"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"ReviewStoryStep": {
|
||||
"properties": {
|
||||
"anchorIds": {
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"dependencyRationale": {
|
||||
"type": "string"
|
||||
},
|
||||
"error": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"goal": {
|
||||
"type": "string"
|
||||
},
|
||||
"index": {
|
||||
"format": "uint32",
|
||||
"minimum": 0.0,
|
||||
"type": "integer"
|
||||
},
|
||||
"readiness": {
|
||||
"$ref": "#/definitions/ReviewStoryStepReadiness"
|
||||
},
|
||||
"reviewFocus": {
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"stepId": {
|
||||
"type": "string"
|
||||
},
|
||||
"summary": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"anchorIds",
|
||||
"dependencyRationale",
|
||||
"goal",
|
||||
"index",
|
||||
"readiness",
|
||||
"reviewFocus",
|
||||
"stepId",
|
||||
"summary",
|
||||
"title"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"ReviewStoryStepReadiness": {
|
||||
"enum": [
|
||||
"outline",
|
||||
"enriching",
|
||||
"ready",
|
||||
"failed"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"ReviewTarget": {
|
||||
"oneOf": [
|
||||
{
|
||||
"description": "Review the working tree: staged, unstaged, and untracked files.",
|
||||
"properties": {
|
||||
"type": {
|
||||
"enum": [
|
||||
"uncommittedChanges"
|
||||
],
|
||||
"title": "UncommittedChangesReviewTargetType",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"type"
|
||||
],
|
||||
"title": "UncommittedChangesReviewTarget",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"description": "Review changes between the current branch and the given base branch.",
|
||||
"properties": {
|
||||
"branch": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"baseBranch"
|
||||
],
|
||||
"title": "BaseBranchReviewTargetType",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"branch",
|
||||
"type"
|
||||
],
|
||||
"title": "BaseBranchReviewTarget",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"description": "Review the changes introduced by a specific commit.",
|
||||
"properties": {
|
||||
"sha": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"description": "Optional human-readable label (e.g., commit subject) for UIs.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"commit"
|
||||
],
|
||||
"title": "CommitReviewTargetType",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"sha",
|
||||
"type"
|
||||
],
|
||||
"title": "CommitReviewTarget",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"description": "Arbitrary instructions, equivalent to the old free-form prompt.",
|
||||
"properties": {
|
||||
"instructions": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"custom"
|
||||
],
|
||||
"title": "CustomReviewTargetType",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"instructions",
|
||||
"type"
|
||||
],
|
||||
"title": "CustomReviewTarget",
|
||||
"type": "object"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"snapshot": {
|
||||
"$ref": "#/definitions/ReviewStorySnapshot"
|
||||
},
|
||||
"threadId": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"snapshot",
|
||||
"threadId"
|
||||
],
|
||||
"title": "ReviewStorySnapshotUpdatedNotification",
|
||||
"type": "object"
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"definitions": {
|
||||
"ReviewTarget": {
|
||||
"oneOf": [
|
||||
{
|
||||
"description": "Review the working tree: staged, unstaged, and untracked files.",
|
||||
"properties": {
|
||||
"type": {
|
||||
"enum": [
|
||||
"uncommittedChanges"
|
||||
],
|
||||
"title": "UncommittedChangesReviewTargetType",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"type"
|
||||
],
|
||||
"title": "UncommittedChangesReviewTarget",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"description": "Review changes between the current branch and the given base branch.",
|
||||
"properties": {
|
||||
"branch": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"baseBranch"
|
||||
],
|
||||
"title": "BaseBranchReviewTargetType",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"branch",
|
||||
"type"
|
||||
],
|
||||
"title": "BaseBranchReviewTarget",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"description": "Review the changes introduced by a specific commit.",
|
||||
"properties": {
|
||||
"sha": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"description": "Optional human-readable label (e.g., commit subject) for UIs.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"commit"
|
||||
],
|
||||
"title": "CommitReviewTargetType",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"sha",
|
||||
"type"
|
||||
],
|
||||
"title": "CommitReviewTarget",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"description": "Arbitrary instructions, equivalent to the old free-form prompt.",
|
||||
"properties": {
|
||||
"instructions": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"custom"
|
||||
],
|
||||
"title": "CustomReviewTargetType",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"instructions",
|
||||
"type"
|
||||
],
|
||||
"title": "CustomReviewTarget",
|
||||
"type": "object"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"target": {
|
||||
"$ref": "#/definitions/ReviewTarget"
|
||||
},
|
||||
"threadId": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"target",
|
||||
"threadId"
|
||||
],
|
||||
"title": "ReviewStoryStartParams",
|
||||
"type": "object"
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,6 @@
|
||||
// GENERATED CODE! DO NOT MODIFY BY HAND!
|
||||
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { ReviewStoryAnchorKind } from "./ReviewStoryAnchorKind";
|
||||
|
||||
export type ReviewStoryAnchor = { anchorId: string, filePath: string, changeKind: ReviewStoryAnchorKind, summary: string, diff: string, };
|
||||
@@ -0,0 +1,5 @@
|
||||
// GENERATED CODE! DO NOT MODIFY BY HAND!
|
||||
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export type ReviewStoryAnchorKind = "added" | "modified" | "deleted" | "renamed" | "copied" | "unknown";
|
||||
@@ -0,0 +1,5 @@
|
||||
// GENERATED CODE! DO NOT MODIFY BY HAND!
|
||||
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export type ReviewStoryListParams = { threadId: string, cursor?: string | null, limit?: number | null, };
|
||||
@@ -0,0 +1,6 @@
|
||||
// GENERATED CODE! DO NOT MODIFY BY HAND!
|
||||
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { ReviewStorySnapshotSummary } from "./ReviewStorySnapshotSummary";
|
||||
|
||||
export type ReviewStoryListResponse = { data: Array<ReviewStorySnapshotSummary>, nextCursor: string | null, };
|
||||
@@ -0,0 +1,5 @@
|
||||
// GENERATED CODE! DO NOT MODIFY BY HAND!
|
||||
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export type ReviewStoryReadParams = { threadId: string, storySnapshotId: string, };
|
||||
@@ -0,0 +1,6 @@
|
||||
// GENERATED CODE! DO NOT MODIFY BY HAND!
|
||||
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { ReviewStorySnapshot } from "./ReviewStorySnapshot";
|
||||
|
||||
export type ReviewStoryReadResponse = { snapshot: ReviewStorySnapshot | null, };
|
||||
@@ -0,0 +1,9 @@
|
||||
// GENERATED CODE! DO NOT MODIFY BY HAND!
|
||||
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { ReviewStoryAnchor } from "./ReviewStoryAnchor";
|
||||
import type { ReviewStorySnapshotStatus } from "./ReviewStorySnapshotStatus";
|
||||
import type { ReviewStoryStep } from "./ReviewStoryStep";
|
||||
import type { ReviewTarget } from "./ReviewTarget";
|
||||
|
||||
export type ReviewStorySnapshot = { storySnapshotId: string, threadId: string, title: string, overview: string, target: ReviewTarget, sourceFingerprint: string, status: ReviewStorySnapshotStatus, createdAt: bigint, updatedAt: bigint, previousStorySnapshotId: string | null, stale: boolean, steps: Array<ReviewStoryStep>, anchors: Array<ReviewStoryAnchor>, };
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// GENERATED CODE! DO NOT MODIFY BY HAND!
|
||||
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export type ReviewStorySnapshotStatus = "building" | "ready" | "partial" | "failed";
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// GENERATED CODE! DO NOT MODIFY BY HAND!
|
||||
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { ReviewStorySnapshotStatus } from "./ReviewStorySnapshotStatus";
|
||||
import type { ReviewTarget } from "./ReviewTarget";
|
||||
|
||||
export type ReviewStorySnapshotSummary = { storySnapshotId: string, threadId: string, title: string, target: ReviewTarget, sourceFingerprint: string, status: ReviewStorySnapshotStatus, createdAt: bigint, updatedAt: bigint, previousStorySnapshotId: string | null, stepCount: number, };
|
||||
Generated
+6
@@ -0,0 +1,6 @@
|
||||
// GENERATED CODE! DO NOT MODIFY BY HAND!
|
||||
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { ReviewStorySnapshot } from "./ReviewStorySnapshot";
|
||||
|
||||
export type ReviewStorySnapshotUpdatedNotification = { threadId: string, snapshot: ReviewStorySnapshot, };
|
||||
@@ -0,0 +1,6 @@
|
||||
// GENERATED CODE! DO NOT MODIFY BY HAND!
|
||||
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { ReviewTarget } from "./ReviewTarget";
|
||||
|
||||
export type ReviewStoryStartParams = { threadId: string, target: ReviewTarget, };
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// GENERATED CODE! DO NOT MODIFY BY HAND!
|
||||
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { ReviewStorySnapshot } from "./ReviewStorySnapshot";
|
||||
import type { Turn } from "./Turn";
|
||||
|
||||
export type ReviewStoryStartResponse = { turn: Turn, storySnapshotId: string, snapshot: ReviewStorySnapshot, };
|
||||
@@ -0,0 +1,6 @@
|
||||
// GENERATED CODE! DO NOT MODIFY BY HAND!
|
||||
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { ReviewStoryStepReadiness } from "./ReviewStoryStepReadiness";
|
||||
|
||||
export type ReviewStoryStep = { stepId: string, index: number, title: string, goal: string, summary: string, dependencyRationale: string, anchorIds: Array<string>, reviewFocus: Array<string>, readiness: ReviewStoryStepReadiness, error: string | null, };
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// GENERATED CODE! DO NOT MODIFY BY HAND!
|
||||
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export type ReviewStoryStepReadiness = "outline" | "enriching" | "ready" | "failed";
|
||||
@@ -323,6 +323,20 @@ export type { ResidencyRequirement } from "./ResidencyRequirement";
|
||||
export type { ReviewDelivery } from "./ReviewDelivery";
|
||||
export type { ReviewStartParams } from "./ReviewStartParams";
|
||||
export type { ReviewStartResponse } from "./ReviewStartResponse";
|
||||
export type { ReviewStoryAnchor } from "./ReviewStoryAnchor";
|
||||
export type { ReviewStoryAnchorKind } from "./ReviewStoryAnchorKind";
|
||||
export type { ReviewStoryListParams } from "./ReviewStoryListParams";
|
||||
export type { ReviewStoryListResponse } from "./ReviewStoryListResponse";
|
||||
export type { ReviewStoryReadParams } from "./ReviewStoryReadParams";
|
||||
export type { ReviewStoryReadResponse } from "./ReviewStoryReadResponse";
|
||||
export type { ReviewStorySnapshot } from "./ReviewStorySnapshot";
|
||||
export type { ReviewStorySnapshotStatus } from "./ReviewStorySnapshotStatus";
|
||||
export type { ReviewStorySnapshotSummary } from "./ReviewStorySnapshotSummary";
|
||||
export type { ReviewStorySnapshotUpdatedNotification } from "./ReviewStorySnapshotUpdatedNotification";
|
||||
export type { ReviewStoryStartParams } from "./ReviewStoryStartParams";
|
||||
export type { ReviewStoryStartResponse } from "./ReviewStoryStartResponse";
|
||||
export type { ReviewStoryStep } from "./ReviewStoryStep";
|
||||
export type { ReviewStoryStepReadiness } from "./ReviewStoryStepReadiness";
|
||||
export type { ReviewTarget } from "./ReviewTarget";
|
||||
export type { SandboxMode } from "./SandboxMode";
|
||||
export type { SandboxPolicy } from "./SandboxPolicy";
|
||||
|
||||
@@ -794,6 +794,21 @@ client_request_definitions! {
|
||||
serialization: thread_id(params.thread_id),
|
||||
response: v2::ReviewStartResponse,
|
||||
},
|
||||
ReviewStoryStart => "reviewStory/start" {
|
||||
params: v2::ReviewStoryStartParams,
|
||||
serialization: thread_id(params.thread_id),
|
||||
response: v2::ReviewStoryStartResponse,
|
||||
},
|
||||
ReviewStoryRead => "reviewStory/read" {
|
||||
params: v2::ReviewStoryReadParams,
|
||||
serialization: thread_id(params.thread_id),
|
||||
response: v2::ReviewStoryReadResponse,
|
||||
},
|
||||
ReviewStoryList => "reviewStory/list" {
|
||||
params: v2::ReviewStoryListParams,
|
||||
serialization: thread_id(params.thread_id),
|
||||
response: v2::ReviewStoryListResponse,
|
||||
},
|
||||
|
||||
ModelList => "model/list" {
|
||||
params: v2::ModelListParams,
|
||||
@@ -1484,6 +1499,7 @@ server_notification_definitions! {
|
||||
TurnStarted => "turn/started" (v2::TurnStartedNotification),
|
||||
HookStarted => "hook/started" (v2::HookStartedNotification),
|
||||
TurnCompleted => "turn/completed" (v2::TurnCompletedNotification),
|
||||
ReviewStorySnapshotUpdated => "reviewStory/snapshot/updated" (v2::ReviewStorySnapshotUpdatedNotification),
|
||||
HookCompleted => "hook/completed" (v2::HookCompletedNotification),
|
||||
TurnDiffUpdated => "turn/diff/updated" (v2::TurnDiffUpdatedNotification),
|
||||
TurnPlanUpdated => "turn/plan/updated" (v2::TurnPlanUpdatedNotification),
|
||||
|
||||
@@ -21,6 +21,7 @@ mod process;
|
||||
mod realtime;
|
||||
mod remote_control;
|
||||
mod review;
|
||||
mod review_story;
|
||||
mod thread;
|
||||
mod thread_data;
|
||||
mod turn;
|
||||
@@ -47,6 +48,7 @@ pub use process::*;
|
||||
pub use realtime::*;
|
||||
pub use remote_control::*;
|
||||
pub use review::*;
|
||||
pub use review_story::*;
|
||||
pub use shared::*;
|
||||
pub use thread::*;
|
||||
pub use thread_data::*;
|
||||
|
||||
@@ -0,0 +1,161 @@
|
||||
use super::ReviewTarget;
|
||||
use super::Turn;
|
||||
use schemars::JsonSchema;
|
||||
use serde::Deserialize;
|
||||
use serde::Serialize;
|
||||
use ts_rs::TS;
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
pub struct ReviewStoryStartParams {
|
||||
pub thread_id: String,
|
||||
pub target: ReviewTarget,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
pub struct ReviewStoryStartResponse {
|
||||
pub turn: Turn,
|
||||
pub story_snapshot_id: String,
|
||||
pub snapshot: ReviewStorySnapshot,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
pub struct ReviewStoryReadParams {
|
||||
pub thread_id: String,
|
||||
pub story_snapshot_id: String,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
pub struct ReviewStoryReadResponse {
|
||||
pub snapshot: Option<ReviewStorySnapshot>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
pub struct ReviewStoryListParams {
|
||||
pub thread_id: String,
|
||||
|
||||
#[ts(optional = nullable)]
|
||||
pub cursor: Option<String>,
|
||||
|
||||
#[ts(optional = nullable)]
|
||||
pub limit: Option<u32>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
pub struct ReviewStoryListResponse {
|
||||
pub data: Vec<ReviewStorySnapshotSummary>,
|
||||
pub next_cursor: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
pub struct ReviewStorySnapshotUpdatedNotification {
|
||||
pub thread_id: String,
|
||||
pub snapshot: ReviewStorySnapshot,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
pub struct ReviewStorySnapshotSummary {
|
||||
pub story_snapshot_id: String,
|
||||
pub thread_id: String,
|
||||
pub title: String,
|
||||
pub target: ReviewTarget,
|
||||
pub source_fingerprint: String,
|
||||
pub status: ReviewStorySnapshotStatus,
|
||||
pub created_at: i64,
|
||||
pub updated_at: i64,
|
||||
pub previous_story_snapshot_id: Option<String>,
|
||||
pub step_count: u32,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
pub struct ReviewStorySnapshot {
|
||||
pub story_snapshot_id: String,
|
||||
pub thread_id: String,
|
||||
pub title: String,
|
||||
pub overview: String,
|
||||
pub target: ReviewTarget,
|
||||
pub source_fingerprint: String,
|
||||
pub status: ReviewStorySnapshotStatus,
|
||||
pub created_at: i64,
|
||||
pub updated_at: i64,
|
||||
pub previous_story_snapshot_id: Option<String>,
|
||||
pub stale: bool,
|
||||
pub steps: Vec<ReviewStoryStep>,
|
||||
pub anchors: Vec<ReviewStoryAnchor>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
pub enum ReviewStorySnapshotStatus {
|
||||
Building,
|
||||
Ready,
|
||||
Partial,
|
||||
Failed,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
pub struct ReviewStoryStep {
|
||||
pub step_id: String,
|
||||
pub index: u32,
|
||||
pub title: String,
|
||||
pub goal: String,
|
||||
pub summary: String,
|
||||
pub dependency_rationale: String,
|
||||
pub anchor_ids: Vec<String>,
|
||||
pub review_focus: Vec<String>,
|
||||
pub readiness: ReviewStoryStepReadiness,
|
||||
pub error: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
pub enum ReviewStoryStepReadiness {
|
||||
Outline,
|
||||
Enriching,
|
||||
Ready,
|
||||
Failed,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
pub struct ReviewStoryAnchor {
|
||||
pub anchor_id: String,
|
||||
pub file_path: String,
|
||||
pub change_kind: ReviewStoryAnchorKind,
|
||||
pub summary: String,
|
||||
pub diff: String,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
pub enum ReviewStoryAnchorKind {
|
||||
Added,
|
||||
Modified,
|
||||
Deleted,
|
||||
Renamed,
|
||||
Copied,
|
||||
Unknown,
|
||||
}
|
||||
@@ -76,6 +76,7 @@ clap = { workspace = true, features = ["derive"] }
|
||||
futures = { workspace = true }
|
||||
serde = { workspace = true, features = ["derive"] }
|
||||
serde_json = { workspace = true }
|
||||
sha2 = { workspace = true }
|
||||
tempfile = { workspace = true }
|
||||
thiserror = { workspace = true }
|
||||
time = { workspace = true }
|
||||
|
||||
@@ -167,6 +167,7 @@ Example with notification opt-out:
|
||||
- `thread/realtime/appendText` — append text input to the active realtime session (experimental); returns `{}`.
|
||||
- `thread/realtime/stop` — stop the active realtime session for the thread (experimental); returns `{}`.
|
||||
- `review/start` — kick off Codex’s automated reviewer for a thread; responds like `turn/start` and emits `item/started`/`item/completed` notifications with `enteredReviewMode` and `exitedReviewMode` items, plus a final assistant `agentMessage` containing the review.
|
||||
- `reviewStory/start` — build a persisted, read-only review story for a concrete source (`uncommittedChanges`, `baseBranch`, or `commit`). Codex collects stable change anchors from the diff, asks a constrained model task to group those anchors into cohesive story steps, validates that every model-referenced anchor exists, and falls back to file-level steps if model generation is unavailable. The response includes the initial `storySnapshot`, and the server emits `reviewStory/snapshot/updated` whenever a snapshot is written. Use `reviewStory/read` to fetch a snapshot by id and `reviewStory/list` to page saved stories for a thread.
|
||||
- `command/exec` — run a single command under the server sandbox without starting a thread/turn (handy for utilities and validation).
|
||||
- `command/exec/write` — write base64-decoded stdin bytes to a running `command/exec` session or close stdin; returns `{}`.
|
||||
- `command/exec/resize` — resize a running PTY-backed `command/exec` session by `processId`; returns `{}`.
|
||||
|
||||
@@ -31,6 +31,7 @@ use crate::request_processors::McpRequestProcessor;
|
||||
use crate::request_processors::PluginRequestProcessor;
|
||||
use crate::request_processors::ProcessExecRequestProcessor;
|
||||
use crate::request_processors::RemoteControlRequestProcessor;
|
||||
use crate::request_processors::ReviewStoryRequestProcessor;
|
||||
use crate::request_processors::SearchRequestProcessor;
|
||||
use crate::request_processors::ThreadGoalRequestProcessor;
|
||||
use crate::request_processors::ThreadRequestProcessor;
|
||||
@@ -177,6 +178,7 @@ pub(crate) struct MessageProcessor {
|
||||
mcp_processor: McpRequestProcessor,
|
||||
plugin_processor: PluginRequestProcessor,
|
||||
remote_control_processor: RemoteControlRequestProcessor,
|
||||
review_story_processor: ReviewStoryRequestProcessor,
|
||||
search_processor: SearchRequestProcessor,
|
||||
thread_goal_processor: ThreadGoalRequestProcessor,
|
||||
thread_processor: ThreadRequestProcessor,
|
||||
@@ -402,6 +404,11 @@ impl MessageProcessor {
|
||||
workspace_settings_cache,
|
||||
);
|
||||
let remote_control_processor = RemoteControlRequestProcessor::new(remote_control_handle);
|
||||
let review_story_processor = ReviewStoryRequestProcessor::new(
|
||||
Arc::clone(&thread_manager),
|
||||
outgoing.clone(),
|
||||
state_db.clone(),
|
||||
);
|
||||
let search_processor = SearchRequestProcessor::new(outgoing.clone());
|
||||
let thread_goal_processor = ThreadGoalRequestProcessor::new(
|
||||
Arc::clone(&thread_manager),
|
||||
@@ -498,6 +505,7 @@ impl MessageProcessor {
|
||||
mcp_processor,
|
||||
plugin_processor,
|
||||
remote_control_processor,
|
||||
review_story_processor,
|
||||
search_processor,
|
||||
thread_goal_processor,
|
||||
thread_processor,
|
||||
@@ -1222,6 +1230,15 @@ impl MessageProcessor {
|
||||
ClientRequest::ReviewStart { params, .. } => {
|
||||
self.turn_processor.review_start(&request_id, params).await
|
||||
}
|
||||
ClientRequest::ReviewStoryStart { params, .. } => {
|
||||
self.review_story_processor.start(&request_id, params).await
|
||||
}
|
||||
ClientRequest::ReviewStoryRead { params, .. } => {
|
||||
self.review_story_processor.read(params).await
|
||||
}
|
||||
ClientRequest::ReviewStoryList { params, .. } => {
|
||||
self.review_story_processor.list(params).await
|
||||
}
|
||||
ClientRequest::McpServerOauthLogin { params, .. } => {
|
||||
self.mcp_processor.mcp_server_oauth_login(params).await
|
||||
}
|
||||
|
||||
@@ -466,6 +466,7 @@ mod mcp_processor;
|
||||
mod plugins;
|
||||
mod process_exec_processor;
|
||||
mod remote_control_processor;
|
||||
mod review_story_processor;
|
||||
mod search;
|
||||
mod thread_processor;
|
||||
mod token_usage_replay;
|
||||
@@ -488,6 +489,7 @@ pub(crate) use mcp_processor::McpRequestProcessor;
|
||||
pub(crate) use plugins::PluginRequestProcessor;
|
||||
pub(crate) use process_exec_processor::ProcessExecRequestProcessor;
|
||||
pub(crate) use remote_control_processor::RemoteControlRequestProcessor;
|
||||
pub(crate) use review_story_processor::ReviewStoryRequestProcessor;
|
||||
pub(crate) use search::SearchRequestProcessor;
|
||||
pub(crate) use thread_goal_processor::ThreadGoalRequestProcessor;
|
||||
pub(crate) use thread_processor::ThreadRequestProcessor;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,6 @@
|
||||
use crate::agent::AgentStatus;
|
||||
use crate::codex_delegate::run_codex_thread_one_shot;
|
||||
use crate::config::Constrained;
|
||||
use crate::config::ConstraintResult;
|
||||
use crate::goals::ExternalGoalSet;
|
||||
use crate::goals::GoalRuntimeEvent;
|
||||
@@ -11,6 +13,7 @@ use codex_protocol::config_types::ApprovalsReviewer;
|
||||
use codex_protocol::config_types::CollaborationMode;
|
||||
use codex_protocol::config_types::Personality;
|
||||
use codex_protocol::config_types::ReasoningSummary;
|
||||
use codex_protocol::config_types::WebSearchMode;
|
||||
use codex_protocol::config_types::WindowsSandboxLevel;
|
||||
use codex_protocol::error::CodexErr;
|
||||
use codex_protocol::error::Result as CodexResult;
|
||||
@@ -23,10 +26,12 @@ use codex_protocol::models::ResponseItem;
|
||||
use codex_protocol::openai_models::ReasoningEffort;
|
||||
use codex_protocol::protocol::AskForApproval;
|
||||
use codex_protocol::protocol::Event;
|
||||
use codex_protocol::protocol::EventMsg;
|
||||
use codex_protocol::protocol::Op;
|
||||
use codex_protocol::protocol::SandboxPolicy;
|
||||
use codex_protocol::protocol::SessionConfiguredEvent;
|
||||
use codex_protocol::protocol::SessionSource;
|
||||
use codex_protocol::protocol::SubAgentSource;
|
||||
use codex_protocol::protocol::Submission;
|
||||
use codex_protocol::protocol::ThreadMemoryMode;
|
||||
use codex_protocol::protocol::ThreadSource;
|
||||
@@ -41,11 +46,13 @@ use codex_thread_store::ThreadStoreError;
|
||||
use codex_thread_store::ThreadStoreResult;
|
||||
use codex_utils_absolute_path::AbsolutePathBuf;
|
||||
use rmcp::model::ReadResourceRequestParams;
|
||||
use serde_json::Value;
|
||||
use std::collections::HashMap;
|
||||
use std::path::PathBuf;
|
||||
use std::sync::Arc;
|
||||
use tokio::sync::Mutex;
|
||||
use tokio::sync::watch;
|
||||
use tokio_util::sync::CancellationToken;
|
||||
|
||||
use codex_rollout::state_db::StateDbHandle;
|
||||
|
||||
@@ -502,6 +509,68 @@ impl CodexThread {
|
||||
self.codex.session.get_config().await
|
||||
}
|
||||
|
||||
/// Run a short-lived model task that produces structured JSON for a caller-owned workflow.
|
||||
///
|
||||
/// This keeps app-server features from needing to know how to spawn sub-agents while still
|
||||
/// reusing the same constrained delegate machinery as review mode.
|
||||
pub async fn run_structured_model_task(
|
||||
&self,
|
||||
prompt: String,
|
||||
base_instructions: String,
|
||||
final_output_json_schema: Value,
|
||||
subagent_source: SubAgentSource,
|
||||
) -> CodexResult<Option<String>> {
|
||||
let ctx = self
|
||||
.codex
|
||||
.session
|
||||
.new_default_turn_with_sub_id(format!("structured-task-{}", uuid::Uuid::now_v7()))
|
||||
.await;
|
||||
let mut sub_agent_config = ctx.config.as_ref().clone();
|
||||
if let Err(err) = sub_agent_config
|
||||
.web_search_mode
|
||||
.set(WebSearchMode::Disabled)
|
||||
{
|
||||
panic!(
|
||||
"by construction Constrained<WebSearchMode> must always support Disabled: {err}"
|
||||
);
|
||||
}
|
||||
let _ = sub_agent_config.features.disable(Feature::SpawnCsv);
|
||||
let _ = sub_agent_config.features.disable(Feature::Collab);
|
||||
let _ = sub_agent_config.features.disable(Feature::MultiAgentV2);
|
||||
sub_agent_config.permissions.approval_policy =
|
||||
Constrained::allow_only(AskForApproval::Never);
|
||||
sub_agent_config.base_instructions = Some(base_instructions);
|
||||
let input = vec![UserInput::Text {
|
||||
text: prompt,
|
||||
text_elements: Vec::new(),
|
||||
}];
|
||||
let io = run_codex_thread_one_shot(
|
||||
sub_agent_config,
|
||||
Arc::clone(&self.codex.session.services.auth_manager),
|
||||
Arc::clone(&self.codex.session.services.models_manager),
|
||||
input,
|
||||
Arc::clone(&self.codex.session),
|
||||
ctx,
|
||||
CancellationToken::new(),
|
||||
subagent_source,
|
||||
Some(final_output_json_schema),
|
||||
/*initial_history*/ None,
|
||||
)
|
||||
.await?;
|
||||
while let Ok(event) = io.next_event().await {
|
||||
match event.msg {
|
||||
EventMsg::TurnComplete(turn_complete) => {
|
||||
return Ok(turn_complete.last_agent_message);
|
||||
}
|
||||
EventMsg::TurnAborted(_) => {
|
||||
return Ok(None);
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
Ok(None)
|
||||
}
|
||||
|
||||
/// Refresh the thread's layer-backed user config state from a caller-supplied
|
||||
/// config snapshot. Thread-scoped layers and session-static settings remain
|
||||
/// unchanged.
|
||||
|
||||
@@ -3,5 +3,5 @@ load("//:defs.bzl", "codex_rust_crate")
|
||||
codex_rust_crate(
|
||||
name = "state",
|
||||
crate_name = "codex_state",
|
||||
compile_data = glob(["goals_migrations/**", "logs_migrations/**", "migrations/**"]),
|
||||
compile_data = glob(["goals_migrations/**", "logs_migrations/**", "migrations/**", "review_story_migrations/**"]),
|
||||
)
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
CREATE TABLE IF NOT EXISTS review_story_snapshots (
|
||||
story_snapshot_id TEXT PRIMARY KEY NOT NULL,
|
||||
thread_id TEXT NOT NULL,
|
||||
source_fingerprint TEXT NOT NULL,
|
||||
status TEXT NOT NULL,
|
||||
title TEXT NOT NULL,
|
||||
step_count INTEGER NOT NULL,
|
||||
target_json TEXT NOT NULL,
|
||||
snapshot_json TEXT NOT NULL,
|
||||
previous_story_snapshot_id TEXT,
|
||||
created_at_ms INTEGER NOT NULL,
|
||||
updated_at_ms INTEGER NOT NULL
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS review_story_snapshots_thread_updated_idx
|
||||
ON review_story_snapshots(thread_id, updated_at_ms DESC, story_snapshot_id DESC);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS review_story_snapshots_thread_fingerprint_idx
|
||||
ON review_story_snapshots(thread_id, source_fingerprint, updated_at_ms DESC);
|
||||
@@ -53,12 +53,17 @@ pub use runtime::GoalAccountingOutcome;
|
||||
pub use runtime::GoalStore;
|
||||
pub use runtime::GoalUpdate;
|
||||
pub use runtime::RemoteControlEnrollmentRecord;
|
||||
pub use runtime::ReviewStoryRecord;
|
||||
pub use runtime::ReviewStoryStore;
|
||||
pub use runtime::ReviewStorySummaryRecord;
|
||||
pub use runtime::RuntimeDbPath;
|
||||
pub use runtime::ThreadFilterOptions;
|
||||
pub use runtime::goals_db_filename;
|
||||
pub use runtime::goals_db_path;
|
||||
pub use runtime::logs_db_filename;
|
||||
pub use runtime::logs_db_path;
|
||||
pub use runtime::review_story_db_filename;
|
||||
pub use runtime::review_story_db_path;
|
||||
pub use runtime::runtime_db_paths;
|
||||
pub use runtime::sqlite_integrity_check;
|
||||
pub use runtime::state_db_filename;
|
||||
@@ -74,6 +79,7 @@ pub const SQLITE_HOME_ENV: &str = "CODEX_SQLITE_HOME";
|
||||
|
||||
pub const LOGS_DB_FILENAME: &str = "logs_2.sqlite";
|
||||
pub const GOALS_DB_FILENAME: &str = "goals_1.sqlite";
|
||||
pub const REVIEW_STORY_DB_FILENAME: &str = "review_stories_1.sqlite";
|
||||
pub const STATE_DB_FILENAME: &str = "state_5.sqlite";
|
||||
|
||||
/// Errors encountered during DB operations. Tags: [stage]
|
||||
|
||||
@@ -5,6 +5,7 @@ use sqlx::migrate::Migrator;
|
||||
pub(crate) static STATE_MIGRATOR: Migrator = sqlx::migrate!("./migrations");
|
||||
pub(crate) static LOGS_MIGRATOR: Migrator = sqlx::migrate!("./logs_migrations");
|
||||
pub(crate) static GOALS_MIGRATOR: Migrator = sqlx::migrate!("./goals_migrations");
|
||||
pub(crate) static REVIEW_STORY_MIGRATOR: Migrator = sqlx::migrate!("./review_story_migrations");
|
||||
|
||||
/// Allow an older Codex binary to open a database that has already been
|
||||
/// migrated by a newer binary running in parallel.
|
||||
@@ -32,3 +33,7 @@ pub(crate) fn runtime_logs_migrator() -> Migrator {
|
||||
pub(crate) fn runtime_goals_migrator() -> Migrator {
|
||||
runtime_migrator(&GOALS_MIGRATOR)
|
||||
}
|
||||
|
||||
pub(crate) fn runtime_review_story_migrator() -> Migrator {
|
||||
runtime_migrator(&REVIEW_STORY_MIGRATOR)
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ use crate::LOGS_DB_FILENAME;
|
||||
use crate::LogEntry;
|
||||
use crate::LogQuery;
|
||||
use crate::LogRow;
|
||||
use crate::REVIEW_STORY_DB_FILENAME;
|
||||
use crate::STATE_DB_FILENAME;
|
||||
use crate::SortKey;
|
||||
use crate::ThreadMetadata;
|
||||
@@ -18,6 +19,7 @@ use crate::ThreadsPage;
|
||||
use crate::apply_rollout_item;
|
||||
use crate::migrations::runtime_goals_migrator;
|
||||
use crate::migrations::runtime_logs_migrator;
|
||||
use crate::migrations::runtime_review_story_migrator;
|
||||
use crate::migrations::runtime_state_migrator;
|
||||
use crate::model::AgentJobRow;
|
||||
use crate::model::ThreadRow;
|
||||
@@ -62,6 +64,7 @@ mod goals;
|
||||
mod logs;
|
||||
mod memories;
|
||||
mod remote_control;
|
||||
mod review_stories;
|
||||
#[cfg(test)]
|
||||
mod test_support;
|
||||
mod threads;
|
||||
@@ -71,6 +74,9 @@ pub use goals::GoalAccountingOutcome;
|
||||
pub use goals::GoalStore;
|
||||
pub use goals::GoalUpdate;
|
||||
pub use remote_control::RemoteControlEnrollmentRecord;
|
||||
pub use review_stories::ReviewStoryRecord;
|
||||
pub use review_stories::ReviewStoryStore;
|
||||
pub use review_stories::ReviewStorySummaryRecord;
|
||||
pub use threads::ThreadFilterOptions;
|
||||
|
||||
// "Partition" is the retained-log-content bucket we cap at 10 MiB:
|
||||
@@ -121,7 +127,15 @@ const GOALS_DB: RuntimeDbSpec = RuntimeDbSpec {
|
||||
migrate_phase: "migrate_goals",
|
||||
};
|
||||
|
||||
const RUNTIME_DBS: [RuntimeDbSpec; 3] = [STATE_DB, LOGS_DB, GOALS_DB];
|
||||
const REVIEW_STORY_DB: RuntimeDbSpec = RuntimeDbSpec {
|
||||
label: "review story DB",
|
||||
filename: REVIEW_STORY_DB_FILENAME,
|
||||
kind: DbKind::ReviewStories,
|
||||
open_phase: "open_review_stories",
|
||||
migrate_phase: "migrate_review_stories",
|
||||
};
|
||||
|
||||
const RUNTIME_DBS: [RuntimeDbSpec; 4] = [STATE_DB, LOGS_DB, GOALS_DB, REVIEW_STORY_DB];
|
||||
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub struct RuntimeDbPath {
|
||||
@@ -136,6 +150,7 @@ pub struct StateRuntime {
|
||||
pool: Arc<sqlx::SqlitePool>,
|
||||
logs_pool: Arc<sqlx::SqlitePool>,
|
||||
thread_goals: GoalStore,
|
||||
review_stories: ReviewStoryStore,
|
||||
thread_updated_at_millis: Arc<AtomicI64>,
|
||||
}
|
||||
|
||||
@@ -172,9 +187,11 @@ impl StateRuntime {
|
||||
let state_migrator = runtime_state_migrator();
|
||||
let logs_migrator = runtime_logs_migrator();
|
||||
let goals_migrator = runtime_goals_migrator();
|
||||
let review_story_migrator = runtime_review_story_migrator();
|
||||
let state_path = STATE_DB.path(codex_home.as_path());
|
||||
let logs_path = LOGS_DB.path(codex_home.as_path());
|
||||
let goals_path = GOALS_DB.path(codex_home.as_path());
|
||||
let review_story_path = REVIEW_STORY_DB.path(codex_home.as_path());
|
||||
let pool = match open_state_sqlite(&state_path, &state_migrator, telemetry_override).await {
|
||||
Ok(db) => Arc::new(db),
|
||||
Err(err) => {
|
||||
@@ -198,6 +215,22 @@ impl StateRuntime {
|
||||
return Err(err);
|
||||
}
|
||||
};
|
||||
let review_story_pool = match open_review_story_sqlite(
|
||||
&review_story_path,
|
||||
&review_story_migrator,
|
||||
telemetry_override,
|
||||
)
|
||||
.await
|
||||
{
|
||||
Ok(db) => Arc::new(db),
|
||||
Err(err) => {
|
||||
warn!(
|
||||
"failed to open review story db at {}: {err}",
|
||||
review_story_path.display()
|
||||
);
|
||||
return Err(err);
|
||||
}
|
||||
};
|
||||
let started = Instant::now();
|
||||
let backfill_state_result = ensure_backfill_state_row_in_pool(pool.as_ref()).await;
|
||||
crate::telemetry::record_init_result(
|
||||
@@ -225,6 +258,7 @@ impl StateRuntime {
|
||||
let thread_updated_at_millis = thread_updated_at_millis.unwrap_or(0);
|
||||
let runtime = Arc::new(Self {
|
||||
thread_goals: GoalStore::new(Arc::clone(&goals_pool)),
|
||||
review_stories: ReviewStoryStore::new(review_story_pool),
|
||||
pool,
|
||||
logs_pool,
|
||||
codex_home,
|
||||
@@ -248,6 +282,10 @@ impl StateRuntime {
|
||||
pub fn thread_goals(&self) -> &GoalStore {
|
||||
&self.thread_goals
|
||||
}
|
||||
|
||||
pub fn review_stories(&self) -> &ReviewStoryStore {
|
||||
&self.review_stories
|
||||
}
|
||||
}
|
||||
|
||||
fn base_sqlite_options(path: &Path) -> SqliteConnectOptions {
|
||||
@@ -287,6 +325,14 @@ async fn open_goals_sqlite(
|
||||
open_sqlite(path, migrator, GOALS_DB, telemetry_override).await
|
||||
}
|
||||
|
||||
async fn open_review_story_sqlite(
|
||||
path: &Path,
|
||||
migrator: &Migrator,
|
||||
telemetry_override: Option<&dyn DbTelemetry>,
|
||||
) -> anyhow::Result<SqlitePool> {
|
||||
open_sqlite(path, migrator, REVIEW_STORY_DB, telemetry_override).await
|
||||
}
|
||||
|
||||
async fn open_sqlite(
|
||||
path: &Path,
|
||||
migrator: &Migrator,
|
||||
@@ -363,6 +409,14 @@ pub fn goals_db_path(codex_home: &Path) -> PathBuf {
|
||||
GOALS_DB.path(codex_home)
|
||||
}
|
||||
|
||||
pub fn review_story_db_filename() -> String {
|
||||
REVIEW_STORY_DB.filename.to_string()
|
||||
}
|
||||
|
||||
pub fn review_story_db_path(codex_home: &Path) -> PathBuf {
|
||||
REVIEW_STORY_DB.path(codex_home)
|
||||
}
|
||||
|
||||
pub fn runtime_db_paths(codex_home: &Path) -> Vec<RuntimeDbPath> {
|
||||
RUNTIME_DBS
|
||||
.iter()
|
||||
@@ -579,6 +633,8 @@ mod tests {
|
||||
"migrate_logs",
|
||||
"open_goals",
|
||||
"migrate_goals",
|
||||
"open_review_stories",
|
||||
"migrate_review_stories",
|
||||
"ensure_backfill_state",
|
||||
"post_init_query",
|
||||
]
|
||||
|
||||
@@ -0,0 +1,220 @@
|
||||
use super::*;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct ReviewStoryStore {
|
||||
pool: Arc<SqlitePool>,
|
||||
}
|
||||
|
||||
impl ReviewStoryStore {
|
||||
pub(crate) fn new(pool: Arc<SqlitePool>) -> Self {
|
||||
Self { pool }
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub struct ReviewStoryRecord {
|
||||
pub story_snapshot_id: String,
|
||||
pub thread_id: String,
|
||||
pub source_fingerprint: String,
|
||||
pub status: String,
|
||||
pub title: String,
|
||||
pub step_count: i64,
|
||||
pub target_json: Value,
|
||||
pub snapshot_json: Value,
|
||||
pub previous_story_snapshot_id: Option<String>,
|
||||
pub created_at_ms: i64,
|
||||
pub updated_at_ms: i64,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub struct ReviewStorySummaryRecord {
|
||||
pub story_snapshot_id: String,
|
||||
pub thread_id: String,
|
||||
pub source_fingerprint: String,
|
||||
pub status: String,
|
||||
pub title: String,
|
||||
pub step_count: i64,
|
||||
pub target_json: Value,
|
||||
pub previous_story_snapshot_id: Option<String>,
|
||||
pub created_at_ms: i64,
|
||||
pub updated_at_ms: i64,
|
||||
}
|
||||
|
||||
impl ReviewStoryStore {
|
||||
pub async fn upsert_snapshot(&self, record: ReviewStoryRecord) -> anyhow::Result<()> {
|
||||
let ReviewStoryRecord {
|
||||
story_snapshot_id,
|
||||
thread_id,
|
||||
source_fingerprint,
|
||||
status,
|
||||
title,
|
||||
step_count,
|
||||
target_json,
|
||||
snapshot_json,
|
||||
previous_story_snapshot_id,
|
||||
created_at_ms,
|
||||
updated_at_ms,
|
||||
} = record;
|
||||
let target_json = serde_json::to_string(&target_json)?;
|
||||
let snapshot_json = serde_json::to_string(&snapshot_json)?;
|
||||
sqlx::query(
|
||||
r#"
|
||||
INSERT INTO review_story_snapshots (
|
||||
story_snapshot_id,
|
||||
thread_id,
|
||||
source_fingerprint,
|
||||
status,
|
||||
title,
|
||||
step_count,
|
||||
target_json,
|
||||
snapshot_json,
|
||||
previous_story_snapshot_id,
|
||||
created_at_ms,
|
||||
updated_at_ms
|
||||
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
||||
ON CONFLICT(story_snapshot_id) DO UPDATE SET
|
||||
thread_id = excluded.thread_id,
|
||||
source_fingerprint = excluded.source_fingerprint,
|
||||
status = excluded.status,
|
||||
title = excluded.title,
|
||||
step_count = excluded.step_count,
|
||||
target_json = excluded.target_json,
|
||||
snapshot_json = excluded.snapshot_json,
|
||||
previous_story_snapshot_id = excluded.previous_story_snapshot_id,
|
||||
created_at_ms = excluded.created_at_ms,
|
||||
updated_at_ms = excluded.updated_at_ms
|
||||
"#,
|
||||
)
|
||||
.bind(story_snapshot_id)
|
||||
.bind(thread_id)
|
||||
.bind(source_fingerprint)
|
||||
.bind(status)
|
||||
.bind(title)
|
||||
.bind(step_count)
|
||||
.bind(target_json)
|
||||
.bind(snapshot_json)
|
||||
.bind(previous_story_snapshot_id)
|
||||
.bind(created_at_ms)
|
||||
.bind(updated_at_ms)
|
||||
.execute(self.pool.as_ref())
|
||||
.await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn get_snapshot(
|
||||
&self,
|
||||
thread_id: ThreadId,
|
||||
story_snapshot_id: &str,
|
||||
) -> anyhow::Result<Option<ReviewStoryRecord>> {
|
||||
let row = sqlx::query(
|
||||
r#"
|
||||
SELECT
|
||||
story_snapshot_id,
|
||||
thread_id,
|
||||
source_fingerprint,
|
||||
status,
|
||||
title,
|
||||
step_count,
|
||||
target_json,
|
||||
snapshot_json,
|
||||
previous_story_snapshot_id,
|
||||
created_at_ms,
|
||||
updated_at_ms
|
||||
FROM review_story_snapshots
|
||||
WHERE thread_id = ? AND story_snapshot_id = ?
|
||||
"#,
|
||||
)
|
||||
.bind(thread_id.to_string())
|
||||
.bind(story_snapshot_id)
|
||||
.fetch_optional(self.pool.as_ref())
|
||||
.await?;
|
||||
|
||||
row.map(|row| review_story_record_from_row(&row))
|
||||
.transpose()
|
||||
}
|
||||
|
||||
pub async fn list_snapshots(
|
||||
&self,
|
||||
thread_id: ThreadId,
|
||||
cursor: Option<String>,
|
||||
limit: Option<u32>,
|
||||
) -> anyhow::Result<(Vec<ReviewStorySummaryRecord>, Option<String>)> {
|
||||
let limit = limit
|
||||
.unwrap_or(/*default*/ 50)
|
||||
.clamp(/*min*/ 1, /*max*/ 100);
|
||||
let offset = cursor
|
||||
.as_deref()
|
||||
.and_then(|cursor| cursor.parse::<u32>().ok())
|
||||
.unwrap_or(/*default*/ 0);
|
||||
let rows = sqlx::query(
|
||||
r#"
|
||||
SELECT
|
||||
story_snapshot_id,
|
||||
thread_id,
|
||||
source_fingerprint,
|
||||
status,
|
||||
title,
|
||||
step_count,
|
||||
target_json,
|
||||
previous_story_snapshot_id,
|
||||
created_at_ms,
|
||||
updated_at_ms
|
||||
FROM review_story_snapshots
|
||||
WHERE thread_id = ?
|
||||
ORDER BY updated_at_ms DESC, story_snapshot_id DESC
|
||||
LIMIT ? OFFSET ?
|
||||
"#,
|
||||
)
|
||||
.bind(thread_id.to_string())
|
||||
.bind(i64::from(limit) + 1)
|
||||
.bind(i64::from(offset))
|
||||
.fetch_all(self.pool.as_ref())
|
||||
.await?;
|
||||
|
||||
let has_next = rows.len() > limit as usize;
|
||||
let rows = rows.into_iter().take(limit as usize);
|
||||
let records = rows
|
||||
.map(|row| review_story_summary_record_from_row(&row))
|
||||
.collect::<anyhow::Result<Vec<_>>>()?;
|
||||
let next_cursor = has_next.then(|| (offset + limit).to_string());
|
||||
Ok((records, next_cursor))
|
||||
}
|
||||
}
|
||||
|
||||
fn review_story_record_from_row(
|
||||
row: &sqlx::sqlite::SqliteRow,
|
||||
) -> anyhow::Result<ReviewStoryRecord> {
|
||||
let target_json: String = row.try_get("target_json")?;
|
||||
let snapshot_json: String = row.try_get("snapshot_json")?;
|
||||
Ok(ReviewStoryRecord {
|
||||
story_snapshot_id: row.try_get("story_snapshot_id")?,
|
||||
thread_id: row.try_get("thread_id")?,
|
||||
source_fingerprint: row.try_get("source_fingerprint")?,
|
||||
status: row.try_get("status")?,
|
||||
title: row.try_get("title")?,
|
||||
step_count: row.try_get("step_count")?,
|
||||
target_json: serde_json::from_str(&target_json)?,
|
||||
snapshot_json: serde_json::from_str(&snapshot_json)?,
|
||||
previous_story_snapshot_id: row.try_get("previous_story_snapshot_id")?,
|
||||
created_at_ms: row.try_get("created_at_ms")?,
|
||||
updated_at_ms: row.try_get("updated_at_ms")?,
|
||||
})
|
||||
}
|
||||
|
||||
fn review_story_summary_record_from_row(
|
||||
row: &sqlx::sqlite::SqliteRow,
|
||||
) -> anyhow::Result<ReviewStorySummaryRecord> {
|
||||
let target_json: String = row.try_get("target_json")?;
|
||||
Ok(ReviewStorySummaryRecord {
|
||||
story_snapshot_id: row.try_get("story_snapshot_id")?,
|
||||
thread_id: row.try_get("thread_id")?,
|
||||
source_fingerprint: row.try_get("source_fingerprint")?,
|
||||
status: row.try_get("status")?,
|
||||
title: row.try_get("title")?,
|
||||
step_count: row.try_get("step_count")?,
|
||||
target_json: serde_json::from_str(&target_json)?,
|
||||
previous_story_snapshot_id: row.try_get("previous_story_snapshot_id")?,
|
||||
created_at_ms: row.try_get("created_at_ms")?,
|
||||
updated_at_ms: row.try_get("updated_at_ms")?,
|
||||
})
|
||||
}
|
||||
@@ -40,6 +40,7 @@ pub(crate) enum DbKind {
|
||||
State,
|
||||
Logs,
|
||||
Goals,
|
||||
ReviewStories,
|
||||
}
|
||||
|
||||
impl DbKind {
|
||||
@@ -48,6 +49,7 @@ impl DbKind {
|
||||
Self::State => "state",
|
||||
Self::Logs => "logs",
|
||||
Self::Goals => "goals",
|
||||
Self::ReviewStories => "review_stories",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,6 +68,9 @@ pub(super) fn server_notification_thread_target(
|
||||
ServerNotification::TurnStarted(notification) => Some(notification.thread_id.as_str()),
|
||||
ServerNotification::HookStarted(notification) => Some(notification.thread_id.as_str()),
|
||||
ServerNotification::TurnCompleted(notification) => Some(notification.thread_id.as_str()),
|
||||
ServerNotification::ReviewStorySnapshotUpdated(notification) => {
|
||||
Some(notification.thread_id.as_str())
|
||||
}
|
||||
ServerNotification::HookCompleted(notification) => Some(notification.thread_id.as_str()),
|
||||
ServerNotification::TurnDiffUpdated(notification) => Some(notification.thread_id.as_str()),
|
||||
ServerNotification::TurnPlanUpdated(notification) => Some(notification.thread_id.as_str()),
|
||||
|
||||
@@ -219,6 +219,7 @@ impl ChatWidget {
|
||||
| ServerNotification::AccountUpdated(_)
|
||||
| ServerNotification::AccountRateLimitsUpdated(_)
|
||||
| ServerNotification::ThreadStarted(_)
|
||||
| ServerNotification::ReviewStorySnapshotUpdated(_)
|
||||
| ServerNotification::ThreadStatusChanged(_)
|
||||
| ServerNotification::ThreadArchived(_)
|
||||
| ServerNotification::ThreadUnarchived(_)
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
# Review Story API Foundation
|
||||
|
||||
Status: accepted
|
||||
|
||||
## Context
|
||||
|
||||
Large code changes are difficult to review as a flat file list. Codex already has `/review`, but that workflow is findings-oriented; a review story is a separate, read-only artifact intended to explain a change in a useful reading order.
|
||||
|
||||
The first reusable layer must support both the future TUI surface and an App UI surface without coupling story generation to either client.
|
||||
|
||||
## Decision
|
||||
|
||||
Introduce an app-server v2 API namespace, `reviewStory/*`, backed by shared Rust generation logic and a separate SQLite story database managed by the state layer.
|
||||
|
||||
`reviewStory/start` accepts a concrete source: branch comparison, uncommitted changes, or one commit. The server collects the source diff, creates deterministic file-level anchors and a source fingerprint, invokes one constrained structured model task to group anchors into ordered steps, validates anchor coverage, and persists the completed snapshot. If generation is unavailable or invalid, it persists a usable file-level fallback snapshot instead.
|
||||
|
||||
The API also provides `reviewStory/read` and `reviewStory/list` for stored snapshots and emits `reviewStory/snapshot/updated` when a snapshot is written. Snapshot and step status fields include values that allow a future progressive generator, but this foundation produces completed `ready` or `partial` snapshots with `ready` steps.
|
||||
|
||||
Story snapshots live in the story store rather than in thread transcript history. The API is the product boundary: a stacked TUI feature and a later App UI can present the same stored story artifact.
|
||||
|
||||
## Deliberately Deferred
|
||||
|
||||
- Interactive TUI or App UI presentation.
|
||||
- Progressive outline-first generation and asynchronous step enrichment.
|
||||
- Hunk-level anchors, dependency graph signals, or semantic indexing.
|
||||
- Staleness detection, refresh, and snapshot lineage behavior.
|
||||
- Review comments, findings, or hosted review submission from a story surface.
|
||||
|
||||
## Consequences
|
||||
|
||||
This layer provides a stable, validated, reusable story artifact without requiring a UI or an asynchronous job lifecycle in the same change. Clients receive a complete snapshot, and failures degrade to full file-level coverage rather than hiding changed evidence.
|
||||
|
||||
Progressive loading remains compatible with the API shape but will require a separate implementation: early `building` snapshots, background enrichment, repeated snapshot writes, and client consumption of replacement notifications.
|
||||
Reference in New Issue
Block a user