diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index 199888187..5b07032de 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -299,7 +299,7 @@ This is structurally sound — if a command exists in code, it appears in docs. Every skill starts with a `{{PREAMBLE}}` block that runs before the skill's own logic. Since v1.70.0.0 the rendered block is a thin fence that invokes `bin/gstack-skill-start` (the consolidated preamble runtime — it replaced ~18KB of inline bash per tier-2+ skill) and reads back `KEY: value` STATUS lines that the skill prose branches on; `bin/gstack-skill-end` logs telemetry at skill end. One-time onboarding and consent text is emitted as session-bound `GSTACK_INSTRUCTION` blocks only when a runtime gate actually fires, instead of rendering in every skill. The startup still handles five things: 1. **Update check** — calls `gstack-update-check`, reports if an upgrade is available. -2. **Session tracking** — touches `~/.gstack/sessions/$PPID` and counts active sessions (files modified in the last 2 hours). When 3+ sessions are running, all skills enter "ELI16 mode" — every question re-grounds the user on context because they're juggling windows. +2. **Session tracking** — touches `~/.gstack/sessions/` and prunes entries older than 2 hours, so concurrent-session state is observable on disk. 3. **Operational self-improvement** — at the end of every skill session, the agent reflects on failures (CLI errors, wrong approaches, project quirks) and logs operational learnings to the project's JSONL file for future sessions. 4. **AskUserQuestion format** — universal format: context, question, `RECOMMENDATION: Choose X because ___`, lettered options. Consistent across all skills. 5. **Search Before Building** — before building infrastructure or unfamiliar patterns, search first. Three layers of knowledge: tried-and-true (Layer 1), new-and-popular (Layer 2), first-principles (Layer 3). When first-principles reasoning reveals conventional wisdom is wrong, the agent names the "eureka moment" and logs it. See `ETHOS.md` for the full builder philosophy. diff --git a/docs/BROWSER_INTERNALS.md b/docs/BROWSER_INTERNALS.md index 885f8e3f8..bdb1ed381 100644 --- a/docs/BROWSER_INTERNALS.md +++ b/docs/BROWSER_INTERNALS.md @@ -68,7 +68,7 @@ return 403. SSE endpoints use a 30-minute HttpOnly `gstack_sse` cookie minted vi `POST /sse-session` (never valid against `/command`). Tunnel-surface rejections go to `~/.gstack/security/attempts.jsonl` via `tunnel-denial-log.ts`. Before editing `server.ts`, `sse-session-cookie.ts`, or `tunnel-denial-log.ts`, read -[ARCHITECTURE.md](ARCHITECTURE.md#dual-listener-tunnel-architecture-v1600) — +[ARCHITECTURE.md](../ARCHITECTURE.md#dual-listener-tunnel-architecture-v1600) — the module boundary (no imports from `token-registry.ts` into `sse-session-cookie.ts`) is load-bearing for scope isolation. @@ -83,7 +83,7 @@ points today: `handleCommandInternal` (HTTP + batch via a sanitizing wrapper aro already escaped the surrogate before regex could match, so the replacer must run inside the encoding pipeline. Before adding a new SSE/WebSocket writer or HTTP response in `server.ts`, read -[ARCHITECTURE.md](ARCHITECTURE.md#unicode-sanitization-at-server-egress-v13800). +[ARCHITECTURE.md](../ARCHITECTURE.md#unicode-sanitization-at-server-egress-v13800). `browse/test/server-sanitize-surrogates.test.ts` pins the wiring with invariant tests, so bypasses fail CI.