Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
5f2580f
Initial plan
Copilot Oct 17, 2025
34f9722
Add board comparison database and viewer tool
Copilot Oct 17, 2025
5adb843
Add vanilla JS frontend and documentation, update main README
Copilot Oct 17, 2025
18b0cdd
Add example queries and deployment documentation
Copilot Oct 17, 2025
7c15967
Add enhanced board explorer with single board view, detailed comparis…
Copilot Oct 17, 2025
3dddcf4
Add comprehensive enhancement documentation
Copilot Oct 17, 2025
01b3fd0
Add comprehensive architecture documentation and test suite
Copilot Oct 17, 2025
602aa45
Add comprehensive testing guide documentation
Copilot Oct 17, 2025
676d7cb
Update frontend to use database-only, remove JSON dependency for API …
Copilot Oct 17, 2025
dbd7c9b
Implement all user feedback: libcst parser, multi-version docs, merma…
Copilot Oct 17, 2025
e6f9eeb
Add GitHub Actions workflow to test board comparison tools on changes
Copilot Oct 17, 2025
b99673e
board explorer - N-M relations
Josverl Oct 17, 2025
07c1f46
Enhance frontend with Font Awesome icons and accessibility
Josverl Oct 17, 2025
b2746ad
fix board names
Josverl Oct 17, 2025
38f28f4
fix contrast
Josverl Oct 17, 2025
f75dad1
Refactor board name formatting and enhance method signature display
Josverl Oct 17, 2025
e8f3ee5
fix navigation via query string
Josverl Oct 17, 2025
7ee20aa
rename pyscript version
Josverl Oct 17, 2025
7224b21
Enhance database schema and frontend to support constants and attribu…
Josverl Oct 17, 2025
2c07b78
Fix method deduplication bug and enhance database schema for complete…
Josverl Oct 17, 2025
2a8f065
chore
Josverl Oct 17, 2025
2531364
Add utility functions to format module and class summary counts, enha…
Josverl Oct 17, 2025
7db5569
Enhance module summary formatting to include deprecation notice for '…
Josverl Oct 17, 2025
5f5cbb3
Enhance board explorer UI to support version selection for boards and…
Josverl Oct 17, 2025
916f582
Refactor control layout and enhance version selection functionality i…
Josverl Oct 17, 2025
a4d0f5e
add version
Josverl Oct 17, 2025
3643644
Refactor compare control layout and enhance stats display for improve…
Josverl Oct 17, 2025
fb82ae4
trees everywhere
Josverl Oct 17, 2025
2472ec0
Add Base classes
Josverl Oct 17, 2025
dd7ac3e
local server to avoid caching issues
Josverl Oct 17, 2025
352ce75
chore: update docs
Josverl Oct 17, 2025
952ad3a
feat: add comprehensive decorator support in tree view and database s…
Josverl Oct 17, 2025
8c60f67
fix and update tests
Josverl Oct 17, 2025
cec3ca3
chore: clean broken testst
Josverl Oct 17, 2025
bec9938
Add comprehensive tests for decorator parsing and error handling in s…
Josverl Oct 18, 2025
f54aeb5
Checkpoint from VS Code for coding agent session
Josverl Oct 18, 2025
c8dd034
Phase 1: Create basic PyScript page with JSON loading
Copilot Oct 18, 2025
ea5d096
Phase 2: Add SQLite database integration via SQL.js
Copilot Oct 18, 2025
d07a12b
Phase 3: Add board utilities module and module list display
Copilot Oct 18, 2025
3c9bf95
Complete Phase 3 documentation and README
Copilot Oct 18, 2025
5429196
Simplify PyScript app: use database exclusively, remove JSON fallback
Copilot Oct 18, 2025
ff40812
Implement expandable module tree with classes and methods
Copilot Oct 18, 2025
6a997ef
Update documentation for expandable tree implementation
Copilot Oct 18, 2025
f15af3c
Fix dynamic loading for board_utils and SQL.js integration in PyScrip…
Josverl Oct 18, 2025
3ca060b
clean Sqlite-wasm example
Josverl Oct 18, 2025
980c23d
Add user_profiles table and enhance query demonstrations in main.py
Josverl Oct 18, 2025
8003066
Well working MicroPython SQLite-asm integration
Josverl Oct 19, 2025
c3d8a40
fixes and simplicifacion of Sql.js wasm database access
Josverl Oct 19, 2025
5c6360c
Remove obsolete frontend files and update SQL.js version in pyscript …
Josverl Oct 19, 2025
a2da23d
remove unused devcontainer to try to fix Agent CDN issues
Josverl Oct 19, 2025
b81394c
small steps
Josverl Oct 20, 2025
09f2e35
better layout - selection broken
Josverl Oct 20, 2025
bbb58ec
remove demo
Josverl Oct 20, 2025
f924bc1
Add Search
Josverl Oct 20, 2025
14cf6a1
Improve text alignment for class items and tree nodes
Josverl Oct 20, 2025
116af55
use more HTML templating
Josverl Oct 20, 2025
ad9cb2b
fix: strange icons
Josverl Oct 20, 2025
564a59b
DRY - no html in my python
Josverl Oct 20, 2025
6199424
reduce html overhead
Josverl Oct 20, 2025
a6998bc
fix: Share url and Query strings
Josverl Oct 20, 2025
618a6df
fix handiling of __init__ and \ in module paths
Josverl Oct 20, 2025
b503fb9
research 4 SQlite perf options
Josverl Oct 20, 2025
1e39621
research 4 SQlite perf options
Josverl Oct 20, 2025
c0fc877
add tests for build_database
Josverl Oct 20, 2025
a95f00d
refactor and clean up
Josverl Oct 20, 2025
c3a0d7f
chore: remove dead code
Josverl Oct 20, 2025
489b8ad
chore: format
Josverl Oct 20, 2025
9ab2d14
Merge pull request #842 from Josverl:copilot/vscode1760785586629
Josverl Oct 20, 2025
c920dff
fixed Search - step 1
Josverl Oct 20, 2025
8ce807a
Search results are a treeview
Josverl Oct 21, 2025
56aee05
more better treeview
Josverl Oct 21, 2025
5aff5d1
chore - cleanup docs etc
Josverl Oct 21, 2025
49f8be5
chore: less relevant stuff
Josverl Oct 21, 2025
0b1db01
refactor-sprint 1
Josverl Oct 21, 2025
cc7a36c
srefactor - sprint 2.0
Josverl Oct 21, 2025
f13aa49
refactor - sprint 2.5
Josverl Oct 21, 2025
ef20df4
refactor - base completed
Josverl Oct 21, 2025
9ac8437
Add GitHub Actions workflow for frontend deployment
Josverl Oct 21, 2025
cea4988
Add workflow_dispatch trigger to publish workflow
Josverl Oct 21, 2025
850ea87
sqlite_wasm: fix database path
Josverl Oct 21, 2025
d818fd5
path 2nd fix
Josverl Oct 21, 2025
4b1eca4
fix some refactor problems
Josverl Oct 21, 2025
46a89bb
refactor: clear tech dept
Josverl Oct 21, 2025
e55fb96
doc: update refactor state
Josverl Oct 21, 2025
f915102
chore: cleanup docs
Josverl Oct 21, 2025
ceb1e7b
update database with stdlib and package name and version
Josverl Oct 21, 2025
683f653
html:update icon
Josverl Oct 22, 2025
8ba3e39
html:Title and subtext
Josverl Oct 22, 2025
1bc308e
stub-explorer: cleanup
Josverl Oct 22, 2025
1158895
board explorer:update to pyscript 2025.10.1
Josverl Oct 22, 2025
880d340
webassembly 1.26.0: Remove faulty GENERIC folder
Josverl Oct 22, 2025
a2a1e85
Normalize version handling in stdlib processing and update help text
Josverl Oct 22, 2025
dca7dc5
Update board_comparison.db
Josverl Oct 22, 2025
980950c
Merge remote-tracking branch 'origin/main' into copilot/create-databa…
Josverl Oct 22, 2025
5986dde
Add instructions
Josverl Oct 22, 2025
afc18bc
chore: cleanup
Josverl Oct 22, 2025
bc6770f
use mpy-click
Josverl Oct 22, 2025
8f7aa4e
stub-explorer: Refactor tree node toggling to MicroPython click han…
Josverl Oct 22, 2025
2bf1f0b
Add WebAssembly findings and testing instructions; include images for…
Josverl Oct 22, 2025
a72e37f
Refactor event handling to use mpy-click attributes; migrate inline J…
Josverl Oct 23, 2025
a363c84
DB Sprint-1
Josverl Oct 23, 2025
9792026
DB refactore - Search page
Josverl Oct 23, 2025
85c9abf
DB refactor: Sprint 3 - explorer
Josverl Oct 23, 2025
b789bac
db refactor : Sprint 4
Josverl Oct 23, 2025
b87f83c
db refactor : Sprint 4.5
Josverl Oct 23, 2025
3444b9d
move Unique badge
Josverl Oct 23, 2025
30c346f
explorer: Add logging console module
Josverl Oct 24, 2025
b9c18b9
explorer: Document Findings
Josverl Oct 24, 2025
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
Binary file added .coverage
Binary file not shown.
21 changes: 0 additions & 21 deletions .devcontainer/Dockerfile

This file was deleted.

53 changes: 0 additions & 53 deletions .devcontainer/devcontainer.json

This file was deleted.

106 changes: 106 additions & 0 deletions .github/instructions/board_compare.instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
applyTo: "tools/board_compare/**"
description: Guidance for working on the board comparison scanner, database builder, and frontend data contract.
---

## Purpose
Compare MicroPython APIs (modules/classes/methods/params/constants) across boards & versions using:
- scan_stubs.py (libcst-based extractor)
- build_database.py (normalized SQLite builder)
- frontend/ (SQL.js-powered explorers & diff views)

## Agent tooling
MCP Server Usage (Agents)
- For DB queries: use Data Access MCP server rather than custom ad-hoc scripts; ensures consistent environment (no local sqlite binary reliance).
- For UI automation: use PlayWright MCP server; do not embed manual sleepsβ€”use explicit waits for selectors / network idle.

### Playwright Guidelines
- the pages can be server as http://localhost:8080 for testing via python. There is a VSCode task defined for this.
The server is a VSCode task - you can stop / start / restart is via the VSCode tasks
"label": "http.server: board explorer",
"detail": "Start the python board_explorer server on port 8080",
the frontend folder will be served as the root.
- Run headless by default; allow headed mode via env flag.

## Core Data Flow
stubs (.pyi) -> scan_stubs.py -> Pydantic models (models.py) -> build_database.py -> normalized SQLite (frontend/board_comparison.db) -> browser (SQL.js queries + UI state in URL).

## Key Conventions
- Parsing: libcst (not ast) to preserve structure & decorators; keep extraction logic idempotent.
- Hidden typing artifacts: _is_typing_related filters (keep logic consistent in both scanner & builder; update both if changed).
- Version normalization: input may be v1.26.0 / 1.26.0 / v1_26_0; display form stored as v1.26.0; directory form uses underscores (v1_26_0).
- Signature hashing: Methods must include context (module_id + class_id) + structural flags + ordered param signature. DO NOT revert to global method hashing or collisions reappear. If adding new structural properties (e.g., kw-only markers, decorators that change semantics), incorporate them BEFORE schema-dependent usage.
- Decorators: All decorator names captured (decorators list) plus boolean flags (classmethod/staticmethod/property) for backward compatibility.
- Positional-only params: Already supported (params.posonly_params). Maintain when refactoring.
- Optional parameters = any with default; variadics (*args/**kwargs) flagged is_variadic.
- Orphan cleanup required after deletions (see _cleanup_orphaned_records). Always call when pruning.

## Schema (stable contract)
Tables (CREATE order): boards, unique_modules, board_module_support, unique_classes, board_class_support, unique_class_bases, unique_class_attributes, board_class_attribute_support, unique_methods, board_method_support, unique_parameters, unique_module_constants, board_module_constant_support.
Do not rename columns casuallyβ€”frontend expects:
- boards(version, port, board, package_name, package_version)
- unique_methods(decorators JSON text, overloads int)
- unique_class_attributes / unique_module_constants(is_hidden int)

## Adding New Metadata
1. models.py: add field(s) (ensure Optional / defaults).
2. scan_stubs.py: populate in extractor.
3. build_database.py: extend schema creation + insertion helpers + hashing if it alters uniqueness.
4. Write migration logic: attempt ALTER TABLE with try/except OperationalError.
5. Update frontend queries (board-explorer.js) only after DB is reproducible.
6. Add test covering extraction + DB presence.

## Common Tasks
- Build DB for one version: python build_database.py --version v1.26.0 --db frontend/board_comparison.db
- Add stdlib: python build_database.py --version v1.26.0 --stdlib-dir ../../publish/micropython-stdlib-stubs --db frontend/board_comparison.db
- List versions: python build_database.py --list-versions --db frontend/board_comparison.db
- Clean just one version: python build_database.py --version v1.26.0 --clean-only
- Full reset (destructive): python build_database.py --reset-db
(Automations: prefer integrating into higher-level workflows instead of ad-hoc scripting.)

## Do / Avoid
DO:
- Keep hashing deterministic & short (current SHA256[:16] OK).
- Represent new many-to-many relationships with bridge tables (board_*_support style).
- Use MCP Data Store / JSON exports for queries instead of ad-hoc sqlite binaries (not installed).
- Preserve commented-out large JSON exporters unless reintroducing a streaming / paginated frontend.

AVOID:
- Re-enabling detailed JSON (168MB) in CIβ€”frontend should rely on SQLite.
- Introducing cascading deletes; rely on explicit cleanup to avoid silent data loss.
- Broad schema rewrites breaking published pages without version gating.

## Testing Focus
Add or update tests when:
- Signature hash logic changes (collision regression test).
- New decorator or parameter category added.
- Filtering rules for typing artifacts change (ensure visibility toggles unaffected).
- Version normalization edge cases (v1_2_3 vs 1.2.3 vs v1.2.3) remain stable.

## Performance Notes
- DB size target: ~5–6 MB for typical multi-version sets; watch growth when adding textual fields.
- Indexes already cover signature_hash, module/class/method lookup; add new indexes only if query latency demonstrated.

## Frontend Contract Highlights
- Methods: decorators stored as JSON string (parse client-side).
- Hidden fields: is_hidden (0/1) indicates suppress-by-default (typing noise).
- Overloads aggregated numeric count; if true overload resolution needed in future, store distinct signatures instead of bumping counter.

## Extensibility Guidelines
If adding inheritance expansion or resolution chains:
- Either create derived view or new table (eager resolution) – avoid N+1 traversal client-side for many boards.
If adding semantic diffing (signature compare):
- Precompute normalized signature text & store hash for O(1) equality checks.

## Debugging Tips
- Duplicate method unexpectedly? Check context parameters to _get_method_signature_hash_with_context.
- Missing positional-only params? Confirm params.posonly_params iteration not removed.
- Decorators empty? Verify _get_decorator_name path covers Attribute and Name nodes.

## Safety Checklist Before Commit
- Can rebuild DB from scratch with no errors.
- New columns guarded by ALTER TABLE try/except.
- Frontend still loads (open board-explorer.html locally with fresh DB).
- No unintended increase in DB size >20% without justification.

## When Unsure
Prefer adding a focused test & small schema extension over mutating existing semantics. Document any intentional hash or filtering changes in ARCHITECTURE.md.
Loading
Loading