-
Notifications
You must be signed in to change notification settings - Fork 118
fix(web): restore Heroku cache-only map_analysis (503 regression) #924
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
northdpole
wants to merge
4
commits into
main
Choose a base branch
from
fix/heroku-map-analysis-cache-only
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
a49b7d9
fix(web): restore Heroku cache-only map_analysis and add GA health mo…
northdpole 4304a5a
fix(scripts): send User-Agent in GA health monitor HTTP requests
northdpole 1e009d9
docs(agents): track AGENTS.md with production GA cache-only policy
northdpole c7cc9cc
fix(ga): block empty primary cache writes and clobbering
northdpole File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -64,6 +64,7 @@ standards_cache.sqlite | |
|
|
||
| ### Docs | ||
| *.md | ||
| !AGENTS.md | ||
|
|
||
| ### Dev DBDumps | ||
| *.sql | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| # OpenCRE Agent Instructions | ||
|
|
||
| Cursor agents working in this repo must follow the rules in `.cursor/rules/`. | ||
|
|
||
| ## Quick start | ||
|
|
||
| 1. **Requirements gate** — If goal, success criteria, `@` file refs, or constraints are missing, stop and ask (`requirements-gate.mdc`). | ||
| 2. **Plan first** — Non-trivial or multi-file work requires a plan and user approval before coding (`plan-first-workflow.mdc`, `multi-agent-workflow.mdc`). | ||
| 3. **Verify** — After code changes, run checks and iterate until green (`verifiable-goals.mdc`): | ||
| - `make lint` | ||
| - `make mypy` | ||
| - `make test` | ||
| - `make frontend` (if frontend touched) | ||
| 4. **Review** — Substantive work needs independent judge/subagent review (`multi-agent-workflow.mdc`). | ||
| 5. **Production gap analysis** — On Heroku/opencreorg, gap analysis is cache-only: serve precomputed rows from Postgres; do not compute GA on production (cache miss → 404). | ||
|
|
||
| ## Rule index | ||
|
|
||
| | Rule | Purpose | | ||
| |------|---------| | ||
| | `requirements-gate.mdc` | Clarifying questions + requirements template | | ||
| | `complete-ticket.mdc` | Ticket gate for `.md`/`.txt` files; uses `requirements-gate` template + coding standards | | ||
| | `plan-first-workflow.mdc` | Plan Mode before non-trivial edits | | ||
| | `multi-agent-workflow.mdc` | Big changes, approval gates, builder ≠ judge | | ||
| | `verifiable-goals.mdc` | Lint, mypy, test, CI — show evidence | | ||
| | `never-assume.mdc` | No guessing; complete code; minimal scope | | ||
| | `tdd-workflow.mdc` | Test-first for new behavior and importers | | ||
| | `autonomous-workflow.mdc` | Execute after approval; no unsolicited commits | | ||
| | `context-management.mdc` | `/clear`, `@` refs, stale context recovery | | ||
| | `production-db-ops-safety.mdc` | Destructive prod DB confirmation | | ||
| | `alembic-deploy-guardrail.mdc` | Pre-deploy migration guardrail | | ||
|
|
||
| ## OpenCRE commands | ||
|
|
||
| ```bash | ||
| make lint # black + frontend prettier | ||
| make mypy # Python typecheck | ||
| make test # Python unittest suite | ||
| make frontend # yarn build (when TS/TSX changed) | ||
| make alembic-guardrail # before deploy/migration ops | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| import unittest | ||
|
|
||
| from scripts import monitor_ga_health as monitor | ||
|
|
||
|
|
||
| class MonitorGaHealthTest(unittest.TestCase): | ||
| def test_material_result_detection(self) -> None: | ||
| self.assertTrue(monitor._http_gap_result_is_material({"a": 1})) | ||
| self.assertFalse(monitor._http_gap_result_is_material({})) | ||
| self.assertFalse(monitor._http_gap_result_is_material(None)) | ||
|
|
||
| def test_503_bucket_is_regression_marker(self) -> None: | ||
| bucket = "http_503_regression" | ||
| self.assertEqual(bucket, "http_503_regression") | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| unittest.main() | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test is ineffective: validates only a local variable, not the production code.
This test assigns a local variable and asserts it equals itself, providing no validation of the
monitor_ga_healthmodule. Given that detecting HTTP 503 regressions is a core objective of this PR, the test should verify that_check_pairactually returns"http_503_regression"as the bucket when a 503 status is encountered.🧪 Proposed fix to test the actual code
Alternative minimal fix (if mocking is too complex for this test suite):
🤖 Prompt for AI Agents