Skip to content

Commit cd40a2c

Browse files
committed
feat(core): seed product surfaces
0 parents  commit cd40a2c

1,042 files changed

Lines changed: 221369 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.devcontainer/devcontainer.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "cortexpilot-ci-core",
3+
"dockerComposeFile": [
4+
"../infra/ci/compose.yml"
5+
],
6+
"service": "core",
7+
"workspaceFolder": "/workspace",
8+
"overrideCommand": false,
9+
"shutdownAction": "stopCompose",
10+
"remoteUser": "root",
11+
"customizations": {
12+
"vscode": {
13+
"settings": {
14+
"terminal.integrated.defaultProfile.linux": "bash"
15+
}
16+
}
17+
}
18+
}

.dockerignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
.git
2+
.github
3+
.claude
4+
.codex
5+
.opencode
6+
.runtime-cache
7+
.venv
8+
.pytest_cache
9+
.mypy_cache
10+
.ruff_cache
11+
.coverage
12+
.coverage.*
13+
.pnpm-store
14+
node_modules
15+
**/node_modules
16+
dist
17+
build
18+
cache
19+
.cache
20+
logs
21+
.agent
22+
.env
23+
.env.local
24+
.env.*
25+
coverage
26+
第三方Repo参考实现

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
trim_trailing_whitespace = true
8+
9+
[*.{py,pyi}]
10+
indent_style = space
11+
indent_size = 4
12+
13+
[*.{js,jsx,ts,tsx,json,md,yml,yaml}]
14+
indent_style = space
15+
indent_size = 2

.env.example

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# CortexPilot local minimal template (do not commit real secrets)
2+
# Core ports and API auth
3+
CORTEXPILOT_DEV_HOST=127.0.0.1
4+
CORTEXPILOT_API_PORT=10000
5+
CORTEXPILOT_DASHBOARD_PORT=3100
6+
CORTEXPILOT_DESKTOP_PORT=18173
7+
CORTEXPILOT_API_AUTH_REQUIRED=true
8+
CORTEXPILOT_API_TOKEN=cortexpilot-dev-token
9+
10+
# Frontend runtime wiring (public env for web / desktop shell token)
11+
NEXT_PUBLIC_CORTEXPILOT_API_BASE=http://127.0.0.1:10000
12+
NEXT_PUBLIC_CORTEXPILOT_API_TOKEN=cortexpilot-dev-token
13+
VITE_CORTEXPILOT_API_BASE=http://127.0.0.1:10000
14+
VITE_CORTEXPILOT_API_TOKEN=cortexpilot-dev-token
15+
# Optional hosted/public dashboard origins (comma-separated, no secrets)
16+
CORTEXPILOT_API_ALLOWED_ORIGINS=
17+
# Later-gated queue pilot stays default-off unless a trusted operator environment enables it.
18+
CORTEXPILOT_MCP_QUEUE_PILOT_ENABLE_APPLY=0
19+
20+
# Unified LLM provider selection
21+
# Supported: gemini | openai | anthropic
22+
CORTEXPILOT_PROVIDER=gemini
23+
# Optional overrides (leave empty to use provider defaults)
24+
CORTEXPILOT_PROVIDER_BASE_URL=
25+
CORTEXPILOT_PROVIDER_MODEL=
26+
CORTEXPILOT_PROVIDER_USE_LITELLM=0
27+
28+
# M10 SSOT alignment: prefer canonical MCP timeout keys for new config
29+
CORTEXPILOT_MCP_TIMEOUT_SEC=
30+
CORTEXPILOT_MCP_CONNECT_TIMEOUT_SEC=
31+
CORTEXPILOT_MCP_CLEANUP_TIMEOUT_SEC=
32+
# Compatibility keys are still registered; keep only for legacy/runtime compatibility
33+
CORTEXPILOT_MCP_SERVER_TIMEOUT_SEC=
34+
CORTEXPILOT_MCP_SERVER_CONNECT_TIMEOUT_SEC=
35+
CORTEXPILOT_MCP_SERVER_CLEANUP_TIMEOUT_SEC=
36+
37+
# Provider credentials (fill only what you use)
38+
GEMINI_API_KEY=
39+
OPENAI_API_KEY=
40+
ANTHROPIC_API_KEY=
41+
GEMINI_BASE_URL=
42+
43+
# Optional eval overrides
44+
CORTEXPILOT_EVAL_MODEL=
45+
CORTEXPILOT_EVAL_CONFIG=tests/evals/promptfoo/promptfooconfig.yaml
46+
47+
# Optional governance knobs
48+
CORTEXPILOT_RUM_MAX_PAYLOAD_BYTES=32768
49+
CORTEXPILOT_CI_CANARY_DRY_RUN=0
50+
# Host compatibility only: set to 1 to bypass docker auto-routing for local gate diagnostics.
51+
CORTEXPILOT_HOST_COMPAT=0
52+
# Repo-authored runtime artifacts stay under .runtime-cache/. Repo-owned external caches stay under ~/.cache/cortexpilot.
53+
CORTEXPILOT_MACHINE_CACHE_ROOT=~/.cache/cortexpilot
54+
CORTEXPILOT_RETENTION_MACHINE_CACHE_CAP_BYTES=21474836480
55+
CORTEXPILOT_MACHINE_CACHE_AUTO_PRUNE=1
56+
CORTEXPILOT_MACHINE_CACHE_AUTO_PRUNE_INTERVAL_SEC=1800
57+
# Local development uses the repo-owned Chrome singleton rooted under ~/.cache/cortexpilot/browser/.
58+
# First migrate the named default-Chrome profile once, then keep manual and automation flows attached to the same CDP endpoint.
59+
CHROME_PATH=
60+
CORTEXPILOT_BROWSER_PROFILE_MODE=allow_profile
61+
CORTEXPILOT_BROWSER_PROFILE_DIR=~/.cache/cortexpilot/browser/chrome-user-data
62+
CORTEXPILOT_BROWSER_PROFILE_NAME=cortexpilot
63+
CORTEXPILOT_BROWSER_PROFILE_ALLOWLIST=~/.cache/cortexpilot/browser
64+
CORTEXPILOT_BROWSER_CDP_HOST=127.0.0.1
65+
CORTEXPILOT_BROWSER_CDP_PORT=9341
66+
67+
# Optional CI diagnostics / route-evidence knobs (usually injected by workflow, not hand-authored locally)
68+
CORTEXPILOT_CI_PROFILE=auto
69+
CORTEXPILOT_CI_SLICE=full
70+
CORTEXPILOT_DOCKER_CI_FORCE_REBUILD=0
71+
CORTEXPILOT_CI_PROVENANCE_IMAGE=cortexpilot-ci-core:local
72+
CORTEXPILOT_CI_ROUTE_ID=
73+
CORTEXPILOT_CI_TRUST_CLASS=
74+
CORTEXPILOT_CI_RUNNER_CLASS=
75+
CORTEXPILOT_CI_CLOUD_BOOTSTRAP_ALLOWED=false
76+
CORTEXPILOT_CI_CLOUD_BOOTSTRAP_USED=false
77+
CORTEXPILOT_CI_CONTROL_PLANE_DOCTOR_OUT_DIR=.runtime-cache/test_output/ci_control_plane_doctor
78+
CORTEXPILOT_DOCTOR_REQUIRE_DOCKER=1
79+
CORTEXPILOT_DOCTOR_REQUIRE_SUDO=1
80+
CORTEXPILOT_CI_PM_CHAT_ON_PR=0
81+
CORTEXPILOT_UPSTREAM_RECORD_FRESH_SEC=1800
82+
CORTEXPILOT_UPSTREAM_VERIFICATION_TIMEOUT_SEC=180

apps/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Apps Overview
2+
3+
`apps/` contains the three main operator-facing surfaces of CortexPilot.
4+
5+
- `orchestrator/`: backend execution, orchestration, evidence, replay
6+
- `dashboard/`: web command surface
7+
- `desktop/`: Tauri desktop shell with a public macOS-only support boundary;
8+
Linux/BSD desktop evidence is historical/manual only
9+
10+
Read these modules as three entry points into one system, not as unrelated
11+
products.

apps/dashboard/AGENTS.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Dashboard AGENTS
2+
3+
Read root `AGENTS.md` first.
4+
5+
## Scope
6+
7+
- Next.js routes and components
8+
- web API clients
9+
- operator-focused dashboard flows
10+
11+
## Commands
12+
13+
- `pnpm --dir apps/dashboard install`
14+
- `pnpm --dir apps/dashboard test`
15+
- `pnpm --dir apps/dashboard exec tsc -p tsconfig.typecheck.json --noEmit`

apps/dashboard/CLAUDE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Dashboard CLAUDE
2+
3+
Read `AGENTS.md` in this directory and the root `CLAUDE.md` first.

apps/dashboard/README.md

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
# Dashboard Module
2+
3+
## Positioning
4+
5+
This module is the repository's **web operator surface**.
6+
7+
Read it as:
8+
9+
- the browser-based control surface for runs, sessions, reviews, and command
10+
visibility
11+
- a way to inspect and operate CortexPilot Command Tower orchestration truth from the web
12+
- a repo-owned UI for evaluating control-plane behavior
13+
14+
Do **not** read it as:
15+
16+
- a polished customer-facing SaaS product
17+
- a standalone web application with its own independent product roadmap
18+
- evidence that every workflow here is already broad-market ready
19+
20+
## Module Responsibility
21+
22+
- Provide run, workflow, session, and review visualization for CortexPilot Command Tower
23+
orchestration output.
24+
- Surface operator-facing status, artifacts, and control points for the web.
25+
- Surface intake preview, approval summaries, and run diagnostics as
26+
operator-readable decision objects rather than raw payloads alone.
27+
28+
## Why This Module Exists
29+
30+
If `apps/orchestrator/` is the machine room, `apps/dashboard/` is the glass
31+
window operators use to see what the machine room is doing. Its job is
32+
visibility and control, not pretending the whole repository is already a
33+
finished consumer product.
34+
35+
## Input / Output
36+
37+
- Input: API responses from the orchestrator backend.
38+
- Output: operational UI views for runs, events, contracts, reports, and
39+
command surfaces.
40+
41+
## High-value operator surfaces
42+
43+
- PM workspace: registry-driven task-pack selection plus `execution_plan_report`
44+
preview before execution starts.
45+
- Agents: the first-screen role catalog now also hosts a repo-owned role
46+
configuration desk for previewing and saving future compiled defaults
47+
(`system_prompt_ref`, bundle refs, and role-level runtime binding) while
48+
`task_contract` remains the only execution authority.
49+
- Workflow views: workflow-case summaries derived from run manifests and PM
50+
session bindings, now with queue/SLA read surfaces and a read-only
51+
`Workflow read model` card sourced from `workflow_case_read_model`.
52+
- Dashboard `Run Detail` and `Workflow Case detail` now resolve page-level
53+
title/subtitle/degraded-state copy from the shared locale substrate via the
54+
UI locale cookie, so the high-value detail routes stay aligned with the
55+
English-first / `zh-CN` operator contract instead of drifting through
56+
page-local literals.
57+
- Run Detail: incident packs, approval summaries, replay compare reports, and a
58+
read-only role-binding summary in the existing `Status & Contract` card, so
59+
bundle/runtime posture is visible on the main run surface without creating a
60+
second execution-authority switch.
61+
- Contracts and Run Detail now also surface the derived runtime capability
62+
posture (`lane`, `compat_api_mode`, `provider_status`, `tool_execution`) so
63+
operators can read chat-style compatibility vs fail-closed tool execution
64+
without overstating the current runtime boundary.
65+
- The staged UI-audit/dashboard-build path now depends on
66+
`apps/dashboard/lib/types.ts` explicitly re-exporting task-pack/runtime
67+
helper values and on `scripts/install_dashboard_deps.sh` recreating its
68+
runtime log directory before each install attempt, so smoke failures track
69+
product regressions instead of staging drift.
70+
- Builder/public discovery: the home builder section now surfaces direct
71+
`Read-only MCP quickstart` and `API and contract quickstart` entry cards so
72+
operators can jump from the web control surface into the truthful public
73+
onboarding ladder before diving into package-level docs.
74+
- Home discovery now compresses the old ecosystem / integrations / AI surfaces /
75+
builder sprawl into one adoption-path section so the dashboard front door
76+
behaves more like a router than a wall of repeated summaries.
77+
- That same adoption layer now treats `/compatibility/` as the primary routing
78+
decision card, swaps the redundant compatibility action button for a lighter
79+
`/use-cases/` proof-first CTA, and keeps `/integrations/`, `/skills/`,
80+
`/mcp/`, `/api/`, and `/builders/` as the deeper branches once the job is
81+
clear.
82+
- The dashboard public-docs resolver still treats `/integrations/`,
83+
`/skills/`, and `/compatibility/` as first-class public docs routes so
84+
public-docs base overrides do not strand those CTA links on app-local paths.
85+
- The same public-home polish keeps the explicit `Open use-case guide` side
86+
door routed through the public-docs resolver, so the proof-first walkthrough
87+
stays visible without turning the dashboard back into a second full routing
88+
matrix.
89+
- The contract-facing builder card now points to the repo-owned
90+
`packages/frontend-api-contract/docs/README.md` guide instead of only the raw
91+
generated `.d.ts` surface, so builders get a human-readable package entrypoint
92+
before opening the generated types.
93+
- The home surface and PM workspace now also carry small `zh-CN` screen-reader
94+
onboarding lists plus the clearer `Back to bottom` chat action wording, so
95+
the first-step contract stays discoverable in localized assistive flows
96+
without changing the visible English-first operator copy.
97+
- PM intake/chat regressions should keep the `Back to bottom` wording and the
98+
localized onboarding note aligned with this README in the same patch, so the
99+
dashboard doc-drift gate tracks the same visible operator-language contract
100+
that the PM intake tests now assert.
101+
102+
## Strongest Signals
103+
104+
- operator-first web workflows
105+
- command visibility over product marketing polish
106+
- alignment with the repository's three truth layers
107+
108+
## Key Config
109+
110+
- API base and frontend fetch layer are defined in `apps/dashboard/lib/api.ts`.
111+
- Runtime defaults and startup commands are coordinated from the repo root
112+
quickstart in `README.md`.
113+
- Dashboard dependency hotfixes should keep the root `package.json` overrides,
114+
root `pnpm-lock.yaml`, and `apps/dashboard/pnpm-lock.yaml` aligned so
115+
dashboard-only transitive patches do not drift from the workspace baseline.
116+
- `apps/dashboard/pnpm-lock.yaml` is a maintained dashboard-specific lockfile;
117+
keep transitive security patch updates in the same change set when dashboard
118+
dependency metadata changes.
119+
- The optional `depcheck` package is intentionally absent from the default
120+
dashboard dependency set; the dead-code gate already skips when the probe is
121+
unavailable, so leaving it out avoids carrying an otherwise unnecessary
122+
`brace-expansion` advisory path in the maintained lock surface.
123+
- Dashboard dependency lock refreshes are repo-owned: when transitive package
124+
fixes land here, keep `apps/dashboard/pnpm-lock.yaml` aligned with the root
125+
`package.json` / `pnpm-lock.yaml` change set.
126+
- Current transitive hardening includes the `yaml` override used through
127+
`cosmiconfig@7.1.0`; keep the dashboard lockfile and the root override in
128+
sync so the dashboard does not drift onto an older parser patch level.
129+
- Current lock maintenance also pins patched `picomatch` / `brace-expansion`
130+
transitive paths through the repo-owned override set so GitHub security
131+
receipts and the dashboard lockfile stay aligned.
132+
- Current security-only lock maintenance also pins `lodash-es@4.18.1` through
133+
both the root workspace and `apps/dashboard` override surfaces so the
134+
tracked `lighthouse@13.0.3` transitive chain does not fall back to the
135+
vulnerable `lodash-es@4.17.23` path on either maintained lockfile.
136+
- When a dashboard security-only lock refresh lands, keep this module README in
137+
the same change set so doc-drift gates can trace the maintenance decision to
138+
the dashboard surface that actually owns the lockfile.
139+
140+
## Common Troubleshooting
141+
142+
- Dependencies missing: `pnpm --dir apps/dashboard install`
143+
- Test failure: `pnpm --dir apps/dashboard test`
144+
- Typecheck: `pnpm --dir apps/dashboard exec tsc -p tsconfig.typecheck.json --noEmit`
145+
146+
## Quality Gate
147+
148+
- Coverage gate (stage-1): >= 85%
149+
- Command Tower regression tests now treat the English-first labels, drawer
150+
names, and quick-action copy as the canonical operator contract; update the
151+
dashboard tests in the same patch whenever those public-facing labels move.
152+
- Search page regression tests should wait for the terminal promote-status copy
153+
instead of the first rendered status node because the UI intentionally passes
154+
through `Promoting evidence...` before it settles on success or failure.
155+
- The current CI unblock patch also keeps the PM and RunDetail regression suite
156+
aligned with the English-first operator surface, including Command Tower
157+
session copy, PM composer controls, and RunDetail tab/status wording.
158+
- Workflow Case detail now also renders the latest linked run's
159+
`workflow_case_read_model` for operator inspection, but that card remains a
160+
read-only mirror below `task_contract` execution authority.
161+
- Run Detail now mirrors `role_binding_read_model` inside the existing
162+
`Status & Contract` card, and that note keeps `task_contract` explicit as the
163+
only execution authority.
164+
- Agents now also uses a registry-backed read-only role catalog on the first
165+
screen, so operators can inspect skills/MCP/runtime posture before drilling
166+
into individual agent seats or scheduler backlog.
167+
- Contracts now acts as a bundle/runtime inspector: each card keeps the task
168+
contract envelope visible while projecting the derived bundle/runtime summary
169+
as read-only operator context rather than a control surface; role-default
170+
edits belong on `Agents`, not on the contract inspector.

0 commit comments

Comments
 (0)