Commit Graph
149 Commits
Author SHA1 Message Date
kawa 6bff8f3c0c feat(04-02): add render_uninstall and render_detect with Jinja2 templates
- render_uninstall(printer_name, driver_name, port_name): Remove-Printer/Driver/Port in safe order
- render_detect(printer_name): Get-Printer check with Write-Output + exit 0/1 Intune contract
- uninstall.ps1.j2: all Remove-* with -ErrorAction SilentlyContinue
- detect.ps1.j2: Intune detection contract template
2026-04-10 13:35:05 +02:00
kawa 0f213df92c test(04-02): add failing tests for render_uninstall and render_detect
- test_render_uninstall: asserts Remove-Printer/Driver/Port order + SilentlyContinue x3
- test_render_detect: asserts Get-Printer, Write-Output, exit 0, exit 1
2026-04-10 13:34:22 +02:00
kawa 8cb420107f docs(04-01): complete script generator install plan summary
- SUMMARY.md for phase 04 plan 01 (TDD install script generator)
- STATE.md: progress updated to 89%, decisions recorded, session updated
- ROADMAP.md: phase 4 plan progress updated (1/2 summaries)
- REQUIREMENTS.md: SCRPT-01, SCRPT-04, SCRPT-05 marked complete
2026-04-10 13:33:08 +02:00
kawa 8193e9dbbd feat(04-01): implement script_generator with install.ps1.j2 template
- Jinja2 Environment with FileSystemLoader, trim_blocks, lstrip_blocks
- render_install() with _duplex_map (LongEdge->TwoSidedLongEdge, ShortEdge->TwoSidedShortEdge)
- install.ps1.j2: WOW64 guard as first block (SCRPT-05)
- install.ps1.j2: SYSTEM/admin detection + UAC self-elevation (SCRPT-04)
- install.ps1.j2: pnputil two-step driver staging + Add-PrinterDriver (SCRPT-01)
- install.ps1.j2: idempotent port creation (Get-PrinterPort check)
- install.ps1.j2: idempotent printer creation (Get-Printer check)
- install.ps1.j2: Set-PrintConfiguration with duplex/color/paper/collate
- All 7 unit tests pass
2026-04-10 13:31:51 +02:00
kawa b4f2c64161 test(04-01): add failing tests for script_generator RED phase
- test_render_install_returns_string: basic smoke test
- test_render_install_contains_pnputil: SCRPT-01 pnputil + Add-PrinterDriver
- test_render_install_print_config: SCRPT-01 duplex mode translation
- test_render_install_wow64_guard: SCRPT-05 WOW64 relaunch guard
- test_render_install_uac_guard: SCRPT-04 SYSTEM vs user + UAC elevation
- test_render_install_idempotency: SCRPT-01 idempotency checks
- test_render_install_booleans: SCRPT-01 boolean rendering
2026-04-10 13:31:00 +02:00
kawaandClaude Opus 4.6 c7361bef18 docs(04): create phase plan for script generation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 13:27:14 +02:00
kawaandClaude Opus 4.6 a57ecb94d4 docs(phase-04): add research and validation strategy
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 13:22:20 +02:00
kawaandClaude Sonnet 4.6 20b95af524 docs(04): research phase 4 script generation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 13:21:03 +02:00
kawaandClaude Opus 4.6 f80f790360 docs(phase-03): complete phase execution and verification
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 13:14:54 +02:00
kawa 7c0ae66d39 docs(03-02): complete printer detail page plan summary
- 03-02-SUMMARY.md: printer detail page with driver info and regenerate placeholder
- STATE.md: advance position, record metrics and decisions
- ROADMAP.md: phase 03 marked complete (2/2 plans done)
- REQUIREMENTS.md: PRNT-10 marked complete
2026-04-10 13:05:55 +02:00
kawa cad664c0f6 feat(03-02): implement printer detail page with driver info and regenerate placeholder
- Add GET /printers/{printer_id} route to pages.py with LEFT OUTER JOINs on Client and Driver
- Create printer_detail.html full-page template showing all config fields and driver info
- Display "No driver assigned" when driver FK is null
- Add disabled "Regenerate Package" button (Phase 4 placeholder)
- Make printer names in printer_list.html clickable links to detail page
2026-04-10 13:04:52 +02:00
kawa 6e7892e862 test(03-02): add failing tests for printer detail page
- test_printer_detail_shows_driver: asserts driver name appears on detail page
- test_printer_detail_not_found: asserts 404 for missing printer ID
- test_printer_detail_no_driver: asserts graceful display when driver is None
2026-04-10 13:04:01 +02:00
kawa 3b644272e7 docs(03-01): complete printer and client CRUD plan summary
- 03-01-SUMMARY.md: documents printer/client CRUD, Alpine.js port derivation,
  HTMX partials, test isolation fix, and PRNT-01 through PRNT-09 requirements
- STATE.md: updated position, decisions, metrics, session record
- ROADMAP.md: phase 03 progress updated (1/2 plans complete)
- REQUIREMENTS.md: PRNT-01 through PRNT-09 marked complete
2026-04-10 12:57:43 +02:00
kawa 356c2ee690 feat(03-01): implement printer and client CRUD with HTMX/Alpine.js UI
- imptune/api/printers.py: POST /printers (all form fields, checkbox->bool,
  FK resolution), DELETE /printers/{id}, grouped list renderer with LEFT JOIN
- imptune/api/clients.py: POST /clients with duplicate-name handling
- imptune/api/pages.py: GET /printers and GET /clients page routes
- imptune/main.py: register printers + clients routers; close db on shutdown
- imptune/db/database.py: close existing connection before re-init (test isolation)
- templates: printers.html, clients.html, printer_form.html (Alpine.js port
  auto-derivation), printer_list.html (grouped by client), client_list.html
- tests/conftest.py: close test-thread db connection in fixture teardown
- tests/test_printer_crud.py: updated to use list(select().where()) for DB
  queries (avoids Peewee thread-local cursor caching across test boundaries)

Auto-fix [Rule 1 - Bug]: DB test isolation — Peewee thread-local connections
persisted across tests causing stale DB reads; fixed via conftest teardown and
lifespan db.close() on shutdown.
2026-04-10 12:56:09 +02:00
kawa 9bc26e377b test(03-01): add failing integration tests for printer and client CRUD
- test_create_printer_persisted: POST /printers + GET /printers
- test_create_printer_duplex/color_mode/paper_size/collate: field persistence
- test_create_client: POST /clients + GET /clients
- test_printer_grouped_by_client: client group heading in list
- test_create_printer_missing_name/invalid_ip: validation 400s
- test_delete_printer: DELETE /printers/{id} removes record
2026-04-10 12:50:00 +02:00
kawaandClaude Opus 4.6 e27d0285ac docs(03): create phase plan for printer configuration
Two plans covering PRNT-01 through PRNT-10: printer+client CRUD with
Alpine.js port derivation (plan 01), and printer detail page with
regeneration placeholder (plan 02).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 12:35:52 +02:00
kawa 17573fbf6d docs(03): add research and validation strategy 2026-04-10 12:29:02 +02:00
kawaandClaude Sonnet 4.6 4c53ecd5db docs(phase-03): research printer configuration phase
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 12:28:03 +02:00
kawaandClaude Opus 4.6 ded9d7a8c5 docs(phase-02): complete phase execution and verification
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 12:06:40 +02:00
kawa 0f669a90e1 docs(02-02): complete driver upload endpoint plan
- SUMMARY.md with deviations, decisions, metrics
- STATE.md: decisions logged, progress updated, session recorded
- ROADMAP.md: phase 02 marked complete (2/2 plans with summaries)
- REQUIREMENTS.md: DRV-01, DRV-03, DRV-04 marked complete
2026-04-10 12:03:43 +02:00
kawa c648fc5793 feat(02-02): add driver upload endpoint with INF parsing and dedup
- POST /drivers/upload: validates ZIP, parses INF, persists via DriverStore + Peewee
- SHA256 dedup: get_or_create prevents duplicate Driver records
- GET /drivers route added to pages.py with driver_data context
- drivers.router registered in main.py
- drivers.html template with HTMX upload form
- partials/driver_list.html HTMX target with select dropdown and unused-file notice
- Fixed conftest client fixture to use context manager (triggers lifespan/init_db)
- [Rule 3] conftest: TestClient context manager required for lifespan trigger
- [Rule 1] drivers.py: dynamic DRIVERS_DIR read so monkeypatch works in tests
2026-04-10 12:02:00 +02:00
kawa 8ecfbf25a7 test(02-02): add failing integration tests for driver upload 2026-04-10 11:59:30 +02:00
kawa 17db5ce1a8 docs(02-01): complete INF parser plan
- 02-01-SUMMARY.md: TDD execution summary with deviation notes
- STATE.md: updated position, decisions, metrics, session
- ROADMAP.md: phase 2 progress updated (1/2 summaries)
- REQUIREMENTS.md: DRV-02 and DRV-05 marked complete
2026-04-10 11:57:54 +02:00
kawa 5056922890 feat(02-01): implement INF parser with encoding detection and token resolution
- ParsedInf dataclass: driver_names, inf_filename, architecture, has_cat_file, unused_files
- _detect_encoding(): BOM sniffing for UTF-16 LE/BE, UTF-8 BOM, cp1252 fallback
- _resolve_tokens(): regex %TOKEN% expansion from [Strings] section dict
- parse_inf(): RawConfigParser(strict=False) with optionxform=str to preserve case
- Architecture detection: NTamd64->x64, NTarm64->arm64, undecorated->x86, mixed->None
- Deduplication via set(); sorted() for deterministic dropdown order
- [Rule 1 - Bug] Fixed configparser key lowercasing by setting optionxform=str
- All 16 tests pass, zero regressions in 40-test suite
2026-04-10 11:56:51 +02:00
kawa 290106d573 test(02-01): add failing tests for INF parser
- 11 test functions covering all DRV-02 and DRV-05 behaviors
- _detect_encoding tests for UTF-16 LE, UTF-16 BE, UTF-8 BOM, ANSI/cp1252
- parse_inf tests: literal DriverDesc, %TOKEN% resolution, UTF-16 fixture
- Multi-model deduplication, architecture detection (x64/arm64/x86/mixed)
- .cat file detection, unused files detection, empty models section
- INF fixtures: sample.inf, sample_utf16.inf (UTF-16 LE BOM), sample_multi_model.inf
- imptune/services/__init__.py package marker
2026-04-10 11:55:41 +02:00
kawaandClaude Opus 4.6 9f5ee24811 docs(02-driver-management): create phase plan
Two plans: INF parser TDD (wave 1), upload endpoint + UI (wave 2).
Covers DRV-01 through DRV-05.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 11:48:02 +02:00
kawa 7930619404 docs(phase-02): add research and validation strategy 2026-04-10 11:43:51 +02:00
kawaandClaude Sonnet 4.6 13e098e244 docs(phase-02): research driver management phase
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 11:42:39 +02:00
kawaandClaude Opus 4.6 e4196f00da docs(phase-01): complete phase execution and verification
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 11:36:26 +02:00
kawa 4d57528963 docs(01-02): complete database schema and driver storage plan
- 01-02-SUMMARY.md: TDD execution results, decisions, self-check passed
- STATE.md: progress updated (100% phase 1), 3 decisions recorded
- ROADMAP.md: phase 1 marked Complete (3/3 summaries)
2026-04-10 11:33:20 +02:00
kawa 88d9c5f0d2 feat(01-02): wire init_db() into FastAPI lifespan startup
- Import init_db from imptune.db.database
- Call init_db() after DATA_DIR/DRIVERS_DIR creation in lifespan
- Database auto-initializes on every app startup via volume-mounted path
2026-04-10 11:31:57 +02:00
kawa dea41483b5 feat(01-02): add Peewee models, database init, and driver storage
- imptune/db/database.py: deferred SqliteDatabase with WAL + foreign_keys pragmas and init_db()
- imptune/db/models.py: full schema (Client, Driver, Printer, Icon) for phases 1-5
- imptune/storage/driver_store.py: SHA256 content-addressed DriverStore with dedup
- tests/test_db.py: 7 TDD tests covering all db and storage behaviors
2026-04-10 11:31:39 +02:00
kawa f614a3e480 docs(01-01): complete Docker scaffold and app shell plan
- 01-01-SUMMARY.md: FastAPI app shell, offline static assets, sidebar, 3-test suite
- STATE.md: advance plan to 01-01 complete, add TemplateResponse and lifespan decisions
- ROADMAP.md: mark 01-01 complete, update progress table (2/3 plans in Phase 1)
- REQUIREMENTS.md: mark INFRA-01 complete
2026-04-10 11:28:49 +02:00
kawa 34c7cb30f1 feat(01-01): add test scaffold, health and static asset tests, fix deprecated APIs
- requirements-dev.txt with pytest and httpx
- tests/conftest.py: client and tmp_data_dir fixtures
- tests/test_health.py: GET /health returns 200 with {"status": "ok"}
- tests/test_static.py: no CDN URLs in templates, dashboard returns 200
- Fix imptune/api/pages.py: use request= kwarg in TemplateResponse (Starlette compat)
- Fix imptune/main.py: replace deprecated on_event with asynccontextmanager lifespan
2026-04-10 11:26:48 +02:00
kawa 139503944b docs(01-03): complete .intunewin builder plan
- Add 01-03-SUMMARY.md with byte-level format validation results
- Update STATE.md: progress 33%, decisions recorded, session updated
- Update ROADMAP.md: phase 1 in progress (1/3 summaries)
- Mark INFRA-02 complete in REQUIREMENTS.md
2026-04-10 11:26:44 +02:00
kawa 25f82e67a2 feat(01-03): implement Python-native .intunewin file builder
- AES-256-CBC encryption with PKCS7 padding using pycryptodome
- HMAC-SHA256 of ciphertext prepended to blob (mac_key, 32 bytes)
- Encrypted blob layout: HMAC(32) + IV(16) + ciphertext
- IV is 16 bytes (corrected from STACK.md documentation error of 32 bytes)
- Detection.xml with all 8 EncryptionInfo sub-elements and correct namespace
- Inner ZIP uses DEFLATE compression; outer ZIP uses STORED compression
- All 14 byte-level tests pass including crypto roundtrip verification
2026-04-10 11:25:22 +02:00
kawa bd4e132f82 feat(01-01): create Docker scaffold, FastAPI app shell, and sidebar templates
- Dockerfile with python:3.12-slim-bookworm, curl downloads Pico CSS, HTMX, Alpine.js at build time
- docker-compose.yml with imptune_data:/data named volume and restart policy
- requirements.txt with all phase 1-5 dependencies
- imptune/config.py loading DATA_DIR/PORT from env with DB_PATH and DRIVERS_DIR derived paths
- imptune/main.py: FastAPI app with StaticFiles mount, health+pages routers, startup dir creation
- imptune/api/health.py: GET /health returning {"status": "ok"}
- imptune/api/pages.py: GET / returning dashboard.html with sync def handler
- imptune/templates/base.html: data-theme="auto", sidebar with 5 nav sections, /static/ paths only
- imptune/templates/dashboard.html: quick actions + empty state recent activity
- imptune/static/app.css: sidebar layout, active link highlight, quick action buttons
2026-04-10 11:25:08 +02:00
kawa 4d455e7b19 test(01-03): add failing tests for .intunewin byte-level format
- 14 tests covering outer ZIP structure, Detection.xml schema, key sizes
- Cryptographic roundtrip: HMAC-SHA256, AES-256-CBC decryption, file digest
- IV size assertion: must be 16 bytes (critical correction from RESEARCH.md)
- Tests serve as format specification for build_intunewin() implementation
2026-04-10 11:24:45 +02:00
kawaandClaude Opus 4.6 a8a27a44d3 docs(01): create phase 1 foundation plans
Three plans covering Docker scaffold, SQLite schema, and .intunewin spike.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 11:19:05 +02:00
kawaandClaude Opus 4.6 1370635e3f docs(01): add research and validation strategy
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 11:15:10 +02:00
kawaandClaude Sonnet 4.6 13d904f426 docs(01): research phase 1 foundation domain
Investigates Docker scaffold, Peewee schema patterns, and .intunewin
format for the foundation phase. Flags a critical IV size correction
(16 bytes, not 32 as stated in STACK.md) verified against svrooij.io.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 11:14:00 +02:00
kawaandClaude Opus 4.6 bd14e5cceb docs(state): record phase 1 context session
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 10:56:20 +02:00
kawaandClaude Opus 4.6 4ba70105d0 docs(01): capture phase context
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 10:56:11 +02:00
kawa 92c22dce8a docs: create roadmap (5 phases) 2026-04-10 10:45:42 +02:00
kawa 8ffcc8c675 docs: define v1 requirements 2026-04-10 10:42:40 +02:00
kawa 548ad9c8b2 docs: add domain research (stack, features, architecture, pitfalls, summary) 2026-04-10 10:36:02 +02:00
kawaandClaude Sonnet 4.6 59c384ed13 docs: complete project research
Adds STACK, FEATURES, ARCHITECTURE, PITFALLS, and SUMMARY research files
covering the full ImpTune technology stack, feature set, architecture
patterns, and critical pitfalls for the printer deployment package generator.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 10:34:25 +02:00
kawa 67a54673e2 chore: add project config 2026-04-10 10:26:29 +02:00
kawa 55c395a22c docs: initialize project 2026-04-10 10:25:16 +02:00