Skip to content

refactor(routes): retire token counter and pipe - #971

Open
trac3r00 wants to merge 1 commit into
release/product-value-20260912-01from
release/product-value-20260912-02
Open

trac3r00 wants to merge 1 commit into
release/product-value-20260912-01from
release/product-value-20260912-02

Conversation

@trac3r00

@trac3r00 trac3r00 commented Sep 12, 2026

Copy link
Copy Markdown
Owner

Summary

refactor(routes): retire token counter and pipe. This is logical change 2/11 in the dependency-ordered product-audit release stack.

Refs #969

What changed

  • refactor(routes): retire token counter and pipe
  • Exact source commit: 5aa335cca3e2ecb40cf450d8cc9a46ed04ef8b68; validated tree: 70ea8cffb37fb493ba30ccff8085c24c85993278.
  • Depends on the preceding release-stack PR. Retarget to main only after its dependency is merged and deployed.

Why

Remove the retired token counter and pipe routes without leaving broken registry entries, fonts, or bookmarks.

Verification

  • bun run build passed on this exact candidate tree.
  • npm test -- --maxWorkers=2 passed on this exact candidate tree.
  • Affected behavior manually exercised as described below.
  • Latest GitHub Build, Unit Tests (Vitest), and E2E Tests (Playwright) must all pass before merge.
Tests  711 passed (711)
CANDIDATE_BUILD_UNIT_GREEN
Committed tree equals validated tree: 70ea8cffb37fb493ba30ccff8085c24c85993278

Four retired URL/slash/query fixtures returned the correct 301 targets; no retired cards or sitemap entries; 45 public tools and 3 dev games.

Final combined tree additionally passed 801 unit tests and all 293 Playwright tests with retries disabled, plus all 48 primary tool workflows at desktop and mobile. The exploratory Color Converter exact-HEX boundary remains a documented pre-existing defect; its runtime is unchanged by this stack.

Risk & rollback

  • Risk: Dependent commits require earlier stack changes; merge in order.
  • Rollback: revert this PR through a new PR; do not revert dependencies beneath already-merged dependents.
  • Release: require an approving review and latest-SHA CI. Respect the 15-minute soak between deploy-affecting merges and verify the production deployment before continuing.

Summary by cubic

Retires the token counter and pipe routes (Refs #969). /token-counter and /pipe now 301 to /prompt-template-builder and /json-formatter instead of rendering their pages, so existing bookmarks and query strings keep working; the production catalog drops from 47 to 45 tools.

Refactors

  • Removes both route handlers, registry entries, translations, home icons, and font subset references.
  • Updates docs, tests, and ad-path checks to match the retired routes.

Rollout

  • This is change 2/11 in the release stack; merge after the preceding PR and retarget to main only after it is deployed.
  • To roll back, revert this PR via a new PR rather than reverting dependencies beneath merged dependents.

Written for commit 5aa335c. Summary will update on new commits.

Review in cubic

Retain query-preserving redirects and keep registry, catalogs, handlers, font subset and route tests aligned.

Ultraworked with [omo](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1 issue found across 36 files

Confidence score: 4/5

  • tests/e2e/generators-utils-ui.spec.js bypasses the user-facing redirect by using an API request for /token-counter and loading /prompt-template-builder directly, so redirect regressions could go undetected; update the test to exercise the browser navigation path.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="tests/e2e/generators-utils-ui.spec.js">

<violation number="1" location="tests/e2e/generators-utils-ui.spec.js:150">
P3: This test never exercises the user-facing redirect: it fetches /token-counter through the API request context and separately loads /prompt-template-builder directly, so the browser path that actually sends users to the builder is untested. Navigate through the redirect in the browser (page.goto('/token-counter') then assert final URL) and, like the sibling /pipe test in page-sweep-2026-05-11.spec.js, assert the landing page renders the prompt builder rather than just matching its URL.</violation>
</file>

Shadow auto-approve: would not auto-approve because issues were found.

Re-trigger cubic

page,
request,
}) => {
const redirect = await request.get("/token-counter", { maxRedirects: 0 });

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: This test never exercises the user-facing redirect: it fetches /token-counter through the API request context and separately loads /prompt-template-builder directly, so the browser path that actually sends users to the builder is untested. Navigate through the redirect in the browser (page.goto('/token-counter') then assert final URL) and, like the sibling /pipe test in page-sweep-2026-05-11.spec.js, assert the landing page renders the prompt builder rather than just matching its URL.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At tests/e2e/generators-utils-ui.spec.js, line 150:

<comment>This test never exercises the user-facing redirect: it fetches /token-counter through the API request context and separately loads /prompt-template-builder directly, so the browser path that actually sends users to the builder is untested. Navigate through the redirect in the browser (page.goto('/token-counter') then assert final URL) and, like the sibling /pipe test in page-sweep-2026-05-11.spec.js, assert the landing page renders the prompt builder rather than just matching its URL.</comment>

<file context>
@@ -143,22 +143,21 @@ test.describe("Generator and utility tools UI interactions", () => {
+    page,
+    request,
+  }) => {
+    const redirect = await request.get("/token-counter", { maxRedirects: 0 });
+    expect(redirect.status()).toBe(301);
+    expect(new URL(redirect.headers().location).pathname).toBe(
</file context>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant