Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
c3def46
fix(orchestrator): fail closed outside explicit development mode
seonghobae Aug 9, 2026
6525970
test(orchestrator): prove production never returns deterministic fake…
seonghobae Aug 9, 2026
02d1bf6
test(coverage): include orchestrator production boundary
seonghobae Aug 9, 2026
2b02f23
docs(orchestrator): define fail-closed learned-coordination boundary
seonghobae Aug 9, 2026
eb9435e
ci(orchestrator): verify fail-closed production behavior once
seonghobae Aug 9, 2026
cc60a85
docs(changelog): record orchestrator production boundary
seonghobae Aug 9, 2026
bdc81fa
ci: remove completed orchestrator one-shot writer
seonghobae Aug 9, 2026
af69b5f
test(orchestrator): reject oversized provider responses
seonghobae Aug 14, 2026
6281964
fix(orchestrator): bound provider response bodies
seonghobae Aug 14, 2026
75f73e4
merge develop: preserve security hardening in orchestrator PR
seonghobae Aug 14, 2026
cc76f59
test(orchestrator): enforce streaming response byte budget
seonghobae Aug 14, 2026
7ea77f0
fix(orchestrator): bound provider response while streaming
seonghobae Aug 14, 2026
c5c890e
docs(orchestrator): record streaming response bound
seonghobae Aug 14, 2026
1e6916a
test(orchestrator): expect explicit development adapter
seonghobae Aug 14, 2026
4a806b5
test(orchestrator): cover residual production boundary branches
seonghobae Aug 14, 2026
d648c45
test(orchestrator): register residual branch coverage suite
seonghobae Aug 14, 2026
766d577
test(orchestrator): cover IPv6 loopback transport
seonghobae Aug 14, 2026
2a81fb4
fix(orchestrator): recognize IPv6 loopback hostname
seonghobae Aug 14, 2026
bd9bfe3
test(orchestrator): reject ambiguous provider endpoint configuration
seonghobae Aug 15, 2026
268536f
fix(orchestrator): require a canonical provider origin
seonghobae Aug 15, 2026
8c150a7
docs(orchestrator): document canonical provider origin
seonghobae Aug 15, 2026
46723a0
test(orchestrator): classify provider rejection before response body
seonghobae Aug 15, 2026
1578bf3
fix(orchestrator): classify provider rejection before body parsing
seonghobae Aug 15, 2026
b2f9639
test(api): isolate orchestrator mock from inherited provider config
seonghobae Aug 15, 2026
e482891
test(orchestrator): cover non-JSON response branch
seonghobae Aug 15, 2026
d57572a
test(orchestrator): require cancellation of rejected bodies
seonghobae Aug 15, 2026
dd85ee0
fix(orchestrator): cancel rejected provider response bodies
seonghobae Aug 15, 2026
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Security

- Made contextual-orchestrator briefing requests fail closed unless an authenticated endpoint is configured. Deterministic generated text is restricted to explicit `SCOPEWEAVE_DEV=1`, message/provider responses are bounded and validated, and non-loopback HTTP transport is rejected.
- Made `SCOPEWEAVE_JWT_SECRET` mandatory at startup and rejected weak or
unexpanded placeholder values so production deployments fail closed.
- Neutralized audit-log CSV formulas even when executable prefixes are hidden
Expand Down
68 changes: 68 additions & 0 deletions docs/orchestrator-production.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# contextual-orchestrator Production Contract

ScopeWeave delegates AI briefing work to `contextual-orchestrator`; it does not
silently replace unavailable production inference with deterministic text.

## Required environment

```text
ORCHESTRATOR_URL=https://orchestrator.example
ORCHESTRATOR_TOKEN=<secret>
ORCHESTRATOR_MODEL=contextual-orchestrator
```

`ORCHESTRATOR_URL` is a provider **origin**, not an arbitrary request URL. It
must not contain user-info credentials, a non-root path, a query string, or a
fragment. ScopeWeave owns the fixed `/v1/chat/completions` request path and keeps
bearer credentials in `ORCHESTRATOR_TOKEN`; operator URL text therefore cannot
silently alter request routing or mix endpoint authority with credentials.
Custom ports remain valid because they are part of the origin.

Production requests fail closed when the endpoint or bearer token is absent.
Non-loopback HTTP endpoints are rejected, requests are bounded to 120 seconds,
message count and content size are validated, provider payloads are not exposed
in errors, and an empty or malformed assistant response is never reported as a
successful briefing.

Provider response bodies have a hard 1 MiB caller-side byte budget **while they
are being read**. An oversized numeric `Content-Length` is rejected before body
allocation; when the header is absent or inaccurate, the stream reader counts
bytes incrementally, cancels the body as soon as the budget is exceeded, and
never buffers an unbounded provider payload before applying the limit. Empty,
non-stream-readable, malformed-length, non-JSON, oversized, or structurally
invalid responses fail with stable operator-safe errors rather than exposing
provider payload details.

The deterministic adapter is available only when `SCOPEWEAVE_DEV=1` and the
endpoint is absent. That variable must never be set in staging or production.

## Orchestration responsibility

ScopeWeave intentionally sends only a versioned OpenAI-compatible request to
the orchestration service. Model selection, single-model versus multi-agent
allocation, task decomposition, role-specific reasoning effort, recursion
limits, access lists, synthesis, and verification belong to
`contextual-orchestrator`, where they can be evaluated and evolved centrally.
This separation is consistent with learned coordination research: Conductor
learns task decompositions, worker assignments, communication topologies, and
recursive test-time scaling; TRINITY adaptively assigns Thinker, Worker, and
Verifier roles over multiple turns; Fugu operationalizes learned orchestration
behind one model-compatible API.

ScopeWeave therefore does not hard-code a local fake solver, fixed topology, or
provider-specific bypass. Changes to orchestration policy require benchmarked
ablation evidence in `contextual-orchestrator`, including single-model,
parallel, sequential, hierarchical, recursive, and verifier-assisted paths.

## APA 7th references

Nielsen, S., Cetin, E., Schwendeman, P., Sun, Q., Xu, J., & Tang, Y. (2025).
*Learning to orchestrate agents in natural language with the Conductor*.
arXiv. https://doi.org/10.48550/arXiv.2512.04388

Sakana AI. (2026). *Sakana Fugu: Multi-agent system as a model*.
https://sakana.ai/fugu/

Xu, J., Sun, Q., Schwendeman, P., Nielsen, S., Cetin, E., & Tang, Y. (2025).
*TRINITY: An evolved LLM coordinator*. arXiv.
https://doi.org/10.48550/arXiv.2512.04695
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
"coverage": "npm run test:coverage",
"server": "node server/server.mjs",
"test:api": "node tests/api/auth-secret.test.mjs && node tests/api/smoke.mjs && node tests/api/ratelimit.test.mjs && node tests/api/attachment-status.test.mjs && node tests/api/session-revocation.test.mjs",
"test:unit": "node tests/unit/analytics.test.mjs && node tests/unit/cpm.test.mjs && node tests/unit/baseline-compare.test.mjs && node tests/unit/workload.test.mjs && node tests/unit/cost-evm.test.mjs && node tests/unit/msproject.test.mjs && node tests/unit/auth-password.test.mjs && node tests/unit/editor-unsaved.test.mjs && node tests/unit/static-coverage-evidence.test.mjs && node tests/unit/dep-types.test.mjs && node tests/unit/weekly-report.test.mjs && node tests/unit/clearfolio.test.mjs && node tests/unit/clearfolio-adapter-mock-hmac.test.mjs && node tests/unit/sprint-stats.test.mjs && node tests/unit/burndown.test.mjs && node tests/unit/pm-analysis.test.mjs && node tests/unit/cloud-sync-security.test.mjs && node tests/unit/attachment-status.test.mjs && node tests/unit/clearfolio-status-signal.test.mjs && node tests/unit/coverage-script-contract.test.mjs",
"test:coverage": "c8 --all --include=app.js --include=cloud-sync.js --include=scripts/ci/static_coverage_evidence.mjs --include=server/attachment_status.mjs --include=server/app.mjs --include=server/auth.mjs --include=server/clearfolio.mjs --reporter=json --reporter=json-summary npm run test:coverage:cases",
"test:coverage:cases": "node tests/unit/coverage-script-contract.test.mjs && node tests/unit/attachment-status.test.mjs && node tests/unit/clearfolio-status-signal.test.mjs && node tests/unit/clearfolio-adapter-mock-hmac.test.mjs && node tests/unit/msproject.test.mjs && node tests/unit/auth-password.test.mjs && node tests/unit/editor-unsaved.test.mjs && node tests/unit/static-coverage-evidence.test.mjs && npm run test:api",
"test:unit": "node tests/unit/analytics.test.mjs && node tests/unit/cpm.test.mjs && node tests/unit/baseline-compare.test.mjs && node tests/unit/workload.test.mjs && node tests/unit/cost-evm.test.mjs && node tests/unit/msproject.test.mjs && node tests/unit/auth-password.test.mjs && node tests/unit/editor-unsaved.test.mjs && node tests/unit/static-coverage-evidence.test.mjs && node tests/unit/dep-types.test.mjs && node tests/unit/weekly-report.test.mjs && node tests/unit/clearfolio.test.mjs && node tests/unit/clearfolio-adapter-mock-hmac.test.mjs && node tests/unit/orchestrator.test.mjs && node tests/unit/orchestrator-coverage.test.mjs && node tests/unit/sprint-stats.test.mjs && node tests/unit/burndown.test.mjs && node tests/unit/pm-analysis.test.mjs && node tests/unit/cloud-sync-security.test.mjs && node tests/unit/attachment-status.test.mjs && node tests/unit/clearfolio-status-signal.test.mjs && node tests/unit/coverage-script-contract.test.mjs",
"test:coverage": "c8 --all --include=app.js --include=cloud-sync.js --include=scripts/ci/static_coverage_evidence.mjs --include=server/attachment_status.mjs --include=server/app.mjs --include=server/auth.mjs --include=server/clearfolio.mjs --include=server/orchestrator.mjs --reporter=json --reporter=json-summary npm run test:coverage:cases",
"test:coverage:cases": "node tests/unit/coverage-script-contract.test.mjs && node tests/unit/attachment-status.test.mjs && node tests/unit/clearfolio-status-signal.test.mjs && node tests/unit/clearfolio-adapter-mock-hmac.test.mjs && node tests/unit/orchestrator.test.mjs && node tests/unit/orchestrator-coverage.test.mjs && node tests/unit/msproject.test.mjs && node tests/unit/auth-password.test.mjs && node tests/unit/editor-unsaved.test.mjs && node tests/unit/static-coverage-evidence.test.mjs && npm run test:api",
"test:e2e": "playwright test",
"test:e2e:headed": "playwright test --headed",
"test:e2e:cloud": "playwright install chromium && playwright test tests/e2e/cloud.spec.js",
Expand Down
Loading
Loading