Skip to content

Commit b795772

Browse files
authored
docs: record integration in fork-local notes; close out SYN-001 status (#3)
AGENTS.md 'Fork-local notes' now lists the .opencode integration (plugins, sidecar, MCP wiring incl. local-entry shape) so future upstream syncs preserve it. SYN-001 status.md updated to final: merged (PRs #1, #2), activated, learning loop verified end-to-end.
1 parent 84215b1 commit b795772

2 files changed

Lines changed: 29 additions & 26 deletions

File tree

‎AGENTS.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ const table = sqliteTable("session", {
165165
This repo is the Alterspective fork (`origin` = `Alter-Igor/opencode`, `upstream` = `anomalyco/opencode`). We work fork-locally: no upstream PRs; keep every local change small and in low-churn files so `git fetch upstream && git merge upstream/dev` stays clean. After any upstream sync: `bun install`, `bun typecheck` from package dirs, `bun test` from `packages/core` and `packages/opencode` (some tests fail on Windows pre-existing — compare against the pre-merge baseline before blaming the sync).
166166

167167
- **Our patches**: `packages/opencode/src/provider/vision-proxy.ts` (vision proxy middleware for text-only models), wired via `wrapLanguageModel` middleware in `packages/opencode/src/session/llm.ts`. Regression test: `packages/opencode/test/provider/vision-proxy.test.ts` — run it after every upstream sync.
168+
- **Alterspective integration** (`.opencode/` only — zero `src/` changes, upstream can't conflict): plugins `plugin/synapse-coder-reporter.ts` (LSP-diagnostics paired-correction reporter to Synapse Coder staging; env-gated `SYNAPSE_CODER_REPORTER_ENABLED`, offline queue `.opencode/synapse-coder-queue.json`, first-use TUI toast) and `plugin/alterspective-rag-standards.ts` (standards system-prompt injection via `experimental.chat.system.transform`); `scripts/health-check.ts` (health/version sidecar, port 4040); `opencode.jsonc` wires Alterspective MCPs (synapse-coder via canonical host `staging.synapse-coder-mcp.alterspective.com.au`, alterspective-rag, keystone, timely, sharedo, vault-local, azure-devops — local entries need `command: string[]` + `environment` + `enabled`, not `args`/`env`). Tests: `packages/opencode/test/plugin/synapse-coder-reporter/` and `test/plugin/alterspective-rag-standards/` — run after upstream syncs. Plan + evidence: `docs/implementation/current/SYN-001-synapse-coder-reporter/` (merged PRs #1, #2).
168169
- **Alterspective branding** (TUI): `packages/tui/src/theme/assets/alterspective.json` (brand palette theme, registered in `theme/index.ts`), fork default theme set to `alterspective` in `packages/tui/src/context/theme.tsx`, ALTERSPECTIVE ASCII wordmark in `packages/tui/src/logo.ts` (shared by `util/presentation.ts` epilogue via import), home splash left-aligned per brand rule LOGO-001 in `packages/tui/src/routes/home.tsx`. After upstream syncs touching these files, re-verify the wordmark renders (bun -e render check) and the theme still registers.
169170
- **Windows env**: `turbo.json` `globalPassThroughEnv` includes `NODIST_PREFIX`/`NODIST_X64` — required so the Nodist node shim works under turbo's strict env-mode (the pre-push hook's 30-package typecheck fails without it). Do not remove.
170171
- **Symlinks**: Windows has no symlink privilege here, so repo symlinks check out as text placeholders. The two typecheck-blocking ones (`packages/app/src/custom-elements.d.ts`, `packages/enterprise/src/custom-elements.d.ts`) are replaced with local hardlinks hidden via `git update-index --skip-worktree` (list them: `git ls-files -v | Select-String '^S'`). ~60 asset symlinks (favicons etc.) remain placeholders — harmless for typecheck/TUI, but app/web builds serving those assets need Developer Mode enabled first.

‎docs/implementation/current/SYN-001-synapse-coder-reporter/status.md‎

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,33 @@
11
# SYN-001: Status
22

3-
**Last updated:** 2026-07-19
4-
**Phase:** Implementation complete — verified (unit + typecheck + MCP wiring + paired E2E against staging). Awaiting commit decision.
5-
**Branch:** `synapse-coder-reporter`
6-
**Worktree:** `C:\GitHub\opencode---synapse-coder-reporter`
3+
**Last updated:** 2026-07-20
4+
**Phase:** MERGED + ACTIVATED. Plugin merged to `dev` via PR #1, canonical-host switch via PR #2. Reporter is live: `SYNAPSE_CODER_REPORTER_ENABLED=true` + staging bearer persisted at User scope; activation probe accepted by Synapse (see below). Related infra/docs: staging canonical host provisioned + global agent file corrected (Alterspective-Intelligence PRs #337, #341, #342).
5+
**Branch:** merged to `dev` (branches/worktrees cleaned up)
6+
7+
## Final Validation Evidence (all observed)
8+
9+
- Merged: PR #1 (`0fbe82b`), PR #2 (`84215b1`) on `Alter-Igor/opencode`
10+
- `bun typecheck` from `packages/opencode` on merged `dev`: 0 errors
11+
- `bun test` (3 new files) on merged `dev`: 39/39 pass
12+
- Activation probe 2026-07-20: paired correction accepted — `coder_stats` record `{"tool":"edit","model":"openrouter/kimi-k3","original":"const enabled: boolean = 'yes'","corrected":"const enabled: boolean = true",...}`
13+
- Learning loop verified end-to-end: 6 lessons promoted via human-gated review board (incl. the keystone-role-claim lesson, independently re-verified), 2 rejected (incl. this plugin's own test probes); A/B generation tests confirm promoted lessons are retrieved (`retrievalMode: rag`) and followed
14+
- Launcher note: `opencodealt.bat` (Nodist bin) fixed to preserve caller cwd and pass args through
15+
16+
## Known Follow-ups (not blocking)
17+
18+
- Phase 2 (permission-rejection detection, formatter pairs, malformed tool calls) needs core hooks — parked, see `ai-memory.md`
19+
- Future verification probes of this plugin should omit `category` so no noise candidates form
20+
- Staging→prod reporter promotion: bake on staging ~1 week, then flip `SYNAPSE_CODER_URL` to the prod facade
21+
722

823
## Current State
924

10-
All Phase 1 tasks implemented and verified. The E2E run against the real staging
11-
service caught a payload schema mismatch (ISS-001) that unit tests could not —
12-
fixed via a pairing redesign (report only `original`→`corrected` pairs; one-sided
13-
detections are held 30 min then dropped). See `evidence/phase4-e2e-verification.md`.
25+
## Task Status (final — all Phase 1 complete)
1426

15-
## Task Status
27+
The E2E run against the real staging service caught a payload schema mismatch
28+
(ISS-001) that unit tests could not — fixed via a pairing redesign (report only
29+
`original`→`corrected` pairs; one-sided detections are held 30 min then dropped).
30+
See `evidence/phase4-e2e-verification.md`.
1631

1732
| Task | Status | Notes |
1833
|------|--------|-------|
@@ -22,31 +37,18 @@ detections are held 30 min then dropped). See `evidence/phase4-e2e-verification.
2237
| 2.2 — LSP diagnostics detection hook | DONE | Detects non-empty `metadata.diagnostics` on edit/write/apply_patch |
2338
| 2.3 — Permission rejection detection | DEFERRED | Phase 2 — infeasible without core changes (plan review) |
2439
| 2.4 — Language derivation utility | DONE | Extension map; covered by unit tests |
25-
| 3.1 — Reporter module (MCP call) DONE (redesigned) | DONE | Direct JSON-RPC `tools/call`; payload matches live schema (ISS-001) |
40+
| 3.1 — Reporter module (MCP call) | DONE (redesigned) | Direct JSON-RPC `tools/call`; payload matches live schema (ISS-001) |
2641
| 3.2 — User opt-in gate | DONE (deviation) | Env var gate (default off) + first-use TUI toast, once-per-project marker (ISS-003) |
2742
| 3.3 — Error handling + offline queue | DONE | `.opencode/synapse-coder-queue.json`, retry on load + 5-min timer, flush on dispose |
2843
| 3.4 — Async fire-and-forget | DONE | No `await` on report path; covered by timing test |
2944
| 4.1 — Unit tests | DONE | 28 tests in `test/plugin/synapse-coder-reporter/synapse-coder-reporter.test.ts` |
3045
| 4.2 — Integration tests | DONE | Simulated LSP diagnostics → paired fix → mocked MCP call asserted end-to-end |
3146
| 4.3 — E2E verification | DONE | Real staging accepted paired correction; `coder_stats` evidence (ISS-001 found & fixed) |
3247

33-
## Validation Evidence
34-
35-
- `bun typecheck` from `packages/opencode`: 0 errors (2026-07-19)
36-
- `bun test` (3 new files): 34/34 pass, 4/4 consecutive clean runs (2026-07-19)
37-
- `opencode mcp list`: `synapse-coder connected` (2026-07-19)
38-
- Staging `coder_stats` contains the probe correction (2026-07-19)
39-
- Fork-local: changes confined to `.opencode/`, `docs/`, `packages/opencode/test/` — no `src/` changes
40-
- Known environmental test flake documented in `evidence/phase4-e2e-verification.md`
41-
42-
## Companion Work (same worktree, outside SYN-001 scope)
48+
## Companion Work (merged in PR #1)
4349

4450
| Item | Status | Notes |
4551
|------|--------|-------|
46-
| `alterspective-rag-standards` plugin + 6 tests | DONE | System-prompt standards injection (Team A) |
47-
| Health/version sidecar `.opencode/scripts/health-check.ts` + 5 tests | DONE | `/health` + `/version` (Team B; path bug fixed ISS-005) |
52+
| `alterspective-rag-standards` plugin + 6 tests | MERGED | System-prompt standards injection (Team A) |
53+
| Health/version sidecar `.opencode/scripts/health-check.ts` + 5 tests | MERGED | `/health` + `/version` (Team B; path bug fixed ISS-005) |
4854
| Brand compliance verification | DONE | All compliant, no fixes needed (Team C report) |
49-
50-
## Blockers
51-
52-
None. Next decision: commit strategy for the worktree (SYN-001 work + companion items).

0 commit comments

Comments
 (0)