docs: add plans/ directory for design and implementation plans#3317
docs: add plans/ directory for design and implementation plans#3317martin-belanger wants to merge 1 commit intolinux-nvme:masterfrom
Conversation
aaa2232 to
a992ae8
Compare
|
Does it make sense to name the document “Implementation plan — libnvme Python bindings redesign”? I was under the impression this plan describes how to “write” the Python generator from scratch. Sure, the whole API is still moving around a bit, but we are slowly getting there, I think. From then on, it should just document the requirements and design decisions needed to be able to “re-write” the generator. |
Introduce a new top-level `plans/` directory to host design and implementation plans for larger refactoring efforts. These documents capture the rationale, architecture, and step-by-step implementation strategy for non-trivial changes before code is written. Many of these plans are developed with the assistance of AI tools (e.g. ChatGPT for prompt refinement/review and Claude for code analysis and plan drafting), and then reviewed/edited by maintainers. The goal is to: - make design intent explicit and reviewable - reduce iteration during implementation - provide a reference for future contributors - allow the flexibility of having one person draft a plan and pass it on to another to execute it. No functional changes. Signed-off-by: Martin Belanger <martin.belanger@dell.com>
a992ae8 to
17ff02e
Compare
|
Good point on the naming. The "Implementation plan" framing is intentional here, though: this document is specifically structured to be fed to an AI assistant (e.g. Claude) to carry out the work phase by phase. Each phase is a discrete session — the level of detail (invariants, truth tables, code snippets) is there to give the AI enough context to implement correctly without needing a human to re-explain things at every step. I've added a short preface to the document making this explicit. Happy to also rename it to something like "Design & implementation plan" if that reads better, but I'd like to keep the phased structure since that's what drives the AI workflow. |
|
Closing. This is an AI-specific plan and as we just discussed does not belong in the main nvme-cli repo. A separate repo (e.g. nvme-cli-ai) would be a better place for this. |
Add initial design plan (v10) under
plans/This adds the current design/implementation plan for the Python bindings + accessor refactor under
plans/.@dwsuse - You previously reviewed an earlier version (v6). This update reflects a few targeted refinements rather than a redesign:
Key changes from v6 → v10
1) SWIG Access model (main change)
generated→ direct struct access (p->member)custom→ accessor functionnone→ no accessRationale: generated accessors are trivial; custom accessors handle the real logic.
2) Removed
!access:nested&fctx->cfg)3) Generated setter semantics (updated)
write=generatedis allowed for all supported typeschar *→free + strdupRationale: allows safe generation while keeping special cases in
customwhen needed.4) Lifecycle annotation (new)
Added struct-level lifecycle control:
!generate-lifecycle=generated!generate-lifecycle=customGenerated lifecycle:
char *) + structRationale: makes ownership and allocation explicit and generator-driven.
5) Generator + typemap alignment
generatedcustom%immutableforwrite=none6) Invariants clarified
A field is exposable if it has a usable access path:
read != noneorwrite != noneEverything else (dict-based API, callbacks, lifetime model, generator structure, etc.) remains unchanged.
The goal of these changes is to simplify the bindings, reduce unnecessary indirection, and make the generator behavior more explicit and predictable.
Happy to adjust anything if you think this is going in the wrong direction.