Implement S6 doctor and A1 daily-board with fixtures.
Add operator health checks (make doctor) wrapping platform CLIs, and the fixtures-only daily board skill library with unit tests (make verify).
This commit is contained in:
@@ -1,5 +1,47 @@
|
||||
# `daily-board` (scaffold)
|
||||
# `daily-board`
|
||||
|
||||
**Status:** Not implemented. Implementation requires explicit **build**.
|
||||
**Status:** Implemented (fixtures only).
|
||||
|
||||
Intent: see [design/use-cases.md](../../design/use-cases.md) and [design/scenarios.md](../../design/scenarios.md).
|
||||
Builds a structured daily board from scheduling data: appointments, gaps, confirmation flags, and summary.
|
||||
|
||||
## What it does
|
||||
|
||||
- Loads appointment data from fixture JSON files
|
||||
- Computes gaps between appointments (≥30 min)
|
||||
- Flags appointments needing client confirmation
|
||||
- Labels all output as `📋 FIXTURE DATA` — never silent fake live data
|
||||
- Outputs structured text or JSON
|
||||
|
||||
## Quick start
|
||||
|
||||
```bash
|
||||
# Text output (default)
|
||||
python skills/daily-board/scripts/build_board.py
|
||||
|
||||
# JSON output
|
||||
python skills/daily-board/scripts/build_board.py --format json
|
||||
```
|
||||
|
||||
## Files
|
||||
|
||||
| Path | Purpose |
|
||||
|------|---------|
|
||||
| `SKILL.md` | Skill spec and usage |
|
||||
| `scripts/build_board.py` | CLI entrypoint |
|
||||
| `../../skills/_lib/lumina_skills/domain.py` | Domain types |
|
||||
| `../../skills/_lib/lumina_skills/board_builder.py` | Board builder logic |
|
||||
| `../../skills/_lib/lumina_skills/providers/scheduling/fixture_provider.py` | Fixture loader |
|
||||
| `../../data/fixtures/scheduling/` | Fixture JSON files |
|
||||
|
||||
## Design references
|
||||
|
||||
- Use case: [A1 — Morning / day board](../../design/use-cases.md)
|
||||
- Scenario: [S8 — Morning board on WhatsApp](../../design/scenarios.md)
|
||||
- Deterministic boundary: [design/det-vs-inf.md](../../design/det-vs-inf.md)
|
||||
|
||||
## Future
|
||||
|
||||
- Live Vagaro adapter (S5)
|
||||
- Live Square adapter (S3)
|
||||
- Staff filtering
|
||||
- Multi-day boards
|
||||
|
||||
@@ -1,18 +1,95 @@
|
||||
---
|
||||
name: daily-board
|
||||
description: "Today's salon board: appointments, tasks, and priorities"
|
||||
description: "Today's salon board: appointments, gaps, and confirmation flags"
|
||||
domain: operations
|
||||
---
|
||||
|
||||
# daily-board
|
||||
|
||||
Today's salon board: appointments, tasks, and priorities.
|
||||
Today's salon board: appointments, gaps, and confirmation flags.
|
||||
|
||||
## Description
|
||||
|
||||
Pulls together the day's schedule, pending tasks, and key metrics into a single board view for the salon owner.
|
||||
Builds a structured daily board from scheduling data showing:
|
||||
- **Appointments** — time, client, service, staff, status
|
||||
- **Gaps** — unbooked slots ≥30 minutes between appointments
|
||||
- **Confirmation flags** — appointments that still need client confirmation
|
||||
- **Summary** — total booked time, gap time, appointment count
|
||||
|
||||
All data is labeled with its source. When using fixtures, output is clearly
|
||||
marked `📋 FIXTURE DATA` so the owner never sees silent fake live data.
|
||||
|
||||
## Data sources
|
||||
|
||||
| Source | Status | Label in output |
|
||||
|--------|--------|-----------------|
|
||||
| Fixtures (JSON) | ✅ Implemented | `📋 FIXTURE DATA` |
|
||||
| Vagaro | Not yet | `📅 LIVE DATA` (future) |
|
||||
| Square | Not yet | `📅 LIVE DATA` (future) |
|
||||
|
||||
## Constraints
|
||||
|
||||
- Deterministic facts from tools; inference for ranking and wording only.
|
||||
- Deterministic facts from fixtures; no model inference for board data.
|
||||
- No silent send or publish.
|
||||
- Cancelled appointments are excluded from the board view.
|
||||
- Gaps under 30 minutes are not shown (too short for a meaningful slot).
|
||||
- Output always labels fixture/offline — never silent fake live data.
|
||||
|
||||
## Usage
|
||||
|
||||
### CLI
|
||||
|
||||
```bash
|
||||
# Build board from fixtures (default demo data)
|
||||
python skills/daily-board/scripts/build_board.py
|
||||
|
||||
# Build board for a specific fixture file
|
||||
python skills/daily-board/scripts/build_board.py \
|
||||
--fixtures data/fixtures/scheduling/claire_bennett_2026-07-28.json
|
||||
|
||||
# Output as JSON
|
||||
python skills/daily-board/scripts/build_board.py --format json
|
||||
|
||||
# Specify date and salon name explicitly
|
||||
python skills/daily-board/scripts/build_board.py \
|
||||
--date 2026-07-28 --salon "Lumina Hair Studio & Spa"
|
||||
```
|
||||
|
||||
### Programmatic
|
||||
|
||||
```python
|
||||
from lumina_skills.providers.scheduling.fixture_provider import load_fixtures
|
||||
from lumina_skills.board_builder import build_board, format_board_text
|
||||
|
||||
appointments = load_fixtures("data/fixtures/scheduling/claire_bennett_2026-07-28.json")
|
||||
board = build_board(appointments, date="2026-07-28", salon_name="Lumina Hair Studio & Spa")
|
||||
print(format_board_text(board))
|
||||
```
|
||||
|
||||
## Output format
|
||||
|
||||
### Text (default)
|
||||
|
||||
Structured text with sections for appointments, gaps, confirmation flags, and summary.
|
||||
|
||||
### JSON
|
||||
|
||||
```json
|
||||
{
|
||||
"date": "2026-07-28",
|
||||
"salon_name": "Lumina Hair Studio & Spa",
|
||||
"source": "fixtures",
|
||||
"is_offline": true,
|
||||
"appointments": [...],
|
||||
"gaps": [...],
|
||||
"needs_confirmation": [...],
|
||||
"total_booked_minutes": 420,
|
||||
"total_gap_minutes": 120
|
||||
}
|
||||
```
|
||||
|
||||
## Design references
|
||||
|
||||
- Use case: [A1 — Morning / day board](../../design/use-cases.md)
|
||||
- Scenario: [S8 — Morning board on WhatsApp](../../design/scenarios.md)
|
||||
- Deterministic boundary: [design/det-vs-inf.md](../../design/det-vs-inf.md)
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Build a daily board from scheduling fixtures.
|
||||
|
||||
Usage:
|
||||
python build_board.py [--fixtures PATH] [--date YYYY-MM-DD] [--salon NAME] [--format text|json]
|
||||
|
||||
All data is labeled as fixture/offline — never silent fake live data.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import pathlib
|
||||
import sys
|
||||
|
||||
# Ensure the _lib package is importable regardless of cwd.
|
||||
_REPO_ROOT = pathlib.Path(__file__).resolve().parents[3]
|
||||
sys.path.insert(0, str(_REPO_ROOT / "skills" / "_lib"))
|
||||
|
||||
from lumina_skills.providers.scheduling.fixture_provider import (
|
||||
load_fixtures,
|
||||
load_fixture_metadata,
|
||||
)
|
||||
from lumina_skills.board_builder import build_board, format_board_text
|
||||
|
||||
# Default fixture: Claire Bennett sample day.
|
||||
_DEFAULT_FIXTURE = _REPO_ROOT / "data" / "fixtures" / "scheduling" / "claire_bennett_2026-07-28.json"
|
||||
|
||||
|
||||
def main() -> int:
|
||||
parser = argparse.ArgumentParser(
|
||||
description="Build a daily salon board from fixture data.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--fixtures",
|
||||
type=pathlib.Path,
|
||||
default=_DEFAULT_FIXTURE,
|
||||
help="Path to fixture JSON file (default: Claire Bennett sample day).",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--date",
|
||||
type=str,
|
||||
default=None,
|
||||
help="Override board date (YYYY-MM-DD). Defaults to fixture date.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--salon",
|
||||
type=str,
|
||||
default=None,
|
||||
help="Override salon name. Defaults to fixture salon_name.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--format",
|
||||
choices=["text", "json"],
|
||||
default="text",
|
||||
help="Output format (default: text).",
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
# Load fixture data.
|
||||
try:
|
||||
appointments = load_fixtures(args.fixtures)
|
||||
except FileNotFoundError as exc:
|
||||
print(f"Error: {exc}", file=sys.stderr)
|
||||
return 1
|
||||
except (json.JSONDecodeError, KeyError, ValueError) as exc:
|
||||
print(f"Error parsing fixture: {exc}", file=sys.stderr)
|
||||
return 1
|
||||
|
||||
# Load metadata for defaults.
|
||||
try:
|
||||
meta = load_fixture_metadata(args.fixtures)
|
||||
except (json.JSONDecodeError, KeyError, TypeError, ValueError) as exc:
|
||||
print(f"Warning: could not parse fixture metadata: {exc}", file=sys.stderr)
|
||||
meta = {}
|
||||
|
||||
date = args.date or meta.get("date", "unknown")
|
||||
salon_name = args.salon or meta.get("salon_name", "Unknown Salon")
|
||||
business_hours = meta.get("business_hours")
|
||||
|
||||
# Build the board.
|
||||
board = build_board(
|
||||
appointments=appointments,
|
||||
date=date,
|
||||
salon_name=salon_name,
|
||||
source="fixtures",
|
||||
business_hours=business_hours,
|
||||
)
|
||||
|
||||
# Output.
|
||||
if args.format == "json":
|
||||
print(json.dumps(board.to_dict(), indent=2))
|
||||
else:
|
||||
print(format_board_text(board))
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
Reference in New Issue
Block a user