Skip to content

Remove legacy_density mode, compat/, and validate_packet alias#129

Merged
WhatsYourWhy merged 1 commit intomainfrom
cleanup/legacy-density-purge
Apr 19, 2026
Merged

Remove legacy_density mode, compat/, and validate_packet alias#129
WhatsYourWhy merged 1 commit intomainfrom
cleanup/legacy-density-purge

Conversation

@WhatsYourWhy
Copy link
Copy Markdown
Owner

Summary

Single-code-path simplification. v0.2 carried a legacy_density
salience-mode branch as a one-release migration path; that release
never came. This PR removes the entire parallel mode.

166 tests passing (was 170; the 4 removed tests exercised
legacy-only code paths).

What changed

Deleted:

  • temporal_gradient/compat/CANONICAL_MODE / LEGACY_DENSITY_MODE
    constants, LEGACY_REJECTED_CANONICAL_KEYS, LEGACY_PACKET_FALLBACK_KEYS,
    normalize_legacy_density_to_psi, coerce_legacy_schema_version,
    legacy_packet_value.
  • ClockRateModulator(salience_mode=..., legacy_density_scale=...)
    kwargs and the input_context tick argument.
  • calculate_information_density() and _psi_from_legacy_density()
    helpers on the clock.
  • ConfigClock.salience_mode / legacy_density_scale fields + their
    entries in DEFAULTS and tg.yaml.
  • validate_packet_schema(salience_mode=...) kwarg (there is one mode
    now).
  • validate_packet() compatibility alias — callers use
    validate_packet_schema.
  • ChronometricVector.from_packet(salience_mode=...) and its legacy
    branch that read t_obj / r / legacy_density keys.
  • normalize_schema_version(\"1\") legacy migration — only \"1.0\" accepted.
  • tests/fixtures/packets/legacy.jsonl.
  • ClockTickRequest.input_context field.

Updated callers: anomaly_poc.py, sanity_harness.py,
calibration_harness.py, README.md, docs/usage.md.

Tests simplified: 13 test files stripped of salience_mode=\"canonical\"
kwargs, legacy_density_scale params, and schema-version-"1"
migration cases.

Why

From the prior audit on #128:

salience_mode / legacy_density_scale / compat/legacy.py still
exist; removing them touches ~10 test files with real assertions and
the telemetry schema. Worth a focused PR.

This is that PR.

Reviewer notes

  • Behavior is identical on the canonical path (which was the only path
    any real caller used).
  • Touches ~30 files but each edit is mechanical: drop a kwarg, drop a
    YAML line, drop a test parameter, drop a legacy-branch test.
  • No API additions; deletions only.

Test plan

  • pytest -q → 166 passed locally
  • CI passes on 3.10 / 3.11 / 3.12

Single-code-path simplification pass. v0.2 carried a `legacy_density`
salience-mode branch as "one-release migration support"; that release
never came. Removing it.

Removed:
- `temporal_gradient/compat/` — CANONICAL_MODE / LEGACY_DENSITY_MODE
  constants, legacy packet fallback keys, density-to-psi normalizer,
  schema-version coercer.
- `ClockRateModulator.salience_mode`, `legacy_density_scale`, and
  `input_context` kwargs; `calculate_information_density()` and
  `_psi_from_legacy_density()` helpers.
- `ConfigClock.salience_mode` / `legacy_density_scale` fields and the
  matching keys from `DEFAULTS` and `tg.yaml`.
- `validate_packet_schema(salience_mode=...)` kwarg — there is now one
  mode.
- `validate_packet()` compatibility alias (use `validate_packet_schema`).
- `ChronometricVector.from_packet(salience_mode=...)` and its legacy
  branch that read `t_obj` / `r` / `legacy_density` keys.
- `normalize_schema_version("1")` legacy migration — only `"1.0"` now.
- `tests/fixtures/packets/legacy.jsonl`.
- `ClockTickRequest.input_context` field.

Callers updated: `anomaly_poc.py`, `sanity_harness.py`,
`calibration_harness.py`, `README.md`, `docs/usage.md`.

Tests updated/simplified: 13 test files touched to drop
`salience_mode="canonical"` kwargs, `legacy_density_scale` params, and
the schema-version "1" legacy-migration cases.

166 tests passing (was 170; 4 removed tests exercised legacy-only
code paths).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@WhatsYourWhy WhatsYourWhy merged commit 38c12b9 into main Apr 19, 2026
9 checks passed
WhatsYourWhy added a commit that referenced this pull request Apr 19, 2026
## Summary

Cuts v0.3.0. Three things:

1. **License → MIT.** The prior bespoke "source-available, no execute"
   clause actively discouraged engagement with a public-portfolio repo.
   Replaced with standard MIT.
2. **Version bump 0.2.0 → 0.3.0** in \`pyproject.toml\`,
   \`temporal_gradient/__init__.py\`, and the version-check test. The
   merged cleanup PRs (#128, #129, #130) were breaking on the API
   surface (removed \`salience_mode\` kwargs, \`validate_packet\` alias,
   moved entrypoints), so this is 0.x-minor-bump territory.
3. **CHANGELOG rewrite.** The Unreleased block was stale — referenced
\`docs/CANONICAL_VS_LEGACY.md\` and \`docs/archive/\` (both deleted) and
   documented a \`chronolog\` typo alias that's also gone. Replaced with
   a dated v0.3.0 section covering the full cleanup pass, plus a
   migration checklist for the breaking changes.

Also applied **out of band** (repo settings, not a file change):

- **Squash-merge set as the only allowed merge method** on
  \`WhatsYourWhy/The-Temporal-Gradient\` (merge commits + rebase
  disabled).
- **Squash commit title** defaults to PR title; **squash commit
  message** defaults to PR body. Auto-merge and delete-branch-on-merge
  enabled.
- Net effect: every future PR — including \`claude/...\`,
\`codex/...\`, and \`alert-autofix-*\` bot branches — lands as a single
  clean commit named after the PR title. \`git log --oneline\` will tell
  an engineering story going forward.

Historical bot merges on \`main\` are left as-is (rewriting merged
history isn't worth it).

Supersedes #131.

## Test plan

- [x] \`pytest -q\` → 166 passed locally
- [x] CI green on 3.10 / 3.11 / 3.12
- [x] After merge: tag \`v0.3.0\` and create a GitHub release pointing
      at the new CHANGELOG section

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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