Vote for your favorite SkillMD. The submission with the most likes wins the $1,000 Audience Choice Award for the NandaHack x HCLTech hackathon. Voting is open through September 25.Vote now →
mergedhumanPR #267Identity

fix(pulse): attribute availability to the endpoint actually probed

One of nine independent PRs from a correctness audit of main at df0b5f1. Each merges cleanly with the others in any order; together they pass 908 tests locally on Python 3.11 and 3.14 (CI covers 3.11 and 3.12).

Author

JamesCarnley avatar

@JamesCarnley

github profile →
Status
Merged
Merged on
Sep 14
Branch
fix/pulse-endpoint-attribution

Description

The pitch.

One of nine independent PRs from a correctness audit of `main` at `df0b5f1`. Each merges cleanly with the others in any order; together they pass 908 tests locally on Python 3.11 and 3.14 (CI covers 3.11 and 3.12).

Commits: `ab37be9`

### Problem

A Pulse target name is an operator's label and can be re-pointed at another URL.
`availability()` grouped probes by name only. Re-pointing `svc` from a URL that
returned 200 to one returning 503 reported the **old** URL with
`last_ok: false` and a blended 50%.

### Change

- Probes of different URLs are never blended.
- A name's headline figures describe the URL it was probed at most recently.
- Each earlier URL keeps its own figures under `previous_endpoints`.
- The report adds `current endpoint` / `earlier endpoint` lines only when a name
  has more than one URL.
- URLs are compared exactly (documented). No identity or normalization is
  introduced.

### Compatibility

- `availability()` gains `previous_endpoints`.
- For re-pointed names only, the headline figures cover the latest URL.
- Nothing is deleted.
- `export_records` output is unchanged, and so is single-URL output.
- Only `render_pulse_report` reads the dict.

### Verification

- Full suite on the branch: 820 passed.
- The new tests fail on `df0b5f1`.
- The tests use real localhost HTTP targets. An adversarial CLI review compared
  base and branch.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Try it

Open PR on GitHubView diff

Checkout locally

git fetch origin pull/267/head:pr-267
git checkout pr-267