@colony2/cortex 0.0.6 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +56 -10
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -9,6 +9,20 @@ Cortex connects to a remote [JobDB](https://github.com/colony-2/jobdb) server.
9
9
  Run c2j workers separately against the same JobDB. Projects in the UI are JobDB
10
10
  tenants; cells are the current Git repository and its c2j-configured dependents.
11
11
 
12
+ ## Document reviews
13
+
14
+ The **Reviews** navigation item lists pending input forms marked `kind: review`.
15
+ Reviews are excluded from **Pending Inputs**, and each section has its own count.
16
+ Open a review to switch between its documents, view Markdown rendered or as its
17
+ exact source, and answer the recipe's questions. Original documents are read only;
18
+ file-upload questions attach separate response documents (one file per question,
19
+ 32 MiB total HTTP request limit). Other document formats can be downloaded.
20
+
21
+ Responses use c2j's request identity, validation, and receipts. A job's story links
22
+ to its review. Completed reviews leave the pending list; historical review lookup
23
+ is not available yet. See the [recipe author guide](GUIDE-Review-Recipe-Authors.md)
24
+ and [c2j API follow-up requirements](docs/C2J-Review-API-Requirements.md).
25
+
12
26
  ## Install and run
13
27
 
14
28
  Releases provide Linux and macOS binaries for x86_64 and ARM64. Install through
@@ -17,7 +31,7 @@ npm (Node.js 14 or newer and `tar` required):
17
31
  ```sh
18
32
  npm install -g @colony2/cortex
19
33
  cortex version
20
- cortex --jobdb-url http://127.0.0.1:9047 --working-dir /path/to/cell
34
+ cortex --jobdb http://127.0.0.1:9047/c2 --working-dir /path/to/cell
21
35
  ```
22
36
 
23
37
  The npm installer downloads the matching binary from
@@ -33,15 +47,45 @@ with a c2j cell configuration; see the
33
47
  | Option | Environment variable | Default |
34
48
  | --- | --- | --- |
35
49
  | `--addr` | `CORTEX_ADDR` | `:8080` |
36
- | `--jobdb-url` | `JOBDB_URL` | Required |
50
+ | `--jobdb` | `C2J_JOBDB` | `jobdb` from `.c2j/config.yaml` |
37
51
  | `--working-dir` | `CORTEX_WORKING_DIR` | Current directory |
38
- | `--tenant-id` | `CORTEX_TENANT_ID` | `1` |
39
52
  | `--cors-origins` | `CORTEX_CORS_ORIGINS` | Empty; comma-separated origins |
40
53
 
41
- Use `cortex --help` for command options and `cortex version` or `cortex --version`
42
- to identify the release. Source builds report `dev`.
54
+ Cortex uses Cobra, like c2j: long flags use `--` (`--jobdb`, `--addr`) and
55
+ short flags use `-` (`-h` for help). `cortex serve` explicitly starts the server;
56
+ `cortex` with the same flags is equivalent. Use `cortex version` or
57
+ `cortex --version` to identify the release. Source builds report `dev`.
58
+
59
+ The JobDB URI includes the tenant, just like c2j:
60
+
61
+ ```sh
62
+ cortex serve --jobdb http://localhost:9047/c2
63
+ # Or share the same environment setting with c2j:
64
+ C2J_JOBDB=http://localhost:9047/c2 cortex
65
+ ```
66
+
67
+ Resolution follows `--jobdb`, then `C2J_JOBDB`, then the nearest ancestor
68
+ `.c2j/config.yaml`. Cortex calls c2j's `pkg/config.LoadProjectConfig` and
69
+ `ProjectConfig.JobDBURI` directly, including support for command-valued settings:
70
+
71
+ ```yaml
72
+ jobdb: http://localhost:9047/c2
73
+ # Alternatively:
74
+ # jobdb:
75
+ # command: your-command-that-prints-a-jobdb-uri
76
+ ```
77
+
78
+ Run `cortex` from that cell or a subdirectory, or select the discovery directory
79
+ with `--working-dir`. Cortex requires a remote HTTP(S) JobDB server; `embed:///`
80
+ is not supported.
81
+
82
+ For migration, `--jobdb-url` remains a deprecated alias accepting either the new
83
+ URI or a server-only URL with `--tenant-id`. Legacy `JOBDB_URL` is used only when
84
+ neither a connection flag nor `C2J_JOBDB` is set, before consulting the config.
85
+ `CORTEX_TENANT_ID` applies only to legacy server-only URLs (default `1`).
43
86
 
44
- Select a tenant in the header, use `/?tenantId=42`, or open a tenant route such as
87
+ Opening the UI uses the tenant in your configured JobDB URI. To override it,
88
+ select a tenant in the header, use `/?tenantId=42`, or open a tenant route such as
45
89
  `/project/42/jobs`. The email screen records an identity cookie; it does not
46
90
  provide server-side authentication.
47
91
 
@@ -54,7 +98,7 @@ downloads enabled. The Go wrapper selects the version in [`.go-version`](.go-ver
54
98
  pnpm install --frozen-lockfile
55
99
  bash scripts/go.sh -C server mod download
56
100
  make build
57
- ./build/cortex --jobdb-url http://127.0.0.1:9047 --working-dir /path/to/cell
101
+ ./build/cortex --jobdb http://127.0.0.1:9047/c2 --working-dir /path/to/cell
58
102
  ```
59
103
 
60
104
  `make build` builds the web packages, copies their output into the Go embed
@@ -67,7 +111,7 @@ checkout is required.
67
111
  Start the API and web dev server in separate terminals:
68
112
 
69
113
  ```sh
70
- JOBDB_URL=http://127.0.0.1:9047 CORTEX_WORKING_DIR=/path/to/cell pnpm dev:api
114
+ C2J_JOBDB=http://127.0.0.1:9047/c2 CORTEX_WORKING_DIR=/path/to/cell pnpm dev:api
71
115
  pnpm dev:web
72
116
  ```
73
117
 
@@ -114,7 +158,9 @@ submission, stories, tenants, cells, and input events. The production tests use
114
158
  HTTP JobDB backed by temporary SQLite storage.
115
159
 
116
160
  The recipe-input tests build the pinned c2j command and execute real Git-backed
117
- recipes with single-question and multi-field input requests. They submit jobs
161
+ recipes with single-question and multi-field input requests, plus document
162
+ reviews. The review test covers rendered/source Markdown, multiple documents,
163
+ stale and invalid responses, separate response attachments, and receipts. They submit jobs
118
164
  through the browser, observe pending requests in a second tab over SSE, check
119
165
  required fields and page reloads, submit answers while the worker is stopped,
120
166
  and restart it to verify the exact recipe output and completed story. They also
@@ -126,7 +172,7 @@ mocks are used in these tests. Worker logs and recipe outcomes are attached to
126
172
  the Playwright report in `web/app/playwright-report`.
127
173
 
128
174
  The timeout regression also runs against the real worker. It currently records
129
- an **expected failure**: with c2j v0.0.53 / JobDB v0.0.19, an unanswered external
175
+ an **expected failure**: with the pinned c2j / JobDB versions, an unanswered external
130
176
  input task remains pending past its recipe deadline. Step deadlines have the
131
177
  same limitation. The test first verifies that the prompt appears, then marks
132
178
  only a confirmed still-pending outcome after the deadline as expected; setup
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colony2/cortex",
3
- "version": "0.0.6",
3
+ "version": "0.0.9",
4
4
  "description": "Web interface for c2j recipe jobs",
5
5
  "license": "UNLICENSED",
6
6
  "homepage": "https://github.com/colony-2/cortex",