githubnext/chopinPublic

Let's compose rich plans together

Run background workers through bounded HarnessAgent sessions

Move document descriptions and research stages to parsed structured output.
Bind public web_search through read-only host GitHub MCP, retire the temporary
Copilot worker runtime, and select a reviewed harness at startup with a
loopback guard for host-login fallback auth.

Keep one native Copilot session for every credit-limited harness session, so
all description chunks and reductions share the registered 64-credit limit.
Refuse settings drift, concurrent or failed turns rather than open a new credit
window. Unlimited Planner turns retain their per-turn session lifecycle.

The pinned HarnessAgent fixes output per agent, so research has separate
private stage agents. The shipped Copilot adapter receives HARNESS_AUTH but
continues using each owner's App token; shared-key billing risks are documented
without promising Chopin billing quotas.

Part of #181 (slice 4 of 5).

Assistant-model: GPT-6 Sol
Assistant-workflow: harness-stack (run 00494056-aec3-47c1-891f-395ff15960d5)
Assistant-duration: 92m converged, estimated 65m
Assistant-verification: Bun focused regression passed: one 64-credit native session across two parsed turns failed before repair (two sessions) and passed after; 23 adapter tests cover drift, abort, error and unlimited behavior
Assistant-verification: Bun unit passed: mise exec -- bun test (1581 pass, 2 PostgreSQL skips)
Assistant-verification: Bun ci passed: mise exec -- bun run ci (one pre-existing unrelated oxlint warning)
Assistant-verification: Bun typecheck passed: mise exec -- bun run types (all workspaces and E2E)
Assistant-verification: Playwright E2E failed: exact unflagged parallel runs 226/230 and 227/230 with UI timing failures under AGENT=off
Assistant-verification: Playwright E2E passed: flock /tmp/chopin-e2e.lock mise exec -- bun run e2e --workers=1 (230/230 on final checkout)
Assistant-verification: Playwright CI-profile E2E passed: CI=1 flock /tmp/chopin-e2e.lock mise exec -- bun run e2e (227 passed, 3 flaky recovered on retry, exit 0)
Assistant-verification: terminal startup passed: HARNESS_AUTH=auto refused 0.0.0.0 and served HTTP 200 on 127.0.0.1:8787 on final source
Assistant-verification: agent-browser Edge E2E passed: 25,336-byte document completed at least seven description turns through one native session; earlier /research published a sourced child
Assistant-verification: exact-case link check passed: 40 documentation links and anchors resolve
Assistant-verification: qlty metrics and smells passed: changed adapter analyzed; existing complexity reported
Assistant-verification: ffprobe QA video passed: 173.133s WebM of signed-in Edge multi-turn description scenario
User-preference: Run live Edge checks with github-copilot/gpt-6-luna without changing other tabs or sign-in settings.
Co-authored-by: Alex Lavaee <lavaman131@github.com>
ALAlex Lavaee authored
7dcc88dPatch
Parent7ea0c53
22 files changed+1535-1418
StackedSplit
.env.example+5 โˆ’0
AGENTS.md+23 โˆ’13
apps/server/src/config.test.ts+31 โˆ’0
apps/server/src/config.ts+11 โˆ’1
apps/server/src/harness/agents.test.ts+209 โˆ’1
apps/server/src/harness/agents.ts+91 โˆ’2
apps/server/src/harness/copilot-sdk/adapter.test.ts+359 โˆ’1
apps/server/src/harness/copilot-sdk/adapter.ts+96 โˆ’26
apps/server/src/harness/copilot-sdk/workers.test.ts+0 โˆ’338
apps/server/src/harness/copilot-sdk/workers.ts+0 โˆ’424
apps/server/src/harness/harnesses.test.ts+15 โˆ’0
apps/server/src/harness/harnesses.ts+45 โˆ’10
apps/server/src/harness/web-search.test.ts+123 โˆ’0
apps/server/src/harness/web-search.ts+95 โˆ’0
apps/server/src/jobs/document-summary.ts+81 โˆ’141
apps/server/src/jobs/research-workspace.test.ts+31 โˆ’0
apps/server/src/jobs/research-workspace.ts+151 โˆ’366
apps/server/src/main.ts+5 โˆ’8
docs/architecture.md+17 โˆ’6
docs/background-jobs.md+43 โˆ’37
docs/hosted-agent.md+45 โˆ’23
docs/self-hosting.md+59 โˆ’21