13 KiB
13 KiB
Directory Structure
crates/dever-core/src/lib.rs: separate syntaxparseand semanticcheckentry points.source.rs: UTF-8 original-source ownership, sorted.dever/.dever.mdloading, the single main/component/domain/role/topic classifier and byte-to-line/column conversion.markdown.rs: CommonMark top-level literaldeverandtypescript deverfence extraction, explicit closure and complete-declaration validation.markdown/contract/:.dever.mdheading/list model, one-section-per-declaration mapping and checked package/type/function documentation contracts.diagnostic.rs: source-located errors, related labels and rendering.lexer.rsandtoken.rs: lexical rules and preserved numeric spellings.syntax.rs: spanned syntax structures and operator precedence.parser.rs: declarations, types, patterns and linear statements.parser/expression.rs: expressions, postfix operations and collection construction, sharing the same parser cursor.check.rsandcheck/: register all declarations before bodies;check/layout.rsowns application layout validation,check/symbols.rsowns logical App aliases and role access, andcheck/api.rsvalidates HTTP routes after signatures resolve. Names, types, linear flow, expressions/operators/value construction, collection handlers and symbolic clause coverage retain separate owners. Cycle checks include nested expressions, handler calls and type references, collapsing physical files in one domain for dependency-cycle purposes.types.rsandhir.rs: nominal types, opaque Stream values, static handler signatures/targets, concrete typed expressions, normalized value-only clause domains and local slots. Only checking constructs executable HIR.wire.rs: shared checked wire schema, policy identity and interned concrete type graph.native/wire.rsandllvm/wire.rsemit concrete backend-specific encoders/decoders; runtimewire.rsowns bounded duplicate-aware JSON parsing and exact raw JSON output. API dispatch, Adapter settings and Job codecs consume this owner, never maintain independent allowed-type registries.specialize.rs: the single function-plus-handler specialization graph used by checking and native emission. It resolves forwarded handlers and rejects recursion after substitution.llvm.rsandllvm/: typed HIR function/coroutine kernels with shared ownership/fault helpers.network.rs,concurrency.rsandparallel.rsown streams/TCP, task composition and worker packs.http*.rslower protocol capabilities;system.rsowns system intrinsics andrender.rsterminal faults.application.rsowns compiler-generated CMD/HTTP/Job roots;api.rsstatic route/auth/permission callbacks;api_context.rsauth/request/Cookie/Upload capabilities;rest.rsgenerated Model REST;application_commands.rstyped tenant management/CMD normalization.jobs.rsowns typed payload dispatch, enqueue, binding and clock adapters;testing.rslinks case-local checked programs into one suite with indexed fault ownership.wire.rsowns concrete checked codecs,ports.rsselected Dever Adapter dispatch and Setting lifetime.database*.rs,orm*.rsandtransaction.rsown persistence codecs, shared SQL/DDL and hidden transactions. Runtimeapplication::Sessionowns config/lifecycle/database/tenant/migration/Job resources and closes after Scope drain within the same runtime.external.rsowns checked Worker calls and embedded resources;process_entry.rswraps callable roots in process main. Private and managed Linux CLI compilation are connected; formal six-target delivery remains unfinished.contracts.rsandcontracts/: post-HIR facts/domain proofs, failure obligations, transitive effects/dependencies and structural suggestions.api.rsowns public snapshots and application exposure analysis; CLIapi.rsowns explicit baseline file I/O.intrinsic.rs: the single name-to-operation mapping for system primitives; checker and emitter exhaustively match this enum. Official result choice shapes are checked before emission and variants resolve by name, not declaration index.native.rsandnative/: concrete record/choice generation, direct functions and collection loops, source-located failures, generated API/CMD/Job application roots and owned temporary build artifacts.native/build.rsowns native compilation and the single shared Cargo runtime target;native/build/cache.rsowns exact immutable inputs and executable cache identity;native/build/cleanup.rsowns marker-protected temporary directories and bounded local cleanup. CLI code must not reproduce those filesystem rules.native/api.rsemits checked static route dispatch, auth scope and response conversion. No generic runtime Value or interpreter dispatch.check/jobs.rsowns Job declarations, App payload contracts and static enqueue checking.native/jobs.rsowns concrete payload dispatch and queue initialization, reusing the shared wire and database owners.specialize::execution_reachableadds Job handlers as independent execution roots without adding synchronous call edges.crates/dever-runtime/src/: shared Decimal128/checked Int rules, ordered copy-on-write collections, Bytes, resource handles, pull-based Stream ownership, rendering and stdout. Native programs link this same runtime library; generated Rust is not a duplicate runtime implementation.crates/dever-backend-bridge/: private LLVM/LLD object/link owner. Its safe API uses explicit six-target selection; only privateffi.rsmay contain authorized unsafe calls. LLD calls are serialized; failed crash recovery terminates the private compiler worker before any cleanup/re-entry. Outputs are exclusively claimed before linking. The opt-inembeddedauthoring build requires a private LLVM 18 SDK; independentruntime-abiexports the canonical C runtime boundary without that SDK. HIR lowering remains in core, and neither build mode is a formal released compiler/target pack.- Runtime
async_stream.rsowns the shared async producer/cursor and closure;net.rsowns Tokio Socket/Listener, duplex I/O, deadlines and resource cancellation.task.rsowns the single runtime, structured tasks/Group and bounded async stream dispatch. File resources remain inresource.rs. - Runtime
job.rsowns transactional enqueue and trusted execution/component checks,job/store.rsowns private queue/cursor schema and fenced state changes, andjob/worker.rsowns bounded production/test dispatch.job/resources.rsowns invocation-local bindings, clock, initialization and tenant queue migrations.auth::authorize_permissionbinds the checked permission after authorization for both backends.cron.rssupplies the shared UTC parser.lifecycle.rsowns service-mode gating and signal-driven stop/drain; all work remains under the existing structured task owner. - Runtime
component.rsowns external Adapter resolution, bounded admission, Worker protocol, restart and shutdown.component/command.rsreuses that owner for one ordinary process per call, with binary I/O and caller-scope completion;dever.process.Outputis its checked result, never an OS process handle.check/ports.rssynthesizes external implementations from the existing Port owner;native/ports.rsemits concrete codecs and dispatch. Do not add per-language runtime supervisors or expose protocol JSON to App code. CLIworkers/command.rspackages domain-owned ELF/resources and reusesworkers/elf.rswith native Python library validation. - Runtime
external.rsowns verified embedded external-resource extraction below the executable's privatedata/cache/lib/<digest>root. It is a packager primitive, not a registry client or shared-cache writer. - Runtime
http/owns Hyper HTTP/1, bounded messages, streaming reply/session ownership and connection deadlines. Runtimeapi.rsadapts typed inputs/JSON envelopes and reuses HTTP serving.sse.rsowns event encoding;websocket.rsreuses tokio-tungstenite. TCP and WebSocket share privateendpoint.rsfor close/wakeup ownership. Nativehttp.rsconverts checked source records and statically bound handlers; no application business code belongs in the runtime. - Runtime
http/client.rsowns fixed-origin pooled requests and leases;client_driver.rsowns physical/request capacity, idle expiry and the one structured pool driver;client_body.rsowns pull-driven upload/download.tls.rsowns shared rustls configurations; the privatetransport.rsenum delegates TCP/TLS I/O for HTTP and WebSocket. library/**/*.dever: bundled official packages processed by the same parser/checker as user source. Compiler-assigned source origins, not filenames, authorize reserved namespaces;SourceMap::files()remains user-only whileget()also resolves bundled diagnostic spans.format.rsandformat/: shared AST-driven declaration layout, preserved per-block comment attachment and syntax-only canonical formatting. Markdown replaces only program-block interiors.reference.rsandreference/: opt-in HIR semantic evaluator and differential output/fault representation. Never link into production native programs.native/liveness.rsandnative/updates.rs: clause-local last-use analysis, safe record alias coalescing and scalar snapshots before aggregate consumption.types.rscaches nominal comparison/move/transfer properties after cycle validation.native/sequences.rs: conservative total-handler proof and eligible collection fusion; collection emission shares lazy Text splitting with the runtime.contracts/dependencies.rs: shared dependency order and reverse-caller work scheduling for contract summaries.check/cache.rs: per-thread last-result cache with complete source identity; bundled AST caching belongs tolib.rs/source.rs.native/build/cache.rs: native artifact identity, integrity validation and atomic publication.native/build.rsowns current runtime freshness, snapshots and isolated executable lifetimes.crates/dever-cli/src/main.rsandformat.rs: argument parsing, source loading, direct execution of the owned native program, local clean command adaptation and prepared/atomic source formatting writes.test_runner.rsis the single owner of application-test ordering, isolated native processes, captured output and temporary project cleanup.- CLI binary-private
compile.rsowns LLVM/object/LLD orchestration;worker.rsis the service-owned source compiler. Sharedtoolchain/runtime_pack.rsvalidates packs/snapshots without bridge imports;compilation.rsowns canonical input and staging validation, whileservice/owns authenticated transport and child supervision. Reuse corenative::compile_artifactfor private builds andNativeProgramfor caller-owned received executables.toolchain/packaging.rsowns deterministic native release assembly/signing from explicit author inputs;sdk/native-release.rsonly adapts its private author CLI. Rootruntime-packprofile owns the four-archive build settings.test/dever-cli-tests/support/llvm_inputs.rsholds explicit fixture SDK inputs, andsupport/daemon.rsholds the shared owned-daemon lifecycle; neither is a production input discovery mechanism. library/dever/json/: ordinary Dever JSON algorithm.library/dever/http.dever,sse.dever,websocket.deverandtls.dever: public protocol types/helpers and the native bridge; no duplicate source protocol stack.task.deverexposes runtime configuration, sleep and periodic streams.examples/cms/dever/andexamples/cms/md/: maintained CMS projects with equal declarations, schema, settings, business behavior and application tests. Generated API/CMD roots replacemodule/main.dever;api/admin/**andapi/front/**are assigned bysites.<key>.path. Both projects keep matchingtest/<component>/<domain>/<topic>cases andconfig/setting.json.examples/old/: archived pre-role-layout language and regression material. It is not a current application root and must not be presented as a directory or visibility template. Formal tests remain under roottest/.examples/README.md: current CMS commands and the archive boundary. Historical rejection fixtures keep their original diagnostics only when invoked by dedicated compiler-level tests, not as current application projects.test/dever-tests/tests/: permanent focused tests. Parser, checker and formatter sharetest/dever-tests/fixtures/core/complete_package.dever; public tests do not depend on private task records.
Core foundations, formatting, optional reference evaluation, official library follow-through and the SQLite/PostgreSQL static ORM have concrete implementations. Compiler distribution and self-hosting remain unshipped; validation evidence belongs to the active task, not this directory map. Compiler phase APIs are bootstrap internals, not an alternative program source format.
Use one owning implementation for each language rule. Do not introduce a generic parser framework, service layer or backend registry for a single concrete implementation.