Skip to content

release: v26.4.1 - #35

Merged
discreteds merged 10 commits into
mainfrom
release/v26.4.1
Apr 18, 2026
Merged

release: v26.4.1#35
discreteds merged 10 commits into
mainfrom
release/v26.4.1

Conversation

@discreteds

Copy link
Copy Markdown
Member

Release v26.4.1

First production release from the 26.4.0 RC line.

Headlines

  • Restores canonical pydantic v2 assignment semantics on `MountainAshBaseSettings` (`validate_assignment=True`). `SecretStr` wrapping, enum coercion, and `AfterValidator` transforms now run on every post-construction `setattr`.
  • Removes the redundant `update_settings_from_dict` re-application from `init`; seven meta-field writes converted to explicit `object.setattr` for harness bookkeeping.
  • Adds regression guards for both `MountainAshBaseSettings` and `DescriptorProfile`.
  • Dev-tooling conformance: pins project venv path in `hatch.toml` and ships `pyrightconfig.json`.

Closes the `setattr-bypass-limitation` backlog item.

Breaking-ish behaviour change

Consumers that previously relied on raw-`setattr` bypassing pydantic validation on `MountainAshBaseSettings` subclasses may see stored values change shape (e.g. raw `str` → `SecretStr`). Subclasses that need to bypass validation intentionally must use `object.setattr`.

Known downstream workarounds in `mountainash-data` remain safe but dead:

  • `PySparkMode.setattr` override — now idempotent; removal tracked as follow-up.
  • `ConnectionProfile._default_driver_kwargs` `SecretStr` unwrap guard — still correct (takes the wrap branch); fallback dead.

Included PR

#34 — fix(base_settings): restore canonical pydantic assignment semantics (merged to develop)

Spec & Plan

  • `docs/superpowers/specs/2026-04-18-setattr-bypass-fix-design.md`
  • `docs/superpowers/plans/2026-04-18-setattr-bypass-fix.md`

Follow-up (post-release, separate PRs)

  • Remove `PySparkMode.setattr` override in `mountainash-data`
  • Remove `ConnectionProfile._default_driver_kwargs` SecretStr unwrap guard
  • Simplify adapter `str(enum_value)` defensive code
  • Close the backlog item
  • Merge `main` back into `develop` after this PR merges (per three-tier flow)

Verification

  • `hatch run test:test` — 368 passed, 0 failed
  • `hatch run ruff:check` — clean
  • `hatch run mypy:check` — at pre-change baseline (27 pre-existing errors, zero new)

🤖 Generated with Claude Code

discreteds and others added 9 commits April 18, 2026 20:14
Restores canonical pydantic v2 assignment semantics on
MountainAshBaseSettings (validate_assignment=True), removes
the redundant update_settings_from_dict re-application in
__init__, and converts seven meta-field writes to
object.__setattr__.

Addresses the setattr-bypass-limitation backlog item promoted
from mountainash-data.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Four-task TDD plan: xfail tests → validate_assignment flip →
__init__ refactor → regression guard. Plus a final verify +
PR-open task targeting develop per the three-tier flow.

Spec: docs/superpowers/specs/2026-04-18-setattr-bypass-fix-design.md

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codifies the contract to be restored by enabling
validate_assignment=True on MountainAshBaseSettings. Covers
SecretStr wrapping, StrEnum coercion, AfterValidator transform
on direct setattr, update_settings_from_dict, and the
DescriptorProfile integration path.

Marked xfail(strict=True) — will flip to expected-pass once
Change A lands.

Spec: docs/superpowers/specs/2026-04-18-setattr-bypass-fix-design.md
Sets model_config["validate_assignment"] = True on
MountainAshBaseSettings. Every setattr on an instance (including
via update_settings_from_dict, SettingsManager runtime overrides,
and apply_runtime_overrides) now runs the field's declared
validator pipeline — enum coercion, SecretStr wrapping,
AfterValidator transforms.

Addresses the setattr-bypass-limitation backlog item. Removes
the bypass mechanism that forced PySparkMode.__setattr__ and
ConnectionProfile SecretStr defensive code in consumer packages.

Flips the canonical-assignment test class out of xfail.

Spec: docs/superpowers/specs/2026-04-18-setattr-bypass-fix-design.md
…init__

super().__init__(**valid_attribute_kwargs) already applies kwargs
under full pydantic validation. The subsequent
update_settings_from_dict(valid_attribute_kwargs) call was
overwriting the validated values with raw input — the original
source of the setattr-bypass-limitation.

Replaces the call plus seven meta-field setattrs with explicit
object.__setattr__ writes. Meta-fields are harness bookkeeping,
not user config: bypassing validation is intentional and now
explicit. SETTINGS_SOURCE_KWARGS is stashed inline here;
update_settings_from_dict still stashes it for the
SettingsManager and apply_runtime_overrides callsites.

Adds a guard test for meta-field bookkeeping.

Spec: docs/superpowers/specs/2026-04-18-setattr-bypass-fix-design.md
Explicit assertion that model_config["validate_assignment"] is True
on MountainAshBaseSettings. Fails loudly if a future change turns
off the canonical assignment contract.

Also:
- Extends the Task-3 meta-field bookkeeping guard to cover a
  DescriptorProfile subclass, since descriptor profiles share the
  same __init__ path.
- Clarifies the __init__ comment block: exact spec filename, and
  explicit note that object.__setattr__ bypasses
  __pydantic_fields_set__ tracking (intentional, matches pre-Task-2
  behaviour — meta-fields are bookkeeping, not model state).

Spec: docs/superpowers/specs/2026-04-18-setattr-bypass-fix-design.md
- hatch.toml: set path = ".venv" under [envs.default] so the project
  env is non-ephemeral and predictable (per repo convention).
- pyrightconfig.json: new — pins venvPath/venv to ".venv", includes
  src + tests, basic type-checking mode, keyed to Python 3.10.
- .gitignore: ignore local .hiivmind/ (user-specific workspace
  symlinks to hiivmind-pulse-gh config outside the repo).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
fix(base_settings): restore canonical pydantic assignment semantics
First production release from the 26.4.0 RC line.

Headlines:
- Restores canonical pydantic v2 assignment semantics on
  MountainAshBaseSettings (validate_assignment=True). SecretStr
  wrapping, enum coercion, and AfterValidator transforms now
  run on every post-construction setattr.
- Removes the redundant update_settings_from_dict re-application
  from __init__; seven meta-field writes converted to explicit
  object.__setattr__ for harness bookkeeping.
- Adds regression guards for both MountainAshBaseSettings and
  DescriptorProfile.
- Pins project venv path in hatch.toml and ships pyrightconfig.json.

Closes the setattr-bypass-limitation backlog item.
Downstream consumer cleanup (PySparkMode.__setattr__,
ConnectionProfile SecretStr unwrap guard, adapter str(enum)
defensive code) tracked as follow-up.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Apr 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.90%. Comparing base (de7f967) to head (ae9b165).
⚠️ Report is 12 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #35      +/-   ##
==========================================
+ Coverage   96.67%   96.90%   +0.23%     
==========================================
  Files          31       31              
  Lines         841      841              
  Branches      109      109              
==========================================
+ Hits          813      815       +2     
+ Misses         16       15       -1     
+ Partials       12       11       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
C Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@discreteds
discreteds merged commit f339944 into main Apr 18, 2026
5 of 6 checks passed
@discreteds
discreteds deleted the release/v26.4.1 branch April 18, 2026 13:44
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