Skip to content

test(observability-map): name the environment on the queues page failure logs - #4485

Closed
1stvamp wants to merge 4 commits into
test/obsmap-worsenfrom
test/obsmap-improve
Closed

test(observability-map): name the environment on the queues page failure logs#4485
1stvamp wants to merge 4 commits into
test/obsmap-worsenfrom
test/obsmap-improve

Conversation

@1stvamp

@1stvamp 1stvamp commented Aug 3, 2026

Copy link
Copy Markdown
Member

Throwaway. Case 1 of 3 in an end-to-end check of the observability-map CI
comment: a real improvement should be reported as one.

The two logger.warn calls on the queues page log { error } with no tenant,
while environment is already in scope. Adding environmentId is exactly the
change the tool asks for.

Locally verified: that route goes 0 -> 50, request-context fail -> pass.
Global stays 19, because one route in 412 cannot move the rounded mean.

Do not merge. Will be closed once the CI behaviour is observed.


This is part 4 of 4 in a stack made with GitButler:

@changeset-bot

changeset-bot Bot commented Aug 3, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 734c872

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 384de13c-56f3-4dca-8d0f-a05badd6be74

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Observability map

As of 734c872.

Nothing in this pull request moves the report any more. The findings an earlier push reported are gone.

Report only, nothing here gates the merge. The rules and their reasons: internal-packages/observability-map/README.md.

@1stvamp
1stvamp force-pushed the test/obsmap-worsen branch from a681f21 to 1cd8d80 Compare August 3, 2026 10:55
@1stvamp
1stvamp force-pushed the test/obsmap-improve branch 2 times, most recently from 7ee2a98 to 05e9507 Compare August 3, 2026 11:06
1stvamp added 2 commits August 3, 2026 13:27
…ure logs

Throwaway PR to verify the observability-map CI comment reports an improvement.
Not for merge.
@1stvamp
1stvamp force-pushed the test/obsmap-worsen branch from 1cd8d80 to d3ce17d Compare August 3, 2026 12:31
@1stvamp
1stvamp force-pushed the test/obsmap-improve branch from 27cf0b0 to 6d9c167 Compare August 3, 2026 12:32
1stvamp added 2 commits August 3, 2026 13:32
Reverts the route edit and touches a non-route file, so the diff is non-empty
but matches neither watched path while a findings comment exists. Tests that the
workflow still starts and reconciles the comment.
@1stvamp

1stvamp commented Aug 3, 2026

Copy link
Copy Markdown
Member Author

Test complete. All four states of the delta rule confirmed on the real runner, plus the stale-comment gap this exposed (fixed in 042c9c3) and its reconcile path. Closing; branch deleted.

@1stvamp 1stvamp closed this Aug 3, 2026
@1stvamp
1stvamp deleted the test/obsmap-improve branch August 3, 2026 13:03
1stvamp added a commit that referenced this pull request Aug 4, 2026
… entry points (#4455)

A static observability scorer for the webapp's route entry points,
Lighthouse-style. The idea comes from evlog's `map` command, but that
tool has no Remix adapter and checks for its own logging API, so the
idea is ported rather than the tool.

It scans all 427 loader/action entry points in `apps/webapp/app/routes`
with the TypeScript compiler API and scores each against five checks:
error-classification, auth-boundary, auth-scope, request-context and
audit-trail. Current output on the real tree is **19/100** over 412
measured entry points.

```
cd internal-packages/observability-map
pnpm exec tsx src/cli.ts               # terminal report
pnpm exec tsx src/cli.ts --json        # machine output
pnpm exec tsx src/cli.ts api/v1/token  # one entry, per-check detail
```

The two findings at the top of the fix list are real: `/auth/sso` and
`/api/v1/authorization-code` mint or exchange credentials
unauthenticated, and `/_app/orgs/:organizationSlug/settings/team`
resolves its org from a URL slug and gates each mutating branch on an
RBAC check alone, which per `apps/webapp/CLAUDE.md` is not the tenant
floor on self-hosted.

Decisions worth knowing, all with the reasoning in the README:

- The score started at 83 during development and fell to 19. Every drop
was a perverse incentive being removed, not a regression: routes were
being paid for having no error handling, two checks were reading the
same fact, suppressing a failure raised the score, and a no-op `catch
(e) { throw e }` was worth 50 points a route.
- **A mutation corpus is the tool's main defence.** 44 entries apply
semantics-preserving edits to a copy of the real route tree and assert
the score cannot rise, per route as well as globally, because a mean can
hide one route going up by taking another down. One entry runs as a live
expected failure: `try { String(0); }` with a deciding catch is a known
open hole worth 19 to 44, and it is disclosed rather than quietly
excluded.
- `audit-trail` and `request-context` are reported as headline figures
rather than one finding repeated hundreds of times. Both still count in
full where they should.
- A cohort change moves the number without anything in the codebase
getting better. Widening the sensitive cohort from 26 to 67 took the
global from 15 to 19 with no webapp change at all, so the report prints
per-check applicability and what the global would be without each one.

CI: a report-only job posts a sticky comment when a PR moves the report,
and says nothing when it does not. The package's own tests gate through
`pr_checks.yml`. The diff-scoped merge gate is still deferred until the
report has been used in anger.

524 tests plus the corpus. No runtime or dependency changes to anything
that ships.

<!-- GitButler Footer Boundary Top -->
---
This is **part 1 of 4 in a stack** made with GitButler:
- <kbd>&nbsp;4&nbsp;</kbd> #4485
- <kbd>&nbsp;3&nbsp;</kbd> #4484
- <kbd>&nbsp;2&nbsp;</kbd> #4483
- <kbd>&nbsp;1&nbsp;</kbd> #4455 👈 
<!-- GitButler Footer Boundary Bottom -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant