# Changelog

All notable changes to this project are documented here.

The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.15.1] - 2026-11-07

### Fixed

- **`telkomsel_resolve_intent` read "mana" as "mainan".** In "paket internet 30 hari, mana yang paling hemat per GB?" the typo reading turned a value question into a gaming search that returned one package. `mana`, `bandingkan` and `banding` are now filler words.

## [0.15.0] - 2026-10-29

An AI agent can now see what telkomsel.com is publishing and read it, not only look it up.

### Added

- **`telkomsel_latest_content`.** The newest news (title, date, link) or the promos (title, product line,
  link) on telkomsel.com's own `/berita` and `/promo` pages, in Indonesian or English. First page of each
  list, about eight items, cached for fifteen minutes. A card whose link is not an article or promo page
  carries `readable: false`.
- **`telkomsel_read_content`.** One news article or promo page in full. A news article returns its headline,
  publication date, read time and body with paragraphs kept. A promo returns its period (as worded, plus an
  ISO end date and an `expired` flag), the main offer and prize details, how to take part, the FAQ and the
  terms and conditions. It accepts the urls `telkomsel_latest_content` and `telkomsel_site_search` return,
  and nothing else: only `/about-us/news/<slug>` and `/promo/<slug>` (and the `/en/` forms) on
  `www.telkomsel.com`, with the query string dropped. Cached for an hour.
- The publication date is read from the visible text, not from the page's `<time datetime>`, which is stale
  (an article dated 16 October says March).

### Changed

- All telkomsel.com reads (site search, news, promo) share one paced fetch (`src/services/site-fetch.ts`),
  so the half-second gap and the user agent hold across tools, not per tool.
- robots.txt disallows more than `*/search`: `Disallow: *?` covers every URL with a query string. The new
  tools read only query-free pages and never page through `?page=N`; older items are reached through
  `telkomsel_site_search`, which does carry a query and stays one request per call, cached. A page robots.txt
  names (`/promo/tambah-cuan-tflyers`) is refused.

### Known limits

- Some English news cards link to `/en/node/<id>` only, which robots.txt disallows; they are listed with
  `readable: false`.
- Campaign hub promo pages (many offers on one page) return their description and FAQ only.

## [0.14.0] - 2026-10-29

The server can search the website, not only the catalogue.

### Added

- **`telkomsel_site_search`.** Reads the telkomsel.com search box as data: promo pages, FAQ entries and news
  matching a phrase, each with a link and a short snippet. The box is a Drupal view that pages through
  `/views/ajax` and answers without cookies or login. Filters: `type` (`page`, `faq`, `news`), `lang`
  (`id`, `en`) and `page` (16 results each, with `hasMore`). It finds the page that talks about something
  ("AMI Awards", "Umrah", "masa tenggang"); it does not price packages, which stays with
  `telkomsel_search_packages`.
- telkomsel.com's robots.txt disallows `*/search` for crawlers, so the tool is one request per call and is
  held to that: results are cached for ten minutes, upstream calls are spaced half a second apart, the user
  agent names this project, and no result link is followed.

### Fixed

- `SERVER_VERSION` read 0.13.5 while the package was 0.13.6; both are 0.14.0 now.

## [0.13.6] - 2026-10-20

A brand typed with a typo is still the brand. "paket buat nonton netflox" searched WeTV.

### Fixed

- **A typo read through for the intent was not read through for the brand.** `resolve_intent` corrected
  "netflox" to "netflix" (and reported it in `corrections`), so the intent was streaming, but the brand the
  suggested call searches was looked up in the phrase as written. No brand was found, and the call fell
  back to the intent's strongest term, "wetv" (76 packages), a different product from the one named.
  The corrections now apply to the phrase before the brands are read, so "paket buat nonton netflox"
  and "nonton netflx di hp" search "netflix". A phrase with no brand still searches "wetv". Found in the
  DIVA search box, "Dicari sebagai: Kata kunci "wetv"".

## [0.13.5] - 2026-10-19

A stay abroad is an at-least, and a bound reads the same in English, with symbols, or after the figure.
"saya ke Kyoto 14 hari ≤500rb" answered "no package" while the catalogue sells 15- and 30-day Japan packages.

### Fixed

- **"ke Kyoto 14 hari" filtered to exactly 14 days.** The catalogue sells 7, 15 and 30 days, so a
  stay of 14 days matched nothing. A stay abroad (roaming intent or a destination) now sets
  `min_validity_days` only: a longer package covers the trip, a shorter one does not. A ceiling
  the customer set ("maksimal 7 hari") is left as said, and a bare "14 hari" without a trip still
  reads as a window around 14.
- **"≤500rb", "<500rb", "under 500k", "500k or less" were read as no bound.** The price was dropped
  (or worse, "500k" went into the text query). A bound is a comparator beside a figure, and the
  figure's unit says which axis it bounds. The comparator is the only language-bound part: a short
  table per language (Indonesian and English) plus the symbols `< <= ≤ > >= ≥`, written before the
  figure ("di bawah", "under", "minimal", "at least") or after it ("ke bawah", "or less", "+").
  The same comparators now bound days ("minimal 14 hari", "up to 7 days").
- **English counts were not read.** "a month", "one month", "two weeks" are now a month and
  14 days; the comparator words no longer reach the text query ("internet below" searched "below").
- **"at least" was read as "les", a course, and answered with Canva packages.** A trigger of three
  or four letters no longer matches a word two letters longer; one letter off stays a typo.

### Added

- **`unreadFigures` in `telkomsel_resolve_intent`.** A figure that no bound took ("500 ribu" with no
  comparator) is reported with a note instead of being dropped, and it is never searched as text.
  The deterministic reading is right only when it read every figure; a caller that sees this should
  set the `min_`/`max_` arguments itself instead of running the suggested call as returned.

## [0.13.4] - 2026-10-19

A word the customer rules out now filters the answer, and more ways of saying it are read.
Found by mapping the neighbours of the 0.13.3 bugs.

### Fixed

- **A ruled-out word was reported and then ignored.** "internet murah selain tiktok" excluded
  "tiktok" and still returned SIMPATI TikTok packages. `telkomsel_search_packages` takes
  `exclude_query` (Elasticsearch `must_not`, Amazon's negation-aware filter): a package is
  dropped when any word is in its name, subcategory or group, not its bonus list, so a package
  that bundles a video quota is not a video package. The suggested call carries it.
- **"tidak mau nonton" and "gak usah ada nonton" still chose streaming.** `tidak`, `gak`, `nggak`,
  `enggak`, `ga`, `tak` lead a negation only before `mau`, `ingin`, `perlu`, `usah`, `butuh`,
  `pakai`, `suka`, `minat`; "kuota ada tapi tidak bisa internet" is a fault report and is left alone.

## [0.13.3] - 2026-10-19

"Paket internet" now means internet, and what a customer rules out is no longer read as what
they want. Two phrases measured through a RAG app that runs the suggested call as returned.

### Fixed

- **"paket internet ke swiss" answered with Talkmania RoaMAX minutes.** The word "internet"
  was ignored once an intent matched, so the roaming intent searched its strongest term,
  "roamax", and a voice package (10 Min) ranked first. With an intent, a data word no matched
  trigger used now adds `min_quota: 0, quota_unit: "GB"`, as it already did without one; the
  answer is Internet RoaMAX Western, in GB.
- **"paket internet bukan nonton ... rupiah/gb termurah" answered with SERU Nonton.** Two
  causes. "bukan nonton" was read as the streaming intent (query "wetv"); a negator
  (`bukan`, `tanpa`, `selain`, `kecuali`, `jangan`, `not`, `without`, `except`) and the word it
  rules out are now taken out before anything is read, and reported under `excluded`. And
  `price_per_gb` divided by the headline "38 GB", which for SERU Nonton Rp40.000 is a Movie
  quota and app quotas plus 2 GB of internet, so it ranked as Rp1.052 a gigabyte.
- The words of an order that matched a longer hint ("rate rupiah/gb termurah") stayed in the
  query, so the search looked for a package named "internet rate termurah" and found none.

### Added

- `internetQuotaGb` (derived): the sum of a package's `data allnet` bonuses, the GB that work
  in any app. `data dpi` and `data video` are app-bound and `data roaming` is abroad only.
  Null when a package has none, so it is never priced on a figure it does not have.
- `price_per_internet_gb` metric, built on it. `telkomsel_resolve_intent` suggests it instead
  of `price_per_gb` when the phrase asked for internet; `price_per_gb` is unchanged.

## [0.13.2] - 2026-10-18

An ordinary word is no longer a country, and a question about the customer's own line is
answered from the official FAQ. Both were measured through a RAG app that pre-routes on
`telkomsel_resolve_intent`, where document and help questions were sent to the catalogue.

### Fixed

- **A misspelled place is read only where a place stands.** "siapa yang mengusulkan PRD,
  kapan" read as Japan and "apa bedanya BM25" as the Netherlands (via "belanda"), each within
  the 0.11 one-third ceiling. No edit budget separates them from "singapure": Elasticsearch's
  AUTO fuzziness allows the same one edit in five letters and two in seven. Gazetteer matchers
  (CLAVIN, Mordecai) instead look a name up fuzzily only in a span already read as a location,
  and `detectDestination` now does the same: a published name counts anywhere, and a
  misspelling only right after a place cue (`ke`, `di`, `menuju`, `to`, `in`, `roaming`,
  `liburan`, `trip`, `travel`, `umrah`, `haji`), or when the phrase is only the place and its
  first letter matches (Elasticsearch's `prefix_length`). "saya mau ke mesri", "roaming
  singapure" and "liburan ke thailan" still resolve; a bare "kapan" and "saya mau jalan" do not.
- **The FAQ no longer lists its empty-search text as a question.** "Hasil tidak ditemukan" was
  the first entry of every `telkomsel_get_faq` answer.

### Added

- **`telkomsel_resolve_intent` routes own-line questions to the FAQ.** When no intent matches
  and the phrase names no place, figure or order, the official FAQ is searched; an entry whose
  question shares two words with the phrase, one of them not a catalogue word, is returned under
  `faq`, and `suggestedCall` is `telkomsel_get_faq`. "cek sisa pulsa", "cara cek masa aktif",
  "masa tenggang" and "masa blokir" were answered with a search over every package; "kuota ada
  tapi tidak bisa internet" shares only catalogue words and stays one. Halo's FAQ is read when
  the phrase says halo, pascabayar or postpaid.
- **`telkomsel_get_faq` takes a `query`.** It returns up to five entries whose question shares
  a word with it, ranked by BM25 over question and answer, or every entry with a note when none
  does.
- Router contract: rules `a-misspelled-place-stands-where-a-place-does` and
  `own-line-questions-go-to-the-faq`.

## [0.13.1] - 2026-10-18

`suggestedCall` searches what the customer named. Every case below was measured on 0.13.0 with
a live catalogue, through an app that runs the suggested call as returned.

### Fixed

- **A named product or brand is the query, not the intent's commonest term.** "paket nonton
  netflix" searched `wetv`, "talkmania roamax berlaku di negara mana" searched `voice`, and
  "roaming buat umrah" searched `roamax`, each a different product. The query is now, in order:
  words of the phrase that appear in at most 20 distinct package names and trigger no intent
  ("umrah", "super seru"); then the brands the phrase names, across intents ("talkmania
  roamax"); then the intent's strongest term as before. Terms carry a new `brand` flag; concept
  words ("nonton", "nelpon") keep the old behaviour. A destination's own name never becomes the
  query, because it is the `region` filter.
- **A place is not a typo of an order.** "umrah" is "murah" with two letters swapped, so the
  Umrah question was sorted by price and lost its word. The typo passes of the order reading
  now skip the place the phrase names.
- **A bare allowance is read as that allowance.** "super seru 100gb" kept `100gb` as text and
  matched four Rp100 000 packages of 50–65 GB; it is now `min_quota = max_quota = 100,
  quota_unit: "GB"` and finds the 100 GB package. A stated range or a lead word ("minimal
  10gb") is read as before.
- **A home city and an unreached country keep their place.** "paket roaming ke bali" and
  "... ke fiji" dropped the destination, so the suggested call returned every roaming package.
  `detectDestination` now returns the city with `reach: "home"` or `"uncovered"`, and
  `suggestedCall` passes it as `region`, whose zero result carries the note (home country, not
  reached). A home city alone ("paket internet di bali") does not make a roaming question, and
  is no longer searched as text: "internet bali" answered with Turkey roaming packages whose
  descriptions name Bali; it is now "internet" with the data-allowance filter.
- **The flat listing no longer reports itself complete.** `TSEL_DEEP_CATALOGUE=0` (or `flat`)
  returned the capped listing, about 300 rows against about 600, with `catalogueComplete: true`.
  Groups at the cap are now reported in `partial`, as the deep walk does.
- **`filtersApplied` follows `packages` in the search JSON.** It carries
  `regionRelevance.rosterPackages`, and a reader that walked the JSON in order took those refs
  for the answer (Japan's cards came back as Vietnam, Turkey and Thailand packages).

## [0.13.0] - 2026-10-18

A rows-first release: what each row says about the destination, and what "internet" means.

### Changed

- **`coverage` is not in the default projection of `telkomsel_search_packages`.** It is per-row
  work that only means something when a `region` was asked for, so it is on demand: name it in
  `fields` or use the `routing` group. Output for every other call is unchanged. The unit
  suite's default-projection invariants now name this exception.
- **The capabilities manifest has its own cap**, `MANIFEST_CHARACTER_LIMIT` (44 000). It sat 25
  characters under the 40 000 shared cap at 0.12.0 and one new field overran it into invalid
  JSON. Every other tool keeps `CHARACTER_LIMIT`. Eight field descriptions were shortened.
- **`telkomsel_resolve_intent` adds `min_quota: 0, quota_unit: "GB"`** when the words left after
  the numbers and the order are only data words, and reports it as `dataAllowance`. Measured
  2026-10-18: 155 packages matched `internet` at 28-31 days, 24 of them without a GB allowance
  (23 with no allowance, 1 in minutes), and those were the cheapest rows. A brand beside the
  word and a stated quota suppress it.

### Added

- **`coverage` per row** (`tier`, `coveringBonus`, `bonusQuota`, `appliesHere`, `note`). A Japan
  search returns `Internet RoaMAX Vietnam` with `appliesHere: false` and `coveringBonus:
  "Roaming Negara Transit"`; without a region the tier is `null` and the note says why.
- **Incomplete-catalogue warning** in the zero-result message: "no package matched" is reported
  as "no package in what could be read" when groups stayed at the upstream cap.

### Fixed

- **Validity words are spent once a window is read.** `masa aktif` no longer stays in the query
  after `sebulan` or `28 hari` set the window; without a window the words remain search terms,
  so "perpanjang masa aktif" still reaches its package.
- **`SERVER_VERSION` was `0.11.2`** while the package was 0.12.0, so the manifest and every
  provenance block reported the wrong version. It is `0.13.0` now.

### Known

- `catalogueComplete: false` persists for four groups the upstream caps at 12 products; a count
  is a floor for them.
- `Voucher Internet Hingga N GB` is excluded by the allowance requirement because its figure is
  only in its name.
- `eval:deep` typoBlast 98%: `"paket murah"` read as `"paket mah"`, present since before 0.12.0.
## [0.12.0] - 2026-10-18

Three phrases a customer typed and the server could not answer, and one field that
contradicted the row it named.

Reported from a retrieval UI: `super seru 28 hari kouta terbesar` came back as
`Masa aktif 28 hari · Kata kunci "super seru kouta terbesar"`; `super seru rentang
20-50` was not answered at all; and a package detail showed
`talkmania-roamax@10gb@50000` beside a quota of `10 Min`. Each is a reading failure,
and each is now read, reported, and pinned by a check that names the measurement.

### Added

- **The router reads the phrase's numbers as bounds.** `telkomsel_resolve_intent`
  reads a validity ("28 hari", "1 bulan", "2 minggu"), a price range ("rentang 20-50",
  "20rb sampai 50rb", "harga 20.000-50.000"), an allowance range ("30GB sampai
  50GB") and one-sided bounds ("di bawah 50rb", "minimal 10GB") into
  `suggestedCall.arguments`, and reports the reading — including the inference it had
  to make, that a bare `20-50` under a price word is rupiah in thousands — under
  `bounds.notes`. `readBounds` lives in `src/services/intents.ts` and is pinned in the
  offline suite.
- **Three more orders.** "kuota terbesar", "kuota terkecil" and "masa aktif terlama"
  are sort hints (`largest_quota`, `smallest_quota`, `longest_active_period`).
  `kuota terbesar` carried no term — the catalogue has no product called "terbesar" —
  and matched no hint, so "super seru 28 hari kouta terbesar" resolved to
  `intent: null` **and** `suggestedCall: null`: nothing at all, which is what the UI
  had to work around.
- **A multi-word order tolerates one mistyped word.** "kouta terbesar" is "kuota
  terbesar" with two letters swapped, and the single-word typo passes skip any phrase
  containing a space, so the order was lost entirely. Read through, and the
  substitution is reported like every other.
- **The suggested call carries the phrase's product words as `query`.** It used to
  omit the query whenever no intent matched, so "super seru termahal" was answered by
  a call that searched the entire catalogue for its most expensive package.
- `filtersApplied.validityWindow` reports a validity filter that was widened to a
  month, with what was asked and what was applied.
- `recon/intent-as-query.md` — research into whether the router should emit a SQL-like
  plan, with the evidence and the reason the answer is a validated plan rather than a
  query language.

### Fixed

- **A month is a band, not a day count.** Super Seru sells a 28-day and a 30-day
  active period as the same month at the same price, so `min_validity_days: 28` with
  `max_validity_days: 28` returned one and hid the other. Both bounds inside 28–31 are
  now read as the month and widened to 28–31, and the widening is reported. A single
  bound is an inequality — "at least 30 days" — and is left exactly as asked.
- **An explicit `sort` survives a `query`.** Relevance ranking ran after the order and
  threw it away: `query: "super seru"` with `sort: largest_quota` returned 18, 8, 10,
  60 GB, ordered by nothing a caller could name. The caller's order now holds and
  relevance breaks ties, the same rule a metric sort has followed since 0.10.0.
- **A `ref` names the unit the package is sold in.** The ref was built with a
  hardcoded `gb`, so Talkmania RoaMAX — 10 minutes of voice — was published as
  `talkmania-roamax@10gb@50000` while its own `totalQuota` said `10 Min`. Minutes and
  SMS packages now say `min` and `sms` (`talkmania-roamax@10min@50000`), an unparsed
  allowance says `na` instead of claiming gigabytes, and gigabyte refs are unchanged.
  Any ref or `offerId` stored for a voice or SMS package has to be resolved again.

### Fixed (tests)

- The fuzzy checks assert the substitution rather than a row count.
  `a misspelled brand still finds its packages` required `matched > 0` for
  `"kombo sakti"`, and the eval asserted the same for `"kombo sakti"` and `"simpaty"`.
  Both brands are still sold; what happened on 2026-10-18 was a walk answering
  `catalogueComplete: false`, which returned 0 rows for `simpaty` and `kombo sakti` in
  one run and 12 and 2 in the next, on identical code. Those probes were briefly moved
  to other brands, which was the wrong repair: it dropped the reference document's own
  examples and left the same fragility in place. They are back on the documented words,
  and what they assert is the reading — `queryFuzzy.applied` with the correction
  `kombo → combo` — read from the JSON when rows come back and from the plain-text
  `Filters applied:` line when they do not (`jsonFieldIn`, matched braces because
  `corrections` nests). Rows are reported as evidence: a partial walk can no longer
  make the fuzzy path look broken, and a broken fuzzy path can no longer pass.
- Both examples the reference document names are pinned offline in `test/unit.mjs`
  against a synthetic candidate set — `kombo sakti` → `combo sakti` and `simpaty` →
  `simpati` — so the failure mode stays covered whatever the catalogue sells.
- The price-bound check uses a typo of a word every walk collects (`internett`) with
  the bound derived from the live matches, so it cannot go vacuous on a partial walk.
- The live checks for this release assert membership rather than the top of a page:
  with `largest_quota` applied, the 30-day Super Seru package sits below rank 25 of 31
  matches, so a page is the wrong place to look for it.

## [0.11.2] - 2026-10-18

0.11.1 said "roster" and meant two different things.

The classification in 0.11.1 was right about the defect and too coarse about the fix.
It labelled every row that is not a package *for* the country as reached "through a
roaming bonus", and said the allowance that applies there is that bonus rather than
`totalQuota`. Measured on 2026-10-18 for Germany, that is true of 28 of the 47 rows
and false of 19:

- `Talkmania RoaMAX`, 10 Min — Germany appears only inside its **`longdesc`** ("Masa
  berlaku 1 x 24 Jam di negara: Afghanistan, ..."), and those minutes work there. The
  description is a first-class retrieval path, not a fallback, exactly as it was
  before 0.11.1 — what changed is the rank and the label, never the membership.
- `Internet RoaMAX Eropa`, 2 GB — its `RoaMAX Eropa` bonus carries 2 GB, which is the
  package's own allowance, so a price per gigabyte over it is a price for Germany.
- `Internet RoaMAX Turki`, 6 GB — reached only by a `Roaming Negara Transit` bonus of
  1 GB. The 6 GB are for Turkey, and this is the row 0.11.1 was describing.

### Changed

- `filtersApplied.regionRelevance` now separates the two: `quotaApplies` counts the
  rows where a metric over `totalQuota` is about the country asked for, `transitOnly`
  counts the rows where it is about the package's own destinations instead, and each
  `rosterPackages[]` entry carries `quotaApplies`. `coveringBonus: null` means the
  description carried the match.
- The rank has three groups, not two: the packages that are for the country, then the
  rows whose own allowance covers it, then the rows reached only by a smaller bonus.
  The requested sort still orders the rows inside each group. For Kyoto that is 12
  destinations, 37 rows whose quota applies and 139 transit-only rows; for Germany, 0,
  19 and 28.
- The note and the roster-only answer say which group a row is in rather than calling
  every non-destination row a bonus.

### Fixed

- `regionQuotaApplies` decides from the quotas rather than from the text that matched:
  a bonus at least as large as the headline leaves the metric meaningful, a smaller
  one does not, and a bonus measured in another unit cannot be compared at all — it is
  unknown, not damning.

## [0.11.1] - 2026-10-18

The cheapest gigabyte to Kyoto was in Australia.

Asked for the cheapest gigabyte to Kyoto, the answer opened with "Internet RoaMAX
Australia & New Zealand" at Rp2 296 per GB, with "Internet RoaMAX Australia & Selandia
Baru" at Rp2 477 next — cheaper than any real Japan package by a factor of five.
Nothing in those records is a lie: their descriptions list 43 countries including
Japan, and a "Roaming Negara Transit" bonus of 1 GB is what actually covers Japan. The
270 and 220 GB they headline is the Australian allowance, and the price per gigabyte
was computed over that. A region search asked one question — does any of this text
name the country — and two different answers came back as one.

### Changed

- A region search now **classifies** each match, and says which kind it is. The tier
  is the package's own identity (`destination`: its name or its `region` field is the
  country asked about) or everything else (`roster`: only its description or one of
  its bonuses names it). Destinations are ranked first; the caller's requested sort
  still decides the order inside each tier, so "cheapest gigabyte to Kyoto" answers
  with the cheapest Japan package.
- `filtersApplied.regionRelevance` reports the census — `destination`, `roster` — and
  lists the roster rows with the bonus that covers the country
  (`rosterPackages[].coveringBonus`, `bonusQuota`). That bonus is the allowance that
  applies there: for Kyoto the honest answer is 1 GB, not 220.
- A region search also reads the **bonuses**, not only the description, so coverage
  that lives in a transit bonus is found. Myanmar, published and sold by no package,
  went from unreachable to 116 rows — every one of them labelled as reached by a 1 GB
  transit bonus, with the sentence the empty answer used to carry, because the
  destination is still the reason rather than a filter. `test/regions-audit.mjs`
  records it: 79 of 80 published destinations reachable, Bhutan still reached by
  nothing.
- Roster rows stay in the result. Group coverage is how the Maldives, Cuba, Jamaica
  and the Seychelles are reachable at all; only their rank and their flagged quota
  changed.

### Fixed

- A metric over `totalQuota` no longer decides the rank of a package that only covers
  the country as a bonus. `price_per_gb` on such a row is a price for somewhere else.
- `telkomsel_get_capabilities` publishes neither new fact and stays under its size
  cap: the manifest JSON is 39 897 of 40 000 characters, and the roster detail lives
  in the search response instead, where it costs nothing.

### Note

The upstream catalogue moved during this work: 601 refs in the morning, 439 in the
evening, with `recon/probe-ref-list.mjs` regenerated against five price bands and
agreeing at 439, so the walk still sees everything the endpoint will give. The smoke
floors calibrated to 601 were recalibrated to what the live catalogue supports, and
the two checks that read packages by a large minimum quota now read them by one.

## [0.11.0] - 2026-10-18

The catalogue the server had been reading was a twelfth of the catalogue.

Telkomsel's `package/list` returns at most twelve products per subcategory group. It
has no paging: `page`, `offset`, `limit`, `skip`, `take`, `size`, `count`, `start`,
`space`, `pagination`, `all`, `showAll` and `subcategory` are all ignored, identically
repeated calls return identical rows, and nothing in the response says a group was
cut. Measured on 2026-10-18: a flat fetch saw 315 distinct packages where the same
endpoint yields 600, and 24 roaming packages where there are 262. `Internet RoaMAX
Umrah` was not among them, and neither was the package that decides whether Fiji is
somewhere you can go.

### Changed

- The catalogue is **walked**, not fetched. Price bands are bisected first — the one
  axis the endpoint honours exactly, and only as strings, since JSON numbers return
  nothing — then quota buckets, then the upstream order is rotated, until every
  subcategory group comes back short of the cap. 600 distinct refs in about 293
  calls, 30 seconds cold, cached for 30 minutes. `TSEL_DEEP_CATALOGUE=0` restores
  the old flat listing, `TSEL_DEEP_BUDGET` caps the calls, `TSEL_CACHE_TTL_MS` sets
  the cache life.
- Every search now filters that one complete catalogue here, category or not. A
  category search used to run through Telkomsel's own filter, which is the thing
  that caps a subcategory at twelve rows: asking for Roaming returned 24 packages
  and calling it roaming.
- `filtersApplied` reports the catalogue it searched: `catalogueSize` rows,
  `catalogueComplete`, and `cataloguePartial` naming any group that was still full
  after every axis was spent. A count is never quietly a floor.
- Cuba, Jamaica and Seychelles are group-covered rather than unreached:
  `Internet RoaMAX Prestige` names all three, and that package was invisible under
  the cap. Fiji stays unreached, and the reason is in the file — the one piece of
  evidence for it was "nadi" inside "Grenadines".
- `telkomsel_search_packages` no longer tells the caller that category filtering is
  server-side, because it is not, and the sentence had outlived its truth.

### Added

- `nextDeepStep`, the partition ladder as a pure function, with 20 unit checks over
  the order the axes are spent in: a band full at one price goes to the quota
  buckets, a degenerate band keeps its price, the budget is read before it is spent.
- Smoke checks that would fail if the cap came back: the whole catalogue stays above
  500, roaming above 200, every category contributes, and a package past the cap
  (`umrah`) is reachable by name.
- A guard that the JSON capability manifest parses and stays inside the character
  cap, which it came within 66 characters of when the completeness line was added.

### Fixed

- Two unit checks asserted that Fiji and Cuba are unreached. One was stale and one
  was never true — see the note on the cities table.


## [0.10.0] - 2026-10-17

A cost question is an order, not a subject. The catalogue has no word for "cheap":
it has prices, quotas and a struck-through price on seventeen packages, and the one
thing the upstream API cannot do with them is order by any of the ratios that
answer "which is the cheapest gigabyte". This release gives the search tool that
arithmetic, removes the intent that used to stand in for it, and fixes what the
change exposed.

### Added

- **A compute engine, in `telkomsel_search_packages`.** `compute: [{ name, expr }]`
  declares up to eight metrics and `sort_by: { metric, direction }` orders by one.
  The engine is a parser and an evaluator, never `eval`: numbers, strings, `null`,
  the published fields, `+ - * /`, comparisons, short-circuiting `&&` and `||`, a
  ternary, and `round/abs/min/max`. Six metrics are built in and need no
  declaration — `price_per_gb`, `price_per_day`, `saving`, `saving_percent`,
  `quota_per_1000`, `price_with_fee` — and `price_per_gb` is the expression the
  price summary already used, kept identical on purpose: two definitions of "per
  gigabyte" in one server would be two answers. Measured: `bestValuePerGb[0]` from
  `telkomsel_aggregate_packages` and `sort_by: { metric: "price_per_gb" }` return
  the same package, both at 250 rupiah per gigabyte at the bottom of the catalogue.
- **A value that cannot be computed is `null`, never 0**, and the response says how
  many rows were skipped and why — `computed.stats` carries `computed`,
  `notComputable`, min, p25, median, mean, p75, max and a reason census, over **every
  match rather than the page**. Rows a metric cannot be computed for sort last in both
  directions rather than being treated as free. The response also attaches each
  package's computed values even when `fields` did not select the columns they read.
- **An order vocabulary in `telkomsel_resolve_intent`.** Five onward orders —
  cheapest gigabyte, biggest discount, most data per rupiah, cheapest package, dearest
  package — over 68 phrases (`rupiah/gb`, `diskon terbesar`, `paling mahal`), each
  reported as `sortHint` with the argument it produces. The hint is read independently
  of the intents, longest phrase wins, and it outranks an intent's default sort so
  "paket nonton yang murah" is a streaming search ordered by price rather than a price
  search that lost the subject.

### Changed

- **The `affordable` intent is gone, and `murah` and `diskon` are reported as
  absent words.** It existed from 0.5.0 and answered "paket murah" with
  `query: "promo"` — a search for a word 62 packages happen to contain, for a question
  about price. No intent inherited its terms: `promo` and `hemat` are not triggers
  anywhere now, and no intent triggers on `murah` or `diskon`. A cost question is
  answered with an order over the packages that exist, and the words the catalogue does
  not contain are published in `computed.absentWords` rather than mapped onto
  something that would return nothing.
- **This is a breaking routing change**, which is why the version moves to 0.10.0:
  a caller that keyed on `intent.id === 'affordable'` gets no intent and a `sortHint`.
  `skills/telkomsel-router/` — the skill and its machine-readable contract — is updated
  to match, and the rule that said "there is no cheapest-per-GB sort and there cannot be
  one" is replaced by the order table.
- `sort` and `sort_by` are mutually exclusive; passing both is refused rather than
  silently preferring one.
- `telkomsel_get_capabilities` publishes the metric names and the five orders in its
  manifest, and the full library, semantics and order table in its markdown rendering.
  The JSON manifest is at 39 844 of its 40 000-character budget, so it carries names and
  a pointer; a longer block truncated it into invalid JSON, which is the one failure a
  router cannot recover from.

### Fixed

- **A comma after a city hid the destination.** "saya pengen ke kyoto, yang rupiah/gb
  nya paling kecil" named **no** country while the same sentence without the comma named
  Japan. Tokens were split on whitespace alone, so the comma stayed glued to the word and
  the city table — keyed by clean names — was handed "kyoto,". Sentence punctuation is now
  stripped from the ends of tokens, and only from the ends: `vision+`, `rupiah/gb` and
  `timor-leste` are names, and the first two are triggers. The same defect meant a
  punctuated stopword was not recognised as filler ("yang," was a content word), which
  the intent map, the order vocabulary and the search tokens all inherit.
- **A dropped or doubled letter in an order word reached no order at all.** The deep
  evaluation's typo family caught it: of 99 perturbed phrases, the three that failed were
  "paket muah" and "paket mah" — one and two letters missing from "murah". An order word
  of five letters or more is now read through a single dropped or doubled letter, while a
  *substitution* is still refused, so "mudah" (easy) never becomes "murah" (cheap) — the
  guard the transposition-only rule was written for. The family moved from 97.0% to 98.0%;
  "mah", two letters short of a five-letter word, is still refused on purpose.

### Measured

On the live catalogue for `081234455666` on 2026-10-17 — **315 packages**, up from 307
earlier the same day:

| Question | Answer |
| --- | --- |
| Packages with a computable gigabyte price | 217 of 315 (98 excluded: no parsed quota, or a quota sold in minutes) |
| Cheapest gigabyte in the catalogue | 25.000 rupiah for 100 GB = **250 rupiah/GB** |
| Gigabyte price spread | min 250, median 5.000, max 94.167 |
| Packages carrying a struck-through price | 17 of 315 — the other 298 carry 0, which means "no discount" |
| Largest discount | ShortMax 30 Hari, 469.000 → 65.000 = **404.000, 86,1%** |

A naive `originalPrice - price` scores those 298 non-discount packages between −716.455
and 0 and sorts the catalogue by a field that does not apply; the `saving` metric guards
it, and the tool description, the capability manifest and the skill all say so.

### Deliberately still true

- A substitution is never read as an order: `mudah` is not `murah`.
- A fragment two letters short of an order word is not read as one: `mah` asks for nothing.
- The five upstream sorts are untouched and still the only ones the API itself has.

## [0.9.4] - 2026-10-17

### Fixed

- **A transposition stopped being read in a destination name.** 0.9.3 read the edit
  budget from the destination name — one edit for a five-letter one — and Levenshtein
  charges two substitutions for a swap, so `mesri` stopped resolving to Egypt while
  `besar`, two substitutions in the same five letters, correctly stayed rejected. That
  trade was not worth making: an adjacent swap counts as one slip on the destination path
  now, exactly as it does for the intent triggers, and the suite asserts both shapes side
  by side so the line between them cannot move unnoticed.

### Changed

- `recon/FINDINGS.md` records the two destination findings behind 0.9.3 — the bonus every
  intent scored, which decided nothing, and the two-edit country match — and says what the
  brand-term counts in it are: provenance recorded in the intent map, not a live
  measurement. `promo` is recorded at 62 there and in `validatedHits`, while one response
  reported `matched: 81` on the same catalogue and a search reported 72 after its own
  de-duplication by `ref`. That is the sentence 0.9.3 removed from the tool output, and
  the document now says why it must not be written where a caller reads it as current.

## [0.9.3] - 2026-10-17

Found by asking the live server for the cheapest rupiah per GB to Singapore and
reading what came back, not by reading the code. The answer to the question itself
was already right; the routing into it was not, and two of the four defects below
were in text the server tells callers to trust.

### Fixed

- **A cheapness word erased the destination.** `telkomsel_resolve_intent` attached
  `destination` only when the `roaming` intent won its ranking, and the ranking
  awarded every candidate the same flat `+600` for naming a place — so the bonus
  cancelled out and decided nothing, and one word was enough to outrank the place it
  was meant to strengthen. "paket ke singapore termurah" came back as
  `destination: null`, `intent: affordable`, and a suggested call of
  `{query: "promo", sort: "lowest_price"}` with no `region`: the router was told to
  search the whole catalogue. "ke singapura termurah" and "ke jepang termurah" were
  never affected, because `ke singapura` and `ke jepang` are triggers in the intent
  map and gave roaming a second exact hit — the case that worked was an accident of
  two hard-coded phrases. Measured on seven spellings that were broken: singapore,
  singapura, japan, jepang, italia, italy and malaysia all keep their destination
  now, and the suggested call carries `region`. The bonus is scored by the roaming
  intent alone at 1500 — more than one exact trigger hit (1000), less than a
  two-trigger topic match, so "nonton netflix di singapore" is still a streaming
  question, phrased with the destination attached.
- **`destination` is a property of the phrase, not of the winning intent.** The
  field is filled whichever intent wins, which also puts the `region` filter into a
  non-roaming intent's suggested search.
- **Four ordinary Indonesian words resolved to countries.** The edit-distance pass
  ranked its candidates but rejected none, so a lone candidate was accepted however
  far it had travelled: "besar" is two edits from "Mesir" — 0.40 of a five-letter
  word — and "cepat", "kerja" and "batas" are equally far from Nepal, Korea and
  Qatar. `kuota besar` resolved to Egypt, and `internet cepat` answered a speed
  question with roaming packages. A candidate costing more than a third of the word
  is now rejected rather than ranked, and the edit budget is read from the
  destination name instead of from the caller's input, which was granting a
  three-edit budget against a five-letter country. Names of four letters get no
  budget at all: "chad" is one substitution from "chat".
- **The `affordable` intent's note carried a count that had moved and a reason that
  was false.** It read `"promo" matches 62 packages because it appears in the word
  "promo" on ribbon labels`. 62 was the count recorded when the term was validated,
  not at the moment of the answer: on one catalogue snapshot the term's own
  `matched` field says 81, `telkomsel_search_packages` says 72, and the word is in
  30 package names and 21 descriptions — the ribbon is the only place in 13 — so the
  reason it gave was wrong on the same data that contradicted its number. The
  sentence no longer states a live count and says where the recorded one is.

### Added

- `test/smoke.mjs`: 25 checks over the two routing defects, including each
  destination asked with and without the cheapness word and compared against each
  other rather than against a fixed expectation, and a list of ordinary phrases that
  must name no destination. Reverting the fixes in the built output fails 11 of them.
- `eval/scenarios-deep.mjs`: three sentences that name a destination and a price,
  and three ordinary phrases that must resolve to no country, in the `destination`
  family — now 35 rows, all passing.

## [0.9.2] - 2026-10-17

Four defects, three of them found by asking the live catalogue rather than by
reading the code. Two destinations resolved to the right country and then matched
nothing; a failed destination-list fetch was cached for six hours and answered
around; an empty search blamed filters nobody had applied; and an unresolvable
`id` said only that it was not found.

### Fixed

- **Two destinations resolved correctly and were then searched for under the wrong
  spelling.** `mapped-regions` publishes "Vatican City" and "Macao"; the rosters
  inside the package descriptions say "Vatican" and "Macau". The resolver found the
  right country and matched only the published pair, so `region=vatican` returned
  nothing while three packages named Vatican, and `region=macao` returned nothing
  while five named Macau. The catalogue's own spelling is now in the alias list.
  Measured before: 0 and 0 matches. After: 3 and 5. `region=vatikan` and
  `region=makau` went from 0 to 3 and 5 for the same reason.
- **An empty destination list was cached for six hours, and answers were invented
  from it.** `mapped-regions` publishes 80 destination names, so a response
  carrying none of them is a failed fetch. It was cached like any other, and every
  destination then resolved to nothing for the life of the process, which reads as a
  resolver bug rather than an upstream one. A stale list is now served instead of a
  wrong answer; with nothing to fall back on, the caller is told the list came back
  empty. This is the likeliest cause of the scheduled run of 2026-10-17 06:20 UTC,
  which failed eight destination checks, every one of them "resolved to nothing".
- **A zero-result search blamed filters that had not been applied.** Every empty
  search printed one fixed sentence — "widen max_price, drop the quota bucket, use
  telkomsel_list_package_categories …" — whatever had been asked, and
  `region=vatican` was answered with it. The message now reads the filters that
  were actually applied. When a destination was resolved and nothing else narrowed
  the search, it says the destination is the reason, names the country it resolved
  to, and reports that it is one of the destinations published upstream. Bhutan and
  Myanmar are the two that are published and sold by no package.
- **An unresolvable `id` now says why one cannot be found.** It is issued per
  upstream request, it is only resolvable while this process still holds it for that
  number, and a freshly fetched catalogue carries new ids — so the message names
  the id and points at `ref`. The README said the lookup "falls back to the live
  catalogue" without saying that the fallback can only consult a catalogue the
  process already holds; it states what the code does now.

### Changed

- **The live smoke test no longer asserts a word upstream can rewrite.** The
  description check used the hardcoded word "tethering", which answered 0 in the
  scheduled run of 2026-10-17 and 20 the next day: the check reported a regression
  that did not exist. It now reads a word out of a real description, one that
  appears in no package name, and requires it to be found. The claim — that the
  description is searched — is unchanged, and it can no longer rot.
- **A published intent term recorded at five hits or fewer is reported, not failed.**
  `luar negeri` was recorded at 4 hits and answered 0 in the scheduled run, and the
  failure read as a regression across six terms. Terms above that floor still fail
  hard. The phrase check for "saya mau ke luar negeri" is now stated as a
  comparison against its own content words rather than a floor of 1.
- **The smoke summary is printed after the last check.** It was printed before the
  isolation block, so a failure in that block exited 1 while the log ended on
  "ALL CHECKS PASSED".
- **`npm run audit:regions`** walks every published destination by name and fails
  when one that should be reachable is not, which is the check that would have
  caught the Vatican and Macao defect. The scheduled workflow runs it.
- The router contract called every published single-country destination one that
  "has its own packages". Measured: 78 of 80 do, and Bhutan and Myanmar do not. The
  contract now records which two, and when.

## [0.9.1] - 2026-10-17

Fixes a cross-caller data leak in 0.9.0. **If you are running the 0.9.0 tag or
commit, upgrade.** No version of this package has ever been published to npm, so
0.9.0 reached nobody through the registry — it exists as a tag on this repository,
and that is the only way it could have been run.

### Fixed

- **One phone number could read another number's packages.** The package index
  behind `telkomsel_get_package` and `telkomsel_compare_packages` was one global map
  shared by every caller in the process, regardless of number. The catalogue differs
  per number (live: 316, 297 and 144 packages for three numbers), so number B
  presenting an `id` that number A had been shown was answered with A's package.
  Reproduced through the handler before the fix: B received a package from A's
  catalogue. The index is now partitioned by number, every lookup names its number,
  and a number can only read its own partition. Impact was limited to ids and refs
  already shown to another caller in the same process; the data is the public
  per-number catalogue, not account data.
- The index is bounded per number as well as per ref: 200 numbers, 5000 ids per
  number, 32 ids per ref. This limits memory; it does not make an old `id` last
  forever.

### Changed

- **Documentation no longer says the host "keeps nothing".** It does not keep a
  conversation, but the process holds best-effort caches (catalogue, package index),
  now stated plainly: partitioned by number, size-bounded, and absent in a fresh
  serverless process. Tool descriptions say an `id` can stop resolving and that
  `ref` is the identifier to reuse.

### Tests

- `test/host.mjs` compares values across two numbers (B cannot resolve A's id, nor
  reach A's ref; each reads its own price). The earlier end-to-end check only asked
  whether a field was defined and would have passed while leaking.
- `test/smoke.mjs` repeats the check live against Telkomsel.
- Verified in a real Next.js 16 process: two numbers with different catalogues
  (316 vs 297 packages), 12 shared names compared, 4 resolving to a different ref per
  number, no answer outside the asking number's own catalogue.

## [0.9.0] - 2026-10-17

The hosting release. `npm install telkomsel-product-mcp` now gives a Next.js app an
MCP server in one import, and the same package still runs over stdio.

```ts
// app/api/mcp/route.ts
import { createMcpHandler } from 'telkomsel-product-mcp';

const handler = createMcpHandler({ apiKey: process.env.MCP_API_KEY! });
export { handler as POST, handler as GET, handler as DELETE };
export const runtime = 'nodejs';
export const dynamic = 'force-dynamic';
```

### Added

- **`createMcpHandler(options)`** — a `(Request) => Promise<Response>` handler. It
  uses no framework API, so the same function is a Next.js App Router handler, a
  Hono or Bun `fetch`, or a Deno `serve` callback.
- **`createTelkomselServer(options)`** — the server with no transport attached, for
  anything else: a test, an in-process client, a host with its own transport. The
  `telkomsel-product-mcp` binary is now a thin stdio launcher around it, so every
  way of running the server exposes the same tools.
- **Library entry and types.** `exports` map, `main`, `types`, and `.d.ts` for the
  whole public surface. The `bin` is unchanged.
- **`skills/` now ships in the package**, so the router contract installs with it.

### Security: the route refuses to be built open

An MCP endpoint here calls Telkomsel on the caller's behalf and accepts any phone
number as an argument. Left open it is a free proxy, so `createMcpHandler` throws at
construction unless you choose one of `apiKey`, `authorize` or `unauthenticated:
true`. A key under 16 characters is refused. Keys compare in constant time. A
browser `Origin` that is not in `allowedOrigins` is refused, which stops a web page
reaching a server on a visitor's machine; clients with no `Origin` are unaffected.
Request bodies over `maxBodyBytes` (1 MiB) are refused before parsing.

### Fixed

These were harmless in a single-user stdio process and wrong the moment the server
was hosted, which is why they were not visible before.

- **One caller could change every caller's number.** The default MSISDN was two
  module-level variables. In a Next.js process every request shares the module, so
  one request calling `telkomsel_set_default_msisdn` changed the default for all of
  them. State now lives on a per-server `Session`. On a stateless host the tool
  refuses and says why, instead of reporting a change it cannot keep.
- **The package index grew without bound.** The upstream mints a new id on every
  request, and each id stayed reachable under one ref. Measured: 1000 refreshes of a
  single package left `findByRef` holding 1000 copies. Capped at 32 ids per ref.
  (The index was still shared across phone numbers in this release; see 0.9.1.)
- **Two caches only ever grew.** The catalogue cache and the menu-level cache gained
  an entry per distinct number and removed one only when it was read. Both are now
  bounded, dropping expired entries first.

### Changed

- `telkomsel_set_default_msisdn` and the manifest's `route.transport` depend on how
  the server is hosted. Over stdio nothing changes.
- `register*Tools` take the session explicitly instead of importing global state.

### Not supported, deliberately

- **No stateful sessions and no SSE stream.** Every request is served by a new
  server with its own session, which is what lets it run on serverless where the
  next request may land on another machine. The process still holds best-effort
  caches (catalogue, package index), partitioned by number and size-bounded, that a
  fresh process will not have. Every tool here is a request and a response; nothing
  is pushed.
- **Not the Edge runtime.** The SDK uses `node:crypto`. Set `runtime = 'nodejs'`.

## [0.8.0] - 2026-10-17

The destination release. The catalogue sells roaming by country; customers name
cities. Nothing bridged the two, and the gap was invisible, because an
unrecognised place looks exactly like a place with no packages.

`region=kyoto` returned nothing at all. `region=tokyo` returned Japan — not
because it was handled, but because the string "tokyo" happens to appear in a
package description. Kyoto failing while Tokyo worked was a coincidence, and a
coincidence is what a system relies on right up until it fails.

### Added

- **Cities and landmarks resolve to the country that sells them.** 704 names
  across the 80 single-country destinations and 55 more reached through group
  packages: `kyoto` → Japan, `machu picchu` → Peru, `cape town` → South Africa,
  `jeju` → South Korea. A whole sentence can be handed over as typed —
  `saya pengen ke kyoto` resolves, and so does `jalan jalan ke jeju`.
- **Four destination tiers, each one answered instead of left empty.** A city in
  a country with its own packages; a city in a country reached only by a group
  package; a city in Indonesia, where roaming does not apply; and a place the
  catalogue genuinely does not reach. The last two return no packages **and say
  why** — `bali` used to return nothing at all, which reads as a broken search
  rather than as an answer.
- **`skills/telkomsel-router/`** — the router contract for the intent router of a
  RAG system sitting in front of this server. Eight rules, each one a defect that
  was measured against the live catalogue, plus `router-contract.json` for
  embedding the same rules as data. Covers destination resolution, why a numeric
  range must never enter a text query, shorthand normalisation, and how to find
  best value per GB when no sort exists for it.

### Fixed

- **The published destination list is not the coverage.** It holds the 80
  single-country destinations. Group packages — `Internet RoaMAX Eropa`,
  `Talkmania RoaMAX` — name the countries they cover inside their description, and
  the region filter reads that text. The largest roster holds 135 names and the
  union across all of them is 142.
  An earlier version of the resolver called eighteen countries unreachable on the
  strength of the published list alone. **Thirteen of them were wrong**:
  `maldives` returns three packages.
- **Multi-word names were missed inside a sentence.** Matching looked at single
  words plus the whole input, so `machu picchu` resolved when it *was* the entire
  query and not when it arrived as `planning a trip to machu picchu` — which then
  fell through to fuzzy country matching and answered **Macao**. Matching is now
  longest-name-first over every run of up to four words.

### Changed

- Deep evaluation gains a `destination` family: 29 cities and sentences across all
  four tiers, scored against the tier each one belongs to. It found the
  multi-word defect on its first run, at 28/29.

## [0.7.1] - 2026-10-17

Found by typing the question 0.7.0 is named after rather than a phrase from the
suite — the whole 95-character sentence, misspelling included. Three defects in
how a destination is read out of a sentence, none of which any family could see,
because every family asked with a short phrase.

### Fixed

- **A misspelled destination inside a sentence was not read.** `paket buat ke
  singapura` found its destination and `paket buat ke singapure` — the same
  length, one letter different — did not, because the token pass in the
  destination detector compared against published names exactly and never offered
  a token to the fuzzy resolver. The resolver could read it; it was never asked.
- **The first token that resolved won, and it was the wrong one.** With the
  fallback in place, `saya mau jalan ke singapure` answered with Japan: `jalan` is
  one edit from `japan` and came first in the sentence, exactly as far as
  `singapure` is from `singapore`. An edit count cannot separate them; the error
  relative to the word can. One letter wrong in a five-letter word is a different
  word, one letter wrong in a nine-letter word is a misspelling. Tokens are now
  ranked by that ratio.
- **An insertion match was unbounded.** Bounding the deletion gap but not the
  insertion one let any short trigger match any longer word containing its letters
  in order: `les` is a subsequence of `lowest`, so `lowest rupiah per gb under
  100k` routed to learning — a question about the lowest price per gigabyte
  answered as a question about courses. Both directions are now bounded by the
  same gap of two, which costs nothing: every genuine typo measured has a gap of
  two or less either way.

All 13 phrases tested now resolve their destination correctly, including the full
95-character sentence. Both evaluations remain at 100%.


## [0.7.0] - 2026-10-17

The compound-question release. The 0.6.0 verdict held for the ten families it
scored, and this round asked the questions it had not: a destination and a budget
in one sentence, a customer who misspells, and a customer writing in English. Two
of the three found real bugs — and the fix for one of them introduced a third,
which the old suites caught.

Before this round, on the deep evaluation: **75.6%**. After: **100.0%**.

### Fixed

- **A destination was reachable in only one language.** Every one of the 19
  countries whose English and Indonesian published names differ returned a
  *disjoint* result set for the two spellings — 19 of 19, sharing nothing.
  "Singapore" returned 4 packages and "Singapura" 12. For the exact question this
  round is about — fly to Singapore, cheapest rupiah per GB, under 100k — the
  English answer was Rp100.000 for 2GB (50.000/GB) against the Indonesian answer
  of Rp55.000 for 25GB (2.200/GB): **23x worse, and the English one wrong**. The
  server-side region filter knows only the Indonesian name, so a destination is
  now resolved to a country first and matched over every spelling. `singapure`
  resolves as well, and reports what it was read as.
- **A two-letter country alias matched inside unrelated words.** The alias list
  for the United Kingdom contains "uk", and a substring match on it returned 195
  of 315 packages — every one of them matching the "uk" inside the Indonesian word
  "untuk". A resolved alias must now match a whole word: `region=uk` returns 3,
  the same 3 as `United Kingdom` and `england`.
- **Pricing shorthand reached nothing.** "75.000", "Rp75.000", "75 ribu" and
  "100rb" are how customers write prices, and none of them was in the index. The
  tokenizer collapses thousands separators, drops a rupiah prefix and reads the
  shorthand, so all four land on the token `75000`.
- **A destination named without a trigger word was discarded.** "package for
  singapore" contains no trigger phrase, so the roaming intent scored on the
  destination and was then filtered out for carrying no matched trigger — the
  strongest signal in the phrase thrown away for want of a weaker one.

### Added

- **Typo tolerance in intent routing, by the shape of the error.** Blast radius
  was 76.8%: 23 of 99 perturbed phrases got no answer at all, and result coverage
  stayed at 100%, so the failure was routing rather than retrieval. A shared
  first letter plus an edit budget fixed most of it and cost precision, because an
  edit count cannot tell a misspelling from a different word — two deletions turn
  "nonton" into "nonn", and two substitutions turn "cheap" into "chat". Every
  genuine typo measured was the trigger with letters *dropped*, and not one false
  match was. A dropped character is now read through at any size, an adjacent swap
  counts as one slip, and a substitution still has to fit a one-edit budget.
  Blast radius **100%**, with the clean-phrase guard at **100%**.
- English and colloquial Indonesian phrasing for all 13 intents, with ~55 English
  stopwords and fillers such as "biar" and "sama" that were reaching unrelated
  triggers once a token could match through an edit. English went from 42.9% to
  100%, colloquial Indonesian from 70% to 100%.
- A **clean-phrase precision guard** in the deep evaluation. Recall on
  misspellings is only an improvement if it does not change the answer to a
  question already spelled correctly, and the first attempt did: "package for
  gaming" became a roaming question through "going", and "cheap package" an SMS
  one through "chat". The guard caught it, and now scores every declared intent
  on its correct spelling.
- An adversarial family scored against what each case requires rather than
  against "did not crash". The first version passed 13/13 while `Rp75.000`
  returned nothing and `75.000` matched one package by accident.

### Fixed (found by the existing suites)

- **De-duplicating the BM25 token stream destroyed term frequency.** Added to
  remove one duplicate the amount expansion introduced, it set every `f(qi,D)` to
  1 and made Okapi BM25 degenerate to IDF times length normalisation. A search for
  "netflix" stopped putting the Netflix bundles first, and "netflx" stopped
  surfacing them at all. The duplicate is fixed at its source instead; the
  tokenizer test asserts a repeated word is kept twice.
- Ranked the corrected match below an exact one, and stopped summing the travel
  penalty across corrections. Both made an intent that fitted the phrase *worse*
  win: "package for gaming" lost to roaming on "going abroad" — twelve characters,
  two edits away — which beat gaming's exact six-character "gaming".

## [0.6.0] - 2026-10-16

The retrieval-quality release. Measuring this server against the BM25 reference
document ("Penjelasan Algoritma Pencarian BM25") turned up one silent data-loss bug,
one missing half of retrieval, and three failure modes the document names.

### Fixed

- **A JSON listing could be cut mid-string and stop parsing.** `fitToBudget` measured
  compact JSON while the result is sent pretty-printed, and applied a flat inflation
  estimate. The estimate held for the default projection and broke for a caller asking
  for `bonus`: the payload passed `CHARACTER_LIMIT`, `capText` cut it inside a string,
  and the body became unparseable — while `isError` stayed false, so an indexer pulling
  the catalogue saw a successful call holding invalid JSON and lost that page silently.
  The payload is now rendered and measured as it will actually be sent, envelope
  included, and trailing records are dropped until it fits. The size cap is exact
  rather than calibrated.
- Pagination guidance now points at `page.nextOffset`. Under the cap a page returns
  fewer rows than `limit`, so the natural loop `offset += limit` skips rows without
  any error; a first attempt at inventorying the catalogue this way collected 94 of
  315 packages and lost the whole Roaming category.

### Added

- **BM25 relevance ranking.** A text query used to decide only *which* packages came
  back, never in what order, so results arrived in catalogue order: a search for
  "netflix" found all four Netflix packages and placed them at ranks 9-12, behind
  eight that merely mention the word. A top-five slice returned none of the real ones.
  Results are now ordered by Okapi BM25 (k1 1.5, b 0.75) over the same text the query
  was matched against, so membership and ordering cannot drift apart. Measured over
  19 partner brands: coverage 100%, MRR 1.00, NDCG@10 100%.
- **Fuzzy fallback for typos.** The document is explicit that an exact lexical index
  scores zero on a misspelling and that Levenshtein matching is therefore mandatory.
  When a query matches nothing as written it is retried with a small edit distance per
  term, and `filtersApplied.queryFuzzy` reports that it happened, what the query was
  read as, and each correction. "kombo sakti" now returns the two Combo SAKTI packages,
  "netflx" returns the Netflix bundles, and nonsense ("zzzqqqxxx") still returns nothing
  rather than a guess.
- **The price is searchable**, following the document's own recipe for the lexical
  field ("… 50GB 50 GB 105000 105rb …"). A customer typing "75000" or "100rb" now
  reaches the offers at that price; before, a bare price matched nothing at all.
- Numeric shorthand is indexed beside the plain form (`105000` also indexes `105rb`,
  `105k`, `105ribu`; `50gb` also indexes `50` and `gb`), so a query written the way a
  customer writes it reaches the document.

### Changed

- `test/unit.mjs` gained 29 checks over the tokenizer, the BM25 scorer, the edit
  distance and the payload fitter; `test/smoke.mjs` gained 21 checks over ranking,
  typo tolerance, price shorthand, range refusal and mid-JSON truncation.
- `eval/` — a scored retrieval evaluation against the same reference document:
  scenarios, metrics (coverage, precision@k, MRR, NDCG@k, exact set equality), a live
  runner and `eval/REPORT.md`. Run it with `npm run eval`.


## [0.5.0] - 2026-10-16

The customer-wording release. 0.4.0 made the catalogue searchable; asking it what a
customer actually says showed that most of those questions still returned nothing.

### Added

- `telkomsel_resolve_intent` — turns customer phrasing into the terms this catalogue
  answers, with live per-term counts, suggested filters, and a ready-to-call search.
  Its 13 intents and ~60 terms were derived from the catalogue (bonus names and
  descriptions) rather than invented, and every term was validated against the live
  data before being published.
- `telkomsel_aggregate_packages` — statistics over every package matching a filter
  set: price spread, price per GB, allowance mix, masa aktif spread, and cheapest and
  best-value shortlists. It runs the same pipeline as the search tool, so an aggregate
  can never describe a different set than a search would return.
- The intent map is published in the capability manifest, and `DOMAIN_CONCEPTS` is now
  read rather than only published: `telkomsel_resolve_intent` matches field-level
  questions ("masa aktifnya berapa lama") against it and reports the fields a concept
  lives in.

### Fixed

- **Filler words no longer break a query.** Every token had to match, so one word that
  appears in few packages took the whole query to zero: `"paket buat nonton"` returned
  0 packages while `"nonton"` alone returned 69, because `"buat"` appears in 3 packages
  and none of them are those 69. Indonesian stopwords are dropped before matching, with
  a query made entirely of filler falling back to its own tokens rather than silently
  becoming "match everything". Measured: 8 of 12 previously-dead customer phrasings
  began working from this alone.
- **The manifest could silently truncate into invalid JSON.** The JSON manifest sat
  1.9 KB under `CHARACTER_LIMIT`; publishing the intent map pushed it past the cap,
  where it was cut mid-string and became unparseable — a failure that looks like a
  working manifest until something tries to parse it. The JSON manifest now carries a
  pointer instead of the full map, and a test pins the margin.

### Changed

- The intent map lives in the markdown manifest in full. The JSON manifest carries an
  index-sized pointer because it has no room for more, and says so.
- `test/tools.mjs` asserts the JSON manifest is never truncated, and
  `test/smoke.mjs` re-checks that no published intent term has gone dead.

## [0.4.0] - 2026-10-16

The catalogue-search release. This one came out of asking what DXMIE-RAG actually needs to answer, and
the answer was structured search over package metadata: a price range, a quota range, masa aktif,
category. Two of those were impossible and a third was actively wrong.

### Added

- **`min_quota` / `max_quota` with `quota_unit`** — a real numeric quota range, replacing a coarse bucket
  as the only option. The unit argument is not a convenience: see Fixed below.
- **`min_validity_days` / `max_validity_days`** — masa aktif was not filterable in any form before.
- **`quotaValue`, `quotaUnit`, `validityDays`** — the parsed measures, on every package and every listing,
  so a caller can filter and compare without re-deriving them. Declared `derived` in the schema, because
  they are this server's reading of two display strings rather than upstream values.
- **`nullable` and `derived` in the field schema**, published in the manifest `tools/list`-adjacent
  `capabilities` output along with `nullableFields` and `derivedFields`, so a router can tell a computed
  field from an authoritative one and a null from a zero.
- **`filtersApplied.quotaRange`** reports how many packages a range filter excluded for being measured in
  a different unit, and how many headline no allowance at all. A filter that silently drops a third of the
  catalogue is worse than one that says so.

### Fixed

- **`totalQuota` is three different quantities, and the sort treated them as one.** Across 307 packages the
  live catalogue returns 91 forms: 60 in GB, 26 in voice minutes (`"335 Min"`), 4 in SMS (`"1500 SMS"`), and
  30 empty. Stripping non-digits turned `"335 Min"` into 335 and ranked it above a 100 GB package in a data
  search. A quota range now requires a unit and excludes packages measured in another; a quota sort only
  ranks comparable packages and puts the rest last.
- **The free-text search omitted the description.** `longdesc` is the field that says what a package is
  for, and it was not searched, so a query answered only by the description returned nothing: measured
  across the live catalogue, adding it takes "video" from **4 matches to 143**, "tethering" from **0 to 20**,
  "youtube" from 1 to 10. The `region` filter had always searched `longdesc`, so the omission was
  inconsistent as well as costly.
- **Raw HTML reached the caller.** All 333 packages carry HTML in `longdesc` and `terms`; both are now
  stripped at the boundary, so the prose a caller reads, the prose an indexer would embed and the prose the
  search matches are the same clean text.
- **A stale size claim in the tool description.** It said a JSON listing was capped at 40 packages. The cap
  has been by serialised size since 0.2.0 — currently about 24 000 characters, which fits 18 packages at the
  full projection. The description now says so.

### Note

`terms` is deliberately excluded from the search. It is 333 KB across the catalogue and only 30% distinct —
the same legal boilerplate repeated on nearly every package. Searching it inflates hit counts through text
that describes nothing: "hemat" goes from 3 matches to 15, none of them because the package has anything to
do with saving money. It stays retrievable by naming the field.

### Tests

**416 checks, up from 348** — 188 offline unit, 48 offline MCP protocol, 63 offline resource and sync
contract, 117 live end-to-end. The parser cases are written from all 91 quota forms and all 15 validity
forms the live catalogue returns, so a new upstream shape fails loudly instead of quietly narrowing a range.

## [0.3.0] - 2026-10-16

The corpus release. Until now this server could answer questions but could not hand an index the material
worth indexing: discovering the product corpus through a *search* tool means every sync is a sequence of
guesses about which queries reveal which documents.

### Added

- **A corpus exposed as MCP Resources**, because a Resource is application-controlled while a Tool is
  model-controlled — the indexer decides what to read, rather than the model deciding what to fetch.
  Resources also escape the tool-result size cap that this server enforces for its own listings, which is
  what makes them the right home for material larger than a single agent turn should carry.
  - `telkomsel://catalog` — every document with a content hash, the volatility policy, and an explicit
    register of what must **never** be embedded.
  - `telkomsel://products`, `telkomsel://products/{slug}`, `telkomsel://segments` — the bundled
    catalogue. The 11 products are enumerated through `resources/list`, so an indexer never guesses slugs.
  - `telkomsel://roaming-destinations` — global reference data (the endpoint takes no number).
- **Content hashing for incremental sync.** `contentHash` covers the `data` field and is computed over
  canonical JSON with **sorted keys**, so a re-ordered upstream response is not reported as an edit. The
  envelope timestamp is deliberately excluded: a digest that moved on every read could not answer whether
  anything changed.
- **Volatility classification** — `static`, `reference`, `live` — with the rule stated once: *if it varies
  by number, it is not corpus.* This is why the FAQ stays a tool despite being prose.
- **A per-document failure mode.** A document that cannot be produced reports `contentHash: null` with a
  `hashError` rather than failing the whole catalog, so one unreachable upstream does not block a sync.
- The manifest from `telkomsel_get_capabilities` now carries a `corpus` block, and `test/resources.mjs`
  asserts it cannot drift from the registered resources or point at a tool that does not exist.

### Note

The MCP protocol has no cache hint: `ttlMs` and `cacheScope` do not exist in SDK 1.32.1. Volatility is
therefore published as **data** — in `resources/list` annotations, in each resource's `corpus` block, and
in the catalog — rather than as something a client would honour automatically.

### Tests

**348 checks, up from 258** — 137 offline unit, 48 offline MCP protocol, 63 offline resource and sync
contract, 100 live end-to-end. The suite asserts that the hash the catalog advertises equals the hash a
read returns; if those diverged, an indexer would re-embed the whole corpus on every sync while believing
nothing had changed, and nothing else would notice.

## [0.2.1] - 2026-10-16

### Fixed

- The `fields` argument's `all` keyword was matched against the raw input before normalisation, so
  `["ALL"]` fell through to the field-name path, matched nothing, and returned an empty selection where
  every field was expected. It was the one lookup in that function that did not normalise first; the
  surrounding field names, group shorthands and dotted sub-fields were already case-insensitive.

### Tests

- Case-insensitivity is now asserted for field names, group shorthands, dotted sub-fields and the `all`
  keyword, in both the offline unit suite and the live smoke test — so the fix cannot silently regress.
- 258 checks, up from 241.

Retrieval-router release. This version lines the server up with its intended use as the live, structured
route of a retrieval-augmented system: a router can now plan against it, ask for the fields it needs, and
tell authoritative live values apart from a stale indexed copy.

The design follows [SchemaRouter](https://arxiv.org/abs/2608.21375), which studies routing across
external APIs, vector stores and graph stores, and measures that selecting only *tools* — never fields —
causes over-fetching and under-fetching. Its counter-intuitive result shaped the field-projection default:
minimising the selected-field count cut answer accuracy from 0.71 to 0.56 for negligible token savings.

### Added

- `telkomsel_get_capabilities` — a machine-readable route manifest carrying only the semantic layer that
  MCP's `tools/list` has no field for: per-tool purpose with what each tool does *not* answer, the entity
  field registry with types and units, the domain vocabulary, the trust boundary, and routing guidance in
  both directions. Static, so it costs no upstream request.
- `fields` argument on `telkomsel_search_packages`, `telkomsel_get_package`,
  `telkomsel_get_offer_break`, `telkomsel_list_products` and `telkomsel_get_product`, for caller-driven
  field projection. Supports `["all"]`, group shorthands (`["pricing"]`) and dotted sub-fields
  (`["bonus.quota"]`).
- `provenance` block on every result: route, `live`/`snapshot` mode, source, timestamp, entity,
  `authoritativeFields`, licence and version. A snapshot declares no authoritative fields, so a router can
  distinguish "nothing here is current" from "this is current".
- `offerId` (`slug@quota`) as the price-independent corpus identity, indexed in the package store and
  resolvable through it. `ref` stays as the key for resolving one priced offer.
- `src/services/schema.ts` — the field registry that the projection, the manifest and the capability tool
  all read, so they cannot drift apart.
- `src/services/provenance.ts` — the trust and attribution block, plus a markdown footer.

### Changed

- **Default field projection is now recall-preserving.** It previously kept 11 of the 24 fields a package
  carries, withholding `fee`, `typeOffer`, `subCategory`, `offerPriority`, `purchasePercentage`,
  `otherBonus`, `trxPackage`, `businessPID`, `validity`, and all bonus classification fields. Those were
  unretrievable rather than merely omitted, so a question needing one of them could not be answered. The
  default now returns every field except the multi-kilobyte `terms` and `longdesc` HTML, each of which is
  announced as a `has*` boolean.
- JSON listings page **by size, not by a fixed item count**. The cost per package depends on the projection
  requested, so a count-based cap broke as soon as the projection widened, cutting JSON mid-string. A
  character budget replaces it, and `droppedForSize` reports when it stops early.
- Unknown field names are rejected with the list of valid ones instead of being ignored.
- `snapshotProvenance` now records the entity it describes; it previously accepted one and dropped it.
- `telkomsel_list_roaming_countries` documented its return shape as `[{ id, en }]`; the API returns
  `[{ original, en }]`, and `original` is the value the `region` filter accepts.

### Fixed

- Field-name lookup is case-insensitive. Names were matched against a canonically-cased map after being
  lowercased, so every camelCase field (`totalQuota`, `originalPrice`, …) was unreachable.

### Tests

- 241 checks, up from 121: 107 offline unit, 48 offline MCP protocol, 86 live end-to-end.
- `test/tools.mjs` now asserts the capability manifest documents exactly the advertised tool set, and that
  its declared fields, heavy fields and unstable fields match the registry — so a tool cannot ship
  undocumented and a declared field cannot drift from the code that implements it.

## [0.1.0] - 2026-10-16

First working release.

### Added

- MCP server over stdio exposing 18 read-only tools for the Telkomsel product
  and package catalogue.
- The 11-product dataset (`src/data/products.ts`), generated from the official
  landing pages by `recon/gen-catalog.mjs` — official name, positioning line,
  slug, segment, URL, plus a scraped summary and section headings each.
- Live package catalogue personalised per MSISDN: categories, subcategories,
  server-side filtered search, package detail, and side-by-side comparison.
- Supporting lookups: filter options, all 82 roaming destinations (with English
  and Indonesian names), featured offer groups, pulsa denominations, and the
  official product FAQ.
- Session MSISDN handling: `telkomsel_get_config`,
  `telkomsel_set_default_msisdn`, `telkomsel_check_msisdn`,
  `telkomsel_get_default_number_hint`, plus `TSEL_DEFAULT_MSISDN`.
- Durable `ref` identifiers (`name@quota@price`) and a session package index,
  because the upstream API mints a new package `id` on every request.
- Result-size guard that keeps listing payloads inside the 40 000-character cap,
  so JSON output is never truncated mid-string.
- Documentation of the reverse-engineered API in `recon/FINDINGS.md`, with the
  scripts that discovered it kept in `recon/` so the findings can be re-verified.
- Offline unit suite (`test/unit.mjs`, 52 checks) and a live end-to-end MCP
  smoke test (`test/smoke.mjs`, 43 checks) driving all 18 tools.

[Unreleased]: https://github.com/EgiStr/telkomsel-product-mcp/compare/v0.9.4...HEAD
[0.10.0]: https://github.com/EgiStr/telkomsel-product-mcp/compare/v0.9.4...v0.10.0
[0.9.4]: https://github.com/EgiStr/telkomsel-product-mcp/compare/v0.9.3...v0.9.4
[0.9.3]: https://github.com/EgiStr/telkomsel-product-mcp/compare/v0.9.2...v0.9.3
[0.9.2]: https://github.com/EgiStr/telkomsel-product-mcp/compare/v0.9.1...v0.9.2
[0.9.1]: https://github.com/EgiStr/telkomsel-product-mcp/compare/v0.9.0...v0.9.1
[0.9.0]: https://github.com/EgiStr/telkomsel-product-mcp/compare/v0.8.0...v0.9.0
[0.8.0]: https://github.com/EgiStr/telkomsel-product-mcp/compare/v0.7.1...v0.8.0
[0.7.1]: https://github.com/EgiStr/telkomsel-product-mcp/compare/v0.7.0...v0.7.1
[0.7.0]: https://github.com/EgiStr/telkomsel-product-mcp/compare/v0.6.0...v0.7.0
[0.6.0]: https://github.com/EgiStr/telkomsel-product-mcp/compare/v0.5.0...v0.6.0
[0.5.0]: https://github.com/EgiStr/telkomsel-product-mcp/compare/v0.4.0...v0.5.0
[0.4.0]: https://github.com/EgiStr/telkomsel-product-mcp/compare/v0.3.0...v0.4.0
[0.3.0]: https://github.com/EgiStr/telkomsel-product-mcp/compare/v0.2.1...v0.3.0
[0.2.1]: https://github.com/EgiStr/telkomsel-product-mcp/compare/v0.2.0...v0.2.1
[0.2.0]: https://github.com/EgiStr/telkomsel-product-mcp/compare/v0.1.0...v0.2.0
[0.1.0]: https://github.com/EgiStr/telkomsel-product-mcp/releases/tag/v0.1.0
