Skip to content
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
183d38c
docs: design single-file hangboard packages
Asherlc Aug 15, 2026
aee65cf
refactor: model physical hangboard holds
Asherlc Aug 15, 2026
e4f3d87
fix: enforce shared hold geometry paths
Asherlc Aug 15, 2026
7200730
refactor: embed Compact II hold geometry
Asherlc Aug 15, 2026
54f87ba
refactor: discover hangboards by directory
Asherlc Aug 15, 2026
efe8f30
fix: complete directory-discovered board integration
Asherlc Aug 15, 2026
97284bf
feat: add Beastmaker 1000 holds
Asherlc Aug 15, 2026
e2c0ce9
feat: add Beastmaker 2000 holds
Asherlc Aug 15, 2026
fd09fd1
feat: add deWoodstok Woodbord holds
Asherlc Aug 15, 2026
8cc0099
feat: add Escape Beta 22 holds
Asherlc Aug 15, 2026
f077a8f
feat: add Lattice Triple Rung holds
Asherlc Aug 15, 2026
8741eb8
Merge origin/main into aquatic-frog
Asherlc Aug 17, 2026
39d0dd4
Restore missing board_artwork compatibility module
Asherlc Aug 17, 2026
166e568
Fix stale staging test fixtures and tolerate backup cleanup failure
Asherlc Aug 17, 2026
389fc59
Fix hold geometry bounds and aspect-ratio metadata mismatches
Asherlc Aug 17, 2026
a6a92d2
Update expected Hangboards directory count for Escape Beta 22
Asherlc Aug 17, 2026
72ac06c
Fix Swift build breaks from the main merge
Asherlc Aug 17, 2026
c6b8607
Add sourced hold depth/feature metadata for 4 new boards
Asherlc Aug 17, 2026
23afdc1
Pin BoardCatalog.defaultBoard to Compact II, update board-count test
Asherlc Aug 17, 2026
0ff7d43
Delete BoardDesignLanguage.swift and finish the physical-geometry ref…
Asherlc Aug 17, 2026
6ef9bfd
Merge origin/main (#173 board-package consolidation)
Asherlc Aug 17, 2026
f4939ae
Address still-applicable CodeRabbit findings on the git-actions endpo…
Asherlc Aug 17, 2026
fe0763e
Address CodeRabbit findings on the HangboardPipeline package
Asherlc Aug 17, 2026
a3ca621
Address remaining CodeRabbit findings across the pipeline, Workbench,…
Asherlc Aug 17, 2026
8a51e9f
Resolve remaining live CodeRabbit findings on PR #208
Asherlc Aug 17, 2026
fd85701
Address latest CodeRabbit review round on PR #208
Asherlc Aug 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:

defaults:
run:
working-directory: Tools/HangboardWorkbench
working-directory: Tools/HangboardPipeline

steps:
# actions/checkout v4.2.2
Expand All @@ -101,16 +101,24 @@ jobs:
with:
python-version: '3.11'
cache: pip
cache-dependency-path: Tools/HangboardWorkbench/pyproject.toml
cache-dependency-path: Tools/HangboardPipeline/pyproject.toml

# astral-sh/setup-uv v6
- name: Set up uv
uses: astral-sh/setup-uv@d0d8abe699bfb85fec6de9f7adb5ae17292296ff

- name: Validate canonical board packages
working-directory: ${{ github.workspace }}
run: scripts/hangboard-tools.sh packages validate --root Hangboards

- name: Install wheel-build prerequisites
run: python -m pip install 'setuptools>=68' wheel

- name: Install Python package and test dependencies
run: python -m pip install -e ".[dev]"

- name: Validate direct board packages
run: python -m pytest tests/test_board_package.py -q
- name: Verify unregistered image inventory
run: python -m pytest tests/test_generated_catalog_import.py -q
Comment thread
Asherlc marked this conversation as resolved.
Outdated

- name: Stage board packages into a temporary app resource root
working-directory: ${{ github.workspace }}
Expand All @@ -134,7 +142,7 @@ jobs:
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
with:
name: python-test-results-${{ github.run_id }}
path: Tools/HangboardWorkbench/pytest-results.xml
path: Tools/HangboardPipeline/pytest-results.xml
if-no-files-found: ignore

build-ios:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Task 2 review-fix report

Date: 2026-08-14

Status: complete

## Review findings and fixes

1. Plan-owned semantic mappings were being replaced by board-package data when the bundled plan library was loaded. Validation and resolution also reconstructed mappings from `TrainingBoard`, and the migration seed still read removed package semantics. The store now preserves the plan document unchanged, validation and resolution use `PlanLibraryDefinition.boardMappings`, and the migration fallback owns the exact existing Compact II mappings. The physical board package remains semantic-free.

2. Workbench discovery had a second, incompatible ID grammar, accepted dotted directory slugs, treated non-minimal directories as drafts, and exposed duplicate published board IDs. Discovery now uses the canonical catalog predicates, accepts canonical IDs containing `_`, restricts package slugs to the canonical flat slug grammar, accepts only an exact `assets/primary.png` draft, and diagnoses/removes every ambiguous published ID.

3. Canonical package materialization collapsed multi-piece holds onto repeated keys, repeated `pieceIndex = 0`, reported physical-hold counts as region counts, and used union hold bounds for each piece. Every geometry piece now receives a stable unique region key, integer ID, local piece index, and piece-specific bounds/anchor, while `metadata.holdID` preserves the physical hold identity. Stage 4 continues to group paths by physical hold and validation deduplicates semantic mappings by that identity.

4. Package replacement is rollback-safe but cannot be reader-atomic for raw filesystem readers because the existing directory is temporarily renamed away. The code and tests now state that boundary accurately. Workbench publication takes an exclusive lock on the stable `Hangboards` root inode and repository snapshots take a shared lock, so cooperating readers never observe the rename-away window.

## Test-first evidence

RED evidence was captured before each implementation change:

- Four focused Swift plan tests failed because `edge-19`/`edge-29` disappeared from the effective plan mappings and the fallback seed attempted to read package semantics.
- Six focused Python tests failed for extra-file drafts, incompatible slug/ID handling, duplicate IDs, repeated multi-piece keys and metadata, and a reader observing the package rename-away window.

GREEN verification:

- Focused Swift plan regressions: 4 passed (`PlanStorageTests` mapping preservation, migration fallback, validation authority, and resolver override).
- Directly impacted Python suites: 72 passed, 19 existing Pillow deprecation warnings.
- Full Task 2 Python set: 96 passed, 19 existing Pillow deprecation warnings.
- Workbench server suite: 120 passed.
- `git diff --check`: passed.

A broader `PlanStorageTests` + `BoardPackageStoreTests` Xcode run was time-boxed and stopped while still building; it emitted no test failure and did not reach the test runner. Its exact isolated simulator and derived data were deleted afterward. No broader-suite success is claimed here.

## Files changed

- `HangTen/Models/PlanStorage.swift`
- `HangTen/Models/TrainingModels.swift`
- `HangTenTests/PlanStorageTests.swift`
- `Tools/HangboardPipeline/src/hangboard_vectorizer/board_catalog.py`
- `Tools/HangboardPipeline/src/hangboard_vectorizer/board_library.py`
- `Tools/HangboardPipeline/src/hangboard_vectorizer/workbench_promotion.py`
- `Tools/HangboardPipeline/src/hangboard_vectorizer/workbench_validation.py`
- `Tools/HangboardPipeline/tests/test_board_library.py`
- `Tools/HangboardPipeline/tests/test_workbench_end_to_end.py`

## Remaining concern

Non-cooperating raw filesystem readers are outside the publication lock protocol and may still observe the rename-away interval. The supported Workbench reader path is coordinated and covered by a deterministic concurrency regression test.
35 changes: 19 additions & 16 deletions HangTen/Models/TrainingModels.swift
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,13 @@ enum HoldKind: String, CaseIterable, Codable, Hashable, Identifiable {
}
}

enum HoldCueStyle: String, Codable, Hashable {
case outerJug
case slot
case pinch
case rounded
}

/// Manufacturer routines often name a hold by function instead of by board
/// ID. Features let a board declare the closest physical match once, keeping
/// routine content unchanged as more boards are added.
Expand Down Expand Up @@ -392,6 +399,7 @@ struct BoardHold: Identifiable, Hashable {
sizeMillimeters: Int? = nil,
gripType: GripType? = nil,
fingerCapacity: Int? = nil,
cueStyle _: HoldCueStyle? = nil,
depthRangeMillimeters: ClosedRange<Int>? = nil,
features: Set<HoldFeature>? = nil
) {
Expand Down Expand Up @@ -781,9 +789,18 @@ enum BoardCatalog {

static let all = packageStore.boards

/// Generic plans (`boardID: nil`) are authored against the same board as
/// the legacy semantic-hold mappings; falls back to the first discovered
/// board if it is ever unavailable so a missing package fails loudly
/// instead of silently resolving generic targets against an unrelated
/// board.
static let defaultBoard: TrainingBoard = {
if let boardID = LegacyPlanSeedBoardMappings.all.first?.boardID,
let board = packageStore.board(id: boardID) {
return board
}
guard let board = all.first else {
fatalError("The bundled board library contains no completed boards.")
fatalError("The bundled board catalog contains no boards.")
}
return board
Comment thread
coderabbitai[bot] marked this conversation as resolved.
}()
Expand Down Expand Up @@ -1003,14 +1020,6 @@ enum MetoliusCycleBuilder {

/// Board-specific target vocabulary retained by the plan migration seed.
/// Physical board packages intentionally contain no training-plan semantics.
extension BoardMappingDefinition {
func unknownHoldIDs(on board: TrainingBoard) -> Set<String> {
let boardHoldIDs = Set(board.holds.map(\.id))
let mappedHoldIDs = Set(semanticHolds.values.flatMap(\.holdIDs))
return mappedHoldIDs.subtracting(boardHoldIDs)
}
}

enum LegacyPlanSeedBoardMappings {
static let all = [
BoardMappingDefinition(
Expand Down Expand Up @@ -1077,13 +1086,7 @@ enum LegacyPlanSeedCatalog {
matches.count == 1,
"Expected exactly one discovered board with ID \(boardID)."
)
let board = matches[0]
let missingHoldIDs = exactTargetMapping.unknownHoldIDs(on: board)
precondition(
missingHoldIDs.isEmpty,
"Plan mapping for board \(boardID) references unknown hold IDs: \(missingHoldIDs.sorted())."
)
return board
return matches[0]
}

private static func exactTarget(
Expand Down
4 changes: 4 additions & 0 deletions HangTen/Views/DesignSystem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ extension Color {
static let hangGreenDark = Color(red: 0.235, green: 0.405, blue: 0.240)
static let hangCream = Color(red: 0.996, green: 0.988, blue: 0.958)
static let hangLine = Color(red: 0.870, green: 0.850, blue: 0.790)
static let hangWood = Color(red: 0.760, green: 0.590, blue: 0.380)
static let hangWoodLight = Color(red: 0.925, green: 0.820, blue: 0.625)
static let hangWoodDeep = Color(red: 0.250, green: 0.165, blue: 0.095)
static let hangWoodShadow = Color(red: 0.420, green: 0.275, blue: 0.155)

static let holdBlue = Color(red: 0.250, green: 0.545, blue: 0.785)
static let holdOrange = Color(red: 0.900, green: 0.425, blue: 0.205)
Expand Down
7 changes: 6 additions & 1 deletion HangTenTests/BoardSourceBoundaryTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ final class BoardSourceBoundaryTests: XCTestCase {

func testCatalogContainsExactlyRegisteredPackageBoards() {
let expectedIDs = [
"metolius.wood-grips-compact-ii"
"beastmaker-1000",
"beastmaker-2000",
"dewoodstok-woodbord",
"escape-beta-22",
"lattice-triple-rung",
"metolius.wood-grips-compact-ii",
]

XCTAssertEqual(
Expand Down
29 changes: 2 additions & 27 deletions HangTenTests/PlanStorageTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,6 @@ import XCTest
@testable import HangTen

final class PlanStorageTests: XCTestCase {
func testBoardMappingReportsOnlyHoldIDsMissingFromBoard() throws {
let board = try XCTUnwrap(
BoardCatalog.all.first { $0.id == "metolius.wood-grips-compact-ii" }
)
let mapping = BoardMappingDefinition(
boardID: board.id,
semanticHolds: [
"fixture-target": SemanticHoldMappingDefinition(
holdIDs: ["edge-19-left", "fixture.missing"]
)
]
)

XCTAssertEqual(
mapping.unknownHoldIDs(on: board),
Set(["fixture.missing"])
)
}

func testBuiltInPlanDataPreservesPlanOwnedMappingsAndResolvesEdge19() throws {
let packageStore = BoardCatalog.packageStore
let store = try PlanLibraryStore(
Expand Down Expand Up @@ -1239,10 +1220,7 @@ final class PlanStorageTests: XCTestCase {
let step = makeStep(
id: "semantic-target",
duration: 10,
targets: [
.semantic("fixture-overridden"),
.semantic("fixture-board-owned")
],
targets: [.semantic("fixture-overridden")],
segments: []
)

Expand All @@ -1261,14 +1239,11 @@ final class PlanStorageTests: XCTestCase {
)
let issues = library.validationIssues(availableBoards: [edgeOnlyBoard])

XCTAssertFalse(issues.contains { $0.path.hasPrefix("boards[0].semanticHolds") })
XCTAssertTrue(issues.contains {
$0.path == "boardMappings[0].semanticHolds.fixture-plan" &&
$0.message == "Hold kind \"pinch\" has no matching hold on board \"fixture.edge-only\"."
})
XCTAssertTrue(issues.contains {
$0.path == "plans[0].blocks[0].steps[0].targets[1]" &&
$0.message == "Unknown semantic target \"fixture-board-owned\" for board \"fixture.edge-only\"."
})
XCTAssertFalse(issues.contains { $0.message.contains("fixture-overridden") })
}

Expand Down
Binary file modified Hangboards/beastmaker-1000/assets/primary.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading