Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .corp-harness/component-contracts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"schema": "corporate-site-component-contracts/v1",
"origin": {
"namespace": "project",
"origin_id": "site"
},
"shared_components": {
"operations-excellence": {
"authority": "review-only",
"evidence_source": "root-produced-immutable",
"may_approve": false,
"may_delegate": false,
"may_execute_site_commands": false,
"readonly": true
},
"site-delivery": {
"atomic_rework_snapshot_required": true,
"corporate_rework_authority": "user",
"dispatch_owner": "root-orchestrator",
"maximum_delegation_depth": 1,
"workers_may_delegate": false
},
"site-manager": {
"authority": "decompose-only",
"dispatch_owner": "root-orchestrator",
"may_approve": false,
"may_delegate": false,
"readonly": true
},
"site-specialist": {
"authority": "adr-bounded-write",
"dispatch_owner": "root-orchestrator",
"may_approve": false,
"may_delegate": false,
"readonly": false
}
}
}
8 changes: 8 additions & 0 deletions .corp-harness/site.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"schema": "corporate-site-site/v1",
"site_id": "corpos",
"corporate_program": null,
"corporate_handoff_sha256": null,
"verify_argv": ["./scripts/harness/verify.sh"],
"adversarial_argv": ["./scripts/harness/adversarial.sh"]
}
10 changes: 10 additions & 0 deletions .cursor/agents/operations-excellence.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: operations-excellence
description: Defines site gates and SLOs, runs the current oracle, and independently reviews evidence.
model: inherit
readonly: true
---

Run `scripts/harness/verify.sh` against the current revision. Inspect executable evidence rather
than producer claims. Return PASS or FAIL, linked findings, site SLOs, and the recommended
transition. Do not fix failures or weaken gates.
11 changes: 11 additions & 0 deletions .cursor/agents/site-manager.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
name: site-manager
description: Decomposes a verified corporate handoff into ADR work and integrates site evidence.
model: inherit
readonly: true
---

Verify the handoff digest, create only consequential ADRs, and dispatch bounded packets to
the root orchestrator. The root launches `site-specialist` in isolated worktrees and
integrates results. Return assignments, evidence requirements, risks, and the recommended
transition; never implement, launch workers, integrate, or self-approve.
11 changes: 11 additions & 0 deletions .cursor/agents/site-specialist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
name: site-specialist
description: Implements one ADR-scoped packet and returns exact command evidence.
model: inherit
readonly: false
---

Stay inside the assigned site root, ADR, and write set. Implement the smallest compliant
change, run the supplied verification command, and return changed paths plus exit codes.
Worker subagents may not delegate further. Do not edit corporate approval state or
approve your own output.
9 changes: 9 additions & 0 deletions .cursor/rules/site-contract.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
description: Keep site work within the approved corporate handoff and evidence gates
alwaysApply: true
---

For an active site program, read the corporate handoff before editing. Site specialists
implement; operations excellence reviews current evidence. Use isolated workspaces for
independent writers. Do not alter corporate approvals, weaken tests, infer gate success,
or grant user approval.
15 changes: 15 additions & 0 deletions .cursor/skills/site-delivery/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: site-delivery
description: Delivers an approved corporate handoff through ADR-scoped implementation and independent site verification.
---

# Site delivery

1. Verify the handoff digest.
2. Have the readonly site manager return bounded ADR packets.
3. The root orchestrator launches site specialists in isolated roots.
4. Integrate and run `scripts/harness/verify.sh`.
5. Record `verification_scripts` as site-relative `scripts/harness` (only
`verify.sh` and `adversarial.sh`). Do not bind the whole `scripts/` tree.
6. Ask operations excellence to review fresh evidence.
7. Return failures to the owning ADR; never bypass retries or self-approve.
54 changes: 13 additions & 41 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,18 @@
# AGENTS.md
# Site contract

CorpOS harness. Profile: **solo**.
## Gates

## Purpose
| Command | Purpose |
| ---------------------------------- | ----------------------------------- |
| `./scripts/harness/verify.sh` | Functional and static acceptance |
| `./scripts/harness/adversarial.sh` | Authorized local adversarial probes |

TypeScript multi-agent runtime with policy, approval, and audit control plane. Simulation-first demo; optional live LLM via OpenRouter.
Record `verification_scripts` as the site directory `scripts/harness` (exactly those
two scripts). Optional wrappers may remain at `scripts/verify.sh` /
`scripts/adversarial.sh` for humans; they are outside the digest boundary.

## Prerequisites
The corporate handoff fixes scope. The site manager assigns ADRs; site specialists write;
operations excellence reviews current evidence. Work in isolated roots, never edit
corporate approval state, and never self-approve.

- Node.js ≥20 (`package.json` engines)
- `npm install` (builds `better-sqlite3` native module)

## Commands

| Command | Purpose |
| --------------------- | ------------------------------- |
| `./scripts/verify.sh` | Definition of Done |
| `npm install` | Install dependencies |
| `npm run dev` | API + dashboard with hot reload |
| `npm run start` | Run without watch |
| `npm run test` | Vitest suite |
| `npm run typecheck` | `tsc --noEmit` |
| `npm run lint` | ESLint |
| `npm run build` | Compile to `dist/` |

## Layout

| Path | Role |
| ---------------- | --------------------------------------------------------- |
| `src/core/` | Orchestrator, policy, store (SQLite at `data/company.db`) |
| `src/agents/` | Department agents |
| `src/tools/` | Permissioned tool registry |
| `src/api/` | Express REST + WebSocket |
| `src/dashboard/` | Control-plane UI |

## Definition of Done

```bash
npx npm@10.9.2 ci
./scripts/verify.sh
```

## Review focus

Block on P0/P1: policy chokepoint bypass, approval gate skips, secret exposure, broken simulation determinism.
Site id: `corpos`. Prior Cursor Harness v4 is under `_archives/harness-v4/`.
40 changes: 40 additions & 0 deletions _archives/harness-v4/20260717T192824Z/.cursor/hooks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"version": 1,
"hooks": {
"beforeShellExecution": [
{
"command": "python3 .cursor/hooks/guard-shell.py",
"failClosed": false
},
{
"command": "python3 .cursor/hooks/guard-network.py",
"matcher": "curl|wget|scp|nc ",
"failClosed": false
}
],
"beforeMCPExecution": [
{
"command": "python3 .cursor/hooks/guard-mcp.py",
"failClosed": false
}
],
"beforeReadFile": [
{
"command": "python3 .cursor/hooks/protect-secrets.py",
"failClosed": true
}
],
"beforeSubmitPrompt": [
{
"command": "python3 .cursor/hooks/scan-prompt.py",
"failClosed": true
}
],
"stop": [
{
"command": "python3 .cursor/hooks/verify-on-stop.py",
"loop_limit": 3
}
]
}
}
Loading