fix: remove the vestigial vercel.json ingestion service (live duplicate)#67
Merged
tornidomaroc-web merged 1 commit intoJul 23, 2026
Merged
Conversation
vercel.json's `experimentalServices.ingestion` block was serving a LIVE DUPLICATE of the ingestion service at /_/ingestion — confirmed by a 200 from `GET https://tryknowflow.com/_/ingestion/health`. It was NOT vestigial-inert, and NOT stale April code: Vercel rebuilds `services/ingestion` from the deployed commit, so it runs the same current main.py as the real Railway service (INGESTION_SERVICE_URL = knowflow-production.up.railway.app). The duplicate is token-shared: INGESTION_TOKEN is a Vercel project env var the Next route already needs, so the same token that authorizes Next->Railway opens this copy's /convert and /embed. VOYAGE_API_KEY is set on Vercel, so a token-holder could burn Voyage credits and run arbitrary documents through MarkItDown here, bypassing every Next-route guard (auth, per-KB limit, enforceLimit, rate limits) — none of which live in the Python service. /health is unauthenticated and discloses provider/model/dimension. This removes ONLY the `ingestion` sub-key, keeping `frontend` exactly as-is, so the Next.js frontend keeps deploying. Logged as register #45 (OPEN). A distinct incident from B5b — the B5b row and PIVOT_PLAN.md:270 are deliberately untouched. MANDATORY sequencing (rotate LAST): (1) merge; (2) confirm production /_/ingestion/health -> 404, and DELETE the Vercel service in the dashboard if it does not (config removal may be necessary-but-insufficient); (3) THEN rotate INGESTION_TOKEN on Railway then Vercel. Rotating before teardown just re-exposes the fresh token on the shared-env duplicate. Preview must be verified before merge: frontend still serves + a real upload completes via Railway, and <preview>/_/ingestion/health -> 404. Header fields refreshed per the §7 policy merged in PR #66 (Active branch pointed at a deleted branch, Main tip was one merge stale). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
tornidomaroc-web
deleted the
fix/remove-duplicate-vercel-ingestion-service
branch
July 23, 2026 12:51
tornidomaroc-web
added a commit
that referenced
this pull request
Jul 23, 2026
…#49 (#68) Convert #45 in place (🔴→✅) with the measured evidence chain: production /_/ingestion/health went 200 (no redirect) → 307 → 404 after PR #67 merged; config removal alone sufficed, no dashboard deletion. INGESTION_TOKEN rotated Railway-first then Vercel, verified by a real production upload reaching READY. Log four product-design items raised by Abo Jad as registers #46-#49 (all OPEN): settings-page premium polish, per-material actions, landing-page nav menu, and an animated terminal demo (with the #20 "Ready in 0.4s" correction). Append-only §7: one new block (18→19), no landed entry touched. Refresh the three header fields. Docs-only; Phase 7 stays ⬜, register #17 stays OPEN. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Security fix. Removes
experimentalServices.ingestionfromvercel.json, which was serving a live duplicate of the ingestion service. Also logs the incident as register #45 (OPEN). Two files:vercel.json(−4) +docs/PROGRESS.md(+8/−3).The finding
GET https://tryknowflow.com/_/ingestion/healthreturns200 {"ok":true,"embed_provider":"voyage",...}. TheexperimentalServices.ingestionblock (entrypoint: services/ingestion,routePrefix: /_/ingestion) was active, serving a second copy of the FastAPI ingestion service on Vercel — alongside the real one on Railway (INGESTION_SERVICE_URL = knowflow-production.up.railway.app).Correction to an earlier misread: this is not stale April code. Vercel rebuilds
services/ingestionfrom the deployed commit, so the duplicate runs the same currentmain.pyas Railway. The danger is the duplicate existing, not a code delta.Why it matters
INGESTION_TOKENis a Vercel project env var the Next route already needs, so the same token that authorizes Next→Railway also opens this copy's/convertand/embed(_check_authis a single-token equality).VOYAGE_API_KEYis set on Vercel (confirmed), so a token-holder can burn Voyage embedding credits and run arbitrary documents through MarkItDown here — bypassing every Next-route guard (auth, per-KB doc limit,enforceLimit('upload'), rate limits), none of which live in the Python service./converthere is Vercel-edge-capped at 4.5 MB inbound (unlike Railway), which bounds but does not remove the abuse./healthis unauthenticated — discloses embedding provider/model/dimension and is a liveness oracle.INGESTION_TOKENhas been reachable on an unintended public endpoint and must be rotated.The fix
Removes only the
ingestionsub-key, keepingfrontendexactly as-is:{ "experimentalServices": { "frontend": { "routePrefix": "/", "framework": "nextjs" } } }Minimal by design — the frontend declaration is untouched, so its deploy behavior does not change.
MANDATORY preview verification before merge
On the preview deployment, confirm all:
/convert→ document reachesready).<preview>/_/ingestion/health→ 404 (was200).Do not merge until all three pass. No blind edit to live deploy config.
Post-merge sequencing — ROTATE LAST (deliberate)
https://tryknowflow.com/_/ingestion/health→ 404. If it does not 404, delete the service in the Vercel dashboard — config removal may be necessary-but-insufficient if Vercel persists an already-built service.INGESTION_TOKENon Railway first, then Vercel, as near-simultaneously as possible (a mismatch window 401s uploads until both match — an availability blip, not a security gap).Rotate-last is intentional: rotating before teardown just re-exposes the fresh token on the still-live duplicate (shared env), so it would not help.
Scope
PROGRESS.md§1 B5b row andPIVOT_PLAN.md:270are deliberately untouched (verified: B5b row byte-identical, PIVOT_PLAN unchanged).docs/PROGRESS.md: new register docs: advance the three stale header lines to reality (main @ 63d498c, PR #44) #45 row + one §7 changelog block (append-only, per PR docs: migrate the changelog out of the line-8 header field into PROGRESS §7 #66) + the three header fields refreshed (the docs: migrate the changelog out of the line-8 header field into PROGRESS §7 #66 policy requires it each step;Active branchhad pointed at a deleted branch,Main tipwas one merge stale). Registers docs: record live-DB reconciliation + "migration ≠ applied" lesson #17 and docs: mark register #31 RESOLVED (per-language quizzes, live-proven) #44 byte-identical; all 17 landed §7 entries byte-identical.Checks
npm run typecheck→ exit 0.db-types: no SQL migration touched → regenerated types byte-identical.🤖 Generated with Claude Code