Skip to content

Onboarding: SWG sample assembly + typhon new/ui/telemetry/docs CLI (#531, #532, #522) - #556

Merged
nockawa merged 4 commits into
mainfrom
feature/531-onboarding-samples
Jul 21, 2026
Merged

nockawa merged 4 commits into
mainfrom
feature/531-onboarding-samples

Conversation

@nockawa

@nockawa nockawa commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

Delivers the onboarding epic (#521): a canonical SWG sample assembly and a first-run CLI so a new user goes typhon new → dotnet run → typhon ui with zero code edits, plus the config-driven telemetry CLI (#522).

What's included

Sample assembly (#531) — samples/Typhon.Samples.Swg: a Light Harvester drone (Position/Footprint/Cargo/Drift/Extractor across Versioned, SingleVersion, Transient + spatial/index) and a Full fixture schema. Workbench.Fixtures and MonitoringDemo migrated onto it; the ARPG sample and examples/ removed; the user guide + runnable example re-themed to SWG and emitting a .typhon-trace.

CLI (#532) — typhon new <name> scaffolds a runnable starter (SWG Light source + app template + a pinned Typhon package ref + config-driven profiling). typhon ui gains --open-latest (watch a profile) and --open-db + --schema (investigate a database, auto-discovering the app's built assembly from ./bin); a session opens a trace or a database, never both. typhon telemetry trace <path> sets the trace output; typhon docs/doc [path] opens the documentation site.

Telemetry CLI (#522) — source-generated flag catalog with list/enable/disable/reset/effective/preset verbs plus a full-screen tri-state tree editor, authoring typhon.telemetry.json.

Workbench typhon ui auth fix — ~17 hand-rolled SPA fetch() sites sent only X-Session-Token, never the bootstrap X-Workbench-Token (masked in dev by the Vite proxy), so every panel 401'd under typhon ui. Routed through a shared applyWorkbenchAuthHeaders; index.html is now served no-cache so republished builds are picked up.

Testing

  • Full solution builds clean.
  • SPA vitest suite green (1583); Typhon.Shell.Tests 22; Workbench/Engine lifecycle fixtures green (incl. the two rebase-auto-merged files).
  • End-to-end proven against a locally-packed engine: typhon new → dotnet run writes a .typhon-trace with zero edits; typhon ui --open-latest renders the Profiler; typhon ui --open-db opens the database with the Harvester archetype + components resolved.

Closes #531, #532, #522. Part of #521.

🤖 Generated with Claude Code

nockawa and others added 2 commits July 21, 2026 23:05
Catalog (224 flags) generated from telemetry-flags.jsonc as the single source of truth; adds list/enable/disable/reset/effective/preset/edit subcommands and a Terminal.Gui tree editor (One Dark palette, cascade resolution, footgun warnings, ungated-gauge notes).
…cs command

Workbench SPA: ~17 hand-rolled fetch() sites sent only X-Session-Token, never the bootstrap X-Workbench-Token, so every profiler/data panel 401'd under `typhon ui` (the Vite dev-proxy had masked it). Add shared applyWorkbenchAuthHeaders(); route customFetch and all raw fetches through it. Serve index.html no-cache so republished builds are picked up (hashed assets stay cached).

typhon ui: add --open-db (open the sole *.typhon in the CWD) and --schema, auto-discovering the app's built assembly from ./bin so the database opens with its archetypes/entities resolved. A session opens a trace OR a database, never both — ValidateOpenTargets rejects the combination (and --schema without a db).

typhon docs [path] (alias doc): open doc.typhondb.io/latest in the browser; --print emits the URL.

manual-test-onboarding.md: add telemetry-driven "change what's profiled" step; reframe §4 around the two Workbench jobs.

Tests: UiCommand + Docs (12+3), applyWorkbenchAuthHeaders + schema-fragment capture; full SPA suite 1583 green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017AtukcD3UDm3zh4qGbjmJo
@github-actions

Copy link
Copy Markdown
Contributor

📝 Doc-accuracy review (advisory · scoped · Layer 2)

Reviewed:

  • doc/guide/01-first-app.md — diff only
  • doc/guide/02-modeling.md — diff only
  • doc/guide/03-transactions.md — diff only
  • doc/guide/04-querying.md — diff only (critical: Where vs WhereField prose)
  • doc/guide/05-systems.md — diff only
  • doc/guide/getting-started.md — diff + full text
  • doc/guide/using-with-ai-coding-agents.md — diff only
  • doc/feature-set/Indexing/batched-index-maintenance.md — diff only (trivial HTML-comment change)
  • doc/feature-set/Observability/telemetry-flags-reference.md — diff only (generator-source rename)
  • doc/key-concepts/component.md — full text
  • doc/key-concepts/archetype.md — full text
  • doc/in-depth-overview/06-ecs.md — full text (uses its own Ant/FlyingAnt domain; not affected)

(Feature-set catalog pages not edited in this PR were skimmed for gross contradictions; none found.)


Findings

1. doc/guide/getting-started.md:172–173 ↔ doc/guide/04-querying.md (both changed in this PR)

Wrong prose: "Where<Cargo>(...) filters by a component predicate (fast here because Cargo.Amount is indexed)"

The query shown is:

tx.Query<Harvester>().Where<Cargo>(c => c.Amount < c.Capacity).Count()

04-querying.md (edited in the same PR) explicitly uses Amount < Capacity as the canonical example of a predicate that cannot use the index, because it compares two fields:

"use Where for computed or non-indexed conditions (like Amount < Capacity, which compares two fields and can't be a simple index lookup)"

Where<T>(lambda) always scans every entity regardless of whether a field happens to be indexed; it is WhereField<T>(expr) that drives the index. The parenthetical "(fast here because Cargo.Amount is indexed)" is therefore inaccurate and contradicts ch.4's own explanation.

Suggested fix (getting-started.md ~line 172): Remove the parenthetical and let the ch.4 link do the work, e.g.:

"Where<Cargo>(...) filters by a component predicate — c.Amount < c.Capacity compares two fields, so this is a broad scan; for index-backed filtering see WhereField in ch.4."


2. doc/key-concepts/component.md:11 and doc/key-concepts/archetype.md:11 — consistency drift (not a factual error, but now visibly mismatched)

Both pages (in the docs-affected list) use Unit.Health / Unit.Position / Unit.ReadAll as inline examples — the old "Skirmish" domain. This PR replaced every guide example with Harvester / Cargo / Harvester.ReadAll. The key-concept pages are not factually wrong (Unit is a valid illustrative name), but a reader coming from the updated guide will see a jarring mismatch in the very next page they open. Worth a follow-up cosmetic pass on those two pages.


Map maintenance:

The following changed source areas have no mapped doc pages in coverage/docs-affected-map.json. They implement the CLI commands documented in the new getting-started.md "fastest start" section (typhon new, typhon telemetry trace/enable/edit, typhon ui --open-latest) — a gap worth closing so future CLI changes auto-flag that page:

src/Typhon.Engine/Typhon.Engine.csproj
src/Typhon.Shell.Extensibility/ShellCommand.cs
src/Typhon.Shell/Commands/DiagnosticCommandExecutor.cs
src/Typhon.Shell/Commands/DocsCommand.cs
src/Typhon.Shell/Commands/NewCommand.cs
src/Typhon.Shell/Commands/ProjectScaffolder.cs
src/Typhon.Shell/Commands/TelemetryCommands.cs
src/Typhon.Shell/Commands/UiCommand.cs
src/Typhon.Shell/Program.cs
src/Typhon.Shell/Telemetry/TelemetryEditor.cs
src/Typhon.Shell/Telemetry/TelemetryFile.cs
src/Typhon.Shell/Telemetry/TelemetrySupport.cs
src/Typhon.Shell/Typhon.Shell.csproj

Advisory & scoped to the pages the change touches — recall for cross-cutting or unmapped drift is covered by the weekly Layer 3 audit.

…can, not index-backed [no-ut]

`Amount < Capacity` compares two fields so it can't be a simple index lookup; point at `WhereField`/ch.4 for index-backed filtering. Resolves the doc-accuracy L2 finding on PR #556 (the parenthetical contradicted 04-querying.md's own canonical non-indexable example).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017AtukcD3UDm3zh4qGbjmJo
@github-actions

Copy link
Copy Markdown
Contributor

📝 Doc-accuracy review (advisory · scoped · Layer 2)

Reviewed:

Deep scrutiny (hand-written narrative):

  • doc/guide/getting-started.md
  • doc/guide/using-with-ai-coding-agents.md
  • doc/guide/01-first-app.md (via diff)
  • doc/guide/02-modeling.md (via diff)
  • doc/guide/03-transactions.md (via diff)
  • doc/guide/04-querying.md (via diff)
  • doc/guide/05-systems.md (via diff)
  • doc/in-depth-overview/06-ecs.md
  • doc/in-depth-overview/12-observability.md
  • doc/key-concepts/archetype.md
  • doc/key-concepts/component.md
  • doc/key-concepts/observability.md
  • doc/key-concepts/database-engine.md
  • doc/key-concepts/schema-evolution.md

Edited in this PR (verified consistency):

  • doc/feature-set/Observability/telemetry-flags-reference.md
  • doc/feature-set/Indexing/batched-index-maintenance.md

Skimmed for gross contradictions (feature-set catalog):

  • doc/feature-set/Observability/README.md
  • doc/feature-set/Observability/telemetry-config-gating.md
  • Remaining doc/feature-set/Ecs/*, doc/feature-set/Schema/*, doc/feature-set/Observability/* pages

Findings:

  • doc/feature-set/Observability/README.md:17 ↔ doc/feature-set/Observability/telemetry-flags-reference.md:9

    The README table still says the Telemetry Flags Reference is "Generated from TelemetryConfig.cs by scripts/gen-telemetry-reference.py". This PR changed the generator source to telemetry-flags.jsonc (the new single source of truth) and correctly updated the reference page itself (GENERATED by scripts/gen-telemetry-reference.py from telemetry-flags.jsonc), but the parent README was not updated.

    Suggested fix: In README.md line 17, replace `TelemetryConfig.cs` with `telemetry-flags.jsonc`.


Map maintenance:

The following source areas were flagged as UNMAPPED (no doc pages mapped — consider adding to coverage/docs-affected-map.json):

src/Typhon.Engine/Typhon.Engine.csproj
src/Typhon.Shell.Extensibility/ShellCommand.cs
src/Typhon.Shell/Commands/DiagnosticCommandExecutor.cs
src/Typhon.Shell/Commands/DocsCommand.cs
src/Typhon.Shell/Commands/NewCommand.cs
src/Typhon.Shell/Commands/ProjectScaffolder.cs
src/Typhon.Shell/Commands/TelemetryCommands.cs
src/Typhon.Shell/Commands/UiCommand.cs
src/Typhon.Shell/Program.cs
src/Typhon.Shell/Telemetry/TelemetryEditor.cs
src/Typhon.Shell/Telemetry/TelemetryFile.cs
src/Typhon.Shell/Telemetry/TelemetrySupport.cs
src/Typhon.Shell/Typhon.Shell.csproj

NewCommand.cs / ProjectScaffolder.cs are particularly worth mapping: getting-started.md describes what typhon new emits (now the SWG Light sample), and any future changes to the scaffold template will go undetected without a mapping entry.


Advisory & scoped to the pages the change touches — recall for cross-cutting or unmapped drift is covered by the weekly Layer 3 audit.

…o-ut] [no-doc]

The WAL renders only as a proportionally-sized opaque block with no page-level detail until the WAL page grid (Module 08 / WAL Events) lands — and with a 64 MiB pre-allocated WAL vs a ~2 MiB data file it dominates the map while showing nothing. Gate `walRect` behind an opt-in `showWal` param (default off); the null ("no WAL") path already handles renderer, camera-fit, hit-test, nav, and minimap, so the map fits just the data square. The sizing math is retained and still unit-tested (showWal: true); re-enable by passing showWal when the region has real content.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017AtukcD3UDm3zh4qGbjmJo
@nockawa
nockawa merged commit 2064af6 into main Jul 21, 2026
10 checks passed
@nockawa
nockawa deleted the feature/531-onboarding-samples branch July 21, 2026 21:50
This was referenced Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Canonical SWG sample: one Light+Full assembly, scaffold-emitted source

1 participant