Skip to content

#15: Assess each PR's expected value to the repository's product - #17

Merged
yyeret merged 5 commits into
mainfrom
tessl/issue-15
Oct 24, 2026
Merged

yyeret merged 5 commits into
mainfrom
tessl/issue-15

Conversation

@tessl-app

@tessl-app tessl-app Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Repository analysis now estimates each sampled PR's expected value to the product, alongside its outcome framing. Gemini infers product context from the repository description, topics and README, then rates up to 30 recent PRs (up to 10 open) as High, Medium, Low or Unclear, with confidence, beneficiaries, rationale, a matching strategic goal and missing context. The dashboard labels these as expectations, never verified impact.

Only public repositories are assessed. README retrieval is unauthenticated to prevent a visibility change from exposing private content; a refused or rate-limited README falls back to metadata. The privacy notice covers the repository and PR text sent to Gemini.

Missing keys, invalid context and provider failures leave the remaining analysis usable. Request deadlines apply locally and on Workers; incomplete reasoning becomes Unclear with Low confidence. Hosted results cache for six hours, shortened to ten minutes after Gemini failures. An uncached analysis makes up to 31 Gemini calls, with five PR assessments at a time; coordination across simultaneous callers remains deferred.

The lock also upgrades certifi from 2026.7.22 to 2026.10.23 and opentelemetry-api from 1.45.0 to 1.45.1 to clear the runtime advisory check.

Cloudflare branch previews now build with explicit staging bindings. The setup script creates or reuses isolated KV and D1 resources, initializes their schema and preserves production bindings. Preview branches intentionally share staging data; only trusted repository branch code should deploy against it. Authentication stays required. Google OAuth origins and preview service secrets remain separate setup.

Closes #15

Related: #16 (Jev follow-up)

Validation

  • Ruff passed; 245 tests passed with 94.34% coverage on Python 3.14 (90% required).
  • All six security checks passed, including the locked runtime advisory audit; the pinned-uv locked export passed.
  • GitHub CI passed on Python 3.11 and 3.13; audit, Tessl Reviewer and the hosted Cloudflare preview build checks passed on 1aadb4c. Tessl's shared-staging advisory was declined and its thread resolved: preview branches use the documented trusted staging boundary, with production on separate resources.
  • The existing automatic Cloudflare branch build published the preview, including the 466-module bundle. Browser checks confirmed the page loads, /api/health returns {"ok":true} and /api/auth/session reports signed out. Production was not deployed.
  • Mocked integration tests cover product context, framing versus value, sample ordering and cohort pairing, malformed responses, partial failures, privacy, timeouts and cache TTLs. The original stub-DOM check covered escaping and unavailable states.

Five preview-provisioning tests cover offline planning, resource reuse/creation and rejecting production IDs before writes. Preview sign-in, live Gemini assessments and the signed-in results layout remain unverified; preview OAuth origins and the Gemini secret were outside this setup.

🤖 Generated with Claude Code

One Gemini call per analysis builds product context (summary, value
proposition, lean canvas, strategic goals) from the repository description,
topics and README. One Gemini call per sampled PR then rates expected value
(High/Medium/Low/Unclear) with confidence, beneficiaries, why it matters, the
matching goal and missing context. Content framing is passed as evidence only.
Results are labelled as expectations, not realized impact, and degrade to a
status and reason when no key is configured or the context call fails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tessl-app tessl-app Bot added the tessl Hands this issue to Tessl to implement label Oct 23, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://tessl-issue-15-github-flow-analytics.yuval-yeret.workers.dev (commit 1aadb4c)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://e9f8c09b-github-flow-analytics.yuval-yeret.workers.dev 1aadb4c 2026-10-23T17:48:16.637Z Visit the dashboard ↗
  • Build: Failed ❌

View logs ↗
34d4505 2026-10-23T16:07:47.082Z View logs ↗
  • Build: Failed ❌

View logs ↗
1d1ae42 2026-10-23T14:42:10.660Z View logs ↗
  • Build: In progress 🔵

View logs ↗
736c142 2026-10-23T14:06:55.074Z View logs ↗

@tessl-reviewer tessl-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Tessl Reviewer

Advisory findings (11)

The product-value feature is integrated into both analysis paths and the dashboard, but its sampling/accounting, fail-soft handling, privacy boundary, and hosted caching/concurrency behavior leave several cases with misleading results, unnecessary provider load, or unavailable analysis responses.

Severity Findings
Major 4
Minor 7

Advisory findings (11)

  • Major · Advisory · Non-blocking · Malformed context JSON bypasses the product-value fail-soft result
    product_value.py:187
  • Major · Advisory · Non-blocking · The README retrieval can disclose content after a repository becomes private
    product_value.py:98
  • Major · Advisory · Non-blocking · Gemini request timeouts are absent in the Worker transport
    product_value.py:120
  • Major · Advisory · Non-blocking · Concurrent uncached analyses duplicate all Gemini product-value work
    cloudflare_app.py:244
  • Minor · Advisory · Non-blocking · Duplicate PR numbers can pair a merged classification with an open snapshot
    product_value.py:126
  • Minor · Advisory · Non-blocking · The displayed assessment denominator is not the selected PR sample
    product_value.py:173
  • Minor · Advisory · Non-blocking · The hosted privacy notice omits the new Gemini disclosures
    product_value.py:178
  • Minor · Advisory · Non-blocking · A transient context failure is retained in the six-hour analysis cache
    cloudflare_app.py:246
  • Minor · Advisory · Non-blocking · The claimed most-recent PR sample is not consistently ordered by recency
    product_value.py:125
  • Minor · Advisory · Non-blocking · Empty assessment narratives are published as high-confidence assessments
    product_value.py:144
  • Minor · Advisory · Non-blocking · Cached analyses do not reflect the current Gemini-key state described in the README
    README.md:72

Reviews are incremental. The first review shows every valid finding. A later round checks the latest changes and earlier findings, and adds a fresh finding when it still applies. It never repeats one you refuted or declined. Ask for a full review to inspect the whole change and show earlier findings again.

Mention @tessl-reviewer to run another review.

Comment thread product_value.py Resolved
Comment thread product_value.py Resolved
Comment thread product_value.py Resolved
Comment thread product_value.py Resolved
Comment thread product_value.py Resolved
Comment thread cloudflare_app.py Resolved
Comment thread cloudflare_app.py Resolved
Comment thread product_value.py Resolved
Comment thread product_value.py Resolved
Comment thread README.md Resolved
- Validate and normalize Gemini's product context inside the fail-soft path.
- Read repository metadata first and send nothing to Gemini unless it is public.
- Enforce request deadlines with asyncio.wait_for so they hold on Workers fetch.
- Select the most recent PRs by date and pair each with its own cohort record.
- Report the selected sample size and use it as the dashboard denominator.
- Downgrade assessments without reasoning to Unclear with Low confidence.
- Cache analyses with Gemini failures for ten minutes instead of six hours.
- Disclose product value data sent to Gemini on the privacy page.
- Document how cached analyses relate to the Gemini key state.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tessl-app

tessl-app Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

Failed checks on 736c142, both outside this PR's diff:

  • audit (job 120458640604): only the "Locked runtime advisories" step failed. I reproduced it locally with uv export --frozen --no-dev --extra local piped to pip-audit: certifi 2026.7.22 (PYSEC-2026-4320, fixed in 2026.10.19) and opentelemetry-api 1.45.0 (CVE-2026-114603, fixed in 1.45.1). uv.lock is byte-identical to main, and Dependabot PR chore(deps): bump uv from 0.12.23 to 0.13.4 #14 fails the same step, so these are new advisories against the shared lock. Bumping the lock belongs in a dependency update on main, not in this feature PR.
  • Workers Builds: github-flow-analytics: its log is only on the Cloudflare dashboard, which I cannot read. The build hook python3 scripts/prepare-cloudflare-build.py succeeds locally on this branch and bundles product_value.py. The same check also fails on dependency-only PRs chore(deps-dev): update pytest requirement from >=8.0 to >=9.1.1 #12, chore(deps): bump uv from 0.12.23 to 0.13.4 #13 and chore(deps): bump uv from 0.12.23 to 0.13.4 #14 while passing on main, which points to the branch preview build setup rather than this diff. An owner with Cloudflare access should confirm from the build log.

Review findings are answered in their threads and fixed in 37a0bf6, except the cross-caller dedupe, which I declined as out of scope. Locally on 37a0bf6: python -m ruff check . passed, and python -m pytest --cov --cov-report=term-missing gave 239 passed with 94.22% coverage (Python 3.14, not the CI 3.11 and 3.13 matrix).

@tessl-reviewer tessl-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Tessl Reviewer

Advisory findings (1)

1 finding requires changes before approval.

Severity Findings
Major 1

Advisory findings (1)

  • Major · Advisory · Non-blocking · A repository can become private between the visibility check and README retrieval
    product_value.py:110
    Still applies at the location above. See the earlier thread.

Earlier findings: 1 still applies · 9 addressed · 1 declined

About this review

These findings are AI-generated and not authoritative. Check each one against the code before acting on it. See the guidance on working with this review.

Mention @tessl-reviewer to run another review.

@yyeret

yyeret commented Oct 23, 2026 via email

Copy link
Copy Markdown
Owner

The owner chose to close the visibility race: the README request is now
unauthenticated, so GitHub refuses it if the repository went private after
the metadata check. A refused or rate-limited README falls back to the
description and topics.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tessl-app

tessl-app Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

Thanks, went with option 1: the README is now fetched without the GitHub token, in 1d1ae42. Details are in the review thread.

@tessl-reviewer tessl-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Tessl Reviewer

No advisory concerns

No findings to surface.

Earlier findings: 10 addressed · 1 declined

About this review

These findings are AI-generated and not authoritative. Check each one against the code before acting on it. See the guidance on working with this review.

Mention @tessl-reviewer to run another review.

@tessl-app

tessl-app Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

PR ready for review: #17

@yyeret

yyeret commented Oct 23, 2026

Copy link
Copy Markdown
Owner

tessl fix failing checks

certifi 2026.7.22 -> 2026.10.23 (PYSEC-2026-4320) and opentelemetry-api
1.45.0 -> 1.45.1 (CVE-2026-114603) so the audit job's locked runtime
advisories step passes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tessl-app

tessl-app Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

Fixed audit in 34d4505: uv.lock now bumps certifi 2026.7.22 to 2026.10.23 (PYSEC-2026-4320) and opentelemetry-api 1.45.0 to 1.45.1 (CVE-2026-114603). Nothing else changed in the lock. Locally on 34d4505, python scripts/security-check.py (the command the audit job runs) passes every step, python -m ruff check . passes, and python -m pytest --cov --cov-report=term-missing gives 240 passed with 94.34% coverage (Python 3.14, not the CI 3.11 and 3.13 matrix). The same bump would also clear audit on main and the Dependabot PRs.

Workers Builds: github-flow-analytics I cannot fix from here: its log is only on the Cloudflare dashboard, which I cannot read. python3 scripts/prepare-cloudflare-build.py succeeds locally on 34d4505, and the same check fails on dependency-only PRs #12, #13 and #14 while passing on main, so the cause looks like the preview build setup rather than this diff. If you can paste the error from the build log, I will fix it if it is in this PR.

@tessl-reviewer tessl-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Tessl Reviewer

No advisory concerns

The product-value assessment is integrated with the analysis paths, cache behavior, dashboard accounting, and public disclosure. The reviewed fixes preserve fail-soft behavior, apply dependency deadlines, retain cohort-specific PR records, and prevent authenticated README retrieval after a visibility transition. The only outstanding concurrency concern was explicitly acknowledged and deferred by the change author.

Earlier findings: 10 addressed · 1 declined

About this review

These findings are AI-generated and not authoritative. Check each one against the code before acting on it. See the guidance on working with this review.

Mention @tessl-reviewer to run another review.

@tessl-app

tessl-app Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

Workers Builds: github-flow-analytics also failed on 34d4505, and I still cannot fix it from this branch. The check run (120518920385) started and completed in the same second, 16:07:48Z, so the build ended before any build step ran. It is the same on every PR branch in this repository, #4 through #17, including #5, which then passed on main. Only main builds succeed. On this head, python3 scripts/prepare-cloudflare-build.py completes locally and main is already merged in.

That pattern points to the Workers Builds setup for non-production branches, not to this diff. @yyeret, can you check the build log, or the project's non-production branch build settings in Cloudflare? If the log shows an error in this PR's code, paste it here and I will fix it.

@tessl-reviewer tessl-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Tessl Reviewer

Advisory findings (1)

1 finding requires changes before approval.

Severity Findings
Major 1

Advisory findings (1)

  • Major · Advisory · Non-blocking · Every branch preview receives the shared preview users database
    wrangler.jsonc:81

Earlier findings: 10 addressed · 1 declined

About this review

These findings are AI-generated and not authoritative. Check each one against the code before acting on it. See the guidance on working with this review.

Mention @tessl-reviewer to run another review.

Comment thread wrangler.jsonc Resolved
@tessl-app

tessl-app Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

PR ready for review: #17

@yyeret

yyeret commented Oct 23, 2026

Copy link
Copy Markdown
Owner

can you check the build log, or the project's non-production branch build settings in Cloudflare?

Checked the hosted build log: wrangler preview failed with Your Wrangler configuration is missing a previews block. The production deployment dry run did not exercise that Preview-specific requirement.

Fixed in 1aadb4c: branch previews now have an explicit configuration with a separate staging KV namespace and D1 database, required authentication, and separate rate-limit namespaces. The repeatable provisioning script defaults to a read-only plan and refuses production bindings before account writes.

The actual hosted Preview build for 1aadb4c now succeeds, alongside the Python CI matrix, audit and Tessl Reviewer checks. Production bindings and data were preserved.

@yyeret yyeret added tessl Hands this issue to Tessl to implement and removed tessl Hands this issue to Tessl to implement labels Oct 23, 2026
@yyeret
yyeret merged commit 2a2befe into main Oct 24, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tessl Hands this issue to Tessl to implement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Assess each PR’s expected value to the repository’s product

1 participant