feat(core): add resolveZones zone resolver (TV2.1)#27
Merged
Conversation
Pure resolver that maps a v2 config's zones into rooted, option-merged ResolvedZone[] placements. Foundation for Phase V2 per-zone execution (TV2.2). - absRoot = join(repoRoot, zone.path); root zone '.' resolves to repoRoot. - tier = zone override ?? catalog tier ?? 'standard' (deviation: resolveZones is pure over config and cannot see check.defaultTier; init always writes a tier). - options = catalog deep-merged with zone override (zone wins; thresholds and nested objects merge recursively). version/path/tier never leak into options. - Single-root configs need no special case: resolveConfig already normalizes an absent zones[] to one zone at '.' with every catalog id. Internal to core; not re-exported from index.ts. Covered by zones.test.ts (6).
yan-vidal
force-pushed
the
task/TV2.1-zone-resolver
branch
from
June 18, 2026 01:09
74a2c4e to
768bb73
Compare
…in CI - check-sdk minor (CheckContext.repoRoot, TV2.3); core patch (resolveZones, TV2.1). - New CI 'Changeset' job runs on pull_request and fails when a publishable package changed without a changeset, pointing at `changeset add --empty` for changes that need no release. Makes the release decision a standard PR gate.
The Changesets release PR (head changeset-release/main) consumes the changeset files, which would make the status gate fail and block releases. Skip the gate step on that branch; the job still runs and reports success.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TV2.1 — Zone model + resolver
Pure resolver that turns a v2 config's
zonesinto rooted, option-mergedResolvedZone[]. This is the foundation Phase V2 per-zone execution (TV2.2) builds on — and, with TV2.3, part of the path toward running Sentiness on polyglot monorepos (Rust + Go + JS).What it does
resolveZones(config, repoRoot)mapsResolvedConfig.zones→ResolvedZone[], each with:path(repo-relative,'.'for root) andabsRoot=join(repoRoot, path).checks: ResolvedCheckPlacement[], where each placement carriesid,tier, and mergedoptions.Resolution rules:
'standard'.thresholds/nested objects merge recursively, arrays/primitives replace). Resolution metadata (version,path,tier) never leaks intooptions.resolveConfigalready normalizes an absentzonesto one zone at'.'with every catalog id, soabsRoot === repoRoot.Internal to
core(the TV2.2 runner imports it directly); not re-exported fromindex.ts.Deviation from spec (flagged)
The TV2.1 interface types
placement.tieras a requiredTier, butresolveZonesis pure over config and cannot see a check'sdefaultTier, and the config tier is optional. Sinceinitalways writes atierper catalog entry, the resolver useszoneOverride.tier ?? catalogEntry.tier ?? 'standard'. The'standard'fallback only affects hand-written configs that omit a tier; TV2.2 can refine the effective tier againstcheck.defaultTierwhere theCheckinstance is in scope.Validation
pnpm --filter @sentiness/core typecheck✅zones.test.ts✅ — 6 cases: root normalization, absRoot join, multi-zone, override/threshold deep-merge, bare-id catalog tier, repeated check across zones.pnpm lint✅ (221 files)Relation to other PRs
Independent of #26 (TV2.3
repoRoot). TV2.2 depends on both this and #26.