brass-runtime 1.16.0 → 1.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/README.md +283 -18
- package/dist/agent/cli/main.cjs +38 -38
- package/dist/agent/cli/main.js +6 -6
- package/dist/agent/cli/main.mjs +6 -6
- package/dist/agent/index.cjs +7 -7
- package/dist/agent/index.d.ts +1 -1
- package/dist/agent/index.js +6 -6
- package/dist/agent/index.mjs +6 -6
- package/dist/chunk-2HQTDLHF.mjs +683 -0
- package/dist/chunk-36I3M4UC.mjs +370 -0
- package/dist/{chunk-QY5FKYEQ.js → chunk-3AYM6WPJ.js} +570 -51
- package/dist/chunk-3LOYJFRR.cjs +300 -0
- package/dist/chunk-3Y2RIUMM.js +300 -0
- package/dist/{chunk-N6VHMOWB.cjs → chunk-4ROBZFL6.cjs} +128 -128
- package/dist/{chunk-NC5SDRYE.js → chunk-52OB2ROS.js} +4 -4
- package/dist/{chunk-JX3LZQJH.cjs → chunk-52PPNNI4.cjs} +82 -20
- package/dist/{chunk-5YOQOXEQ.cjs → chunk-5EC274J5.cjs} +676 -293
- package/dist/chunk-5QC7LRZ3.js +229 -0
- package/dist/{chunk-7TL2LHQJ.js → chunk-5VRJNBLZ.mjs} +524 -141
- package/dist/chunk-62AZW6UT.cjs +313 -0
- package/dist/chunk-6IXXWIUM.js +683 -0
- package/dist/chunk-74ZTY6CP.js +2871 -0
- package/dist/chunk-76YMRMH2.cjs +777 -0
- package/dist/chunk-7CMJS3QE.mjs +2871 -0
- package/dist/{chunk-2WC63LJK.mjs → chunk-7JIJOVCT.js} +20 -10
- package/dist/{chunk-FM4W4QPL.js → chunk-A2OM6NEH.mjs} +5 -4
- package/dist/chunk-AGR5B2BC.cjs +683 -0
- package/dist/chunk-AVNQLJ5V.js +777 -0
- package/dist/chunk-B33ICAKP.js +313 -0
- package/dist/{chunk-J3H54ZRV.mjs → chunk-B5JD23U7.mjs} +1 -1
- package/dist/chunk-BABBZK4Y.js +2024 -0
- package/dist/{chunk-U5KWK3PX.mjs → chunk-C3MDXTRZ.js} +11 -0
- package/dist/{chunk-F5EUMJL7.mjs → chunk-CIZFIMK5.js} +55 -5
- package/dist/{chunk-SPUEME2B.cjs → chunk-CZIVE6NT.cjs} +12 -1
- package/dist/{chunk-TDVMADDN.js → chunk-DNFJLJMW.mjs} +11 -0
- package/dist/chunk-DNFO2EIZ.mjs +777 -0
- package/dist/{chunk-XDZOO4L5.js → chunk-EJ6BPYVR.mjs} +79 -17
- package/dist/{chunk-JNFRRJYH.cjs → chunk-ENKODRU3.cjs} +242 -192
- package/dist/chunk-EOC4UHBS.mjs +229 -0
- package/dist/{chunk-7LVI2GIN.js → chunk-FH2X7BVP.js} +507 -72
- package/dist/{chunk-OOGJ73B6.js → chunk-FHQGHPMO.mjs} +20 -10
- package/dist/{chunk-WQ5QNU5R.cjs → chunk-GLE2WY7Z.cjs} +652 -217
- package/dist/{chunk-G6IQOE4P.mjs → chunk-GYM3LLGS.mjs} +507 -72
- package/dist/chunk-HLWLMW2F.mjs +2024 -0
- package/dist/{chunk-TVN5I4U6.cjs → chunk-JF5WGYJJ.cjs} +25 -24
- package/dist/{chunk-CY33PGEX.mjs → chunk-KH4SYAOS.mjs} +570 -51
- package/dist/chunk-KN32XNTH.mjs +313 -0
- package/dist/chunk-KQLYONSE.cjs +2871 -0
- package/dist/{chunk-7HUOJA4W.cjs → chunk-KZJQ723N.cjs} +90 -80
- package/dist/{chunk-CCKHV5BT.mjs → chunk-L2SYFEBS.js} +5 -4
- package/dist/{chunk-IJT6RRQ5.cjs → chunk-L6VB5N7Q.cjs} +20 -9
- package/dist/{chunk-ZGLD4TVZ.mjs → chunk-MBEJI5HF.mjs} +4 -4
- package/dist/{chunk-PRWCB3QL.mjs → chunk-MIIYDLGM.js} +524 -141
- package/dist/{chunk-H55LI6WY.js → chunk-MOO4L7F4.mjs} +15 -4
- package/dist/{chunk-7XOPAB5Q.js → chunk-MT3OWDPC.mjs} +55 -5
- package/dist/chunk-MVGUEJ5Z.cjs +370 -0
- package/dist/chunk-PD4EJTQC.cjs +229 -0
- package/dist/chunk-PWC3RBQE.mjs +300 -0
- package/dist/{chunk-MWXMNYJS.cjs → chunk-Q2I37RP3.cjs} +643 -124
- package/dist/{chunk-VFIUZG7J.mjs → chunk-RKGKFN2A.js} +79 -17
- package/dist/{chunk-NYL4D7SK.cjs → chunk-SA6HUJVI.cjs} +5 -5
- package/dist/{chunk-K2T3DV26.mjs → chunk-TRM4JUZQ.js} +15 -4
- package/dist/chunk-UB4B6OFY.js +370 -0
- package/dist/{chunk-G3XGCZDQ.js → chunk-UCUBNWM2.js} +1 -1
- package/dist/chunk-VN44DYYT.cjs +2024 -0
- package/dist/{client-CtFmoDvM.d.ts → client-CZHU674n.d.ts} +211 -36
- package/dist/core/index.cjs +135 -9
- package/dist/core/index.d.ts +238 -33
- package/dist/core/index.js +155 -29
- package/dist/core/index.mjs +155 -29
- package/dist/{effect-CGNl5Rqp.d.ts → effect-DIUHZ9IN.d.ts} +89 -1
- package/dist/effectRunner-CFLC32IK.cjs +8 -0
- package/dist/{effectRunner-A4CHJXJI.js → effectRunner-L4S7IPT3.js} +2 -2
- package/dist/{effectRunner-OPUF6QRN.mjs → effectRunner-NNGG75QA.mjs} +2 -2
- package/dist/http/index.cjs +324 -2986
- package/dist/http/index.d.ts +54 -68
- package/dist/http/index.js +238 -2900
- package/dist/http/index.mjs +238 -2900
- package/dist/http/testing.cjs +14 -12
- package/dist/http/testing.d.ts +5 -4
- package/dist/http/testing.js +10 -8
- package/dist/http/testing.mjs +10 -8
- package/dist/index.cjs +423 -255
- package/dist/index.d.ts +87 -69
- package/dist/index.js +301 -133
- package/dist/index.mjs +301 -133
- package/dist/observability/index.cjs +16 -531
- package/dist/observability/index.d.ts +81 -8
- package/dist/observability/index.js +23 -538
- package/dist/observability/index.mjs +23 -538
- package/dist/perf/cli.cjs +401 -0
- package/dist/perf/cli.d.ts +1 -0
- package/dist/perf/cli.js +401 -0
- package/dist/perf/cli.mjs +401 -0
- package/dist/perf/index.cjs +141 -0
- package/dist/perf/index.d.ts +483 -0
- package/dist/perf/index.js +141 -0
- package/dist/perf/index.mjs +141 -0
- package/dist/schedule-CK3Ml_7p.d.ts +259 -0
- package/dist/schema/index.cjs +6 -2
- package/dist/schema/index.d.ts +3 -1
- package/dist/schema/index.js +5 -1
- package/dist/schema/index.mjs +5 -1
- package/dist/{server-C8hDXA74.d.ts → server-GJPg8ZSG.d.ts} +4 -3
- package/dist/{stream-dvSs0QS5.d.ts → stream-B4oK9JFP.d.ts} +1 -1
- package/dist/{tracer-B5tRH9H7.d.ts → tracer-Hwt1cl7h.d.ts} +13 -54
- package/dist/{tracing-Dt9S_6V8.d.ts → tracing-DqbTKGcf.d.ts} +1 -1
- package/docs/ARCHITECTURE.md +292 -0
- package/docs/README.md +63 -0
- package/docs/adr/0001-ai-context-pack.md +32 -0
- package/docs/agent-apply-mode.md +104 -0
- package/docs/agent-approvals.md +110 -0
- package/docs/agent-batch.md +185 -0
- package/docs/agent-boundaries.md +112 -0
- package/docs/agent-chat-sessions.md +160 -0
- package/docs/agent-ci.md +17 -0
- package/docs/agent-cli.md +405 -0
- package/docs/agent-config.md +480 -0
- package/docs/agent-context-discovery.md +159 -0
- package/docs/agent-copilot-like-dx.md +126 -0
- package/docs/agent-declarative-optimized-planning.md +138 -0
- package/docs/agent-dx.md +224 -0
- package/docs/agent-env-files.md +126 -0
- package/docs/agent-follow-up-context.md +43 -0
- package/docs/agent-global-usage.md +180 -0
- package/docs/agent-init.md +109 -0
- package/docs/agent-install-and-configure.md +516 -0
- package/docs/agent-language-workspace-ux.md +99 -0
- package/docs/agent-llm-adapters.md +123 -0
- package/docs/agent-local-install.md +190 -0
- package/docs/agent-local-tests.md +51 -0
- package/docs/agent-observability.md +155 -0
- package/docs/agent-patch-quality-loop.md +162 -0
- package/docs/agent-presets.md +22 -0
- package/docs/agent-project-commands.md +237 -0
- package/docs/agent-project-intelligence.md +156 -0
- package/docs/agent-redaction.md +18 -0
- package/docs/agent-release-readiness.md +76 -0
- package/docs/agent-rollback-safety.md +162 -0
- package/docs/agent-rollback.md +23 -0
- package/docs/agent-run-artifacts.md +16 -0
- package/docs/agent-vscode-auto-discovery.md +137 -0
- package/docs/agent-vscode-batch-runner.md +100 -0
- package/docs/agent-vscode-chat-layout.md +90 -0
- package/docs/agent-vscode-clean-install.md +147 -0
- package/docs/agent-vscode-code-actions.md +70 -0
- package/docs/agent-vscode-diff-preview.md +45 -0
- package/docs/agent-vscode-inline-assist.md +56 -0
- package/docs/agent-vscode-install.md +186 -0
- package/docs/agent-vscode-model-setup.md +97 -0
- package/docs/agent-vscode-patch-preview.md +92 -0
- package/docs/agent-vscode-problems.md +79 -0
- package/docs/agent-vscode-project-dashboard.md +106 -0
- package/docs/agent-vscode-run-history.md +92 -0
- package/docs/agent-vscode-ux.md +73 -0
- package/docs/ai/INVARIANTS.md +84 -0
- package/docs/ai/PROJECT_MAP.md +338 -0
- package/docs/ai/PUBLIC_API.md +336 -0
- package/docs/ai/VALIDATION_MATRIX.md +67 -0
- package/docs/api-polish.md +37 -0
- package/docs/cancellation.md +162 -0
- package/docs/coverage.md +46 -0
- package/docs/getting-started.md +159 -0
- package/docs/guides/README.md +40 -0
- package/docs/guides/circuit-breaker.md +89 -0
- package/docs/guides/error-handling.md +91 -0
- package/docs/guides/getting-started.md +107 -0
- package/docs/guides/layers.md +189 -0
- package/docs/guides/metrics.md +101 -0
- package/docs/guides/resource-management.md +141 -0
- package/docs/guides/retry.md +215 -0
- package/docs/guides/semaphore.md +66 -0
- package/docs/guides/streams.md +117 -0
- package/docs/guides/supervisors.md +98 -0
- package/docs/guides/testing.md +162 -0
- package/docs/guides/tracing.md +71 -0
- package/docs/http-recipes.md +399 -0
- package/docs/http.md +749 -0
- package/docs/modules.md +285 -0
- package/docs/observability-collector-smoke.md +31 -0
- package/docs/observability-framework-examples.md +98 -0
- package/docs/observability.md +542 -0
- package/docs/otel-collector-smoke.yaml +27 -0
- package/docs/performance-profiler.md +199 -0
- package/docs/production-readiness.md +73 -0
- package/docs/recipes/README.md +12 -0
- package/docs/recipes/http-server.md +45 -0
- package/docs/recipes/layers.md +44 -0
- package/docs/recipes/performance.md +47 -0
- package/docs/recipes/runtime.md +41 -0
- package/docs/recipes/testing.md +41 -0
- package/docs/release.md +53 -0
- package/docs/wasm-bounded-queues.md +44 -0
- package/docs/wasm-engine-observability-benchmarks.md +85 -0
- package/docs/wasm-fiber-engine.md +117 -0
- package/docs/wasm-scheduler-state-machine.md +122 -0
- package/docs/wasm-stream-chunks.md +54 -0
- package/package.json +22 -2
- package/dist/chunk-45F7OKGT.cjs +0 -104
- package/dist/chunk-7V4KY4RL.mjs +0 -104
- package/dist/chunk-DJQ7OMMB.cjs +0 -144
- package/dist/chunk-GOV47PPB.mjs +0 -552
- package/dist/chunk-JF4XXPZ5.cjs +0 -552
- package/dist/chunk-KCPT2D6G.js +0 -552
- package/dist/chunk-NOYZIMUJ.mjs +0 -144
- package/dist/chunk-PNVFW245.js +0 -144
- package/dist/chunk-ROJC3NBJ.js +0 -104
- package/dist/effectRunner-3ZHAD3LE.cjs +0 -8
- package/dist/schedule-Fque9Abz.d.ts +0 -70
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Brass Agent VS Code UX
|
|
2
|
+
|
|
3
|
+
The VS Code extension is intentionally a thin client over the `brass-agent` CLI, but the editor surface should still feel guided and uncluttered.
|
|
4
|
+
|
|
5
|
+
## Runs sidebar
|
|
6
|
+
|
|
7
|
+
The Activity Bar contributes a **Brass Agent** container with a **Run History** view.
|
|
8
|
+
|
|
9
|
+
When the history is empty, the view shows a welcome state with links to:
|
|
10
|
+
|
|
11
|
+
- **New Run** — guided quick pick for common actions.
|
|
12
|
+
- **Initialize Workspace** — writes `.brass-agent.json`, `brass-agent.batch.json`, `.env.example`, and `BRASS_AGENT.md`.
|
|
13
|
+
- **Doctor** — checks CLI, workspace, model, package manager, and VS Code setup.
|
|
14
|
+
|
|
15
|
+
## Toolbar design
|
|
16
|
+
|
|
17
|
+
The view title toolbar is intentionally small:
|
|
18
|
+
|
|
19
|
+
- **New Run** — primary action.
|
|
20
|
+
- **Cancel Current Run** — only visible while a run is active.
|
|
21
|
+
- **Refresh History** — always visible.
|
|
22
|
+
|
|
23
|
+
Everything else lives in the overflow menu:
|
|
24
|
+
|
|
25
|
+
- Show Output
|
|
26
|
+
- Initialize Workspace
|
|
27
|
+
- Doctor
|
|
28
|
+
- Run Configured Batch
|
|
29
|
+
- Run Batch File
|
|
30
|
+
- Show Last Patch Preview
|
|
31
|
+
- Clear History
|
|
32
|
+
|
|
33
|
+
This prevents the toolbar from turning into a row of long command labels.
|
|
34
|
+
|
|
35
|
+
## New Run flow
|
|
36
|
+
|
|
37
|
+
`Brass Agent: New Run...` opens a Quick Pick with the most common workflows:
|
|
38
|
+
|
|
39
|
+
- Inspect Workspace
|
|
40
|
+
- Propose Fix
|
|
41
|
+
- Apply Fix
|
|
42
|
+
- Fix Tests
|
|
43
|
+
- Typecheck
|
|
44
|
+
- Lint
|
|
45
|
+
- Run Configured Batch
|
|
46
|
+
- Run Batch File
|
|
47
|
+
- Doctor
|
|
48
|
+
- Initialize Workspace
|
|
49
|
+
- Show Output
|
|
50
|
+
|
|
51
|
+
`Apply Fix`, `Fix Tests`, `Typecheck`, and `Lint` still use the safe patch preview flow. VS Code never applies patches directly.
|
|
52
|
+
|
|
53
|
+
## Running state
|
|
54
|
+
|
|
55
|
+
While a CLI process is active, the extension sets the `brassAgent.running` VS Code context key. That controls whether the cancel action appears in the Run History toolbar.
|
|
56
|
+
|
|
57
|
+
The Status Bar also shows run state and links to the output channel.
|
|
58
|
+
|
|
59
|
+
## Command Palette
|
|
60
|
+
|
|
61
|
+
Command Palette commands are grouped under the `Brass Agent` category, so users see names such as:
|
|
62
|
+
|
|
63
|
+
```txt
|
|
64
|
+
Brass Agent: New Run...
|
|
65
|
+
Brass Agent: Doctor
|
|
66
|
+
Brass Agent: Initialize Workspace
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Argument-only commands such as `Open Run Details`, `Show History Patch`, and `Rerun History Run` are hidden from the Command Palette because they are meant to be invoked from the Run History tree context menu.
|
|
70
|
+
|
|
71
|
+
## Chat view
|
|
72
|
+
|
|
73
|
+
P29 adds a persistent Chat view to the Brass Agent sidebar. It provides a lower-friction, Copilot-like way to ask questions, request patch proposals, and run apply-after-preview flows without memorizing CLI commands. See [Copilot-like VS Code DX](./agent-copilot-like-dx.md).
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# Invariants
|
|
2
|
+
|
|
3
|
+
These are the rules that make `brass-runtime` understandable. Treat them as
|
|
4
|
+
stronger than local convenience.
|
|
5
|
+
|
|
6
|
+
## Core effect invariants
|
|
7
|
+
|
|
8
|
+
- Effects are values. Constructing an effect must not run the side effect.
|
|
9
|
+
- `Async<R, E, A>` is the semantic async representation.
|
|
10
|
+
- `Promise` is an interop boundary, not the runtime primitive.
|
|
11
|
+
- Public helpers may expose `toPromise` for DX, but execution still belongs to
|
|
12
|
+
the runtime/fiber interpreter.
|
|
13
|
+
- Synchronous loops must respect fiber/scheduler budgets.
|
|
14
|
+
- Failure must remain typed where the API promises typed errors.
|
|
15
|
+
|
|
16
|
+
## Cancellation and scopes
|
|
17
|
+
|
|
18
|
+
- Async operations should be cancelable whenever the host API allows it.
|
|
19
|
+
- If a host operation returns a canceler, the fiber must detach it when the
|
|
20
|
+
operation completes.
|
|
21
|
+
- Child fibers belong to a scope or parent relationship.
|
|
22
|
+
- Closing a scope interrupts owned children and runs finalizers.
|
|
23
|
+
- Finalizers run exactly once and in reverse registration order.
|
|
24
|
+
- Await `closeAsync` when completion matters; `close` is fire-and-forget.
|
|
25
|
+
|
|
26
|
+
## Scheduler and fibers
|
|
27
|
+
|
|
28
|
+
- All normal async resumption goes back through the scheduler/fiber machinery.
|
|
29
|
+
The no-hooks/no-lane native top-level fast path may resume via its own
|
|
30
|
+
microtask loop, but only when it preserves runtime/fiber-local semantics and
|
|
31
|
+
is disabled for hooks, custom schedulers, lanes, and WASM mode.
|
|
32
|
+
- Fibers must not notify joiners more than once.
|
|
33
|
+
- Interrupt must be cooperative and idempotent.
|
|
34
|
+
- Runtime hooks must observe events without changing semantics.
|
|
35
|
+
- Lane/caller scheduling is metadata for fairness and observability, not a
|
|
36
|
+
behavior change for user effects.
|
|
37
|
+
|
|
38
|
+
## Streams
|
|
39
|
+
|
|
40
|
+
- Streams are pull-based and lazy.
|
|
41
|
+
- End-of-stream is modeled separately from failure.
|
|
42
|
+
- Buffering must preserve the selected backpressure/drop strategy.
|
|
43
|
+
- Stream finalizers must cancel readers/producers.
|
|
44
|
+
- Fusion optimizations must not change ordering, failure, or cancellation.
|
|
45
|
+
|
|
46
|
+
## HTTP
|
|
47
|
+
|
|
48
|
+
- HTTP is built on top of runtime primitives; it is not part of the core.
|
|
49
|
+
- Request construction must stay lazy.
|
|
50
|
+
- Fetch cancellation must be wired to fiber interruption through
|
|
51
|
+
`AbortController`.
|
|
52
|
+
- Keep wire, content, and metadata layers separate.
|
|
53
|
+
- Middleware transforms clients; it should not execute requests while being
|
|
54
|
+
composed.
|
|
55
|
+
- Retry must respect method safety, retry budgets, aborts, pool rejection, and
|
|
56
|
+
explicit per-request overrides.
|
|
57
|
+
- Compression/decompression must keep headers and body semantics explicit.
|
|
58
|
+
- Lifecycle cache/dedup/priority code must preserve cancellation ownership.
|
|
59
|
+
|
|
60
|
+
## WASM
|
|
61
|
+
|
|
62
|
+
- WASM mode is strict. If WASM is requested and unavailable, fail clearly.
|
|
63
|
+
- TypeScript and WASM engines should have parity tests for shared behavior.
|
|
64
|
+
- Generated `wasm/pkg` output is build output; source changes live in `crates/`
|
|
65
|
+
and TypeScript bridge files.
|
|
66
|
+
|
|
67
|
+
## Agent
|
|
68
|
+
|
|
69
|
+
- `src/agent` may depend on runtime primitives.
|
|
70
|
+
- Core runtime must not depend on agent code.
|
|
71
|
+
- Discovery and patch application go through agent services and permission
|
|
72
|
+
policies.
|
|
73
|
+
- Workspace reads/writes stay workspace-relative and policy-aware.
|
|
74
|
+
- Prompt/context helpers should be bounded and redaction-aware.
|
|
75
|
+
|
|
76
|
+
## When unsure
|
|
77
|
+
|
|
78
|
+
Before changing behavior, answer these:
|
|
79
|
+
|
|
80
|
+
- What owns this async operation?
|
|
81
|
+
- What cancels it?
|
|
82
|
+
- Which scope/fiber runs its finalizer?
|
|
83
|
+
- Is this public API or internal plumbing?
|
|
84
|
+
- Which tests encode the invariant I am touching?
|
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
# Project Map
|
|
2
|
+
|
|
3
|
+
This is the compact map for understanding `brass-runtime` quickly.
|
|
4
|
+
|
|
5
|
+
## Package entry points
|
|
6
|
+
|
|
7
|
+
- `src/index.ts` -> package root export `brass-runtime`.
|
|
8
|
+
- `src/http/index.ts` -> subpath export `brass-runtime/http`.
|
|
9
|
+
- `src/observability/index.ts` -> subpath export `brass-runtime/observability`.
|
|
10
|
+
- `src/perf/index.ts` -> subpath export `brass-runtime/perf`.
|
|
11
|
+
- `src/perf/cli.ts` -> CLI binary `brass-perf`.
|
|
12
|
+
- `src/agent/index.ts` -> subpath export `brass-runtime/agent`.
|
|
13
|
+
- `src/agent/cli/main.ts` -> CLI binary `brass-agent`.
|
|
14
|
+
- `tsup.config.ts` -> CJS, ESM, and JS bundle entries.
|
|
15
|
+
- `package.json` -> scripts, exports, package files, CLI bin.
|
|
16
|
+
|
|
17
|
+
## Core runtime
|
|
18
|
+
|
|
19
|
+
Paths:
|
|
20
|
+
|
|
21
|
+
- `src/core/types`
|
|
22
|
+
- `src/core/runtime`
|
|
23
|
+
- `src/core/runtime/engine`
|
|
24
|
+
|
|
25
|
+
Purpose:
|
|
26
|
+
|
|
27
|
+
- Define `Effect`, `Async`, `Exit`, `Cause`, and cancellation types.
|
|
28
|
+
- Interpret `Async` values in fibers.
|
|
29
|
+
- Provide first-release DX helpers (`runPromise`, `runExit`, `makeRuntime`) on
|
|
30
|
+
top of the existing runtime.
|
|
31
|
+
- Own scheduler, scopes, finalizers, runtime hooks, layers, metrics, tracing,
|
|
32
|
+
schedules, supervisors, semaphores, resources, worker pools, and engine
|
|
33
|
+
selection.
|
|
34
|
+
|
|
35
|
+
Read first:
|
|
36
|
+
|
|
37
|
+
- `src/core/types/asyncEffect.ts`
|
|
38
|
+
- `src/core/runtime/runtime.ts`
|
|
39
|
+
- `src/core/runtime/dx.ts`
|
|
40
|
+
- `src/core/runtime/fiber.ts`
|
|
41
|
+
- `src/core/runtime/scope.ts`
|
|
42
|
+
- `src/core/runtime/scheduler.ts`
|
|
43
|
+
- `src/core/runtime/supervisor.ts`
|
|
44
|
+
- `src/core/runtime/resource.ts`
|
|
45
|
+
- `src/core/runtime/schedule.ts`
|
|
46
|
+
|
|
47
|
+
Tests:
|
|
48
|
+
|
|
49
|
+
- `src/core/types/__tests__`
|
|
50
|
+
- `src/core/runtime/__tests__`
|
|
51
|
+
|
|
52
|
+
Docs:
|
|
53
|
+
|
|
54
|
+
- `docs/ARCHITECTURE.md`
|
|
55
|
+
- `docs/cancellation.md`
|
|
56
|
+
- `docs/observability.md`
|
|
57
|
+
- `docs/guides/testing.md`
|
|
58
|
+
- `docs/guides/resource-management.md`
|
|
59
|
+
- `docs/guides/retry.md`
|
|
60
|
+
- `docs/guides/supervisors.md`
|
|
61
|
+
- `docs/recipes`
|
|
62
|
+
- `docs/api-polish.md`
|
|
63
|
+
- `docs/release.md`
|
|
64
|
+
|
|
65
|
+
## Streams
|
|
66
|
+
|
|
67
|
+
Paths:
|
|
68
|
+
|
|
69
|
+
- `src/core/stream`
|
|
70
|
+
|
|
71
|
+
Purpose:
|
|
72
|
+
|
|
73
|
+
- Provide pull-based streams, buffering, queues, hubs, pipelines, chunks,
|
|
74
|
+
fusion, and stream operators.
|
|
75
|
+
- Preserve backpressure, cancellation, and resource safety.
|
|
76
|
+
|
|
77
|
+
Read first:
|
|
78
|
+
|
|
79
|
+
- `src/core/stream/stream.ts`
|
|
80
|
+
- `src/core/stream/buffer.ts`
|
|
81
|
+
- `src/core/stream/queue.ts`
|
|
82
|
+
- `src/core/stream/pipeline.ts`
|
|
83
|
+
|
|
84
|
+
Tests:
|
|
85
|
+
|
|
86
|
+
- `src/core/stream/__tests__`
|
|
87
|
+
|
|
88
|
+
Docs:
|
|
89
|
+
|
|
90
|
+
- `docs/guides/streams.md`
|
|
91
|
+
- `agent.md` stream and pipeline sections
|
|
92
|
+
|
|
93
|
+
## HTTP
|
|
94
|
+
|
|
95
|
+
Paths:
|
|
96
|
+
|
|
97
|
+
- `src/http`
|
|
98
|
+
- `src/http/defaultClient.ts`
|
|
99
|
+
- `src/http/server.ts`
|
|
100
|
+
- `src/http/retry`
|
|
101
|
+
- `src/http/lifecycle`
|
|
102
|
+
- `src/http/compression`
|
|
103
|
+
- `src/http/adaptiveLimiter`
|
|
104
|
+
- `src/http/prewarm`
|
|
105
|
+
- `src/http/optics`
|
|
106
|
+
|
|
107
|
+
Purpose:
|
|
108
|
+
|
|
109
|
+
- Provide a lazy, cancelable HTTP client on top of `Async`.
|
|
110
|
+
- Expose `makeDefaultHttpClient` as the one-stop default entrypoint.
|
|
111
|
+
- Provide a first-party HTTP server MVP with a Node adapter, effect router,
|
|
112
|
+
schema validation, observability integration, and `Resource` lifecycle.
|
|
113
|
+
- Keep wire, content, metadata, lifecycle, retry, compression, batching,
|
|
114
|
+
pre-warming, adaptive concurrency, tracing, server, and validation concerns
|
|
115
|
+
separated.
|
|
116
|
+
|
|
117
|
+
Read first:
|
|
118
|
+
|
|
119
|
+
- `src/http/client.ts`
|
|
120
|
+
- `src/http/httpClient.ts`
|
|
121
|
+
- `src/http/defaultClient.ts`
|
|
122
|
+
- `src/http/server.ts`
|
|
123
|
+
- `src/http/index.ts`
|
|
124
|
+
- `src/http/lifecycle/lifecycleClient.ts`
|
|
125
|
+
- `src/http/lifecycle/batch.ts`
|
|
126
|
+
- `src/http/retry/retry.ts`
|
|
127
|
+
- `src/http/compression/middleware.ts`
|
|
128
|
+
- `src/http/adaptiveLimiter/adaptiveLimiter.ts`
|
|
129
|
+
- `src/http/prewarm/prewarmManager.ts`
|
|
130
|
+
|
|
131
|
+
Tests:
|
|
132
|
+
|
|
133
|
+
- `src/http/__tests__`
|
|
134
|
+
- `src/http/lifecycle/__tests__`
|
|
135
|
+
- `src/http/prewarm/__tests__`
|
|
136
|
+
- `src/http/adaptiveLimiter/__tests__`
|
|
137
|
+
|
|
138
|
+
Docs:
|
|
139
|
+
|
|
140
|
+
- `docs/http.md`
|
|
141
|
+
- `docs/production-readiness.md`
|
|
142
|
+
- `src/http/README.md`
|
|
143
|
+
- `src/http/lifecycle/README.md`
|
|
144
|
+
- `src/http/prewarm/README.md`
|
|
145
|
+
|
|
146
|
+
## Observability Export
|
|
147
|
+
|
|
148
|
+
Paths:
|
|
149
|
+
|
|
150
|
+
- `src/observability`
|
|
151
|
+
- `src/core/runtime/events.ts`
|
|
152
|
+
- `src/core/runtime/tracingSink.ts`
|
|
153
|
+
|
|
154
|
+
Purpose:
|
|
155
|
+
|
|
156
|
+
- Export runtime metrics, logs, and spans out of process.
|
|
157
|
+
- Keep Prometheus/OTLP formatting dependency-free and backend-neutral.
|
|
158
|
+
- Provide effect-level span/log-context helpers on top of fiber context.
|
|
159
|
+
|
|
160
|
+
Read first:
|
|
161
|
+
|
|
162
|
+
- `src/observability/index.ts`
|
|
163
|
+
- `src/observability/metrics.ts`
|
|
164
|
+
- `src/observability/logs.ts`
|
|
165
|
+
- `src/observability/traces.ts`
|
|
166
|
+
- `src/observability/traceContext.ts`
|
|
167
|
+
- `src/observability/request.ts`
|
|
168
|
+
- `src/observability/exportPipeline.ts`
|
|
169
|
+
- `src/observability/sampling.ts`
|
|
170
|
+
- `src/observability/redaction.ts`
|
|
171
|
+
- `src/observability/cardinality.ts`
|
|
172
|
+
- `src/observability/adapters.ts`
|
|
173
|
+
- `src/observability/config.ts`
|
|
174
|
+
- `src/observability/server.ts`
|
|
175
|
+
|
|
176
|
+
Tests:
|
|
177
|
+
|
|
178
|
+
- `src/observability/__tests__`
|
|
179
|
+
|
|
180
|
+
Docs:
|
|
181
|
+
|
|
182
|
+
- `docs/observability.md`
|
|
183
|
+
- `docs/observability-framework-examples.md`
|
|
184
|
+
- `docs/observability-collector-smoke.md`
|
|
185
|
+
- `docs/otel-collector-smoke.yaml`
|
|
186
|
+
|
|
187
|
+
## Performance Profiler
|
|
188
|
+
|
|
189
|
+
Paths:
|
|
190
|
+
|
|
191
|
+
- `src/perf`
|
|
192
|
+
- `docs/performance-profiler.md`
|
|
193
|
+
|
|
194
|
+
Purpose:
|
|
195
|
+
|
|
196
|
+
- Profile runtime primitives, HTTP layer overhead, memory retention, and
|
|
197
|
+
observability cost using dependency-free local workloads.
|
|
198
|
+
- Provide importable report APIs plus `npm run perf`, `npm run perf:json`,
|
|
199
|
+
`npm run perf:history`, `npm run benchmark:perf`, and the `brass-perf`
|
|
200
|
+
package binary.
|
|
201
|
+
- Persist compact perf history to `.brass/perf-history/runs.jsonl` and named
|
|
202
|
+
baselines to `.brass/perf-history/baselines`.
|
|
203
|
+
- Keep profiler code outside core because it depends on runtime, HTTP, and
|
|
204
|
+
observability modules.
|
|
205
|
+
|
|
206
|
+
Read first:
|
|
207
|
+
|
|
208
|
+
- `src/perf/index.ts`
|
|
209
|
+
- `src/perf/report.ts`
|
|
210
|
+
- `src/perf/httpProfiler.ts`
|
|
211
|
+
- `src/perf/httpMemoryLab.ts`
|
|
212
|
+
- `src/perf/history.ts`
|
|
213
|
+
- `src/perf/runtimeProfiler.ts`
|
|
214
|
+
- `src/perf/runtimeAb.ts`
|
|
215
|
+
- `src/perf/runtimeSoak.ts`
|
|
216
|
+
- `src/perf/runtimeDiagnostics.ts`
|
|
217
|
+
- `src/perf/budget.ts`
|
|
218
|
+
- `src/perf/recommendations.ts`
|
|
219
|
+
|
|
220
|
+
Tests:
|
|
221
|
+
|
|
222
|
+
- `src/perf/__tests__`
|
|
223
|
+
|
|
224
|
+
Docs:
|
|
225
|
+
|
|
226
|
+
- `docs/performance-profiler.md`
|
|
227
|
+
|
|
228
|
+
## Brass Agent
|
|
229
|
+
|
|
230
|
+
Paths:
|
|
231
|
+
|
|
232
|
+
- `src/agent/cli`
|
|
233
|
+
- `src/agent/core`
|
|
234
|
+
- `src/agent/node`
|
|
235
|
+
- `src/agent/tools`
|
|
236
|
+
- `src/agent/llm`
|
|
237
|
+
- `extensions/vscode-brass-agent`
|
|
238
|
+
|
|
239
|
+
Purpose:
|
|
240
|
+
|
|
241
|
+
- Inspect workspaces, discover commands/context, ask an LLM for patches, apply
|
|
242
|
+
or roll back changes under policy, and expose CLI/VS Code surfaces.
|
|
243
|
+
|
|
244
|
+
Read first:
|
|
245
|
+
|
|
246
|
+
- `src/agent/core/runAgent.ts`
|
|
247
|
+
- `src/agent/core/contextDiscovery.ts`
|
|
248
|
+
- `src/agent/core/projectCommands.ts`
|
|
249
|
+
- `src/agent/core/projectProfile.ts`
|
|
250
|
+
- `src/agent/cli/main.ts`
|
|
251
|
+
|
|
252
|
+
Docs:
|
|
253
|
+
|
|
254
|
+
- `docs/agent-boundaries.md`
|
|
255
|
+
- `docs/agent-project-intelligence.md`
|
|
256
|
+
- `docs/agent-context-discovery.md`
|
|
257
|
+
- `docs/agent-cli.md`
|
|
258
|
+
- `docs/agent-vscode-install.md`
|
|
259
|
+
|
|
260
|
+
## WASM
|
|
261
|
+
|
|
262
|
+
Paths:
|
|
263
|
+
|
|
264
|
+
- `crates/brass-runtime-wasm-engine`
|
|
265
|
+
- `src/core/runtime/engine/WasmFiberEngine.ts`
|
|
266
|
+
- `src/core/runtime/wasmModule.ts`
|
|
267
|
+
- `src/http/wasmPermitPool.ts`
|
|
268
|
+
- `src/http/retry/wasmRetryPlanner.ts`
|
|
269
|
+
- `wasm/pkg` generated package output
|
|
270
|
+
|
|
271
|
+
Purpose:
|
|
272
|
+
|
|
273
|
+
- Provide strict WASM-backed state machines/engine pieces.
|
|
274
|
+
- Do not silently fall back to TypeScript when a caller requests WASM.
|
|
275
|
+
|
|
276
|
+
Docs:
|
|
277
|
+
|
|
278
|
+
- `docs/wasm-fiber-engine.md`
|
|
279
|
+
- `docs/wasm-scheduler-state-machine.md`
|
|
280
|
+
- `docs/wasm-bounded-queues.md`
|
|
281
|
+
- `docs/wasm-engine-observability-benchmarks.md`
|
|
282
|
+
|
|
283
|
+
## Benchmarks
|
|
284
|
+
|
|
285
|
+
Paths:
|
|
286
|
+
|
|
287
|
+
- `src/benchmarks`
|
|
288
|
+
- `src/core/runtime/bench`
|
|
289
|
+
|
|
290
|
+
Purpose:
|
|
291
|
+
|
|
292
|
+
- Track runtime and HTTP lifecycle overhead.
|
|
293
|
+
- Run the standard benchmark surface, including heap-per-suspended-fiber, from
|
|
294
|
+
`npm run benchmark`.
|
|
295
|
+
- Run the focused Runtime Performance Track with `npm run benchmark:runtime`
|
|
296
|
+
and its regression budget with `npm run benchmark:runtime:budget`.
|
|
297
|
+
- Run the complete performance profiler JSON surface with
|
|
298
|
+
`npm run benchmark:perf`.
|
|
299
|
+
- Run runtime-only A/B and soak checks with `npm run perf:runtime:ab`,
|
|
300
|
+
`npm run perf:runtime:soak`, and `npm run perf:runtime:budget`.
|
|
301
|
+
- Run HTTP retained-memory checks with `npm run perf:http:memory`.
|
|
302
|
+
- Record comparable local profiler history with `npm run perf:history` or
|
|
303
|
+
`npm run perf -- --record-history --save-baseline NAME`.
|
|
304
|
+
- Keep benchmark thresholds separate from correctness tests.
|
|
305
|
+
|
|
306
|
+
Commands:
|
|
307
|
+
|
|
308
|
+
- `npm run benchmark`
|
|
309
|
+
- `npm run benchmark:json`
|
|
310
|
+
- `npm run benchmark:runtime`
|
|
311
|
+
- `npm run benchmark:runtime:budget`
|
|
312
|
+
- `npm run benchmark:perf`
|
|
313
|
+
- `npm run perf:runtime:ab`
|
|
314
|
+
- `npm run perf:runtime:soak`
|
|
315
|
+
- `npm run perf:runtime:budget`
|
|
316
|
+
- `npm run perf:http:memory`
|
|
317
|
+
- `npm run perf:history`
|
|
318
|
+
|
|
319
|
+
## Where to start by task
|
|
320
|
+
|
|
321
|
+
- Runtime semantics: start in `docs/ai/INVARIANTS.md`, then `asyncEffect.ts`,
|
|
322
|
+
`fiber.ts`, `runtime.ts`, and adjacent tests.
|
|
323
|
+
- Cancellation bug: start in `scope.ts`, `fiber.ts`, `runtime.ts`, and
|
|
324
|
+
`docs/cancellation.md`.
|
|
325
|
+
- Stream bug: start in `stream.ts`, `queue.ts`, `buffer.ts`, and stream tests.
|
|
326
|
+
- HTTP behavior: start in `client.ts`, `httpClient.ts`, relevant middleware,
|
|
327
|
+
and `src/http/__tests__`.
|
|
328
|
+
- HTTP compression: start in `src/http/compression/middleware.ts` and
|
|
329
|
+
`src/http/__tests__/compression.property.test.ts`.
|
|
330
|
+
- HTTP batching: start in `src/http/lifecycle/batch.ts` and
|
|
331
|
+
`src/http/lifecycle/__tests__/batch.property.test.ts`.
|
|
332
|
+
- HTTP prewarm: start in `src/http/prewarm/prewarmManager.ts` and
|
|
333
|
+
`src/http/prewarm/__tests__/prewarmManager.test.ts`.
|
|
334
|
+
- HTTP adaptive concurrency: start in `src/http/adaptiveLimiter/adaptiveLimiter.ts`
|
|
335
|
+
and `src/http/adaptiveLimiter/__tests__/`.
|
|
336
|
+
- Agent behavior: start in `src/agent/core`, then CLI/node adapters.
|
|
337
|
+
- Export/package issue: start in `package.json`, `tsup.config.ts`, `src/index.ts`,
|
|
338
|
+
`src/http/index.ts`, and `src/agent/index.ts`.
|