-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
232 lines (221 loc) · 13 KB
/
Copy pathpyproject.toml
File metadata and controls
232 lines (221 loc) · 13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
[build-system]
requires = ["setuptools>=68", "wheel"]
build-backend = "setuptools.build_meta"
# Force the capabilities-plane RepoGraph fleet-wide. The plane lives in
# platform_manifest.capabilities, which re-exports CapabilityRegistry /
# load_capability_registry from `repograph`. PlatformManifest does NOT declare
# repograph as a dependency (it path-imports a sibling checkout), so the only
# `repograph` in this venv otherwise comes transitively from context-lifecycle,
# which pins the PLANELESS repograph@v0.2.0 (no CapabilityRegistry). A
# [tool.uv.sources] entry is insufficient — uv honors the transitive consumer's
# own version pin; only override-dependencies wins. Pinned to RepoGraph v0.3.0
# (e0b205e, #7) — the first release tag carrying the capabilities plane (the
# v0.2.x tags are planeless).
[tool.uv]
override-dependencies = [
"repograph @ git+https://github.com/ProtocolWarden/RepoGraph.git@v0.3.0",
]
[project]
name = "operations-center"
version = "0.1.0"
description = "Planning, routing, execution, policy, and evidence service for canonical task proposals"
readme = "README.md"
requires-python = ">=3.11"
dependencies = [
"pydantic>=2.7",
"PyYAML>=6.0",
"httpx>=0.27",
"typer>=0.12",
"cxrp @ git+https://github.com/ProtocolWarden/CxRP.git@v0.3.1",
"source-registry @ git+https://github.com/ProtocolWarden/SourceRegistry.git",
"rxp @ git+https://github.com/ProtocolWarden/RxP.git",
"core-runner @ git+https://github.com/ProtocolWarden/CoreRunner.git",
# Capabilities plane (C2 runtime enforcement). Pinned to PlatformManifest
# v1.1.0 (17095f433) — the first release tag shipping
# src/platform_manifest/capabilities.py + data/capabilities.yaml (v1.0.0 is
# planeless).
"platform-manifest @ git+https://github.com/ProtocolWarden/PlatformManifest.git@v1.1.0",
# ADR 0002 P4 — dispatcher CL wrap.
"context-lifecycle @ git+https://github.com/ProtocolWarden/ContextLifecycle.git@v0.4.3",
# EVAL answer-key signatures (Ed25519) — operations_center.eval.signing.
"cryptography>=42",
]
[project.scripts]
operations-center-setup = "operations_center.entrypoints.setup.main:app"
operations-center-audit = "operations_center.entrypoints.audit.main:app"
operations-center-artifacts = "operations_center.entrypoints.artifacts.main:app"
operations-center-calibration = "operations_center.entrypoints.calibration.main:app"
operations-center-fixtures = "operations_center.entrypoints.fixtures.main:app"
operations-center-replay = "operations_center.entrypoints.replay.main:app"
operations-center-regression = "operations_center.entrypoints.regression.main:app"
operations-center-governance = "operations_center.entrypoints.governance.main:app"
# Audit + maintenance trinity (added 2026-04-28). See docs/architecture/
# {ghost_work,flow,code_health}_audit.md for the catalogs each scanner enforces.
operations-center-ghost-audit = "operations_center.entrypoints.ghost_audit.main:main"
operations-center-flow-audit = "operations_center.entrypoints.flow_audit.main:main"
operations-center-lineage = "operations_center.lineage.cli:main"
# Cross-repo Custodian sweep — runs custodian-audit against every managed repo
# with a local checkout and a .custodian.yaml, emits one Plane task per repo
# with --emit. Read-only against the managed repos; mutates Plane only.
operations-center-custodian-sweep = "operations_center.entrypoints.custodian_sweep.main:main"
# code_health_audit moved to Custodian (2026-04-29). Run `custodian-audit
# --repo .` instead. The OC-specific detectors (OC1-OC9) live in
# _custodian/detectors.py and are wired via .custodian.yaml.
operations-center-recover-stale = "operations_center.entrypoints.maintenance.recover_stale:main"
operations-center-cleanup-state = "operations_center.entrypoints.maintenance.cleanup_state:main"
operations-center-close-stale-prs = "operations_center.entrypoints.maintenance.close_stale_prs:main"
operations-center-cleanup-stale-backlog = "operations_center.entrypoints.maintenance.cleanup_stale_backlog:main"
operations-center-check-regressions = "operations_center.entrypoints.maintenance.check_regressions:main"
operations-center-triage-scan = "operations_center.entrypoints.maintenance.triage_scan:main"
operations-center-board-unblock = "operations_center.entrypoints.maintenance.board_unblock:main"
# Audit closed-unmerged PRs for close receipts (salvage/dup/intentional). Orphaned
# scanner — wired here so it has a verb like its maintenance siblings.
operations-center-audit-close-receipts = "operations_center.entrypoints.maintenance.audit_close_receipts:main"
# ADR 0007 Phase B — spec trigger watcher. Emits one `spec-author` Plane task
# per cycle on drop-file or queue-drain; no LLM calls. Supersedes the trigger
# half of spec_director (retired in Phase F).
operations-center-spec-trigger = "operations_center.entrypoints.spec_trigger.main:main"
# Operator one-shots — added 2026-04-28 from audit triage Group B.
operations-center-autonomy-tiers = "operations_center.entrypoints.autonomy_tiers.main:main"
operations-center-ci-monitor = "operations_center.entrypoints.ci_monitor.main:main"
# Phase 13 — re-audit trigger evaluator. Cron-friendly; nonzero exit when stale.
operations-center-reaudit-check = "operations_center.entrypoints.reaudit_check.main:main"
# Manifest primitive — diagnose EffectiveRepoGraph wiring (R4.1).
operations-center-graph-doctor = "operations_center.entrypoints.graph_doctor.main:main"
# Cross-repo task chaining — manual trigger (R5.2).
operations-center-propagate = "operations_center.entrypoints.propagate.main:main"
# Cross-repo task chaining — inspect parent-child chains (R5.5).
operations-center-propagation-links = "operations_center.entrypoints.propagation_links.main:main"
# Phase 14 fork-management engine extracted to SourceRegistry.
# Use the `source-registry` CLI directly with
# --registry registry/source_registry.yaml
# --patches registry/patches
# ER-001 — Repo Graph primitive extracted to PlatformManifest.
# Use the `platform-manifest` CLI directly (provided by that package).
# ER-002 — Run Memory primitive.
operations-center-run-memory = "operations_center.run_memory.cli:app"
# Snapshot validation CLI — validate observer snapshots for manual CI testing.
operations-center-observer-snapshot = "operations_center.observer.cli:app"
# Single-command provenance reader — prints OC↔RxP↔SwitchBoard chain
# from execution_trace.json alone. Hardening arc item 3.
operations-center-run-show = "operations_center.entrypoints.run_show.main:main"
operations-center-worker-backend-status = "operations_center.entrypoints.worker_backend_status.main:main"
operations-center-worker-backend-probe = "operations_center.entrypoints.worker_backend_probe.main:main"
# ADR 0007 Phase A — spec_hygiene watcher. Non-LLM hygiene + active.json
# projection rebuild extracted from spec_director. Single writer of
# state/campaigns/active.json.
operations-center-spec-hygiene = "operations_center.entrypoints.spec_hygiene.main:main"
# WO-4 orphan-branch detector — remote branches with commits ahead of main,
# no open PR, older than 24 h. Run in watchdog STEP-2 or as a one-shot sweep.
operations-center-orphan-branch-check = "operations_center.entrypoints.maintenance.orphan_branch_check:main"
# Sandbox base-branch preflight — verify each repo's sandbox_base_branch exists
# on origin (--heal creates it from default). Run in the watchdog loop so a
# missing branch is fixed before any task stalls on it. Exit 1 if any missing.
operations-center-verify-sandbox-branches = "operations_center.entrypoints.maintenance.verify_sandbox_base_branches:main"
# Merged-PR → Plane-task reconciler — mark a non-terminal task Done when a merged
# PR closes it (explicit "Closes <task-id>" ref, or an In-Review task whose
# description references a now-merged PR). Fixes done-but-open board debt. Read-
# only without --apply.
operations-center-reconcile-merged-tasks = "operations_center.entrypoints.maintenance.reconcile_merged_tasks:main"
# Convergence stall breaker — when a source_family's Blocked tasks fail
# identically past a threshold (env/transport, not code), escalate to the
# operator ledger and suppress re-proposal via the existing rejection store.
operations-center-detect-convergence-stall = "operations_center.entrypoints.maintenance.detect_convergence_stall:main"
# EVAL answer-key signing CLI — Ed25519 sign/verify for eval operator workflow.
operations-center-eval-sign = "operations_center.eval.sign:main"
[project.entry-points."pytest11"]
flaky-detection = "operations_center.observer.pytest_flaky_plugin"
[project.optional-dependencies]
dev = [
"pytest>=8.0",
"pytest-xdist>=3.0",
"pytest-cov>=6.0",
"ruff==0.15.13",
"ty==0.0.40",
"custodian @ git+https://github.com/ProtocolWarden/Custodian.git@d6ba8ab245c6f4e79e9f8fffd4e4221bfaf266e8",
]
[tool.setuptools.packages.find]
where = ["src"]
[tool.pytest.ini_options]
pythonpath = ["src", "."]
testpaths = ["tests"]
filterwarnings = [
"ignore:cannot collect test class:pytest.PytestCollectionWarning",
]
markers = [
"integration: marks integration tests that require external services (run with: pytest tests/integration/ -v)",
"slow: marks tests as slow-running and typically excluded from quick validation runs",
"perf: marks tests as performance regression tests (timing + memory bounds; run with: pytest -m perf)",
"smoke: marks tests as smoke tests for quick validation of core functionality",
"edge_case: marks tests that exercise edge cases or unusual scenarios",
"flaky: marks tests that exercise flaky test detection logic",
"flaky_historical: marks tests for flaky test historical aggregation and trends",
"flaky_integration: marks flaky test integration tests with observer service",
]
# xdist configuration for parallel test execution
# Distribution strategy: loadscope (groups tests by class/module to respect fixture boundaries)
# Usage: pytest -n auto --dist=loadscope (auto-detect CPU count)
# pytest -n 4 --dist=loadscope (4 workers)
# pytest -n auto --dist=loadfile (one file per worker; alternative strategy)
# For CI/batch runs: pytest -n auto --dist=loadscope -x (stop on first failure)
# For fixture audits: pytest -n 1 (single worker; disables parallelization)
addopts = "--strict-markers"
[tool.ruff]
line-length = 100
target-version = "py311"
[tool.ruff.lint]
# Tool-side replacements for Custodian native detectors deprecated under the
# "use the tool first" principle. See Custodian docs/design/detector_disposition_matrix.md.
extend-select = [
"T201", # C2 — print()
"S101", # C40 — assert in prod
"S324", # C31 — weak hash
"DTZ001", "DTZ003", "DTZ005", "DTZ006", "DTZ007", # C10 — naive datetime
"G004", # C15 — f-string in logger
"B006", # C38 — mutable default arg
"B028", # C42 — warnings.warn no stacklevel
"PLC1802", # C17 — len(x) == 0
"TRY002", # C20 — raise vanilla Exception
"TRY203", # D9 — useless try/except
"PGH003", # C35 — bare # type: ignore
"RET503", # D8 — implicit return
"N818", # N1 — exception class naming
]
# Dropped (too noisy across codebase, real legitimate uses):
# S110 — try/except/pass — used in cleanup paths and maintenance code
# S602/S603 — subprocess invocations — heavily used in adapters / CLI / setup
# BLE001 — blind except — codebase uses defensive top-level handlers
[tool.ruff.lint.per-file-ignores]
# Tests use `assert`, may patch subprocess, can have broad excepts in
# fixtures, intentionally use vanilla Exception, and may print for
# debug visibility — none of these are real violations there.
"tests/**/*.py" = [
"S101",
"S110",
"S602", "S603",
"BLE001",
"DTZ001", "DTZ003", "DTZ005", "DTZ006", "DTZ007",
"B006", "B028",
"PLC1802",
"TRY002", "TRY203",
"PGH003",
"RET503",
"G004",
"T201",
]
# CLI scripts and entrypoints are allowed to print() and broad-except.
"scripts/**/*.py" = ["T201", "BLE001", "S110"]
"src/operations_center/entrypoints/**/*.py" = ["T201"]
# Tools / one-shots (test_*.py files use assert like tests/)
"tools/**/*.py" = ["T201", "BLE001"]
"tools/**/test_*.py" = ["S101"]
# Root-level verification scripts
"verify_stage3.py" = ["T201"]
# EVAL verify + operator-signing CLIs print; the seed script is dev tooling.
"src/operations_center/eval/verify.py" = ["T201"]
"src/operations_center/eval/sign.py" = ["T201"]
# Lineage display CLI prints the human-facing read-model.
"src/operations_center/lineage/cli.py" = ["T201"]
"eval/**/*.py" = ["T201", "BLE001"]
[tool.ty.environment]
python-version = "3.11"