Skip to content

feat(settings): add typed occurrence operations - #119

Merged
Teakowa merged 2 commits into
mainfrom
codex/issue-111-settings-api
Aug 28, 2026
Merged

feat(settings): add typed occurrence operations#119
Teakowa merged 2 commits into
mainfrom
codex/issue-111-settings-api

Conversation

@Teakowa

@Teakowa Teakowa commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • expose typed authored settings values and structured operation errors
  • add source-preserving SettingDefinition::read and write operations over existing occurrences
  • resolve effective hero applicability from reviewed exceptional hero evidence while preserving unknown common evidence
  • reject wrong kinds, non-finite numbers, unknown enum/list members, and source-list resizing
  • document and integration-test typed read/write behavior with unrelated structure preservation

Verification

  • cargo fmt --all -- --check
  • cargo +1.85.0 clippy --workspace --all-targets --locked -- -D warnings
  • cargo test --workspace --all-targets --locked
  • cargo run --locked -p workshop-rs --bin workshop-catalog-gen -- check
  • git diff --check

Refs #111

Expose canonical identity lookup, source-located validation errors, and standard error traits for typed settings consumers. Add public API examples and regression coverage for invalid members and non-applicable targets.

Fixes #111
@Teakowa
Teakowa merged commit ea45518 into main Aug 28, 2026
4 checks passed
@Teakowa
Teakowa deleted the codex/issue-111-settings-api branch August 28, 2026 08:40

Teakowa commented Aug 28, 2026

Copy link
Copy Markdown
Contributor Author

Post-merge QA audit — changes required

A full audit of the merged #111 implementation found contract regressions and unsafe edit behavior. #111 should not remain completed yet.

Blocker

  1. Hero applicability is again inferred from locale/presentation data. hero_setting_applicability() uses GENERATED_HERO_SETTING_NAMES and non-empty localized strings to decide whether a hero/key is applicable. This directly contradicts ADR-0006 and the generated file's own contract: that projection is presentation-only, absence/emptiness is not an applicability fact, and locale label quality must never change applicability. Applicability needs independent reviewed semantic evidence or must remain Unknown.

  2. A narrower semantic target can silently edit a broader shared occurrence. applicability() intentionally allows Team -> Hero and TeamAbility -> HeroAbility narrowing. write() then accepts those narrower targets, but concrete_path() only substitutes placeholders that exist in the definition's source path. Calling write() on a common TeamAbility definition with a concrete HeroAbility target therefore edits the team/common setting, affecting multiple heroes, even though the caller supplied one hero target. The same problem exists for common Team definitions queried with Hero. A validated source-edit API must not silently widen the mutation scope.

Major

  1. Unknown applicability is treated as write-safe. ensure_target() accepts both Applicable and Unknown. For an evidence-insufficient target, write() therefore succeeds without surfacing that the applicability contract is unresolved. At minimum the edit operation needs an explicit unknown/inconclusive path rather than silently treating it as validated.

  2. The required evidenced numeric-clamp example is not backed by a catalog definition. Production catalog projection still constructs Number/Percent domains with NumericBounds::unknown(). The docs create an ad-hoc NumericBounds::new(0, 500) value instead of demonstrating an actual provenance-backed Workshop setting. That does not satisfy Expose typed settings query, validation, and source-preserving edit APIs #111's requested representative evidenced clamp API example and should not be presented as proof that the catalog exposes such evidence.

  3. The patch-oriented source-edit requirement remains unproven. write() mutates the SettingsNode tree in place and returns (). It preserves semantic tree structure, but it does not expose a source patch/edit over the original source. Expose typed settings query, validation, and source-preserving edit APIs #111 explicitly says source editing should be patch-oriented where provenance is available and whole-file regeneration must not be the default. This needs either a bounded source-edit contract or an explicit rebaseline of the issue; it should not be silently declared complete.

Goal evidence

There is also no durable downstream WrightKit consumer of definitions_by_id/the new typed operations visible in the org repositories yet; current code search finds the API only inside workshop-rs. That is not sufficient evidence for the Goal's real-consumer dogfood condition.

CI on the PR is green, but these are semantic/API-contract gaps not exercised by the current tests. #111 is being reopened and remains dependent on the corrected #110 contract.

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