cli: add explicit package source modules
Link manifest-selected source graphs with module-local names, qualified structs/enums/functions and task workers through ordinary AIR verification. Keep source inputs bounded, reject source symlinks and preserve explicit grants, diagnostics and deterministic canonical lowering. Integrate spec 12/15, RFC 0021, source reference budgets, roadmap, examples and CI coverage. Validate 579 conformance tests, unit tests, 76 source constructs, hosted smoke, 36 package CLI checks and task schedule stress.
This commit is contained in:
81 files changed
+1419
-234
No files matched your search
@@ -360,3 +360,30 @@ The usual enum rules apply: missing arm `E7004`, wrong enum/payload `E7005`, unk
|
||||
`std.utf8` validates bytes and decodes the next scalar with an explicit consumed count. `std.encoding.hex` and `std.encoding.base64` encode/decode into `mut` output slices; ordinary enum results expose malformed input and short capacity, leaving output unchanged on errors. Base64 accepts canonical padded standard encoding. Signatures and a checked example are in `/docs/library/std.md`.
|
||||
|
||||
`std.fmt.write_u64/i64/usize/isize` write decimal integers into supplied output slices; `WriteResult::ok(count)` / `short_output` expose capacity, with unchanged output on failure. Composition and signatures are in `/docs/library/std.md`.
|
||||
|
||||
## 11. Package modules
|
||||
|
||||
Declare package inputs explicitly in `aji.toml`:
|
||||
|
||||
```toml
|
||||
[package]
|
||||
entry = "main.aji"
|
||||
[modules]
|
||||
app.model = "model.aji"
|
||||
```
|
||||
|
||||
`model.aji` declares `module app.model`. Import it directly; functions, structs and enums use full names. Short names stay local to their defining module; imports grant no authority or transitive name visibility.
|
||||
|
||||
```aji
|
||||
module app.entry
|
||||
import app.model;
|
||||
|
||||
fn main() -> u64
|
||||
effects []
|
||||
{
|
||||
let pair = app.model.Pair { left: 20, right: 22 };
|
||||
return app.model.total(pair);
|
||||
}
|
||||
```
|
||||
|
||||
Use `aji check|lower|report|run|explore --manifest aji.toml`; `run` and `explore` instantiate manifest grants. A file-only command does not discover packages. Qualified workers work in `task.spawn(s, app.work.run, args)` with ordinary `move`, borrow and join rules. Missing/direct-import names: `E7002`; cycles/header mismatch/duplicates: `E7006`. Read `/docs/language/modules.md` for limits and file-loading rules. `lower --stats` counts entry source against combined AIR, so it is not a whole-package size metric.
|
||||
Reference in new issue
Block a user