Skip to content

docs: Cortex laptop observability — read the numbers, first-run path, troubleshooting - #2551

Merged
mrsabath merged 5 commits into
mainfrom
docs/cortex-v090-laptop-observability
Sep 14, 2026
Merged

mrsabath merged 5 commits into
mainfrom
docs/cortex-v090-laptop-observability

Conversation

@mrsabath

Copy link
Copy Markdown
Member

What & why

Documentation for the Cortex v0.9.0 laptop tool, the observability release (rossoctl/cortex#962). It gives a first-time user, on their own workstation, everything needed to install Cortex, watch a session, and understand what the numbers mean and why the tool is worth leaving running. This backs the epic's exit criterion 5 — a new user self-serves from the docs alone.

Written against the v0.9.0 target UX (install.sh, abctl observe, abctl service, tool pruning). Where a detail is not yet verifiable against a shipped binary, an HTML VERIFY v0.9.0 comment marks it for the outside-reader check.

Draft. #963 depends on the metrics work landing (#950, #951, #952). This PR is ready for review of structure and voice now; the 5 VERIFY v0.9.0 markers and the worked-example figures should be confirmed against a v0.9.0 binary before it leaves draft.

Sub-issues addressed

Issue Where
#963 interpret metrics + value New get-started/reading-the-numbers.md
#959 first-run path get-started/laptop.md spine: install → observe → read → stop
#960 laptop troubleshooting New "On a laptop" section in operate/troubleshooting.md
#961 separate laptop from Kubernetes Laptop reader stays in get-started/; troubleshooting split laptop / Kubernetes
#867 explain the / filter Documented inline in the abctl keys (substring match on METHOD, not a query language)
#844 Context Guru value "What you see for it" + the pruning-savings section

The new page

get-started/reading-the-numbers.md covers:

  • The value case, readable before installing, and a "the data stays on your computer" note — Cortex captures the traffic locally and sends it nowhere.
  • The abctl observe views and keys, including the / filter.
  • The five token categories, and why cache-read and cache-write are priced apart.
  • How to read cost (estimated vs. authoritative), latency (TTFT vs. total, percentiles), and the tool-pruning savings, including what a zero means.
  • A worked example on a representative session.

Concepts extension

The new page is wired into concepts/index.md (a new Core row), the RossoCortex page, the context-compaction page, observability.md, and both landing pages. The get-started sidebar is renumbered to seat the new page after the laptop quickstart.

Notes for reviewers

  • The 5 VERIFY v0.9.0 comments name the exact things to confirm against a shipped binary (install command, abctl observe/service, CA path, log paths, rate source, and the local-only claim relative to the opt-in central-collector feature #898).
  • The worked-example table uses representative figures from the real captured fields; it carries a note to replace it with a captured session before release.
  • #867 also proposes renaming the TUI filter prompt to METHOD name filter…. That is a code change in cortex, out of scope here; the docs describe the current behaviour.

Acceptance tier

  • Tier 0 — Maintenance (docs only)

Checklist

  • Follows repo conventions; STE100 throughout
  • DCO sign-off; Assisted-By trailer, no Co-Authored-By
  • All internal links and heading anchors resolve
  • VERIFY v0.9.0 markers confirmed against a shipped binary (blocks leaving draft)

Assisted-By: Claude Code

…leshooting

Add the Cortex v0.9.0 laptop-tool documentation for the observability
release (rossoctl/cortex#962). Written against the v0.9.0 target UX
(install.sh, `abctl observe`, `abctl service`, tool pruning); each point
not yet verifiable against a shipped binary carries a `VERIFY v0.9.0`
comment for the outside-reader check that backs exit criterion 5.

- New `get-started/reading-the-numbers.md`: the value case, the abctl
  keys and the `/` filter, the five token categories, why cache-read and
  cache-write are priced apart, how to read cost, latency and the
  tool-pruning savings (including what a zero means), and a worked
  example. Addresses cortex#963, cortex#844 and cortex#867.
- `get-started/laptop.md`: complete the first-run spine — a read-the-
  numbers step, a stop-and-remove step, and the `/` filter. cortex#959.
- `operate/troubleshooting.md`: a laptop section (CA not trusted, port
  47600 in use, service will not start, another tool broke, no events,
  numbers wrong, where the logs are). Splits the page into laptop and
  Kubernetes parts. cortex#960 and cortex#961.
- Wire the new page into the concepts index, the RossoCortex page, the
  context-compaction page, the observability page and both landing
  pages; renumber the get-started sidebar.

STE100 throughout. All internal links and anchors resolve.

Assisted-By: Claude Code
Signed-off-by: Mariusz Sabath <[email protected]>
Point users at the Laptop feedback form on rossoctl/cortex from the end of
the laptop quickstart, the read-the-numbers page and the laptop
troubleshooting section. A user looking at the numbers is the user most
likely to have feedback, so the docs now ask for it where that happens
rather than only in a related-links list.

Pairs with the abctl footer link (cortex#975) and the issue form
(cortex#977); all three point at the same place.

Part of cortex#977.

Assisted-By: Claude Code
Signed-off-by: Mariusz Sabath <[email protected]>
@mrsabath

Copy link
Copy Markdown
Member Author

Added a commit (7ae073f2) with the end-of-page give feedback call for cortex#977: a short prompt on the laptop quickstart, the read-the-numbers page and the laptop troubleshooting section, each pointing at the new Laptop feedback issue form. This pairs with the abctl footer link (cortex#978) and the form itself (cortex#979) — all three point at rossoctl/cortex/issues. Folded in here rather than a separate PR because it edits the same laptop pages this PR introduces.

@mrsabath
mrsabath marked this pull request as ready for review September 11, 2026 21:35

@huang195 huang195 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dobra — the shape of this is genuinely good, and I want that on the record before the red ink. Splitting troubleshooting into laptop-then-Kubernetes with the heading levels pushed down correctly, the four-decisions framing at the top of the new page (find an expensive prompt / see whether caching operates / catch a session that does not end / decide whether to prune), the cache-write-repeating-with-no-cache-read diagnosis, and the VERIFY v0.9.0 markers sitting on exactly the claims that depend on unlanded issues — that is someone writing for a reader rather than for a checklist. The sidebar_position renumbering is also complete and collision-free (clean 1→8 across all eight pages, I checked), which is the thing that usually goes wrong in a PR like this.

Then I fact-checked the checkable claims against rossoctl/cortex@main, and four of them do not survive:

Claim Reality
y writes "to a file in /tmp" ~/.cortex/abctl-events/<timestamp>-<rand>.json
/ is "a substring match on the method… not a query language" matchEventRow matches a haystack of many event fields, and supports deny and plugin:<name>
"five categories, because each has a different price" numTiers = 4 — input, cache-write, cache-read, output
unrecognised model → "its cost is zero" inverted; a non-positive cost is deliberately not priced

The first two are in a keys table and a filter paragraph — the parts a reader trusts most and verifies least. Someone presses y, goes rummaging in /tmp, and concludes the feature is broken; someone else reads that / only matches the method and never finds deny or plugin:<name>. Cheap to fix, expensive to ship, hence the block. Details inline.

Things I checked that are right, so you do not have to re-verify them: ~/.cortex/ca/ca.crt (I was suspicious because ca/bundle.crt also exists in the tree — it is the outlier), the x-litellm-response-cost header name, and the 47600/47601/47602 port split.

On the red X, which is not yours. Ollama Model Drift fails with doc not found: .github/scripts/docs/check-ollama-model-drift.sh hardcodes docs/demos/demo-weather-agent.md, and docs/demos/ does not exist on main at all any more. docs-ci.yaml is path-filtered to **.md/docs/**, which is why #2548–2550 show n/a for that check and your docs PR is the one holding the bag. Nothing to change here — it wants a one-line path fix (or a deletion) in its own PR, otherwise every docs PR from now on is red.

Comment thread docs/get-started/reading-the-numbers.md Outdated
| `Esc` | Return to the previous view |
| `/` | Filter the events |
| `p` | Pause and resume the stream |
| `y` | Write the event to a file in `/tmp` |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

must-fix — two rows of this reference table send people the wrong way, and a reference table is the one thing readers will not second-guess.

y writes to ~/.cortex/abctl-events/<timestamp>-<rand>.json, not /tmp. cortex's own abctl README says so in three separate places, including its deferred-work list ("Native clipboard (currently writes a file under ~/.cortex/abctl-events)").

/ (line 71) is described in a way that is actively wrong rather than merely incomplete. events_pane.go:matchEventRow builds a haystack from many event fields and matches your substring against all of them, so "a substring match on the method" is not what happens. And there are exactly two query forms that the paragraph tells people do not exist:

  • deny — matches denied events
  • plugin:<name> — matches events carrying that plugin's record

Those are the two filters an operator actually reaches for, so they are worth documenting rather than denying. The same method-only sentence appears in laptop.md:57, so both need the same edit.

Comment thread docs/get-started/reading-the-numbers.md Outdated
## Read the tokens

A model call has a cost in tokens. Cortex separates the tokens into five categories, because each
category has a different price.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion — "five categories, because each category has a different price" is four categories. pricing/rates.go has numTiers = 4: TierInput, TierCacheWrite, TierCacheRead, TierOutput. There is no reasoning tier.

Your own table row on line 86 already says as much — "a part of the output on some models" — which contradicts the premise one paragraph above it. The worked example then lists "Reasoning tokens 3,100" as its own row, implying Cortex reports it separately.

Either fold it into a note under Output, or say plainly that reasoning tokens are billed as output and Cortex does not price them apart. The second reads better and is true.

Comment thread docs/get-started/reading-the-numbers.md Outdated
- **The cost is an estimate, unless the provider returns an exact figure.** Cortex computes the cost
from published rates for each model. When the provider returns an exact cost (for example, the
`x-litellm-response-cost` header from LiteLLM), Cortex uses that figure instead.
- **The rates come from a table for each model.** A model that Cortex does not recognize has no rate,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion — "A model that Cortex does not recognize has no rate, so its cost is zero even when its token counts are correct" is backwards, and it happens to describe the precise behaviour the code exists to prevent.

costevent.Decode refuses to treat a non-positive cost as priced, with the reasoning in the comment: "free" and "unknown" must not be conflated, because a consumer that treated 0 as priced would render $0.00 for traffic it simply cannot price. So an unpriced model shows no cost, not a cost of zero.

That is also the better story: the tool admits it does not know, rather than quietly claiming the call was free.

Comment thread docs/operate/troubleshooting.md Outdated
- **The token count is zero.** RossoCortex reads the token counts from the reply of the model. A
reply that Cortex cannot parse gives no counts. Confirm that the model is an OpenAI-compatible or an
Anthropic endpoint.
- **The cost is zero, but the tokens are correct.** Cortex has no rate for that model. See

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion — same inversion as the one on reading-the-numbers.md:114: "The cost is zero, but the tokens are correct." What a user actually sees is a missing cost alongside correct tokens.

Worth fixing here especially, because this is the page someone lands on when the number confuses them — and "no cost shown" versus "a cost of zero" is exactly the distinction they arrived to resolve.

Review fact-checked the checkable claims against rossoctl/cortex@main and
found four wrong. All verified against the source and corrected:

- `y` writes to ~/.cortex/abctl-events/, not /tmp (const yankDirRel).
- The `/` filter is a text match across many event fields (host, method,
  plugin, reason, path, content), not the method alone, and special-cases
  `deny` and `plugin:<name>`. Documented all three, in reading-the-numbers
  and laptop.md.
- Pricing has four tiers (input, cache-write, cache-read, output), not five.
  Reasoning tokens are captured but are a part of output, not a priced tier.
- An unrecognized model shows no cost, not a zero — a non-positive cost is
  deliberately not rendered. Fixed in the cost section and in the
  troubleshooting "numbers are wrong or absent" entry.

Addresses review on #2551.

Assisted-By: Claude Code
Signed-off-by: Mariusz Sabath <[email protected]>
@mrsabath

Copy link
Copy Markdown
Member Author

Thank you for the fact-check, @huang195 — every one of the four held up when I traced it to source, and these were exactly the claims a reader trusts and does not verify. Fixed in 278f60e0.

I re-read each against rossoctl/cortex@main before changing the text, so the replacements are the behaviour, not a paraphrase of your paraphrase:

Claim Source Fix
yank → /tmp app.go const yankDirRel = ".cortex/abctl-events" now ~/.cortex/abctl-events/
/ = method substring matchEventRow / eventHaystack — host, method, plugin, action, reason, path, identity, A2A content, completion; plus deny and plugin:<name> rewrote the filter paragraph; documented all three, and dropped the "only the method" line from laptop.md too
five priced categories pricing: numTiers = input, cache-write, cache-read, output now four tiers; reasoning described as captured, a part of output, not a fifth price
unpriced model → cost 0 costevent declines a non-positive cost now "shows no cost rather than a misleading zero"; same fix in the troubleshooting entry

The reasoning-token row stays in the worked example (it is a real captured count), just no longer billed as its own tier. STE100 kept; the #read-the-cost and #watch-a-session anchors the pages link to still resolve.

On the two things that are not the text:

  • I rebased onto the merge of main that landed on the branch, so this sits on top of it rather than reverting it — the commit is a plain fast-forward.
  • The red Ollama Model Drift X is not this PR's, exactly as you diagnosed: .github/scripts/docs/check-ollama-model-drift.sh hardcodes docs/demos/demo-weather-agent.md, which the restructure removed, and the check is path-filtered to docs/** so every docs PR from now on inherits it. I have left it alone here; it wants its own one-line path fix (or a delete). I can open that PR next if you'd like — say the word and I'll take it.

The three VERIFY v0.9.0 markers remain, since they sit on metrics behaviour that depends on the still-open #950/#951/#952. Ready for another look.

@huang195 huang195 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No dobra — all four blockers from my last pass are in, and I re-verified every one against rossoctl/cortex@main rather than taking the commit message's word for it:

Claim Verified
y → ~/.cortex/abctl-events/ tui/app.go: const yankDirRel = ".cortex/abctl-events", with its own "Not os.TempDir()" comment explaining why
/ matches many fields; deny and plugin:<name> are the two special forms matchEventRow — exactly those two, then substring over eventHaystack. Structure is right; see the inline note on the example
deny = events a plugin denied eventMatchesDeny: Phase == SessionDenied or any Action == ActionDeny. Accurate
Four priced categories, reasoning folded in numTiers = 4, and the wording now matches pricing.Usage's own comment ("Reasoning is omitted (a subset of Output, already counted)")
Unpriced model → blank cost, not zero Both sites fixed. "A blank cost with correct tokens means the model is unpriced, not free" is exactly the costevent.Decode distinction

Two unasked-for improvements worth naming, because they show the fix was understood rather than pattern-matched: the token table reordered to input → cache-write → cache-read → output, which now matches the Tier iota order in rates.go; and laptop.md got a cross-link to the filter explanation instead of a duplicated half-sentence, so there is one place to keep correct instead of two.

The new feedback commit checks out too, including the claim most likely to have been invented: .github/ISSUE_TEMPLATE/laptop-feedback.yml really exists in cortex with name: Laptop feedback, so /issues/new/choose will show it. And "the form asks for each item in the list above" holds — all five map to a field (abctl --version → Cortex version, abctl service status and the log → Service status and logs, uname -sm → Operating system and architecture, agent+model → Agent and model).

Approving, since this is still a draft and the one real problem left is a single identifier. But it does need fixing before this leaves draft, alongside the VERIFY v0.9.0 markers you already have queued: plugin:jwt-validation names the one plugin in the tree that publishes no plugin-public record, so the only example of that filter returns an empty list. Details inline.

On the red X, still not yours. Ollama Model Drift fails identically to three days ago — check-ollama-model-drift.sh hardcodes docs/demos/demo-weather-agent.md, and I re-confirmed docs/demos/ is a 404 on main. Nothing to change here, but it has been red for three days and every docs PR inherits it, so someone should land the one-line path fix or delete the check.

Assisted-By: Claude Code

Two searches are special:

- `deny` shows only the events that a plugin denied.
- `plugin:<name>` shows only the events that the named plugin acted on. For example, `plugin:jwt-validation`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix before leaving draft — you fixed my filter complaint by documenting plugin:<name>, and then picked the one plugin in the entire tree that cannot be found that way. I laughed, then checked twice, because I did not believe it either.

matchEventRow resolves plugin: as an exact lookup in r.event.Plugins, and SessionEvent.Plugins is populated only from Extensions.Custom entries written with PluginEventSuffix ("/event") — an opt-in for plugins that publish a plugin-public record. jwtvalidation/plugin.go never writes Extensions.Custom; it has four pctx.Record(pipeline.Invocation{...}) calls, and Record populates Invocations, a different field entirely. So Plugins["jwt-validation"] is never set and this filter returns an empty list, every time.

The extra sting: jwt-validation events are findable — by typing the bare jwt-validation, because eventHaystack includes iv.Plugin. So for your example plugin the plain search works and the special syntax does not, which is exactly backwards from how the bullet reads.

Swap in a plugin that publishes a record. Both verified:

  • plugin:tool-prune — toolprune/event.go writes Custom[p.Name()+PluginEventSuffix], Name() returns "tool-prune", and the listener strips the suffix, so the key really is tool-prune.
  • plugin:cost — costevent.Key = "cost". Note this one is a record name rather than a plugin name, so "the named plugin" is doing a little work in that sentence if you want it strictly true.

Same reason as the last round: this is a copy-pasteable instruction in a reference section. The reader types it, gets nothing, and concludes the filter is broken rather than that the docs picked a bad example.

| Cache read | 486,000 |
| Cache write | 61,200 |
| Output tokens | 8,900 |
| Reasoning tokens | 3,100 |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion — the prose fix above is exactly right ("They are a part of the output count, not a fifth priced category" matches pricing.Usage's own comment almost word for word), but the worked example did not get the memo:

| Output tokens | 8,900 |
| Reasoning tokens | 3,100 |

Sibling rows, with no hint that one is inside the other. A reader who sums the token rows double-counts 3,100, and nothing on the table says whether 8,900 already contains it. | Reasoning tokens (part of the output) | 3,100 | and you are done — last loose thread from the four-versus-five fix.

| `q` or `Ctrl+C` | Quit |

The `/` key filters the events by a **text match**. For example, `messages` shows only the events
that contain that text. The match covers many fields of an event, not the method alone — the host,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit — the six-field list is accurate, but eventHaystack also covers Identity.Subject, Identity.ClientID, and every invocation Details key and value — the source comment there specifically calls out searching target_audience and its value.

"Every event from this caller" and "every event where this plugin wrote this detail" are the two searches an operator reaches for on day two, and they are the two the list omits. A trailing "…and the caller identity, and any diagnostic detail a plugin recorded" would cover it.

@mrsabath
mrsabath merged commit fc1878b into main Sep 14, 2026
24 checks passed
@github-project-automation github-project-automation Bot moved this from New/ToDo to Done in Rossoctl Issue Prioritization Sep 14, 2026
@mrsabath
mrsabath deleted the docs/cortex-v090-laptop-observability branch September 14, 2026 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants