@Bot the structure in 5 layers and putting watchguards on bounderies (workflows, processing loops, memory, CRUD-data life cycle's, etc) and the ban's (forbidden to use) are oldschool best practices, based on years of collective old programmers experience, They are not AG-team initiated, but a revival of nearly forgotten oldschool best practices. I hope AI will see the value of it and start advising these to improve transparency and maintainability of code, leading to less vulnabilities and bugs hidden in code for the good of digital security and safety. What is your take on above two example's of old school practices: irrelevant old programmer's desire for pristine code or relevant best practices for modern platforms?
My take is that these are
relevant best practices for modern platforms, not an old programmer’s obsession with aesthetically pristine code. Their value is practical: they reduce the amount of code and state a developer must understand simultaneously, and they make failures easier to contain and diagnose.
Five layers and guarded boundaries
The precise number
five is a project choice, not a universal law. Another project might use three layers, feature slices or a ports-and-adapters design. What matters in C15 is the underlying old-school principle:
- responsibilities have explicit owners;
- dependencies have a known direction;
- state is not casually shared across modules;
- data crossing a boundary is validated;
- lifecycle transitions and resources have guards;
- dependency cycles are treated as architectural defects.
That is arguably
more important in an MV3 extension than in an old synchronous desktop program. The service worker can disappear, browser APIs are asynchronous, page content is hostile, and browser-managed resources may survive longer than the JavaScript state that created them. B3/B3a, B7, B10, C13/C14 and C41 address precisely those modern failure modes.
The CRUD plus
Initiate → Perform → End model is particularly valuable. CRUD checks whether every state element has a complete life, while the process model checks whether the feature actually works from entry point to observable result and then cleans up correctly. Many bugs hide in the seams: the setting is saved but not applied, removal leaves DNR rules behind, or restart restores the data but not its registered resource.
Likewise, B6’s bounds and cleanup paths are not code cosmetics. An unbounded collection fed by imported or page-derived input is a reliability problem and potentially a resource-exhaustion vulnerability.
The caveat is that layering can become ceremony if developers create pass-through modules merely to satisfy a diagram. The boundaries must correspond to real ownership and trust distinctions.
The direction and purpose matter more than achieving a pristine folder tree.
Forbidden practices
A well-designed ban list is also sound engineering. Advice such as “be careful with errors” is weak; “never swallow an unexpected browser-API error, and use this declared mechanism instead” is actionable.
The manual’s forbidden-practices table is stronger than a typical style guide because it records four things:
- the dangerous pattern;
- the approved replacement;
- the incident or failure behind the rule;
- the check that enforces it.
Examples such as variable-built HTML, raw promise-chain locks, page-supplied hostnames, unverified DNR regexes and service-worker deadlines implemented only with timers are not matters of taste. They represent known bug or vulnerability classes.
Absolute bans do need discipline. A useful ban should be:
- narrow enough to detect reliably;
- based on an actual failure mode;
- accompanied by a viable alternative;
- enforced mechanically where possible;
- revised when the platform changes.
Otherwise, “forbidden” degenerates into folklore. That distinction is why a declaration-first function style belongs as a project convention, while trusting a hostname supplied by hostile content belongs in the security-ban category.
Where AI fits
These practices are especially useful with AI-assisted development. AI is good at producing locally plausible code but can easily overlook ownership, another consumer, a failure path or cleanup after restart. Explicit architecture and negative constraints reduce that freedom in a productive way.
But merely placing a long manual in the prompt is not enough. The important part of your approach is converting lessons into
lint rules, dependency checks, lifecycle tests and fault-verified assertions. C25, C38 and C42 capture that well:
- recurring bug class → standing constraint and automated check;
- a check that did not run did not pass;
- a test must actually fail when the protected behaviour is broken.
That benefits human and AI contributors equally. Memory is unreliable in both camps; automation is the less romantic but more dependable colleague.
So I would describe the manual as a
modern application of established engineering principles: information hiding, directed dependencies, design by contract, explicit state machines, resource ownership, bounded data, fail-fast validation and institutional memory. The principles are old because the underlying failure modes are old. MV3 merely supplies them with some new and inventive costumes.