test(e2e): journey — upload → SSE → document appears (#387) - #432

Merged
AndresL230 merged 2 commits into
mainfrom
test/387-journey-upload-sse
Jul 28, 2026
Merged

test(e2e): journey — upload → SSE → document appears (#387)#432
AndresL230 merged 2 commits into
mainfrom
test/387-journey-upload-sse

Conversation

@AndresL230

@AndresL230AndresL230 commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

Browser journey for the document pipeline (#387): upload a fixture PDF through the real UI (upload-modal testids), ride the SSE stream (streamSSE under uploadDocumentStream) to its terminal done event, then assert the document appears in the library and the row exists in Postgres via raw-SQL readback.

  • frontend/e2e/upload.spec.ts — the journey. Event-based waiting only (auto-retrying expect()s on UI state; zero waitForTimeout). Asserts: SSE completion (upload-modal-done replaces submit only after the terminal event), the scripted result payload rendered in the row (summary abstract + concept chips), the Postgres documents row (plaintext columns: user_id, category, offering_id; summary asserted ciphertext-not-plaintext), the phase-3 graph_nodes merge, and the library card (decrypted summary round-trip).
  • frontend/e2e/fixtures/upload-journey.pdf — hand-assembled 838-byte single-page PDF with a real text layer (232 chars extract natively via pypdf, so backend extraction never reaches the OCR engines).
  • Postgres readback uses queryRaw from frontend/e2e/support/db.ts (landed with test(e2e): journey — tutor conversation persists to messages (#392) #434; this PR adds no db.ts changes).
  • frontend/src/components/screens/Library.tsx + docs/frontend-testids.md + frontend/eslint.config.mjs — Library registered as a testid surface per the "Adding a surface" procedure (doc row, inventory, eslint files array; every intrinsic interactive element tagged).

LLM-dependence finding (the issue's "known hard part")

The SSE completion event and the documents row itself require model responses — there is no LLM-free scoping that can honestly assert "document appears". Trace of POST /api/documents/upload (backend/routes/documents.py):

  1. The happy path is agent-driven: classifier_agent → (summary_agentconcept_extraction_agent) → graph merge → _persist_document. Persistence happens only after the agent stages, so without a model there is no row, no done event, no library entry. Option (2) from the issue (assert "upload accepted + row created" without an LLM) is factually impossible on this pipeline.
  2. Any agent failure falls back to _legacy_upload_pipelineservices/gemini_service.py::call_gemini_jsonreal Gemini (the feat(backend): pydantic-ai test seam via FunctionModel (SAPLING_MODEL_MODE) #391 seam does not cover gemini_service); if that also fails, the stream ends error/failed + done "Failed." with no row persisted.
  3. The feat(backend): pydantic-ai test seam via FunctionModel (SAPLING_MODEL_MODE) #391 seam does cover every agent in the happy path (all build via model_for), but it originally had no boot-time half: handlers could only be registered by an in-process Python caller, which a separately booted uvicorn doesn't have. Booting SAPLING_MODEL_MODE=function make e2e-up alone would make every agent raise a handler-miss LookupError → legacy fallback → live Gemini. test(e2e): journey — tutor conversation persists to messages (#392) #434 (tutor) landed the canonical boot-time half on main — the SAPLING_FUNCTION_HANDLERS once-per-process autoload with its failure-latch ordering — and this PR (rebased onto it) adopts that seam wholesale and appends on top of it:
    • backend/agents/function_handlers_e2e.py — the upload-pipeline handlers appended to main's module per its own "append here" guidance: deterministic scripted outputs for classifier (→ lecture_notes), summary, concepts, plus post-roll course_summary. These agents have structured output_types, so each handler emits through the agent's output tool — the real output schema validates the payload; no function tools, zero model-driven writes (within the module's stated constraints).
    • /api/health now surfaces model_mode, and the spec fail-fasts against a real-mode stack instead of silently billing Gemini.
    • backend/tests/test_e2e_function_handlers.py — two appended cases pinning the upload handlers under the canonical once-latch design: one autoload dispatch registers the whole pipeline and drives the real classifier; the scripted summary payload passes the real Summary output schema in the hermetic lane.
  4. Residual egress note: post-roll _index_document_chunks embeds via services/rag_service.py (a direct google.genai client — not covered by the seam). It is fire-and-forget and swallowed on failure, so the journey doesn't depend on it, but for the 10-run tally the stack ran with a dummy GEMINI_API_KEY so even that attempt fails fast without billing. update_course_context is covered (its course_summary agent goes through the seam) and degrades to a template string if unregistered.

Boot contract for this spec:

SAPLING_MODEL_MODE=function SAPLING_FUNCTION_HANDLERS=agents.function_handlers_e2e make e2e-up

Verification

  • 10 consecutive local runs green under a single stack-lock hold (one make e2e-up in function mode, 10× npx playwright test e2e/upload.spec.ts, make e2e-down; exit 0):

    run12345678910
    resultpass 7.8spass 6.4spass 6.2spass 6.1spass 6.3spass 6.2spass 6.5spass 6.1spass 6.4spass 6.2s
  • Zero waitForTimeout calls — every wait is an auto-retrying expect() on state an event flips (the only grep hit for the string is the header comment stating the rule).

  • Post-rebase confirmation (converged onto main's test(e2e): journey — tutor conversation persists to messages (#392) #434 seam): 3/3 consecutive runs green under one lock hold — pass 7.4s / pass 6.1s / pass 7.1s, exit 0, clean teardown. The 10/10 pre-rebase tally stands as acceptance evidence; this cycle proves the seam swap changed no behavior.

  • Backend after rebase: pytest tests/ -q → 1088 passed, 23 skipped, 1 pre-existing error (tests/test_ocr_pipeline.py::test_save_to_db, "RuntimeError: Event loop is closed" — reproduces identically on an untouched main checkout; unrelated to this change).

  • Frontend after rebase: eslint . 0 errors (Library.tsx now under the testid enforcement block), tsc --noEmit clean, vitest run 204 passed.

Part of #402, closes#387.

🤖 Generated with Claude Code

@coderabbitai

coderabbitaiBot commented Jul 28, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@AndresL230, you've reached your PR review limit, so we couldn't start this review.

Next review available in:3 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b709ebed-cdfd-4ce2-85f8-6fef55c66164

📥 Commits

Reviewing files that changed from the base of the PR and between c8e8f79 and 79f9662.

⛔ Files ignored due to path filters (1)
  • frontend/e2e/fixtures/upload-journey.pdf is excluded by !**/*.pdf
📒 Files selected for processing (7)
  • backend/agents/function_handlers_e2e.py
  • backend/main.py
  • backend/tests/test_e2e_function_handlers.py
  • docs/frontend-testids.md
  • frontend/e2e/upload.spec.ts
  • frontend/eslint.config.mjs
  • frontend/src/components/screens/Library.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/387-journey-upload-sse

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cloudflare-workers-and-pages

cloudflare-workers-and-pagesBot commented Jul 28, 2026

Copy link
Copy Markdown

Deploying with Cloudflare Workers Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

StatusNameLatest CommitPreview URLUpdated (UTC)
✅ Deployment successful!
View logs
frontend-staging79f9662Commit Preview URL

Branch Preview URL
Jul 28 2026, 04:05 AM

Browser journey driving the real streaming upload pipeline end to end:
fixture PDF in through the upload modal, ride the SSE stream to its
terminal done event, then assert the document renders in the library AND
the row exists in Postgres via raw-SQL readback (plaintext columns only;
documents.summary is asserted ciphertext-not-plaintext).
The pipeline's happy path is agent-driven (classifier → summary ∥
concepts → graph merge) and only persists the documents row after those
stages, so the journey cannot complete without model responses. All four
agents build via the #391 seam (model_for), so this adds the seam's
boot-time half per ADR 0019: SAPLING_FUNCTION_HANDLERS names a module
that _providers loads (and register()s) on the first function-mode
handler miss, plus agents/function_handlers_e2e.py with deterministic
scripted outputs for the upload tasks. /api/health now surfaces
model_mode so the spec fail-fasts instead of billing Gemini against a
real-mode stack. Library.tsx becomes a registered testid surface
(doc row + inventory + eslint files array).
global-setup.ts picks up the #386 sibling fix verbatim (sapling_user
localStorage in storageState — cookie alone leaves authed screens on
their skeleton).
Part of #402.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The RAG post-roll embed predates the seam and sits below it; the
journey's determinism holds (failures swallowed) but the comments
claimed more than the seam vouches for. Tracked in #439.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@AndresL230

Copy link
Copy Markdown
CollaboratorAuthor

Code review

No issues found. Checked for bugs and CLAUDE.md compliance. (The panel verified the seam-file union, fixture PDF validity, schema-valid scripted payloads, and encryption-aware assertions. One pre-existing below-seam RAG egress path was confirmed and is tracked as #439; the PR's hermeticity comments were scoped accordingly in-branch.)

🤖 Generated with Claude Code

@AndresL230
AndresL230 merged commit c42717c into mainJul 28, 2026
6 checks passed
@AndresL230
AndresL230 deleted the test/387-journey-upload-sse branch August 2, 2026 18:30
Sign up for freeto 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.

test(e2e): journey — upload → SSE → document appears

1 participant

@AndresL230
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

test(e2e): journey — upload → SSE → document appears (#387) - #432

Merged
AndresL230 merged 2 commits into
mainfrom
test/387-journey-upload-sse
Jul 28, 2026
Merged

test(e2e): journey — upload → SSE → document appears (#387)#432
AndresL230 merged 2 commits into
mainfrom
test/387-journey-upload-sse

Conversation

@AndresL230

@AndresL230AndresL230 commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

Browser journey for the document pipeline (#387): upload a fixture PDF through the real UI (upload-modal testids), ride the SSE stream (streamSSE under uploadDocumentStream) to its terminal done event, then assert the document appears in the library and the row exists in Postgres via raw-SQL readback.

  • frontend/e2e/upload.spec.ts — the journey. Event-based waiting only (auto-retrying expect()s on UI state; zero waitForTimeout). Asserts: SSE completion (upload-modal-done replaces submit only after the terminal event), the scripted result payload rendered in the row (summary abstract + concept chips), the Postgres documents row (plaintext columns: user_id, category, offering_id; summary asserted ciphertext-not-plaintext), the phase-3 graph_nodes merge, and the library card (decrypted summary round-trip).
  • frontend/e2e/fixtures/upload-journey.pdf — hand-assembled 838-byte single-page PDF with a real text layer (232 chars extract natively via pypdf, so backend extraction never reaches the OCR engines).
  • Postgres readback uses queryRaw from frontend/e2e/support/db.ts (landed with test(e2e): journey — tutor conversation persists to messages (#392) #434; this PR adds no db.ts changes).
  • frontend/src/components/screens/Library.tsx + docs/frontend-testids.md + frontend/eslint.config.mjs — Library registered as a testid surface per the "Adding a surface" procedure (doc row, inventory, eslint files array; every intrinsic interactive element tagged).

LLM-dependence finding (the issue's "known hard part")

The SSE completion event and the documents row itself require model responses — there is no LLM-free scoping that can honestly assert "document appears". Trace of POST /api/documents/upload (backend/routes/documents.py):

  1. The happy path is agent-driven: classifier_agent → (summary_agentconcept_extraction_agent) → graph merge → _persist_document. Persistence happens only after the agent stages, so without a model there is no row, no done event, no library entry. Option (2) from the issue (assert "upload accepted + row created" without an LLM) is factually impossible on this pipeline.
  2. Any agent failure falls back to _legacy_upload_pipelineservices/gemini_service.py::call_gemini_jsonreal Gemini (the feat(backend): pydantic-ai test seam via FunctionModel (SAPLING_MODEL_MODE) #391 seam does not cover gemini_service); if that also fails, the stream ends error/failed + done "Failed." with no row persisted.
  3. The feat(backend): pydantic-ai test seam via FunctionModel (SAPLING_MODEL_MODE) #391 seam does cover every agent in the happy path (all build via model_for), but it originally had no boot-time half: handlers could only be registered by an in-process Python caller, which a separately booted uvicorn doesn't have. Booting SAPLING_MODEL_MODE=function make e2e-up alone would make every agent raise a handler-miss LookupError → legacy fallback → live Gemini. test(e2e): journey — tutor conversation persists to messages (#392) #434 (tutor) landed the canonical boot-time half on main — the SAPLING_FUNCTION_HANDLERS once-per-process autoload with its failure-latch ordering — and this PR (rebased onto it) adopts that seam wholesale and appends on top of it:
    • backend/agents/function_handlers_e2e.py — the upload-pipeline handlers appended to main's module per its own "append here" guidance: deterministic scripted outputs for classifier (→ lecture_notes), summary, concepts, plus post-roll course_summary. These agents have structured output_types, so each handler emits through the agent's output tool — the real output schema validates the payload; no function tools, zero model-driven writes (within the module's stated constraints).
    • /api/health now surfaces model_mode, and the spec fail-fasts against a real-mode stack instead of silently billing Gemini.
    • backend/tests/test_e2e_function_handlers.py — two appended cases pinning the upload handlers under the canonical once-latch design: one autoload dispatch registers the whole pipeline and drives the real classifier; the scripted summary payload passes the real Summary output schema in the hermetic lane.
  4. Residual egress note: post-roll _index_document_chunks embeds via services/rag_service.py (a direct google.genai client — not covered by the seam). It is fire-and-forget and swallowed on failure, so the journey doesn't depend on it, but for the 10-run tally the stack ran with a dummy GEMINI_API_KEY so even that attempt fails fast without billing. update_course_context is covered (its course_summary agent goes through the seam) and degrades to a template string if unregistered.

Boot contract for this spec:

SAPLING_MODEL_MODE=function SAPLING_FUNCTION_HANDLERS=agents.function_handlers_e2e make e2e-up

Verification

  • 10 consecutive local runs green under a single stack-lock hold (one make e2e-up in function mode, 10× npx playwright test e2e/upload.spec.ts, make e2e-down; exit 0):

    run12345678910
    resultpass 7.8spass 6.4spass 6.2spass 6.1spass 6.3spass 6.2spass 6.5spass 6.1spass 6.4spass 6.2s
  • Zero waitForTimeout calls — every wait is an auto-retrying expect() on state an event flips (the only grep hit for the string is the header comment stating the rule).

  • Post-rebase confirmation (converged onto main's test(e2e): journey — tutor conversation persists to messages (#392) #434 seam): 3/3 consecutive runs green under one lock hold — pass 7.4s / pass 6.1s / pass 7.1s, exit 0, clean teardown. The 10/10 pre-rebase tally stands as acceptance evidence; this cycle proves the seam swap changed no behavior.

  • Backend after rebase: pytest tests/ -q → 1088 passed, 23 skipped, 1 pre-existing error (tests/test_ocr_pipeline.py::test_save_to_db, "RuntimeError: Event loop is closed" — reproduces identically on an untouched main checkout; unrelated to this change).

  • Frontend after rebase: eslint . 0 errors (Library.tsx now under the testid enforcement block), tsc --noEmit clean, vitest run 204 passed.

Part of #402, closes#387.

🤖 Generated with Claude Code

@coderabbitai

coderabbitaiBot commented Jul 28, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@AndresL230, you've reached your PR review limit, so we couldn't start this review.

Next review available in:3 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b709ebed-cdfd-4ce2-85f8-6fef55c66164

📥 Commits

Reviewing files that changed from the base of the PR and between c8e8f79 and 79f9662.

⛔ Files ignored due to path filters (1)
  • frontend/e2e/fixtures/upload-journey.pdf is excluded by !**/*.pdf
📒 Files selected for processing (7)
  • backend/agents/function_handlers_e2e.py
  • backend/main.py
  • backend/tests/test_e2e_function_handlers.py
  • docs/frontend-testids.md
  • frontend/e2e/upload.spec.ts
  • frontend/eslint.config.mjs
  • frontend/src/components/screens/Library.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/387-journey-upload-sse

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cloudflare-workers-and-pages

cloudflare-workers-and-pagesBot commented Jul 28, 2026

Copy link
Copy Markdown

Deploying with Cloudflare Workers Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

StatusNameLatest CommitPreview URLUpdated (UTC)
✅ Deployment successful!
View logs
frontend-staging79f9662Commit Preview URL

Branch Preview URL
Jul 28 2026, 04:05 AM

Browser journey driving the real streaming upload pipeline end to end:
fixture PDF in through the upload modal, ride the SSE stream to its
terminal done event, then assert the document renders in the library AND
the row exists in Postgres via raw-SQL readback (plaintext columns only;
documents.summary is asserted ciphertext-not-plaintext).
The pipeline's happy path is agent-driven (classifier → summary ∥
concepts → graph merge) and only persists the documents row after those
stages, so the journey cannot complete without model responses. All four
agents build via the #391 seam (model_for), so this adds the seam's
boot-time half per ADR 0019: SAPLING_FUNCTION_HANDLERS names a module
that _providers loads (and register()s) on the first function-mode
handler miss, plus agents/function_handlers_e2e.py with deterministic
scripted outputs for the upload tasks. /api/health now surfaces
model_mode so the spec fail-fasts instead of billing Gemini against a
real-mode stack. Library.tsx becomes a registered testid surface
(doc row + inventory + eslint files array).
global-setup.ts picks up the #386 sibling fix verbatim (sapling_user
localStorage in storageState — cookie alone leaves authed screens on
their skeleton).
Part of #402.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The RAG post-roll embed predates the seam and sits below it; the
journey's determinism holds (failures swallowed) but the comments
claimed more than the seam vouches for. Tracked in #439.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@AndresL230

Copy link
Copy Markdown
CollaboratorAuthor

Code review

No issues found. Checked for bugs and CLAUDE.md compliance. (The panel verified the seam-file union, fixture PDF validity, schema-valid scripted payloads, and encryption-aware assertions. One pre-existing below-seam RAG egress path was confirmed and is tracked as #439; the PR's hermeticity comments were scoped accordingly in-branch.)

🤖 Generated with Claude Code

@AndresL230
AndresL230 merged commit c42717c into mainJul 28, 2026
6 checks passed
@AndresL230
AndresL230 deleted the test/387-journey-upload-sse branch August 2, 2026 18:30
Sign up for freeto 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.

test(e2e): journey — upload → SSE → document appears

1 participant

@AndresL230
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

test(e2e): journey — upload → SSE → document appears (#387) - #432

Merged
AndresL230 merged 2 commits into
mainfrom
test/387-journey-upload-sse
Jul 28, 2026
Merged

test(e2e): journey — upload → SSE → document appears (#387)#432
AndresL230 merged 2 commits into
mainfrom
test/387-journey-upload-sse

Conversation

@AndresL230

@AndresL230AndresL230 commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

Browser journey for the document pipeline (#387): upload a fixture PDF through the real UI (upload-modal testids), ride the SSE stream (streamSSE under uploadDocumentStream) to its terminal done event, then assert the document appears in the library and the row exists in Postgres via raw-SQL readback.

  • frontend/e2e/upload.spec.ts — the journey. Event-based waiting only (auto-retrying expect()s on UI state; zero waitForTimeout). Asserts: SSE completion (upload-modal-done replaces submit only after the terminal event), the scripted result payload rendered in the row (summary abstract + concept chips), the Postgres documents row (plaintext columns: user_id, category, offering_id; summary asserted ciphertext-not-plaintext), the phase-3 graph_nodes merge, and the library card (decrypted summary round-trip).
  • frontend/e2e/fixtures/upload-journey.pdf — hand-assembled 838-byte single-page PDF with a real text layer (232 chars extract natively via pypdf, so backend extraction never reaches the OCR engines).
  • Postgres readback uses queryRaw from frontend/e2e/support/db.ts (landed with test(e2e): journey — tutor conversation persists to messages (#392) #434; this PR adds no db.ts changes).
  • frontend/src/components/screens/Library.tsx + docs/frontend-testids.md + frontend/eslint.config.mjs — Library registered as a testid surface per the "Adding a surface" procedure (doc row, inventory, eslint files array; every intrinsic interactive element tagged).

LLM-dependence finding (the issue's "known hard part")

The SSE completion event and the documents row itself require model responses — there is no LLM-free scoping that can honestly assert "document appears". Trace of POST /api/documents/upload (backend/routes/documents.py):

  1. The happy path is agent-driven: classifier_agent → (summary_agentconcept_extraction_agent) → graph merge → _persist_document. Persistence happens only after the agent stages, so without a model there is no row, no done event, no library entry. Option (2) from the issue (assert "upload accepted + row created" without an LLM) is factually impossible on this pipeline.
  2. Any agent failure falls back to _legacy_upload_pipelineservices/gemini_service.py::call_gemini_jsonreal Gemini (the feat(backend): pydantic-ai test seam via FunctionModel (SAPLING_MODEL_MODE) #391 seam does not cover gemini_service); if that also fails, the stream ends error/failed + done "Failed." with no row persisted.
  3. The feat(backend): pydantic-ai test seam via FunctionModel (SAPLING_MODEL_MODE) #391 seam does cover every agent in the happy path (all build via model_for), but it originally had no boot-time half: handlers could only be registered by an in-process Python caller, which a separately booted uvicorn doesn't have. Booting SAPLING_MODEL_MODE=function make e2e-up alone would make every agent raise a handler-miss LookupError → legacy fallback → live Gemini. test(e2e): journey — tutor conversation persists to messages (#392) #434 (tutor) landed the canonical boot-time half on main — the SAPLING_FUNCTION_HANDLERS once-per-process autoload with its failure-latch ordering — and this PR (rebased onto it) adopts that seam wholesale and appends on top of it:
    • backend/agents/function_handlers_e2e.py — the upload-pipeline handlers appended to main's module per its own "append here" guidance: deterministic scripted outputs for classifier (→ lecture_notes), summary, concepts, plus post-roll course_summary. These agents have structured output_types, so each handler emits through the agent's output tool — the real output schema validates the payload; no function tools, zero model-driven writes (within the module's stated constraints).
    • /api/health now surfaces model_mode, and the spec fail-fasts against a real-mode stack instead of silently billing Gemini.
    • backend/tests/test_e2e_function_handlers.py — two appended cases pinning the upload handlers under the canonical once-latch design: one autoload dispatch registers the whole pipeline and drives the real classifier; the scripted summary payload passes the real Summary output schema in the hermetic lane.
  4. Residual egress note: post-roll _index_document_chunks embeds via services/rag_service.py (a direct google.genai client — not covered by the seam). It is fire-and-forget and swallowed on failure, so the journey doesn't depend on it, but for the 10-run tally the stack ran with a dummy GEMINI_API_KEY so even that attempt fails fast without billing. update_course_context is covered (its course_summary agent goes through the seam) and degrades to a template string if unregistered.

Boot contract for this spec:

SAPLING_MODEL_MODE=function SAPLING_FUNCTION_HANDLERS=agents.function_handlers_e2e make e2e-up

Verification

  • 10 consecutive local runs green under a single stack-lock hold (one make e2e-up in function mode, 10× npx playwright test e2e/upload.spec.ts, make e2e-down; exit 0):

    run12345678910
    resultpass 7.8spass 6.4spass 6.2spass 6.1spass 6.3spass 6.2spass 6.5spass 6.1spass 6.4spass 6.2s
  • Zero waitForTimeout calls — every wait is an auto-retrying expect() on state an event flips (the only grep hit for the string is the header comment stating the rule).

  • Post-rebase confirmation (converged onto main's test(e2e): journey — tutor conversation persists to messages (#392) #434 seam): 3/3 consecutive runs green under one lock hold — pass 7.4s / pass 6.1s / pass 7.1s, exit 0, clean teardown. The 10/10 pre-rebase tally stands as acceptance evidence; this cycle proves the seam swap changed no behavior.

  • Backend after rebase: pytest tests/ -q → 1088 passed, 23 skipped, 1 pre-existing error (tests/test_ocr_pipeline.py::test_save_to_db, "RuntimeError: Event loop is closed" — reproduces identically on an untouched main checkout; unrelated to this change).

  • Frontend after rebase: eslint . 0 errors (Library.tsx now under the testid enforcement block), tsc --noEmit clean, vitest run 204 passed.

Part of #402, closes#387.

🤖 Generated with Claude Code

@coderabbitai

coderabbitaiBot commented Jul 28, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@AndresL230, you've reached your PR review limit, so we couldn't start this review.

Next review available in:3 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b709ebed-cdfd-4ce2-85f8-6fef55c66164

📥 Commits

Reviewing files that changed from the base of the PR and between c8e8f79 and 79f9662.

⛔ Files ignored due to path filters (1)
  • frontend/e2e/fixtures/upload-journey.pdf is excluded by !**/*.pdf
📒 Files selected for processing (7)
  • backend/agents/function_handlers_e2e.py
  • backend/main.py
  • backend/tests/test_e2e_function_handlers.py
  • docs/frontend-testids.md
  • frontend/e2e/upload.spec.ts
  • frontend/eslint.config.mjs
  • frontend/src/components/screens/Library.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/387-journey-upload-sse

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cloudflare-workers-and-pages

cloudflare-workers-and-pagesBot commented Jul 28, 2026

Copy link
Copy Markdown

Deploying with Cloudflare Workers Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

StatusNameLatest CommitPreview URLUpdated (UTC)
✅ Deployment successful!
View logs
frontend-staging79f9662Commit Preview URL

Branch Preview URL
Jul 28 2026, 04:05 AM

Browser journey driving the real streaming upload pipeline end to end:
fixture PDF in through the upload modal, ride the SSE stream to its
terminal done event, then assert the document renders in the library AND
the row exists in Postgres via raw-SQL readback (plaintext columns only;
documents.summary is asserted ciphertext-not-plaintext).
The pipeline's happy path is agent-driven (classifier → summary ∥
concepts → graph merge) and only persists the documents row after those
stages, so the journey cannot complete without model responses. All four
agents build via the #391 seam (model_for), so this adds the seam's
boot-time half per ADR 0019: SAPLING_FUNCTION_HANDLERS names a module
that _providers loads (and register()s) on the first function-mode
handler miss, plus agents/function_handlers_e2e.py with deterministic
scripted outputs for the upload tasks. /api/health now surfaces
model_mode so the spec fail-fasts instead of billing Gemini against a
real-mode stack. Library.tsx becomes a registered testid surface
(doc row + inventory + eslint files array).
global-setup.ts picks up the #386 sibling fix verbatim (sapling_user
localStorage in storageState — cookie alone leaves authed screens on
their skeleton).
Part of #402.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The RAG post-roll embed predates the seam and sits below it; the
journey's determinism holds (failures swallowed) but the comments
claimed more than the seam vouches for. Tracked in #439.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@AndresL230

Copy link
Copy Markdown
CollaboratorAuthor

Code review

No issues found. Checked for bugs and CLAUDE.md compliance. (The panel verified the seam-file union, fixture PDF validity, schema-valid scripted payloads, and encryption-aware assertions. One pre-existing below-seam RAG egress path was confirmed and is tracked as #439; the PR's hermeticity comments were scoped accordingly in-branch.)

🤖 Generated with Claude Code

@AndresL230
AndresL230 merged commit c42717c into mainJul 28, 2026
6 checks passed
@AndresL230
AndresL230 deleted the test/387-journey-upload-sse branch August 2, 2026 18:30
Sign up for freeto 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.

test(e2e): journey — upload → SSE → document appears

1 participant

@AndresL230
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

test(e2e): journey — upload → SSE → document appears (#387) - #432

Merged
AndresL230 merged 2 commits into
mainfrom
test/387-journey-upload-sse
Jul 28, 2026
Merged

test(e2e): journey — upload → SSE → document appears (#387)#432
AndresL230 merged 2 commits into
mainfrom
test/387-journey-upload-sse

Conversation

@AndresL230

@AndresL230AndresL230 commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

Browser journey for the document pipeline (#387): upload a fixture PDF through the real UI (upload-modal testids), ride the SSE stream (streamSSE under uploadDocumentStream) to its terminal done event, then assert the document appears in the library and the row exists in Postgres via raw-SQL readback.

  • frontend/e2e/upload.spec.ts — the journey. Event-based waiting only (auto-retrying expect()s on UI state; zero waitForTimeout). Asserts: SSE completion (upload-modal-done replaces submit only after the terminal event), the scripted result payload rendered in the row (summary abstract + concept chips), the Postgres documents row (plaintext columns: user_id, category, offering_id; summary asserted ciphertext-not-plaintext), the phase-3 graph_nodes merge, and the library card (decrypted summary round-trip).
  • frontend/e2e/fixtures/upload-journey.pdf — hand-assembled 838-byte single-page PDF with a real text layer (232 chars extract natively via pypdf, so backend extraction never reaches the OCR engines).
  • Postgres readback uses queryRaw from frontend/e2e/support/db.ts (landed with test(e2e): journey — tutor conversation persists to messages (#392) #434; this PR adds no db.ts changes).
  • frontend/src/components/screens/Library.tsx + docs/frontend-testids.md + frontend/eslint.config.mjs — Library registered as a testid surface per the "Adding a surface" procedure (doc row, inventory, eslint files array; every intrinsic interactive element tagged).

LLM-dependence finding (the issue's "known hard part")

The SSE completion event and the documents row itself require model responses — there is no LLM-free scoping that can honestly assert "document appears". Trace of POST /api/documents/upload (backend/routes/documents.py):

  1. The happy path is agent-driven: classifier_agent → (summary_agentconcept_extraction_agent) → graph merge → _persist_document. Persistence happens only after the agent stages, so without a model there is no row, no done event, no library entry. Option (2) from the issue (assert "upload accepted + row created" without an LLM) is factually impossible on this pipeline.
  2. Any agent failure falls back to _legacy_upload_pipelineservices/gemini_service.py::call_gemini_jsonreal Gemini (the feat(backend): pydantic-ai test seam via FunctionModel (SAPLING_MODEL_MODE) #391 seam does not cover gemini_service); if that also fails, the stream ends error/failed + done "Failed." with no row persisted.
  3. The feat(backend): pydantic-ai test seam via FunctionModel (SAPLING_MODEL_MODE) #391 seam does cover every agent in the happy path (all build via model_for), but it originally had no boot-time half: handlers could only be registered by an in-process Python caller, which a separately booted uvicorn doesn't have. Booting SAPLING_MODEL_MODE=function make e2e-up alone would make every agent raise a handler-miss LookupError → legacy fallback → live Gemini. test(e2e): journey — tutor conversation persists to messages (#392) #434 (tutor) landed the canonical boot-time half on main — the SAPLING_FUNCTION_HANDLERS once-per-process autoload with its failure-latch ordering — and this PR (rebased onto it) adopts that seam wholesale and appends on top of it:
    • backend/agents/function_handlers_e2e.py — the upload-pipeline handlers appended to main's module per its own "append here" guidance: deterministic scripted outputs for classifier (→ lecture_notes), summary, concepts, plus post-roll course_summary. These agents have structured output_types, so each handler emits through the agent's output tool — the real output schema validates the payload; no function tools, zero model-driven writes (within the module's stated constraints).
    • /api/health now surfaces model_mode, and the spec fail-fasts against a real-mode stack instead of silently billing Gemini.
    • backend/tests/test_e2e_function_handlers.py — two appended cases pinning the upload handlers under the canonical once-latch design: one autoload dispatch registers the whole pipeline and drives the real classifier; the scripted summary payload passes the real Summary output schema in the hermetic lane.
  4. Residual egress note: post-roll _index_document_chunks embeds via services/rag_service.py (a direct google.genai client — not covered by the seam). It is fire-and-forget and swallowed on failure, so the journey doesn't depend on it, but for the 10-run tally the stack ran with a dummy GEMINI_API_KEY so even that attempt fails fast without billing. update_course_context is covered (its course_summary agent goes through the seam) and degrades to a template string if unregistered.

Boot contract for this spec:

SAPLING_MODEL_MODE=function SAPLING_FUNCTION_HANDLERS=agents.function_handlers_e2e make e2e-up

Verification

  • 10 consecutive local runs green under a single stack-lock hold (one make e2e-up in function mode, 10× npx playwright test e2e/upload.spec.ts, make e2e-down; exit 0):

    run12345678910
    resultpass 7.8spass 6.4spass 6.2spass 6.1spass 6.3spass 6.2spass 6.5spass 6.1spass 6.4spass 6.2s
  • Zero waitForTimeout calls — every wait is an auto-retrying expect() on state an event flips (the only grep hit for the string is the header comment stating the rule).

  • Post-rebase confirmation (converged onto main's test(e2e): journey — tutor conversation persists to messages (#392) #434 seam): 3/3 consecutive runs green under one lock hold — pass 7.4s / pass 6.1s / pass 7.1s, exit 0, clean teardown. The 10/10 pre-rebase tally stands as acceptance evidence; this cycle proves the seam swap changed no behavior.

  • Backend after rebase: pytest tests/ -q → 1088 passed, 23 skipped, 1 pre-existing error (tests/test_ocr_pipeline.py::test_save_to_db, "RuntimeError: Event loop is closed" — reproduces identically on an untouched main checkout; unrelated to this change).

  • Frontend after rebase: eslint . 0 errors (Library.tsx now under the testid enforcement block), tsc --noEmit clean, vitest run 204 passed.

Part of #402, closes#387.

🤖 Generated with Claude Code

@coderabbitai

coderabbitaiBot commented Jul 28, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@AndresL230, you've reached your PR review limit, so we couldn't start this review.

Next review available in:3 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b709ebed-cdfd-4ce2-85f8-6fef55c66164

📥 Commits

Reviewing files that changed from the base of the PR and between c8e8f79 and 79f9662.

⛔ Files ignored due to path filters (1)
  • frontend/e2e/fixtures/upload-journey.pdf is excluded by !**/*.pdf
📒 Files selected for processing (7)
  • backend/agents/function_handlers_e2e.py
  • backend/main.py
  • backend/tests/test_e2e_function_handlers.py
  • docs/frontend-testids.md
  • frontend/e2e/upload.spec.ts
  • frontend/eslint.config.mjs
  • frontend/src/components/screens/Library.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/387-journey-upload-sse

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cloudflare-workers-and-pages

cloudflare-workers-and-pagesBot commented Jul 28, 2026

Copy link
Copy Markdown

Deploying with Cloudflare Workers Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

StatusNameLatest CommitPreview URLUpdated (UTC)
✅ Deployment successful!
View logs
frontend-staging79f9662Commit Preview URL

Branch Preview URL
Jul 28 2026, 04:05 AM

Browser journey driving the real streaming upload pipeline end to end:
fixture PDF in through the upload modal, ride the SSE stream to its
terminal done event, then assert the document renders in the library AND
the row exists in Postgres via raw-SQL readback (plaintext columns only;
documents.summary is asserted ciphertext-not-plaintext).
The pipeline's happy path is agent-driven (classifier → summary ∥
concepts → graph merge) and only persists the documents row after those
stages, so the journey cannot complete without model responses. All four
agents build via the #391 seam (model_for), so this adds the seam's
boot-time half per ADR 0019: SAPLING_FUNCTION_HANDLERS names a module
that _providers loads (and register()s) on the first function-mode
handler miss, plus agents/function_handlers_e2e.py with deterministic
scripted outputs for the upload tasks. /api/health now surfaces
model_mode so the spec fail-fasts instead of billing Gemini against a
real-mode stack. Library.tsx becomes a registered testid surface
(doc row + inventory + eslint files array).
global-setup.ts picks up the #386 sibling fix verbatim (sapling_user
localStorage in storageState — cookie alone leaves authed screens on
their skeleton).
Part of #402.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The RAG post-roll embed predates the seam and sits below it; the
journey's determinism holds (failures swallowed) but the comments
claimed more than the seam vouches for. Tracked in #439.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@AndresL230

Copy link
Copy Markdown
CollaboratorAuthor

Code review

No issues found. Checked for bugs and CLAUDE.md compliance. (The panel verified the seam-file union, fixture PDF validity, schema-valid scripted payloads, and encryption-aware assertions. One pre-existing below-seam RAG egress path was confirmed and is tracked as #439; the PR's hermeticity comments were scoped accordingly in-branch.)

🤖 Generated with Claude Code

@AndresL230
AndresL230 merged commit c42717c into mainJul 28, 2026
6 checks passed
@AndresL230
AndresL230 deleted the test/387-journey-upload-sse branch August 2, 2026 18:30
Sign up for freeto 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.

test(e2e): journey — upload → SSE → document appears

1 participant

@AndresL230
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

test(e2e): journey — upload → SSE → document appears (#387) - #432

Merged
AndresL230 merged 2 commits into
mainfrom
test/387-journey-upload-sse
Jul 28, 2026
Merged

test(e2e): journey — upload → SSE → document appears (#387)#432
AndresL230 merged 2 commits into
mainfrom
test/387-journey-upload-sse

Conversation

@AndresL230

@AndresL230AndresL230 commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

Browser journey for the document pipeline (#387): upload a fixture PDF through the real UI (upload-modal testids), ride the SSE stream (streamSSE under uploadDocumentStream) to its terminal done event, then assert the document appears in the library and the row exists in Postgres via raw-SQL readback.

  • frontend/e2e/upload.spec.ts — the journey. Event-based waiting only (auto-retrying expect()s on UI state; zero waitForTimeout). Asserts: SSE completion (upload-modal-done replaces submit only after the terminal event), the scripted result payload rendered in the row (summary abstract + concept chips), the Postgres documents row (plaintext columns: user_id, category, offering_id; summary asserted ciphertext-not-plaintext), the phase-3 graph_nodes merge, and the library card (decrypted summary round-trip).
  • frontend/e2e/fixtures/upload-journey.pdf — hand-assembled 838-byte single-page PDF with a real text layer (232 chars extract natively via pypdf, so backend extraction never reaches the OCR engines).
  • Postgres readback uses queryRaw from frontend/e2e/support/db.ts (landed with test(e2e): journey — tutor conversation persists to messages (#392) #434; this PR adds no db.ts changes).
  • frontend/src/components/screens/Library.tsx + docs/frontend-testids.md + frontend/eslint.config.mjs — Library registered as a testid surface per the "Adding a surface" procedure (doc row, inventory, eslint files array; every intrinsic interactive element tagged).

LLM-dependence finding (the issue's "known hard part")

The SSE completion event and the documents row itself require model responses — there is no LLM-free scoping that can honestly assert "document appears". Trace of POST /api/documents/upload (backend/routes/documents.py):

  1. The happy path is agent-driven: classifier_agent → (summary_agentconcept_extraction_agent) → graph merge → _persist_document. Persistence happens only after the agent stages, so without a model there is no row, no done event, no library entry. Option (2) from the issue (assert "upload accepted + row created" without an LLM) is factually impossible on this pipeline.
  2. Any agent failure falls back to _legacy_upload_pipelineservices/gemini_service.py::call_gemini_jsonreal Gemini (the feat(backend): pydantic-ai test seam via FunctionModel (SAPLING_MODEL_MODE) #391 seam does not cover gemini_service); if that also fails, the stream ends error/failed + done "Failed." with no row persisted.
  3. The feat(backend): pydantic-ai test seam via FunctionModel (SAPLING_MODEL_MODE) #391 seam does cover every agent in the happy path (all build via model_for), but it originally had no boot-time half: handlers could only be registered by an in-process Python caller, which a separately booted uvicorn doesn't have. Booting SAPLING_MODEL_MODE=function make e2e-up alone would make every agent raise a handler-miss LookupError → legacy fallback → live Gemini. test(e2e): journey — tutor conversation persists to messages (#392) #434 (tutor) landed the canonical boot-time half on main — the SAPLING_FUNCTION_HANDLERS once-per-process autoload with its failure-latch ordering — and this PR (rebased onto it) adopts that seam wholesale and appends on top of it:
    • backend/agents/function_handlers_e2e.py — the upload-pipeline handlers appended to main's module per its own "append here" guidance: deterministic scripted outputs for classifier (→ lecture_notes), summary, concepts, plus post-roll course_summary. These agents have structured output_types, so each handler emits through the agent's output tool — the real output schema validates the payload; no function tools, zero model-driven writes (within the module's stated constraints).
    • /api/health now surfaces model_mode, and the spec fail-fasts against a real-mode stack instead of silently billing Gemini.
    • backend/tests/test_e2e_function_handlers.py — two appended cases pinning the upload handlers under the canonical once-latch design: one autoload dispatch registers the whole pipeline and drives the real classifier; the scripted summary payload passes the real Summary output schema in the hermetic lane.
  4. Residual egress note: post-roll _index_document_chunks embeds via services/rag_service.py (a direct google.genai client — not covered by the seam). It is fire-and-forget and swallowed on failure, so the journey doesn't depend on it, but for the 10-run tally the stack ran with a dummy GEMINI_API_KEY so even that attempt fails fast without billing. update_course_context is covered (its course_summary agent goes through the seam) and degrades to a template string if unregistered.

Boot contract for this spec:

SAPLING_MODEL_MODE=function SAPLING_FUNCTION_HANDLERS=agents.function_handlers_e2e make e2e-up

Verification

  • 10 consecutive local runs green under a single stack-lock hold (one make e2e-up in function mode, 10× npx playwright test e2e/upload.spec.ts, make e2e-down; exit 0):

    run12345678910
    resultpass 7.8spass 6.4spass 6.2spass 6.1spass 6.3spass 6.2spass 6.5spass 6.1spass 6.4spass 6.2s
  • Zero waitForTimeout calls — every wait is an auto-retrying expect() on state an event flips (the only grep hit for the string is the header comment stating the rule).

  • Post-rebase confirmation (converged onto main's test(e2e): journey — tutor conversation persists to messages (#392) #434 seam): 3/3 consecutive runs green under one lock hold — pass 7.4s / pass 6.1s / pass 7.1s, exit 0, clean teardown. The 10/10 pre-rebase tally stands as acceptance evidence; this cycle proves the seam swap changed no behavior.

  • Backend after rebase: pytest tests/ -q → 1088 passed, 23 skipped, 1 pre-existing error (tests/test_ocr_pipeline.py::test_save_to_db, "RuntimeError: Event loop is closed" — reproduces identically on an untouched main checkout; unrelated to this change).

  • Frontend after rebase: eslint . 0 errors (Library.tsx now under the testid enforcement block), tsc --noEmit clean, vitest run 204 passed.

Part of #402, closes#387.

🤖 Generated with Claude Code

@coderabbitai

coderabbitaiBot commented Jul 28, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@AndresL230, you've reached your PR review limit, so we couldn't start this review.

Next review available in:3 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b709ebed-cdfd-4ce2-85f8-6fef55c66164

📥 Commits

Reviewing files that changed from the base of the PR and between c8e8f79 and 79f9662.

⛔ Files ignored due to path filters (1)
  • frontend/e2e/fixtures/upload-journey.pdf is excluded by !**/*.pdf
📒 Files selected for processing (7)
  • backend/agents/function_handlers_e2e.py
  • backend/main.py
  • backend/tests/test_e2e_function_handlers.py
  • docs/frontend-testids.md
  • frontend/e2e/upload.spec.ts
  • frontend/eslint.config.mjs
  • frontend/src/components/screens/Library.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/387-journey-upload-sse

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cloudflare-workers-and-pages

cloudflare-workers-and-pagesBot commented Jul 28, 2026

Copy link
Copy Markdown

Deploying with Cloudflare Workers Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

StatusNameLatest CommitPreview URLUpdated (UTC)
✅ Deployment successful!
View logs
frontend-staging79f9662Commit Preview URL

Branch Preview URL
Jul 28 2026, 04:05 AM

Browser journey driving the real streaming upload pipeline end to end:
fixture PDF in through the upload modal, ride the SSE stream to its
terminal done event, then assert the document renders in the library AND
the row exists in Postgres via raw-SQL readback (plaintext columns only;
documents.summary is asserted ciphertext-not-plaintext).
The pipeline's happy path is agent-driven (classifier → summary ∥
concepts → graph merge) and only persists the documents row after those
stages, so the journey cannot complete without model responses. All four
agents build via the #391 seam (model_for), so this adds the seam's
boot-time half per ADR 0019: SAPLING_FUNCTION_HANDLERS names a module
that _providers loads (and register()s) on the first function-mode
handler miss, plus agents/function_handlers_e2e.py with deterministic
scripted outputs for the upload tasks. /api/health now surfaces
model_mode so the spec fail-fasts instead of billing Gemini against a
real-mode stack. Library.tsx becomes a registered testid surface
(doc row + inventory + eslint files array).
global-setup.ts picks up the #386 sibling fix verbatim (sapling_user
localStorage in storageState — cookie alone leaves authed screens on
their skeleton).
Part of #402.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The RAG post-roll embed predates the seam and sits below it; the
journey's determinism holds (failures swallowed) but the comments
claimed more than the seam vouches for. Tracked in #439.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@AndresL230

Copy link
Copy Markdown
CollaboratorAuthor

Code review

No issues found. Checked for bugs and CLAUDE.md compliance. (The panel verified the seam-file union, fixture PDF validity, schema-valid scripted payloads, and encryption-aware assertions. One pre-existing below-seam RAG egress path was confirmed and is tracked as #439; the PR's hermeticity comments were scoped accordingly in-branch.)

🤖 Generated with Claude Code

@AndresL230
AndresL230 merged commit c42717c into mainJul 28, 2026
6 checks passed
@AndresL230
AndresL230 deleted the test/387-journey-upload-sse branch August 2, 2026 18:30
Sign up for freeto 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.

test(e2e): journey — upload → SSE → document appears

1 participant

@AndresL230
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

test(e2e): journey — upload → SSE → document appears (#387) - #432

Merged
AndresL230 merged 2 commits into
mainfrom
test/387-journey-upload-sse
Jul 28, 2026
Merged

test(e2e): journey — upload → SSE → document appears (#387)#432
AndresL230 merged 2 commits into
mainfrom
test/387-journey-upload-sse

Conversation

@AndresL230

@AndresL230AndresL230 commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

Browser journey for the document pipeline (#387): upload a fixture PDF through the real UI (upload-modal testids), ride the SSE stream (streamSSE under uploadDocumentStream) to its terminal done event, then assert the document appears in the library and the row exists in Postgres via raw-SQL readback.

  • frontend/e2e/upload.spec.ts — the journey. Event-based waiting only (auto-retrying expect()s on UI state; zero waitForTimeout). Asserts: SSE completion (upload-modal-done replaces submit only after the terminal event), the scripted result payload rendered in the row (summary abstract + concept chips), the Postgres documents row (plaintext columns: user_id, category, offering_id; summary asserted ciphertext-not-plaintext), the phase-3 graph_nodes merge, and the library card (decrypted summary round-trip).
  • frontend/e2e/fixtures/upload-journey.pdf — hand-assembled 838-byte single-page PDF with a real text layer (232 chars extract natively via pypdf, so backend extraction never reaches the OCR engines).
  • Postgres readback uses queryRaw from frontend/e2e/support/db.ts (landed with test(e2e): journey — tutor conversation persists to messages (#392) #434; this PR adds no db.ts changes).
  • frontend/src/components/screens/Library.tsx + docs/frontend-testids.md + frontend/eslint.config.mjs — Library registered as a testid surface per the "Adding a surface" procedure (doc row, inventory, eslint files array; every intrinsic interactive element tagged).

LLM-dependence finding (the issue's "known hard part")

The SSE completion event and the documents row itself require model responses — there is no LLM-free scoping that can honestly assert "document appears". Trace of POST /api/documents/upload (backend/routes/documents.py):

  1. The happy path is agent-driven: classifier_agent → (summary_agentconcept_extraction_agent) → graph merge → _persist_document. Persistence happens only after the agent stages, so without a model there is no row, no done event, no library entry. Option (2) from the issue (assert "upload accepted + row created" without an LLM) is factually impossible on this pipeline.
  2. Any agent failure falls back to _legacy_upload_pipelineservices/gemini_service.py::call_gemini_jsonreal Gemini (the feat(backend): pydantic-ai test seam via FunctionModel (SAPLING_MODEL_MODE) #391 seam does not cover gemini_service); if that also fails, the stream ends error/failed + done "Failed." with no row persisted.
  3. The feat(backend): pydantic-ai test seam via FunctionModel (SAPLING_MODEL_MODE) #391 seam does cover every agent in the happy path (all build via model_for), but it originally had no boot-time half: handlers could only be registered by an in-process Python caller, which a separately booted uvicorn doesn't have. Booting SAPLING_MODEL_MODE=function make e2e-up alone would make every agent raise a handler-miss LookupError → legacy fallback → live Gemini. test(e2e): journey — tutor conversation persists to messages (#392) #434 (tutor) landed the canonical boot-time half on main — the SAPLING_FUNCTION_HANDLERS once-per-process autoload with its failure-latch ordering — and this PR (rebased onto it) adopts that seam wholesale and appends on top of it:
    • backend/agents/function_handlers_e2e.py — the upload-pipeline handlers appended to main's module per its own "append here" guidance: deterministic scripted outputs for classifier (→ lecture_notes), summary, concepts, plus post-roll course_summary. These agents have structured output_types, so each handler emits through the agent's output tool — the real output schema validates the payload; no function tools, zero model-driven writes (within the module's stated constraints).
    • /api/health now surfaces model_mode, and the spec fail-fasts against a real-mode stack instead of silently billing Gemini.
    • backend/tests/test_e2e_function_handlers.py — two appended cases pinning the upload handlers under the canonical once-latch design: one autoload dispatch registers the whole pipeline and drives the real classifier; the scripted summary payload passes the real Summary output schema in the hermetic lane.
  4. Residual egress note: post-roll _index_document_chunks embeds via services/rag_service.py (a direct google.genai client — not covered by the seam). It is fire-and-forget and swallowed on failure, so the journey doesn't depend on it, but for the 10-run tally the stack ran with a dummy GEMINI_API_KEY so even that attempt fails fast without billing. update_course_context is covered (its course_summary agent goes through the seam) and degrades to a template string if unregistered.

Boot contract for this spec:

SAPLING_MODEL_MODE=function SAPLING_FUNCTION_HANDLERS=agents.function_handlers_e2e make e2e-up

Verification

  • 10 consecutive local runs green under a single stack-lock hold (one make e2e-up in function mode, 10× npx playwright test e2e/upload.spec.ts, make e2e-down; exit 0):

    run12345678910
    resultpass 7.8spass 6.4spass 6.2spass 6.1spass 6.3spass 6.2spass 6.5spass 6.1spass 6.4spass 6.2s
  • Zero waitForTimeout calls — every wait is an auto-retrying expect() on state an event flips (the only grep hit for the string is the header comment stating the rule).

  • Post-rebase confirmation (converged onto main's test(e2e): journey — tutor conversation persists to messages (#392) #434 seam): 3/3 consecutive runs green under one lock hold — pass 7.4s / pass 6.1s / pass 7.1s, exit 0, clean teardown. The 10/10 pre-rebase tally stands as acceptance evidence; this cycle proves the seam swap changed no behavior.

  • Backend after rebase: pytest tests/ -q → 1088 passed, 23 skipped, 1 pre-existing error (tests/test_ocr_pipeline.py::test_save_to_db, "RuntimeError: Event loop is closed" — reproduces identically on an untouched main checkout; unrelated to this change).

  • Frontend after rebase: eslint . 0 errors (Library.tsx now under the testid enforcement block), tsc --noEmit clean, vitest run 204 passed.

Part of #402, closes#387.

🤖 Generated with Claude Code

@coderabbitai

coderabbitaiBot commented Jul 28, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@AndresL230, you've reached your PR review limit, so we couldn't start this review.

Next review available in:3 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b709ebed-cdfd-4ce2-85f8-6fef55c66164

📥 Commits

Reviewing files that changed from the base of the PR and between c8e8f79 and 79f9662.

⛔ Files ignored due to path filters (1)
  • frontend/e2e/fixtures/upload-journey.pdf is excluded by !**/*.pdf
📒 Files selected for processing (7)
  • backend/agents/function_handlers_e2e.py
  • backend/main.py
  • backend/tests/test_e2e_function_handlers.py
  • docs/frontend-testids.md
  • frontend/e2e/upload.spec.ts
  • frontend/eslint.config.mjs
  • frontend/src/components/screens/Library.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/387-journey-upload-sse

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cloudflare-workers-and-pages

cloudflare-workers-and-pagesBot commented Jul 28, 2026

Copy link
Copy Markdown

Deploying with Cloudflare Workers Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

StatusNameLatest CommitPreview URLUpdated (UTC)
✅ Deployment successful!
View logs
frontend-staging79f9662Commit Preview URL

Branch Preview URL
Jul 28 2026, 04:05 AM

Browser journey driving the real streaming upload pipeline end to end:
fixture PDF in through the upload modal, ride the SSE stream to its
terminal done event, then assert the document renders in the library AND
the row exists in Postgres via raw-SQL readback (plaintext columns only;
documents.summary is asserted ciphertext-not-plaintext).
The pipeline's happy path is agent-driven (classifier → summary ∥
concepts → graph merge) and only persists the documents row after those
stages, so the journey cannot complete without model responses. All four
agents build via the #391 seam (model_for), so this adds the seam's
boot-time half per ADR 0019: SAPLING_FUNCTION_HANDLERS names a module
that _providers loads (and register()s) on the first function-mode
handler miss, plus agents/function_handlers_e2e.py with deterministic
scripted outputs for the upload tasks. /api/health now surfaces
model_mode so the spec fail-fasts instead of billing Gemini against a
real-mode stack. Library.tsx becomes a registered testid surface
(doc row + inventory + eslint files array).
global-setup.ts picks up the #386 sibling fix verbatim (sapling_user
localStorage in storageState — cookie alone leaves authed screens on
their skeleton).
Part of #402.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The RAG post-roll embed predates the seam and sits below it; the
journey's determinism holds (failures swallowed) but the comments
claimed more than the seam vouches for. Tracked in #439.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@AndresL230

Copy link
Copy Markdown
CollaboratorAuthor

Code review

No issues found. Checked for bugs and CLAUDE.md compliance. (The panel verified the seam-file union, fixture PDF validity, schema-valid scripted payloads, and encryption-aware assertions. One pre-existing below-seam RAG egress path was confirmed and is tracked as #439; the PR's hermeticity comments were scoped accordingly in-branch.)

🤖 Generated with Claude Code

@AndresL230
AndresL230 merged commit c42717c into mainJul 28, 2026
6 checks passed
@AndresL230
AndresL230 deleted the test/387-journey-upload-sse branch August 2, 2026 18:30
Sign up for freeto 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.

test(e2e): journey — upload → SSE → document appears

1 participant

@AndresL230
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

test(e2e): journey — upload → SSE → document appears (#387) - #432

Merged
AndresL230 merged 2 commits into
mainfrom
test/387-journey-upload-sse
Jul 28, 2026
Merged

test(e2e): journey — upload → SSE → document appears (#387)#432
AndresL230 merged 2 commits into
mainfrom
test/387-journey-upload-sse

Conversation

@AndresL230

@AndresL230AndresL230 commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

Browser journey for the document pipeline (#387): upload a fixture PDF through the real UI (upload-modal testids), ride the SSE stream (streamSSE under uploadDocumentStream) to its terminal done event, then assert the document appears in the library and the row exists in Postgres via raw-SQL readback.

  • frontend/e2e/upload.spec.ts — the journey. Event-based waiting only (auto-retrying expect()s on UI state; zero waitForTimeout). Asserts: SSE completion (upload-modal-done replaces submit only after the terminal event), the scripted result payload rendered in the row (summary abstract + concept chips), the Postgres documents row (plaintext columns: user_id, category, offering_id; summary asserted ciphertext-not-plaintext), the phase-3 graph_nodes merge, and the library card (decrypted summary round-trip).
  • frontend/e2e/fixtures/upload-journey.pdf — hand-assembled 838-byte single-page PDF with a real text layer (232 chars extract natively via pypdf, so backend extraction never reaches the OCR engines).
  • Postgres readback uses queryRaw from frontend/e2e/support/db.ts (landed with test(e2e): journey — tutor conversation persists to messages (#392) #434; this PR adds no db.ts changes).
  • frontend/src/components/screens/Library.tsx + docs/frontend-testids.md + frontend/eslint.config.mjs — Library registered as a testid surface per the "Adding a surface" procedure (doc row, inventory, eslint files array; every intrinsic interactive element tagged).

LLM-dependence finding (the issue's "known hard part")

The SSE completion event and the documents row itself require model responses — there is no LLM-free scoping that can honestly assert "document appears". Trace of POST /api/documents/upload (backend/routes/documents.py):

  1. The happy path is agent-driven: classifier_agent → (summary_agentconcept_extraction_agent) → graph merge → _persist_document. Persistence happens only after the agent stages, so without a model there is no row, no done event, no library entry. Option (2) from the issue (assert "upload accepted + row created" without an LLM) is factually impossible on this pipeline.
  2. Any agent failure falls back to _legacy_upload_pipelineservices/gemini_service.py::call_gemini_jsonreal Gemini (the feat(backend): pydantic-ai test seam via FunctionModel (SAPLING_MODEL_MODE) #391 seam does not cover gemini_service); if that also fails, the stream ends error/failed + done "Failed." with no row persisted.
  3. The feat(backend): pydantic-ai test seam via FunctionModel (SAPLING_MODEL_MODE) #391 seam does cover every agent in the happy path (all build via model_for), but it originally had no boot-time half: handlers could only be registered by an in-process Python caller, which a separately booted uvicorn doesn't have. Booting SAPLING_MODEL_MODE=function make e2e-up alone would make every agent raise a handler-miss LookupError → legacy fallback → live Gemini. test(e2e): journey — tutor conversation persists to messages (#392) #434 (tutor) landed the canonical boot-time half on main — the SAPLING_FUNCTION_HANDLERS once-per-process autoload with its failure-latch ordering — and this PR (rebased onto it) adopts that seam wholesale and appends on top of it:
    • backend/agents/function_handlers_e2e.py — the upload-pipeline handlers appended to main's module per its own "append here" guidance: deterministic scripted outputs for classifier (→ lecture_notes), summary, concepts, plus post-roll course_summary. These agents have structured output_types, so each handler emits through the agent's output tool — the real output schema validates the payload; no function tools, zero model-driven writes (within the module's stated constraints).
    • /api/health now surfaces model_mode, and the spec fail-fasts against a real-mode stack instead of silently billing Gemini.
    • backend/tests/test_e2e_function_handlers.py — two appended cases pinning the upload handlers under the canonical once-latch design: one autoload dispatch registers the whole pipeline and drives the real classifier; the scripted summary payload passes the real Summary output schema in the hermetic lane.
  4. Residual egress note: post-roll _index_document_chunks embeds via services/rag_service.py (a direct google.genai client — not covered by the seam). It is fire-and-forget and swallowed on failure, so the journey doesn't depend on it, but for the 10-run tally the stack ran with a dummy GEMINI_API_KEY so even that attempt fails fast without billing. update_course_context is covered (its course_summary agent goes through the seam) and degrades to a template string if unregistered.

Boot contract for this spec:

SAPLING_MODEL_MODE=function SAPLING_FUNCTION_HANDLERS=agents.function_handlers_e2e make e2e-up

Verification

  • 10 consecutive local runs green under a single stack-lock hold (one make e2e-up in function mode, 10× npx playwright test e2e/upload.spec.ts, make e2e-down; exit 0):

    run12345678910
    resultpass 7.8spass 6.4spass 6.2spass 6.1spass 6.3spass 6.2spass 6.5spass 6.1spass 6.4spass 6.2s
  • Zero waitForTimeout calls — every wait is an auto-retrying expect() on state an event flips (the only grep hit for the string is the header comment stating the rule).

  • Post-rebase confirmation (converged onto main's test(e2e): journey — tutor conversation persists to messages (#392) #434 seam): 3/3 consecutive runs green under one lock hold — pass 7.4s / pass 6.1s / pass 7.1s, exit 0, clean teardown. The 10/10 pre-rebase tally stands as acceptance evidence; this cycle proves the seam swap changed no behavior.

  • Backend after rebase: pytest tests/ -q → 1088 passed, 23 skipped, 1 pre-existing error (tests/test_ocr_pipeline.py::test_save_to_db, "RuntimeError: Event loop is closed" — reproduces identically on an untouched main checkout; unrelated to this change).

  • Frontend after rebase: eslint . 0 errors (Library.tsx now under the testid enforcement block), tsc --noEmit clean, vitest run 204 passed.

Part of #402, closes#387.

🤖 Generated with Claude Code

@coderabbitai

coderabbitaiBot commented Jul 28, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@AndresL230, you've reached your PR review limit, so we couldn't start this review.

Next review available in:3 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b709ebed-cdfd-4ce2-85f8-6fef55c66164

📥 Commits

Reviewing files that changed from the base of the PR and between c8e8f79 and 79f9662.

⛔ Files ignored due to path filters (1)
  • frontend/e2e/fixtures/upload-journey.pdf is excluded by !**/*.pdf
📒 Files selected for processing (7)
  • backend/agents/function_handlers_e2e.py
  • backend/main.py
  • backend/tests/test_e2e_function_handlers.py
  • docs/frontend-testids.md
  • frontend/e2e/upload.spec.ts
  • frontend/eslint.config.mjs
  • frontend/src/components/screens/Library.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/387-journey-upload-sse

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cloudflare-workers-and-pages

cloudflare-workers-and-pagesBot commented Jul 28, 2026

Copy link
Copy Markdown

Deploying with Cloudflare Workers Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

StatusNameLatest CommitPreview URLUpdated (UTC)
✅ Deployment successful!
View logs
frontend-staging79f9662Commit Preview URL

Branch Preview URL
Jul 28 2026, 04:05 AM

Browser journey driving the real streaming upload pipeline end to end:
fixture PDF in through the upload modal, ride the SSE stream to its
terminal done event, then assert the document renders in the library AND
the row exists in Postgres via raw-SQL readback (plaintext columns only;
documents.summary is asserted ciphertext-not-plaintext).
The pipeline's happy path is agent-driven (classifier → summary ∥
concepts → graph merge) and only persists the documents row after those
stages, so the journey cannot complete without model responses. All four
agents build via the #391 seam (model_for), so this adds the seam's
boot-time half per ADR 0019: SAPLING_FUNCTION_HANDLERS names a module
that _providers loads (and register()s) on the first function-mode
handler miss, plus agents/function_handlers_e2e.py with deterministic
scripted outputs for the upload tasks. /api/health now surfaces
model_mode so the spec fail-fasts instead of billing Gemini against a
real-mode stack. Library.tsx becomes a registered testid surface
(doc row + inventory + eslint files array).
global-setup.ts picks up the #386 sibling fix verbatim (sapling_user
localStorage in storageState — cookie alone leaves authed screens on
their skeleton).
Part of #402.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The RAG post-roll embed predates the seam and sits below it; the
journey's determinism holds (failures swallowed) but the comments
claimed more than the seam vouches for. Tracked in #439.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@AndresL230

Copy link
Copy Markdown
CollaboratorAuthor

Code review

No issues found. Checked for bugs and CLAUDE.md compliance. (The panel verified the seam-file union, fixture PDF validity, schema-valid scripted payloads, and encryption-aware assertions. One pre-existing below-seam RAG egress path was confirmed and is tracked as #439; the PR's hermeticity comments were scoped accordingly in-branch.)

🤖 Generated with Claude Code

@AndresL230
AndresL230 merged commit c42717c into mainJul 28, 2026
6 checks passed
@AndresL230
AndresL230 deleted the test/387-journey-upload-sse branch August 2, 2026 18:30
Sign up for freeto 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.

test(e2e): journey — upload → SSE → document appears

1 participant

@AndresL230
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

test(e2e): journey — upload → SSE → document appears (#387) - #432

Merged
AndresL230 merged 2 commits into
mainfrom
test/387-journey-upload-sse
Jul 28, 2026
Merged

test(e2e): journey — upload → SSE → document appears (#387)#432
AndresL230 merged 2 commits into
mainfrom
test/387-journey-upload-sse

Conversation

@AndresL230

@AndresL230AndresL230 commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

Browser journey for the document pipeline (#387): upload a fixture PDF through the real UI (upload-modal testids), ride the SSE stream (streamSSE under uploadDocumentStream) to its terminal done event, then assert the document appears in the library and the row exists in Postgres via raw-SQL readback.

  • frontend/e2e/upload.spec.ts — the journey. Event-based waiting only (auto-retrying expect()s on UI state; zero waitForTimeout). Asserts: SSE completion (upload-modal-done replaces submit only after the terminal event), the scripted result payload rendered in the row (summary abstract + concept chips), the Postgres documents row (plaintext columns: user_id, category, offering_id; summary asserted ciphertext-not-plaintext), the phase-3 graph_nodes merge, and the library card (decrypted summary round-trip).
  • frontend/e2e/fixtures/upload-journey.pdf — hand-assembled 838-byte single-page PDF with a real text layer (232 chars extract natively via pypdf, so backend extraction never reaches the OCR engines).
  • Postgres readback uses queryRaw from frontend/e2e/support/db.ts (landed with test(e2e): journey — tutor conversation persists to messages (#392) #434; this PR adds no db.ts changes).
  • frontend/src/components/screens/Library.tsx + docs/frontend-testids.md + frontend/eslint.config.mjs — Library registered as a testid surface per the "Adding a surface" procedure (doc row, inventory, eslint files array; every intrinsic interactive element tagged).

LLM-dependence finding (the issue's "known hard part")

The SSE completion event and the documents row itself require model responses — there is no LLM-free scoping that can honestly assert "document appears". Trace of POST /api/documents/upload (backend/routes/documents.py):

  1. The happy path is agent-driven: classifier_agent → (summary_agentconcept_extraction_agent) → graph merge → _persist_document. Persistence happens only after the agent stages, so without a model there is no row, no done event, no library entry. Option (2) from the issue (assert "upload accepted + row created" without an LLM) is factually impossible on this pipeline.
  2. Any agent failure falls back to _legacy_upload_pipelineservices/gemini_service.py::call_gemini_jsonreal Gemini (the feat(backend): pydantic-ai test seam via FunctionModel (SAPLING_MODEL_MODE) #391 seam does not cover gemini_service); if that also fails, the stream ends error/failed + done "Failed." with no row persisted.
  3. The feat(backend): pydantic-ai test seam via FunctionModel (SAPLING_MODEL_MODE) #391 seam does cover every agent in the happy path (all build via model_for), but it originally had no boot-time half: handlers could only be registered by an in-process Python caller, which a separately booted uvicorn doesn't have. Booting SAPLING_MODEL_MODE=function make e2e-up alone would make every agent raise a handler-miss LookupError → legacy fallback → live Gemini. test(e2e): journey — tutor conversation persists to messages (#392) #434 (tutor) landed the canonical boot-time half on main — the SAPLING_FUNCTION_HANDLERS once-per-process autoload with its failure-latch ordering — and this PR (rebased onto it) adopts that seam wholesale and appends on top of it:
    • backend/agents/function_handlers_e2e.py — the upload-pipeline handlers appended to main's module per its own "append here" guidance: deterministic scripted outputs for classifier (→ lecture_notes), summary, concepts, plus post-roll course_summary. These agents have structured output_types, so each handler emits through the agent's output tool — the real output schema validates the payload; no function tools, zero model-driven writes (within the module's stated constraints).
    • /api/health now surfaces model_mode, and the spec fail-fasts against a real-mode stack instead of silently billing Gemini.
    • backend/tests/test_e2e_function_handlers.py — two appended cases pinning the upload handlers under the canonical once-latch design: one autoload dispatch registers the whole pipeline and drives the real classifier; the scripted summary payload passes the real Summary output schema in the hermetic lane.
  4. Residual egress note: post-roll _index_document_chunks embeds via services/rag_service.py (a direct google.genai client — not covered by the seam). It is fire-and-forget and swallowed on failure, so the journey doesn't depend on it, but for the 10-run tally the stack ran with a dummy GEMINI_API_KEY so even that attempt fails fast without billing. update_course_context is covered (its course_summary agent goes through the seam) and degrades to a template string if unregistered.

Boot contract for this spec:

SAPLING_MODEL_MODE=function SAPLING_FUNCTION_HANDLERS=agents.function_handlers_e2e make e2e-up

Verification

  • 10 consecutive local runs green under a single stack-lock hold (one make e2e-up in function mode, 10× npx playwright test e2e/upload.spec.ts, make e2e-down; exit 0):

    run12345678910
    resultpass 7.8spass 6.4spass 6.2spass 6.1spass 6.3spass 6.2spass 6.5spass 6.1spass 6.4spass 6.2s
  • Zero waitForTimeout calls — every wait is an auto-retrying expect() on state an event flips (the only grep hit for the string is the header comment stating the rule).

  • Post-rebase confirmation (converged onto main's test(e2e): journey — tutor conversation persists to messages (#392) #434 seam): 3/3 consecutive runs green under one lock hold — pass 7.4s / pass 6.1s / pass 7.1s, exit 0, clean teardown. The 10/10 pre-rebase tally stands as acceptance evidence; this cycle proves the seam swap changed no behavior.

  • Backend after rebase: pytest tests/ -q → 1088 passed, 23 skipped, 1 pre-existing error (tests/test_ocr_pipeline.py::test_save_to_db, "RuntimeError: Event loop is closed" — reproduces identically on an untouched main checkout; unrelated to this change).

  • Frontend after rebase: eslint . 0 errors (Library.tsx now under the testid enforcement block), tsc --noEmit clean, vitest run 204 passed.

Part of #402, closes#387.

🤖 Generated with Claude Code

@coderabbitai

coderabbitaiBot commented Jul 28, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@AndresL230, you've reached your PR review limit, so we couldn't start this review.

Next review available in:3 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b709ebed-cdfd-4ce2-85f8-6fef55c66164

📥 Commits

Reviewing files that changed from the base of the PR and between c8e8f79 and 79f9662.

⛔ Files ignored due to path filters (1)
  • frontend/e2e/fixtures/upload-journey.pdf is excluded by !**/*.pdf
📒 Files selected for processing (7)
  • backend/agents/function_handlers_e2e.py
  • backend/main.py
  • backend/tests/test_e2e_function_handlers.py
  • docs/frontend-testids.md
  • frontend/e2e/upload.spec.ts
  • frontend/eslint.config.mjs
  • frontend/src/components/screens/Library.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/387-journey-upload-sse

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cloudflare-workers-and-pages

cloudflare-workers-and-pagesBot commented Jul 28, 2026

Copy link
Copy Markdown

Deploying with Cloudflare Workers Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

StatusNameLatest CommitPreview URLUpdated (UTC)
✅ Deployment successful!
View logs
frontend-staging79f9662Commit Preview URL

Branch Preview URL
Jul 28 2026, 04:05 AM

Browser journey driving the real streaming upload pipeline end to end:
fixture PDF in through the upload modal, ride the SSE stream to its
terminal done event, then assert the document renders in the library AND
the row exists in Postgres via raw-SQL readback (plaintext columns only;
documents.summary is asserted ciphertext-not-plaintext).
The pipeline's happy path is agent-driven (classifier → summary ∥
concepts → graph merge) and only persists the documents row after those
stages, so the journey cannot complete without model responses. All four
agents build via the #391 seam (model_for), so this adds the seam's
boot-time half per ADR 0019: SAPLING_FUNCTION_HANDLERS names a module
that _providers loads (and register()s) on the first function-mode
handler miss, plus agents/function_handlers_e2e.py with deterministic
scripted outputs for the upload tasks. /api/health now surfaces
model_mode so the spec fail-fasts instead of billing Gemini against a
real-mode stack. Library.tsx becomes a registered testid surface
(doc row + inventory + eslint files array).
global-setup.ts picks up the #386 sibling fix verbatim (sapling_user
localStorage in storageState — cookie alone leaves authed screens on
their skeleton).
Part of #402.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The RAG post-roll embed predates the seam and sits below it; the
journey's determinism holds (failures swallowed) but the comments
claimed more than the seam vouches for. Tracked in #439.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@AndresL230

Copy link
Copy Markdown
CollaboratorAuthor

Code review

No issues found. Checked for bugs and CLAUDE.md compliance. (The panel verified the seam-file union, fixture PDF validity, schema-valid scripted payloads, and encryption-aware assertions. One pre-existing below-seam RAG egress path was confirmed and is tracked as #439; the PR's hermeticity comments were scoped accordingly in-branch.)

🤖 Generated with Claude Code

@AndresL230
AndresL230 merged commit c42717c into mainJul 28, 2026
6 checks passed
@AndresL230
AndresL230 deleted the test/387-journey-upload-sse branch August 2, 2026 18:30
Sign up for freeto 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.

test(e2e): journey — upload → SSE → document appears

1 participant

@AndresL230