Author SHA1 Message Date
cflmy deadf6edee ci: keep the contract lane short and make Bundle materialization idempotent
ci/woodpecker/pr/main Pipeline was successful
ci/woodpecker/push/main Pipeline was successful
Woodpecker executes the job commands as one shell script; the inline contract
block plus its trailing commands exceeded the runner's command buffer and the
last command was truncated mid-argument (the raw log shows the shell received
'python3 tools/c'). Move the lane into tools/ci/contract_lane.sh and keep the
CI commands short, preserving every check.

CI jobs share one workspace, so a second job saw 'output already exists' from
the first fetch. The helper now reuses an output only after verifying it against
the pin, builds into a temporary sibling and moves it into place atomically.

Refs cflmy/marqdo-cli#11
2026-11-27 01:21:46 +08:00
cflmy 72f57beee0 refactor: accept the ecosystem stdlib Bundle and remove the in-repo sources
ci/woodpecker/push/main Pipeline failed
ci/woodpecker/pr/main Pipeline failed
Phase B of ADR-0070 (issue #11): the CLI no longer owns standard-library
sources. The pin names the accepted ecosystem Bundle (marqdo-stdlib@0.2.0,
root commit + tree/alias digests); tools/ci/fetch_ecosystem_bundle.py
materializes it from the pinned root commit and stdlib gitlinks and verifies
the digests. bundle.py and the test harness require an explicit verified Bundle
for the accepted identity, and runtime discovery has no compile-time source
fallback in any profile.

Delete stdlib/ (modules, self-tests, aliases manifest). Module and domain tests
stay with their component owners; the CLI product lane now verifies the
external Bundle's public surface, std: resolution and official print/打印 alias
routing (tests/product-stdlib). Composition assertions whose owner is the
ecosystem (Table split, print-format equivalence) moved to the root Bundle
acceptance; the generic TCP round-trip stays a CLI test. Spawned-CLI tests name
the verified Bundle explicitly.

CI (Woodpecker + GitHub) materializes the pinned Bundle before product tests,
packaging and performance lanes; packaging and release take --stdlib-dir from
that artifact. Docs, STATUS, ADR-0070 and a Phase B evidence record updated.

Refs cflmy/marqdo#9, cflmy/marqdo-cli#11
2026-11-27 01:04:01 +08:00
cflmy f8b82d4143 merge: bring master (issue #13 boundary + SDK revert) into issue #11 Phase A
ci/woodpecker/pr/main Pipeline was successful
ci/woodpecker/push/main Pipeline was successful
2026-11-26 23:00:32 +08:00
cflmy f836f05998 docs: align the issue #13 snapshot with the SDK split revert
ci/woodpecker/push/main Pipeline was successful
- mark the old 0.12 remaining-work line as superseded by 0.13;
- record Woodpecker #112 success for the revert code commit in the evidence.

Docs-only change; no code/lock/protocol bytes move.
2026-11-26 21:28:24 +08:00
cflmy 98d256f5a2 refactor: keep the plugin SDK in the CLI workspace (revert split)
ci/woodpecker/push/main Pipeline was successful
The pre-stable line prioritizes atomic ABI/header/spec/SDK/loader changes over
a premature repository boundary. ADR-0073 supersedes ADR-0072:

- restore crates/marqdo-plugin-sdk as a contract-only CLI workspace crate
  (marqdo-plugin-abi + serde; no loader/host/worker dependency);
- restore tests/sdk-plugin and tools/ci/check_plugin_sdk.py, including the real
  CLI invocation and tampered-digest negative case;
- restore workspace/lock/architecture/dependency/docs/CI references; the SDK is
  a reviewed workspace member again and must not become a remote repo, mirror
  or submodule in this stage;
- ADR-0072 and the old issue #15 evidence are marked superseded; ADR-0073 and
  the split-revert evidence record the decision and the deleted remote repo;
- logical ADR-0071 boundaries are unchanged.

Workspace: 636 passed / 0 failed / 2 ignored; fmt, clippy, docs, architecture,
dependency, SDK gate and engine differential all PASS.

Refs #13, #15
2026-11-26 21:21:41 +08:00
cflmy 89acb709c6 Merge PR #16: independent plugin SDK repository
ci/woodpecker/push/main Pipeline was successful
Implements ADR-0072 / issue #15. SDK moved to cflmy/marqdo-plugin-sdk pinned to the CLI contract revision; CLI no longer carries or depends on it. CI push #108 and PR #110 green.
2026-11-26 20:13:11 +08:00
cflmy 3ab4aaa861 refactor: move the plugin SDK to its independent repository (issue #15)
ci/woodpecker/push/main Pipeline was successful
ci/woodpecker/pr/main Pipeline was successful
Implements ADR-0072 and the SDK physical migration tracked by issue #15:

- remove crates/marqdo-plugin-sdk, tests/sdk-plugin and the CLI-side
  check_plugin_sdk.py; the public cflmy/marqdo-plugin-sdk repository now owns
  the SDK workspace, lock, fixture, docs, AGENTS rules and CI definition.
- SDK consumes marqdo-plugin-abi at the exact CLI contract rev
  2585915e16906dac75f8571bed02e7f6f868c6bc; no path/submodule/copied contract.
- CLI does not depend on the SDK and must not re-add it as a workspace member
  or copy; dependency/architecture gates enforce this.
- docs: ADR-0072, CURRENT responsibility map/dependency graph, ADR-0071
  amendment, indexes, README, spec/plugin-abi, CI and developer entries.
- evidence: clean-clone SDK build/tests and real frozen 3.0.0-rc.4 CLI
  invocation (Int 42; tampered digest rejected).

CLI workspace: 631 passed / 0 failed / 0 ignored; fmt/clippy/docs/architecture/
dependency gates green.

Refs #15, #13
2026-11-26 19:48:24 +08:00
cflmy c769eafc60 docs: list the Phase A commits in the evidence record
ci/woodpecker/push/main Pipeline was successful
ci/woodpecker/pr/main Pipeline was successful
Add the smoke commit and the CI gate follow-up so the evidence names the
reviewed implementation sequence instead of a relative commit.
2026-11-26 15:59:07 +08:00
cflmy 2acaaefe77 ci: fold the independent build into the linux evidence gate
tools/ci/release_evidence.py accepts only its declared gate names; the
extra independent_build gate would have failed the release-evidence job.
The job still depends on independent-build and marks linux FAIL when it
does not pass.
2026-11-26 15:56:20 +08:00
cflmy 88ce91a9e1 docs: record the issue #11 Phase A state and evidence
Update STATUS, the architecture overview, README and tests/README with
the explicit Bundle input, pinned test/perf lanes and the independent
build. Add the Phase A evidence record: bundle identity, failure paths,
deterministic pack/package digests, independent build, archive smoke,
cold install and the 634-passed workspace gate. Phase B remains
explicitly unclaimed.
2026-11-26 15:52:04 +08:00
cflmy 0e1efc713e smoke: keep language-only execution after removing the Bundle
Moving the shipped stdlib aside must fail the print program with an
explicit diagnostic and still run a language-only program. The archive
smoke and the cold-install container now both call the factorial
example after the move, and the archive contract test pins the new
message.
2026-11-26 15:51:39 +08:00
cflmy ab6b6b1a23 ci: add the independent-build lane and pin the perf Bundle
Add tools/ci/independent_build.py: export HEAD without stdlib/, build
both shipped binaries with --locked, run a language-only check/call, and
require a stdlib-dependent run to fail closed with no sibling stdlib.
Add tests/independent/language-only.mq.md and run the lane as its own
GitHub job and Woodpecker step.

Perf runner resolves the pinned Bundle (--stdlib-dir/--bundle-pin),
exports it to every workload and records it in the report; GitHub and
Woodpecker lanes verify the pin and pass the product tests an explicit
Bundle. docs/ci.md and performance docs describe the lanes.
2026-11-26 15:25:40 +08:00
cflmy 3a68260cf2 tests: resolve one pinned Bundle and separate the loader lane
Add crates/cli/tests/support/stdlib.rs as the product/conformance test
resolver: explicit MARQDO_TEST_STDLIB_BUNDLE or the pinned path, always
verified against bundle-pin.json (name/version/commit/digests), with a
bad explicit override failing closed. Route stdlib_product,
stdlib_bundle, http, table, alias routing, p2_closure,
conformance_semantics and architecture_boundaries through it.

Loader unit tests now build small synthetic Bundles; discovery is split
into discover_with so the bad-override-no-fallback rule is testable.
2026-11-26 15:15:59 +08:00
cflmy 422b9de6d7 release: take the stdlib Bundle as one explicit, pinned input
package.py now requires --stdlib-dir and accepts --bundle-pin; it
verifies the manifest, required files, tree/alias digests and the pin
before staging, copies exactly that Bundle next to the binary, and
records stdlib.source{kind,repository,commit,path} in RELEASE_INFO.
Digest logic moves to tools/stdlib/bundle.py. GitHub/Woodpecker
release steps and docs/releasing.md pass the pinned input.
2026-11-26 15:07:29 +08:00
cflmy 1b9d9c4c26 stdlib: add one pinned Bundle resolver and explicit pack input
Add tools/stdlib/bundle.py + bundle-pin.json as the single source-side
Bundle identity (name, version, source commit, tree/alias digests) and
require tools/pack-stdlib.py --stdlib-dir instead of reading the
checkout implicitly. Missing input, missing manifest, digest/alias
mismatch, pin mismatch and symlinks fail closed; two packs are
byte-identical. Tests: tools/ci/test_stdlib_bundle_tools.py.
2026-11-26 15:00:26 +08:00
cflmy b9c72e1d2a docs: inventory stdlib source coupling and record the Phase A boundary
Record ADR-0070 (one explicit stdlib Bundle build input) and the
issue #11 Phase A inventory of every direct checkout-stdlib reference.
Baseline 4bbefc9; bundle source 2cbde54; no runtime contract change.
2026-11-26 14:54:11 +08:00
115 changed files with 35108 additions and 6135 deletions

No files matched your search

File diff suppressed because it is too large. Load diff
+940
View File
@@ -0,0 +1,940 @@
{
"schema": "marqdo.analysis",
"schema_version": 3,
"producer": {
"name": "marqdo",
"version": "3.0.0-rc.4",
"markdown_profile": "marqdo.md.v1"
},
"project": {
"root_id": "sha256:68fe7f20571673eda2078779c82fb2457f109e6c31da95b8b91b0513acb0fe15",
"identity_kind": "workspace_snapshot",
"entry_module_id": "root:default::85-nested-loop-control.mq.md",
"lock_digest": "",
"manifest_digest": "",
"stdlib": {
"version": "0.2.0",
"digest": "sha256:db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7",
"instance_id": "std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7"
},
"extensions": []
},
"modules": [
{
"id": "root:default::85-nested-loop-control.mq.md",
"package_instance_id": "root:default",
"relative_path": "85-nested-loop-control.mq.md",
"source_digest": "f0d654a033937dd5ab963cb021a155e2e01f05fc3a865af9907ebabbbc5a9b24",
"source": "## @exec main\n\n`外 = 0`\n\n`合计 = 0`\n\n`while 外 < 3`\n\n`外 = 外 + 1`\n\n`内 = 0`\n\n`while 内 < 4`\n\n`内 = 内 + 1`\n\n`if 内 == 1`\n\n`continue`\n\n`else if 内 == 3`\n\n`break`\n\n`end`\n\n`合计 = 合计 + 外`\n\n`end`\n\n`if 外 == 2`\n\n`continue`\n\n`end`\n\n`合计 = 合计 + 10`\n\n`end`\n\n`return 合计`\n",
"document": {
"children": [
{
"children": [
{
"children": [],
"kind": "text",
"literal": "@exec main",
"span": {
"end": 13,
"start": 3
}
}
],
"kind": "heading",
"level": 2,
"setext": false,
"span": {
"end": 13,
"start": 0
}
},
{
"children": [
{
"children": [],
"kind": "code",
"literal": "外 = 0",
"span": {
"end": 24,
"start": 15
},
"ticks": 1
}
],
"kind": "paragraph",
"span": {
"end": 24,
"start": 15
}
},
{
"children": [
{
"children": [],
"kind": "code",
"literal": "合计 = 0",
"span": {
"end": 38,
"start": 26
},
"ticks": 1
}
],
"kind": "paragraph",
"span": {
"end": 38,
"start": 26
}
},
{
"children": [
{
"children": [],
"kind": "code",
"literal": "while 外 < 3",
"span": {
"end": 55,
"start": 40
},
"ticks": 1
}
],
"kind": "paragraph",
"span": {
"end": 55,
"start": 40
}
},
{
"children": [
{
"children": [],
"kind": "code",
"literal": "外 = 外 + 1",
"span": {
"end": 72,
"start": 57
},
"ticks": 1
}
],
"kind": "paragraph",
"span": {
"end": 72,
"start": 57
}
},
{
"children": [
{
"children": [],
"kind": "code",
"literal": "内 = 0",
"span": {
"end": 83,
"start": 74
},
"ticks": 1
}
],
"kind": "paragraph",
"span": {
"end": 83,
"start": 74
}
},
{
"children": [
{
"children": [],
"kind": "code",
"literal": "while 内 < 4",
"span": {
"end": 100,
"start": 85
},
"ticks": 1
}
],
"kind": "paragraph",
"span": {
"end": 100,
"start": 85
}
},
{
"children": [
{
"children": [],
"kind": "code",
"literal": "内 = 内 + 1",
"span": {
"end": 117,
"start": 102
},
"ticks": 1
}
],
"kind": "paragraph",
"span": {
"end": 117,
"start": 102
}
},
{
"children": [
{
"children": [],
"kind": "code",
"literal": "if 内 == 1",
"span": {
"end": 132,
"start": 119
},
"ticks": 1
}
],
"kind": "paragraph",
"span": {
"end": 132,
"start": 119
}
},
{
"children": [
{
"children": [],
"kind": "code",
"literal": "continue",
"span": {
"end": 144,
"start": 134
},
"ticks": 1
}
],
"kind": "paragraph",
"span": {
"end": 144,
"start": 134
}
},
{
"children": [
{
"children": [],
"kind": "code",
"literal": "else if 内 == 3",
"span": {
"end": 164,
"start": 146
},
"ticks": 1
}
],
"kind": "paragraph",
"span": {
"end": 164,
"start": 146
}
},
{
"children": [
{
"children": [],
"kind": "code",
"literal": "break",
"span": {
"end": 173,
"start": 166
},
"ticks": 1
}
],
"kind": "paragraph",
"span": {
"end": 173,
"start": 166
}
},
{
"children": [
{
"children": [],
"kind": "code",
"literal": "end",
"span": {
"end": 180,
"start": 175
},
"ticks": 1
}
],
"kind": "paragraph",
"span": {
"end": 180,
"start": 175
}
},
{
"children": [
{
"children": [],
"kind": "code",
"literal": "合计 = 合计 + 外",
"span": {
"end": 205,
"start": 182
},
"ticks": 1
}
],
"kind": "paragraph",
"span": {
"end": 205,
"start": 182
}
},
{
"children": [
{
"children": [],
"kind": "code",
"literal": "end",
"span": {
"end": 212,
"start": 207
},
"ticks": 1
}
],
"kind": "paragraph",
"span": {
"end": 212,
"start": 207
}
},
{
"children": [
{
"children": [],
"kind": "code",
"literal": "if 外 == 2",
"span": {
"end": 227,
"start": 214
},
"ticks": 1
}
],
"kind": "paragraph",
"span": {
"end": 227,
"start": 214
}
},
{
"children": [
{
"children": [],
"kind": "code",
"literal": "continue",
"span": {
"end": 239,
"start": 229
},
"ticks": 1
}
],
"kind": "paragraph",
"span": {
"end": 239,
"start": 229
}
},
{
"children": [
{
"children": [],
"kind": "code",
"literal": "end",
"span": {
"end": 246,
"start": 241
},
"ticks": 1
}
],
"kind": "paragraph",
"span": {
"end": 246,
"start": 241
}
},
{
"children": [
{
"children": [],
"kind": "code",
"literal": "合计 = 合计 + 10",
"span": {
"end": 270,
"start": 248
},
"ticks": 1
}
],
"kind": "paragraph",
"span": {
"end": 270,
"start": 248
}
},
{
"children": [
{
"children": [],
"kind": "code",
"literal": "end",
"span": {
"end": 277,
"start": 272
},
"ticks": 1
}
],
"kind": "paragraph",
"span": {
"end": 277,
"start": 272
}
},
{
"children": [
{
"children": [],
"kind": "code",
"literal": "return 合计",
"span": {
"end": 294,
"start": 279
},
"ticks": 1
}
],
"kind": "paragraph",
"span": {
"end": 294,
"start": 279
}
}
],
"kind": "document",
"span": {
"end": 295,
"start": 0
}
},
"units": [
{
"id": "root:default::85-nested-loop-control.mq.md#",
"path": [],
"parent_id": null,
"kind": "root",
"name": "",
"level": 0,
"mode": "knowledge",
"mode_origin": "default",
"mode_source_unit_id": "root:default::85-nested-loop-control.mq.md#",
"heading_span": null,
"span": {
"start": 0,
"end": 295
},
"function": null
},
{
"id": "root:default::85-nested-loop-control.mq.md#main",
"path": [
"main"
],
"parent_id": "root:default::85-nested-loop-control.mq.md#",
"kind": "function",
"name": "main",
"level": 2,
"mode": "exec",
"mode_origin": "explicit",
"mode_source_unit_id": "root:default::85-nested-loop-control.mq.md#main",
"heading_span": {
"start": 0,
"end": 13
},
"span": {
"start": 0,
"end": 295
},
"function": "root:default::85-nested-loop-control.mq.md::main"
}
],
"anchors": [
{
"anchor": "main",
"unit_id": "root:default::85-nested-loop-control.mq.md#main"
}
],
"functions": [
{
"id": "root:default::85-nested-loop-control.mq.md::main",
"unit_id": "root:default::85-nested-loop-control.mq.md#main",
"local_name": "main",
"namespace": null,
"span": {
"start": 0,
"end": 294
},
"heading_span": {
"start": 0,
"end": 13
},
"signature": {
"kind": "inferred",
"params": []
},
"effects": [
"unknown"
],
"body": [
{
"kind": "assign",
"span": {
"end": 24,
"start": 15
},
"target": "外",
"value": {
"kind": "literal",
"span": {
"end": 0,
"start": 0
},
"type": "int",
"value": "0"
}
},
{
"kind": "assign",
"span": {
"end": 38,
"start": 26
},
"target": "合计",
"value": {
"kind": "literal",
"span": {
"end": 0,
"start": 0
},
"type": "int",
"value": "0"
}
},
{
"body": [
{
"kind": "assign",
"span": {
"end": 72,
"start": 57
},
"target": "外",
"value": {
"kind": "binary",
"left": {
"kind": "variable",
"name": "外",
"span": {
"end": 67,
"start": 64
}
},
"op": "add",
"right": {
"kind": "literal",
"span": {
"end": 0,
"start": 0
},
"type": "int",
"value": "1"
},
"span": {
"end": 71,
"start": 64
}
}
},
{
"kind": "assign",
"span": {
"end": 83,
"start": 74
},
"target": "内",
"value": {
"kind": "literal",
"span": {
"end": 0,
"start": 0
},
"type": "int",
"value": "0"
}
},
{
"body": [
{
"kind": "assign",
"span": {
"end": 117,
"start": 102
},
"target": "内",
"value": {
"kind": "binary",
"left": {
"kind": "variable",
"name": "内",
"span": {
"end": 112,
"start": 109
}
},
"op": "add",
"right": {
"kind": "literal",
"span": {
"end": 0,
"start": 0
},
"type": "int",
"value": "1"
},
"span": {
"end": 116,
"start": 109
}
}
},
{
"arms": [
{
"body": [
{
"kind": "continue",
"span": {
"end": 144,
"start": 134
}
}
],
"condition": {
"kind": "binary",
"left": {
"kind": "variable",
"name": "内",
"span": {
"end": 126,
"start": 123
}
},
"op": "eq",
"right": {
"kind": "literal",
"span": {
"end": 0,
"start": 0
},
"type": "int",
"value": "1"
},
"span": {
"end": 131,
"start": 123
}
},
"condition_span": {
"end": 132,
"start": 119
},
"span": {
"end": 132,
"start": 119
}
},
{
"body": [
{
"kind": "break",
"span": {
"end": 173,
"start": 166
}
}
],
"condition": {
"kind": "binary",
"left": {
"kind": "variable",
"name": "内",
"span": {
"end": 158,
"start": 155
}
},
"op": "eq",
"right": {
"kind": "literal",
"span": {
"end": 0,
"start": 0
},
"type": "int",
"value": "3"
},
"span": {
"end": 163,
"start": 155
}
},
"condition_span": {
"end": 164,
"start": 146
},
"span": {
"end": 164,
"start": 146
}
}
],
"kind": "branch",
"span": {
"end": 132,
"start": 119
}
},
{
"kind": "assign",
"span": {
"end": 205,
"start": 182
},
"target": "合计",
"value": {
"kind": "binary",
"left": {
"kind": "variable",
"name": "合计",
"span": {
"end": 198,
"start": 192
}
},
"op": "add",
"right": {
"kind": "variable",
"name": "外",
"span": {
"end": 204,
"start": 201
}
},
"span": {
"end": 204,
"start": 192
}
}
}
],
"condition": {
"kind": "binary",
"left": {
"kind": "variable",
"name": "内",
"span": {
"end": 95,
"start": 92
}
},
"op": "lt",
"right": {
"kind": "literal",
"span": {
"end": 0,
"start": 0
},
"type": "int",
"value": "4"
},
"span": {
"end": 99,
"start": 92
}
},
"condition_span": {
"end": 100,
"start": 85
},
"kind": "loop",
"span": {
"end": 100,
"start": 85
}
},
{
"arms": [
{
"body": [
{
"kind": "continue",
"span": {
"end": 239,
"start": 229
}
}
],
"condition": {
"kind": "binary",
"left": {
"kind": "variable",
"name": "外",
"span": {
"end": 221,
"start": 218
}
},
"op": "eq",
"right": {
"kind": "literal",
"span": {
"end": 0,
"start": 0
},
"type": "int",
"value": "2"
},
"span": {
"end": 226,
"start": 218
}
},
"condition_span": {
"end": 227,
"start": 214
},
"span": {
"end": 227,
"start": 214
}
}
],
"kind": "branch",
"span": {
"end": 227,
"start": 214
}
},
{
"kind": "assign",
"span": {
"end": 270,
"start": 248
},
"target": "合计",
"value": {
"kind": "binary",
"left": {
"kind": "variable",
"name": "合计",
"span": {
"end": 264,
"start": 258
}
},
"op": "add",
"right": {
"kind": "literal",
"span": {
"end": 0,
"start": 0
},
"type": "int",
"value": "10"
},
"span": {
"end": 269,
"start": 258
}
}
}
],
"condition": {
"kind": "binary",
"left": {
"kind": "variable",
"name": "外",
"span": {
"end": 50,
"start": 47
}
},
"op": "lt",
"right": {
"kind": "literal",
"span": {
"end": 0,
"start": 0
},
"type": "int",
"value": "3"
},
"span": {
"end": 54,
"start": 47
}
},
"condition_span": {
"end": 55,
"start": 40
},
"kind": "loop",
"span": {
"end": 55,
"start": 40
}
},
{
"kind": "return",
"span": {
"end": 294,
"start": 279
},
"value": {
"kind": "variable",
"name": "合计",
"span": {
"end": 293,
"start": 287
}
}
}
]
}
],
"imports": [],
"references": [],
"calls": [],
"resources": []
}
],
"diagnostics": []
}
+66
View File
@@ -0,0 +1,66 @@
{"kind":"stream.opened","payload":{"limits":{"max_observation_bytes":16777216,"max_observation_events":100000,"max_value_bytes":256},"observation":{"allow_text_values":false,"level":"structural","selected_parameters":[],"selected_variables":[],"values":false},"producer":{"name":"marqdo","version":"3.0.0-rc.4"}},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":0}
{"kind":"run.started","payload":{"entry":"root:default::85-nested-loop-control.mq.md::main","mode":"project","source":{"analysis_digest":"sha256:9ed92f781c37d2560803e5a67d35c1d26cf37637d6bd435fe70856bb38d9cc72","root_id":"sha256:68fe7f20571673eda2078779c82fb2457f109e6c31da95b8b91b0513acb0fe15"},"started_unix_ms":1795713596382},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":1}
{"kind":"call.enter","payload":{"frame_id":"f1","function_id":"root:default::85-nested-loop-control.mq.md::main","module_id":"root:default::85-nested-loop-control.mq.md","parent_frame_id":null,"span":null},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":2}
{"kind":"variable.assigned","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","name":"外","span":{"end":24,"start":15},"value_state":"not_requested","value_type":"Int"},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":3}
{"kind":"variable.assigned","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","name":"合计","span":{"end":38,"start":26},"value_state":"not_requested","value_type":"Int"},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":4}
{"kind":"loop.iteration","payload":{"decision":"continue","frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","span":{"end":55,"start":40}},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":5}
{"kind":"variable.assigned","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","name":"外","span":{"end":72,"start":57},"value_state":"not_requested","value_type":"Int"},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":6}
{"kind":"variable.assigned","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","name":"内","span":{"end":83,"start":74},"value_state":"not_requested","value_type":"Int"},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":7}
{"kind":"loop.iteration","payload":{"decision":"continue","frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","span":{"end":100,"start":85}},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":8}
{"kind":"variable.assigned","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","name":"内","span":{"end":117,"start":102},"value_state":"not_requested","value_type":"Int"},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":9}
{"kind":"branch.eval","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","result":true,"span":{"end":132,"start":119}},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":10}
{"kind":"control.continue","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","span":{"end":144,"start":134}},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":11}
{"kind":"loop.iteration","payload":{"decision":"continue","frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","span":{"end":100,"start":85}},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":12}
{"kind":"variable.assigned","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","name":"内","span":{"end":117,"start":102},"value_state":"not_requested","value_type":"Int"},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":13}
{"kind":"branch.eval","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","result":false,"span":{"end":132,"start":119}},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":14}
{"kind":"branch.eval","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","result":false,"span":{"end":164,"start":146}},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":15}
{"kind":"variable.assigned","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","name":"合计","span":{"end":205,"start":182},"value_state":"not_requested","value_type":"Int"},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":16}
{"kind":"loop.iteration","payload":{"decision":"continue","frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","span":{"end":100,"start":85}},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":17}
{"kind":"variable.assigned","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","name":"内","span":{"end":117,"start":102},"value_state":"not_requested","value_type":"Int"},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":18}
{"kind":"branch.eval","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","result":false,"span":{"end":132,"start":119}},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":19}
{"kind":"branch.eval","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","result":true,"span":{"end":164,"start":146}},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":20}
{"kind":"control.break","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","span":{"end":173,"start":166}},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":21}
{"kind":"branch.eval","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","result":false,"span":{"end":227,"start":214}},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":22}
{"kind":"variable.assigned","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","name":"合计","span":{"end":270,"start":248},"value_state":"not_requested","value_type":"Int"},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":23}
{"kind":"loop.iteration","payload":{"decision":"continue","frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","span":{"end":55,"start":40}},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":24}
{"kind":"variable.assigned","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","name":"外","span":{"end":72,"start":57},"value_state":"not_requested","value_type":"Int"},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":25}
{"kind":"variable.assigned","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","name":"内","span":{"end":83,"start":74},"value_state":"not_requested","value_type":"Int"},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":26}
{"kind":"loop.iteration","payload":{"decision":"continue","frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","span":{"end":100,"start":85}},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":27}
{"kind":"variable.assigned","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","name":"内","span":{"end":117,"start":102},"value_state":"not_requested","value_type":"Int"},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":28}
{"kind":"branch.eval","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","result":true,"span":{"end":132,"start":119}},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":29}
{"kind":"control.continue","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","span":{"end":144,"start":134}},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":30}
{"kind":"loop.iteration","payload":{"decision":"continue","frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","span":{"end":100,"start":85}},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":31}
{"kind":"variable.assigned","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","name":"内","span":{"end":117,"start":102},"value_state":"not_requested","value_type":"Int"},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":32}
{"kind":"branch.eval","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","result":false,"span":{"end":132,"start":119}},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":33}
{"kind":"branch.eval","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","result":false,"span":{"end":164,"start":146}},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":34}
{"kind":"variable.assigned","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","name":"合计","span":{"end":205,"start":182},"value_state":"not_requested","value_type":"Int"},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":35}
{"kind":"loop.iteration","payload":{"decision":"continue","frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","span":{"end":100,"start":85}},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":36}
{"kind":"variable.assigned","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","name":"内","span":{"end":117,"start":102},"value_state":"not_requested","value_type":"Int"},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":37}
{"kind":"branch.eval","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","result":false,"span":{"end":132,"start":119}},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":38}
{"kind":"branch.eval","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","result":true,"span":{"end":164,"start":146}},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":39}
{"kind":"control.break","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","span":{"end":173,"start":166}},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":40}
{"kind":"branch.eval","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","result":true,"span":{"end":227,"start":214}},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":41}
{"kind":"control.continue","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","span":{"end":239,"start":229}},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":42}
{"kind":"loop.iteration","payload":{"decision":"continue","frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","span":{"end":55,"start":40}},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":43}
{"kind":"variable.assigned","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","name":"外","span":{"end":72,"start":57},"value_state":"not_requested","value_type":"Int"},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":44}
{"kind":"variable.assigned","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","name":"内","span":{"end":83,"start":74},"value_state":"not_requested","value_type":"Int"},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":45}
{"kind":"loop.iteration","payload":{"decision":"continue","frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","span":{"end":100,"start":85}},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":46}
{"kind":"variable.assigned","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","name":"内","span":{"end":117,"start":102},"value_state":"not_requested","value_type":"Int"},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":47}
{"kind":"branch.eval","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","result":true,"span":{"end":132,"start":119}},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":48}
{"kind":"control.continue","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","span":{"end":144,"start":134}},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":49}
{"kind":"loop.iteration","payload":{"decision":"continue","frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","span":{"end":100,"start":85}},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":50}
{"kind":"variable.assigned","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","name":"内","span":{"end":117,"start":102},"value_state":"not_requested","value_type":"Int"},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":51}
{"kind":"branch.eval","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","result":false,"span":{"end":132,"start":119}},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":52}
{"kind":"branch.eval","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","result":false,"span":{"end":164,"start":146}},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":53}
{"kind":"variable.assigned","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","name":"合计","span":{"end":205,"start":182},"value_state":"not_requested","value_type":"Int"},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":54}
{"kind":"loop.iteration","payload":{"decision":"continue","frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","span":{"end":100,"start":85}},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":55}
{"kind":"variable.assigned","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","name":"内","span":{"end":117,"start":102},"value_state":"not_requested","value_type":"Int"},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":56}
{"kind":"branch.eval","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","result":false,"span":{"end":132,"start":119}},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":57}
{"kind":"branch.eval","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","result":true,"span":{"end":164,"start":146}},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":58}
{"kind":"control.break","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","span":{"end":173,"start":166}},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":59}
{"kind":"branch.eval","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","result":false,"span":{"end":227,"start":214}},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":60}
{"kind":"variable.assigned","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","name":"合计","span":{"end":270,"start":248},"value_state":"not_requested","value_type":"Int"},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":61}
{"kind":"loop.iteration","payload":{"decision":"exit","frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","span":{"end":55,"start":40}},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":62}
{"kind":"return","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","span":{"end":294,"start":279},"value_type":"Int"},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":63}
{"kind":"call.exit","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","span":null,"status":"return"},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":64}
{"kind":"run.completed","payload":{"status":"ok","value":{"decimal":"26","type":"int"},"value_type":"Int"},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":65}
@@ -0,0 +1 @@
{"events":[{"kind":"stream.opened","payload":{"limits":{"max_observation_bytes":16777216,"max_observation_events":100000,"max_value_bytes":256},"observation":{"allow_text_values":false,"level":"structural","selected_parameters":[],"selected_variables":[],"values":false},"producer":{"name":"marqdo","version":"3.0.0-rc.4"}},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":0},{"kind":"run.started","payload":{"entry":"root:default::85-nested-loop-control.mq.md::main","mode":"project","source":{"analysis_digest":"sha256:9ed92f781c37d2560803e5a67d35c1d26cf37637d6bd435fe70856bb38d9cc72","root_id":"sha256:68fe7f20571673eda2078779c82fb2457f109e6c31da95b8b91b0513acb0fe15"},"started_unix_ms":1795713596382},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":1},{"kind":"call.enter","payload":{"frame_id":"f1","function_id":"root:default::85-nested-loop-control.mq.md::main","module_id":"root:default::85-nested-loop-control.mq.md","parent_frame_id":null,"span":null},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":2},{"kind":"variable.assigned","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","name":"外","span":{"end":24,"start":15},"value_state":"not_requested","value_type":"Int"},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":3},{"kind":"variable.assigned","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","name":"合计","span":{"end":38,"start":26},"value_state":"not_requested","value_type":"Int"},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":4},{"kind":"loop.iteration","payload":{"decision":"continue","frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","span":{"end":55,"start":40}},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":5},{"kind":"variable.assigned","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","name":"外","span":{"end":72,"start":57},"value_state":"not_requested","value_type":"Int"},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":6},{"kind":"variable.assigned","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","name":"内","span":{"end":83,"start":74},"value_state":"not_requested","value_type":"Int"},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":7},{"kind":"loop.iteration","payload":{"decision":"continue","frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","span":{"end":100,"start":85}},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":8},{"kind":"variable.assigned","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","name":"内","span":{"end":117,"start":102},"value_state":"not_requested","value_type":"Int"},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":9},{"kind":"branch.eval","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","result":true,"span":{"end":132,"start":119}},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":10},{"kind":"control.continue","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","span":{"end":144,"start":134}},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":11},{"kind":"loop.iteration","payload":{"decision":"continue","frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","span":{"end":100,"start":85}},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":12},{"kind":"variable.assigned","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","name":"内","span":{"end":117,"start":102},"value_state":"not_requested","value_type":"Int"},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":13},{"kind":"branch.eval","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","result":false,"span":{"end":132,"start":119}},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":14},{"kind":"branch.eval","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","result":false,"span":{"end":164,"start":146}},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":15},{"kind":"variable.assigned","payload":{"frame_id":"f1","module_id":"root:default::85-nested-loop-control.mq.md","name":"合计","span":{"end":205,"start":182},"value_state":"not_requested","value_type":"Int"},"run_id":"20-1795713596362568889","schema":"marqdo.observation","schema_version":1,"seq":16},{"kind":"loop.iteration","payload":{"decisiLine truncated
+1
View File
@@ -0,0 +1 @@
{"events":[{"kind":"stream.opened","payload":{"limits":{"max_observation_bytes":16777216,"max_observation_events":100000,"max_value_bytes":256},"observation":{"allow_text_values":false,"level":"structural","selected_parameters":[],"selected_variables":[],"values":false},"producer":{"name":"marqdo","version":"3.0.0-rc.4"}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":0},{"kind":"run.started","payload":{"entry":"root:default::basic.mq.md::main","mode":"project","source":{"analysis_digest":"sha256:3e64eee5ba9686a578b5d5789075010d87177a727f7e54ac19fd61c99d7519d5","root_id":"sha256:0403dd889a7d44f0f3b2b823530c9301062d5ade2cd63329d3803abad55841f0"},"started_unix_ms":1795713570722},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":1},{"kind":"call.enter","payload":{"frame_id":"f1","function_id":"root:default::basic.mq.md::Execution Events fixture A.main","module_id":"root:default::basic.mq.md","parent_frame_id":null,"span":null},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":2},{"kind":"call.enter","payload":{"frame_id":"f2","function_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io.mq.md::io.写值","module_id":"root:default::basic.mq.md","parent_frame_id":"f1","span":{"end":72,"start":57}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":3},{"kind":"parameter.observed","payload":{"frame_id":"f2","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io.mq.md","name":"值","source":"provided","span":{"end":315,"start":312},"value_state":"not_requested","value_type":"Text"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":4},{"kind":"call.enter","payload":{"frame_id":"f3","function_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md::format.显示","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io.mq.md","parent_frame_id":"f2","span":{"end":422,"start":404}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":5},{"kind":"parameter.observed","payload":{"frame_id":"f3","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","name":"值","source":"provided","span":{"end":489,"start":486},"value_state":"not_requested","value_type":"Text"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":6},{"kind":"variable.assigned","payload":{"frame_id":"f3","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","name":"类别","span":{"end":701,"start":677},"value_state":"not_requested","value_type":"Text"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":7},{"kind":"branch.eval","payload":{"frame_id":"f3","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","result":false,"span":{"end":724,"start":703}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":8},{"kind":"branch.eval","payload":{"frame_id":"f3","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","result":true,"span":{"end":749,"start":743}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":9},{"kind":"branch.eval","payload":{"frame_id":"f3","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","result":false,"span":{"end":771,"start":750}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":10},{"kind":"branch.eval","payload":{"frame_id":"f3","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","result":true,"span":{"end":796,"start":790}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":11},{"kind":"branch.eval","payload":{"frame_id":"f3","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","result":true,"span":{"end":818,"start":797}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":12},{"kind":"return","payload":{"frame_id":"f3","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","span":{"end":832,"start":820},"value_type":"Text"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":13},{"kind":"call.exit","payload":{"frame_id":"f3","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::ioLine truncated
+316
View File
@@ -0,0 +1,316 @@
{"kind":"stream.opened","payload":{"limits":{"max_observation_bytes":16777216,"max_observation_events":100000,"max_value_bytes":256},"observation":{"allow_text_values":false,"level":"structural","selected_parameters":[],"selected_variables":[],"values":false},"producer":{"name":"marqdo","version":"3.0.0-rc.4"}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":0}
{"kind":"run.started","payload":{"entry":"root:default::basic.mq.md::main","mode":"project","source":{"analysis_digest":"sha256:3e64eee5ba9686a578b5d5789075010d87177a727f7e54ac19fd61c99d7519d5","root_id":"sha256:0403dd889a7d44f0f3b2b823530c9301062d5ade2cd63329d3803abad55841f0"},"started_unix_ms":1795713570722},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":1}
{"kind":"call.enter","payload":{"frame_id":"f1","function_id":"root:default::basic.mq.md::Execution Events fixture A.main","module_id":"root:default::basic.mq.md","parent_frame_id":null,"span":null},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":2}
{"kind":"call.enter","payload":{"frame_id":"f2","function_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io.mq.md::io.写值","module_id":"root:default::basic.mq.md","parent_frame_id":"f1","span":{"end":72,"start":57}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":3}
{"kind":"parameter.observed","payload":{"frame_id":"f2","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io.mq.md","name":"值","source":"provided","span":{"end":315,"start":312},"value_state":"not_requested","value_type":"Text"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":4}
{"kind":"call.enter","payload":{"frame_id":"f3","function_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md::format.显示","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io.mq.md","parent_frame_id":"f2","span":{"end":422,"start":404}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":5}
{"kind":"parameter.observed","payload":{"frame_id":"f3","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","name":"值","source":"provided","span":{"end":489,"start":486},"value_state":"not_requested","value_type":"Text"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":6}
{"kind":"variable.assigned","payload":{"frame_id":"f3","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","name":"类别","span":{"end":701,"start":677},"value_state":"not_requested","value_type":"Text"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":7}
{"kind":"branch.eval","payload":{"frame_id":"f3","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","result":false,"span":{"end":724,"start":703}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":8}
{"kind":"branch.eval","payload":{"frame_id":"f3","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","result":true,"span":{"end":749,"start":743}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":9}
{"kind":"branch.eval","payload":{"frame_id":"f3","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","result":false,"span":{"end":771,"start":750}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":10}
{"kind":"branch.eval","payload":{"frame_id":"f3","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","result":true,"span":{"end":796,"start":790}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":11}
{"kind":"branch.eval","payload":{"frame_id":"f3","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","result":true,"span":{"end":818,"start":797}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":12}
{"kind":"return","payload":{"frame_id":"f3","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","span":{"end":832,"start":820},"value_type":"Text"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":13}
{"kind":"call.exit","payload":{"frame_id":"f3","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io.mq.md","span":{"end":422,"start":404},"status":"return"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":14}
{"kind":"call.enter","payload":{"frame_id":"f4","function_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md::stream.写文本","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io.mq.md","parent_frame_id":"f2","span":{"end":430,"start":387}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":15}
{"kind":"parameter.observed","payload":{"frame_id":"f4","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","name":"文本","source":"provided","span":{"end":1178,"start":1172},"value_state":"not_requested","value_type":"Text"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":16}
{"kind":"call.enter","payload":{"frame_id":"f5","function_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md::format.字节长度","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","parent_frame_id":"f4","span":{"end":1418,"start":1391}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":17}
{"kind":"parameter.observed","payload":{"frame_id":"f5","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","name":"文本","source":"provided","span":{"end":46,"start":40},"value_state":"not_requested","value_type":"Text"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":18}
{"kind":"variable.assigned","payload":{"frame_id":"f5","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","name":"点","span":{"end":84,"start":51},"value_state":"not_requested","value_type":"List"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":19}
{"kind":"variable.assigned","payload":{"frame_id":"f5","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","name":"总字节","span":{"end":103,"start":86},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":20}
{"kind":"variable.assigned","payload":{"frame_id":"f5","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","name":"下标","span":{"end":119,"start":105},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":21}
{"kind":"loop.iteration","payload":{"decision":"continue","frame_id":"f5","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","span":{"end":149,"start":121}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":22}
{"kind":"variable.assigned","payload":{"frame_id":"f5","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","name":"码点","span":{"end":175,"start":151},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":23}
{"kind":"branch.eval","payload":{"frame_id":"f5","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","result":true,"span":{"end":194,"start":177}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":24}
{"kind":"variable.assigned","payload":{"frame_id":"f5","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","name":"总字节","span":{"end":225,"start":196},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":25}
{"kind":"variable.assigned","payload":{"frame_id":"f5","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","name":"下标","span":{"end":440,"start":417},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":26}
{"kind":"loop.iteration","payload":{"decision":"continue","frame_id":"f5","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","span":{"end":149,"start":121}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":27}
{"kind":"variable.assigned","payload":{"frame_id":"f5","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","name":"码点","span":{"end":175,"start":151},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":28}
{"kind":"branch.eval","payload":{"frame_id":"f5","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","result":true,"span":{"end":194,"start":177}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":29}
{"kind":"variable.assigned","payload":{"frame_id":"f5","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","name":"总字节","span":{"end":225,"start":196},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":30}
{"kind":"variable.assigned","payload":{"frame_id":"f5","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","name":"下标","span":{"end":440,"start":417},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":31}
{"kind":"loop.iteration","payload":{"decision":"continue","frame_id":"f5","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","span":{"end":149,"start":121}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":32}
{"kind":"variable.assigned","payload":{"frame_id":"f5","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","name":"码点","span":{"end":175,"start":151},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":33}
{"kind":"branch.eval","payload":{"frame_id":"f5","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","result":true,"span":{"end":194,"start":177}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":34}
{"kind":"variable.assigned","payload":{"frame_id":"f5","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","name":"总字节","span":{"end":225,"start":196},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":35}
{"kind":"variable.assigned","payload":{"frame_id":"f5","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","name":"下标","span":{"end":440,"start":417},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":36}
{"kind":"loop.iteration","payload":{"decision":"continue","frame_id":"f5","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","span":{"end":149,"start":121}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":37}
{"kind":"variable.assigned","payload":{"frame_id":"f5","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","name":"码点","span":{"end":175,"start":151},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":38}
{"kind":"branch.eval","payload":{"frame_id":"f5","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","result":true,"span":{"end":194,"start":177}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":39}
{"kind":"variable.assigned","payload":{"frame_id":"f5","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","name":"总字节","span":{"end":225,"start":196},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":40}
{"kind":"variable.assigned","payload":{"frame_id":"f5","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","name":"下标","span":{"end":440,"start":417},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":41}
{"kind":"loop.iteration","payload":{"decision":"continue","frame_id":"f5","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","span":{"end":149,"start":121}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":42}
{"kind":"variable.assigned","payload":{"frame_id":"f5","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","name":"码点","span":{"end":175,"start":151},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":43}
{"kind":"branch.eval","payload":{"frame_id":"f5","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","result":true,"span":{"end":194,"start":177}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":44}
{"kind":"variable.assigned","payload":{"frame_id":"f5","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","name":"总字节","span":{"end":225,"start":196},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":45}
{"kind":"variable.assigned","payload":{"frame_id":"f5","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","name":"下标","span":{"end":440,"start":417},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":46}
{"kind":"loop.iteration","payload":{"decision":"continue","frame_id":"f5","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","span":{"end":149,"start":121}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":47}
{"kind":"variable.assigned","payload":{"frame_id":"f5","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","name":"码点","span":{"end":175,"start":151},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":48}
{"kind":"branch.eval","payload":{"frame_id":"f5","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","result":true,"span":{"end":194,"start":177}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":49}
{"kind":"variable.assigned","payload":{"frame_id":"f5","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","name":"总字节","span":{"end":225,"start":196},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":50}
{"kind":"variable.assigned","payload":{"frame_id":"f5","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","name":"下标","span":{"end":440,"start":417},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":51}
{"kind":"loop.iteration","payload":{"decision":"exit","frame_id":"f5","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","span":{"end":149,"start":121}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":52}
{"kind":"return","payload":{"frame_id":"f5","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","span":{"end":466,"start":448},"value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":53}
{"kind":"call.exit","payload":{"frame_id":"f5","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","span":{"end":1418,"start":1391},"status":"return"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":54}
{"kind":"variable.assigned","payload":{"frame_id":"f4","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","name":"字节数","span":{"end":1420,"start":1377},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":55}
{"kind":"call.enter","payload":{"frame_id":"f6","function_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md::stream.页数","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","parent_frame_id":"f4","span":{"end":1461,"start":1444}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":56}
{"kind":"parameter.observed","payload":{"frame_id":"f6","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","name":"字节","source":"provided","span":{"end":114,"start":108},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":57}
{"kind":"variable.assigned","payload":{"frame_id":"f6","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","name":"页","span":{"end":154,"start":119},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":58}
{"kind":"branch.eval","payload":{"frame_id":"f6","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","result":false,"span":{"end":169,"start":156}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":59}
{"kind":"branch.eval","payload":{"frame_id":"f6","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","result":true,"span":{"end":189,"start":183}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":60}
{"kind":"branch.eval","payload":{"frame_id":"f6","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","result":true,"span":{"end":199,"start":190}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":61}
{"kind":"return","payload":{"frame_id":"f6","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","span":{"end":213,"start":201},"value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":62}
{"kind":"call.exit","payload":{"frame_id":"f6","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","span":{"end":1461,"start":1444},"status":"return"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":63}
{"kind":"call.enter","payload":{"frame_id":"f7","function_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md::stream.页数","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","parent_frame_id":"f4","span":{"end":1480,"start":1463}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":64}
{"kind":"parameter.observed","payload":{"frame_id":"f7","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","name":"字节","source":"provided","span":{"end":114,"start":108},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":65}
{"kind":"variable.assigned","payload":{"frame_id":"f7","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","name":"页","span":{"end":154,"start":119},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":66}
{"kind":"branch.eval","payload":{"frame_id":"f7","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","result":false,"span":{"end":169,"start":156}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":67}
{"kind":"branch.eval","payload":{"frame_id":"f7","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","result":true,"span":{"end":189,"start":183}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":68}
{"kind":"branch.eval","payload":{"frame_id":"f7","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","result":true,"span":{"end":199,"start":190}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":69}
{"kind":"return","payload":{"frame_id":"f7","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","span":{"end":213,"start":201},"value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":70}
{"kind":"call.exit","payload":{"frame_id":"f7","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","span":{"end":1480,"start":1463},"status":"return"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":71}
{"kind":"effect","payload":{"frame_id":"f4","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","operation":"memory.new","result_code":"ok","span":{"end":1481,"start":1433}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":72}
{"kind":"variable.assigned","payload":{"frame_id":"f4","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","name":"内存","span":{"end":1483,"start":1422},"value_state":"not_requested","value_type":"Memory"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":73}
{"kind":"call.enter","payload":{"frame_id":"f8","function_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md::utf8.编码","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","parent_frame_id":"f4","span":{"end":1526,"start":1496}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":74}
{"kind":"parameter.observed","payload":{"frame_id":"f8","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","name":"文本","source":"provided","span":{"end":260,"start":254},"value_state":"not_requested","value_type":"Text"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":75}
{"kind":"parameter.observed","payload":{"frame_id":"f8","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","name":"内存","source":"provided","span":{"end":268,"start":261},"value_state":"not_requested","value_type":"Memory"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":76}
{"kind":"parameter.observed","payload":{"frame_id":"f8","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","name":"基址","source":"provided","span":{"end":276,"start":269},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":77}
{"kind":"variable.assigned","payload":{"frame_id":"f8","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","name":"点","span":{"end":466,"start":433},"value_state":"not_requested","value_type":"List"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":78}
{"kind":"variable.assigned","payload":{"frame_id":"f8","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","name":"下标","span":{"end":482,"start":468},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":79}
{"kind":"variable.assigned","payload":{"frame_id":"f8","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","name":"偏移","span":{"end":498,"start":484},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":80}
{"kind":"loop.iteration","payload":{"decision":"continue","frame_id":"f8","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","span":{"end":528,"start":500}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":81}
{"kind":"variable.assigned","payload":{"frame_id":"f8","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","name":"码点","span":{"end":554,"start":530},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":82}
{"kind":"branch.eval","payload":{"frame_id":"f8","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","result":true,"span":{"end":573,"start":556}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":83}
{"kind":"effect","payload":{"frame_id":"f8","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","operation":"memory.write","result_code":"ok","span":{"end":601,"start":578}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":84}
{"kind":"variable.assigned","payload":{"frame_id":"f8","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","name":"偏移","span":{"end":638,"start":615},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":85}
{"kind":"variable.assigned","payload":{"frame_id":"f8","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","name":"下标","span":{"end":1347,"start":1324},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":86}
{"kind":"loop.iteration","payload":{"decision":"continue","frame_id":"f8","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","span":{"end":528,"start":500}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":87}
{"kind":"variable.assigned","payload":{"frame_id":"f8","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","name":"码点","span":{"end":554,"start":530},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":88}
{"kind":"branch.eval","payload":{"frame_id":"f8","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","result":true,"span":{"end":573,"start":556}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":89}
{"kind":"effect","payload":{"frame_id":"f8","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","operation":"memory.write","result_code":"ok","span":{"end":601,"start":578}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":90}
{"kind":"variable.assigned","payload":{"frame_id":"f8","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","name":"偏移","span":{"end":638,"start":615},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":91}
{"kind":"variable.assigned","payload":{"frame_id":"f8","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","name":"下标","span":{"end":1347,"start":1324},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":92}
{"kind":"loop.iteration","payload":{"decision":"continue","frame_id":"f8","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","span":{"end":528,"start":500}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":93}
{"kind":"variable.assigned","payload":{"frame_id":"f8","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","name":"码点","span":{"end":554,"start":530},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":94}
{"kind":"branch.eval","payload":{"frame_id":"f8","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","result":true,"span":{"end":573,"start":556}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":95}
{"kind":"effect","payload":{"frame_id":"f8","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","operation":"memory.write","result_code":"ok","span":{"end":601,"start":578}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":96}
{"kind":"variable.assigned","payload":{"frame_id":"f8","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","name":"偏移","span":{"end":638,"start":615},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":97}
{"kind":"variable.assigned","payload":{"frame_id":"f8","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","name":"下标","span":{"end":1347,"start":1324},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":98}
{"kind":"loop.iteration","payload":{"decision":"continue","frame_id":"f8","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","span":{"end":528,"start":500}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":99}
{"kind":"variable.assigned","payload":{"frame_id":"f8","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","name":"码点","span":{"end":554,"start":530},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":100}
{"kind":"branch.eval","payload":{"frame_id":"f8","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","result":true,"span":{"end":573,"start":556}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":101}
{"kind":"effect","payload":{"frame_id":"f8","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","operation":"memory.write","result_code":"ok","span":{"end":601,"start":578}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":102}
{"kind":"variable.assigned","payload":{"frame_id":"f8","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","name":"偏移","span":{"end":638,"start":615},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":103}
{"kind":"variable.assigned","payload":{"frame_id":"f8","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","name":"下标","span":{"end":1347,"start":1324},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":104}
{"kind":"loop.iteration","payload":{"decision":"continue","frame_id":"f8","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","span":{"end":528,"start":500}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":105}
{"kind":"variable.assigned","payload":{"frame_id":"f8","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","name":"码点","span":{"end":554,"start":530},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":106}
{"kind":"branch.eval","payload":{"frame_id":"f8","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","result":true,"span":{"end":573,"start":556}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":107}
{"kind":"effect","payload":{"frame_id":"f8","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","operation":"memory.write","result_code":"ok","span":{"end":601,"start":578}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":108}
{"kind":"variable.assigned","payload":{"frame_id":"f8","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","name":"偏移","span":{"end":638,"start":615},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":109}
{"kind":"variable.assigned","payload":{"frame_id":"f8","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","name":"下标","span":{"end":1347,"start":1324},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":110}
{"kind":"loop.iteration","payload":{"decision":"continue","frame_id":"f8","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","span":{"end":528,"start":500}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":111}
{"kind":"variable.assigned","payload":{"frame_id":"f8","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","name":"码点","span":{"end":554,"start":530},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":112}
{"kind":"branch.eval","payload":{"frame_id":"f8","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","result":true,"span":{"end":573,"start":556}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":113}
{"kind":"effect","payload":{"frame_id":"f8","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","operation":"memory.write","result_code":"ok","span":{"end":601,"start":578}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":114}
{"kind":"variable.assigned","payload":{"frame_id":"f8","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","name":"偏移","span":{"end":638,"start":615},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":115}
{"kind":"variable.assigned","payload":{"frame_id":"f8","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","name":"下标","span":{"end":1347,"start":1324},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":116}
{"kind":"loop.iteration","payload":{"decision":"exit","frame_id":"f8","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","span":{"end":528,"start":500}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":117}
{"kind":"return","payload":{"frame_id":"f8","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","span":{"end":1370,"start":1355},"value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":118}
{"kind":"call.exit","payload":{"frame_id":"f8","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","span":{"end":1526,"start":1496},"status":"return"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":119}
{"kind":"variable.assigned","payload":{"frame_id":"f4","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","name":"长度","span":{"end":1528,"start":1485},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":120}
{"kind":"effect","payload":{"frame_id":"f4","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","operation":"resource.open","result_code":"ok","span":{"end":1581,"start":1538}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":121}
{"kind":"variable.assigned","payload":{"frame_id":"f4","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","name":"流","span":{"end":1583,"start":1530},"value_state":"not_requested","value_type":"Resource"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":122}
{"kind":"call.enter","payload":{"frame_id":"f9","function_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md::stream.写全部","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","parent_frame_id":"f4","span":{"end":1632,"start":1599}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":123}
{"kind":"parameter.observed","payload":{"frame_id":"f9","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","name":"流","source":"provided","span":{"end":251,"start":248},"value_state":"not_requested","value_type":"Resource"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":124}
{"kind":"parameter.observed","payload":{"frame_id":"f9","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","name":"内存","source":"provided","span":{"end":259,"start":252},"value_state":"not_requested","value_type":"Memory"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":125}
{"kind":"parameter.observed","payload":{"frame_id":"f9","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","name":"起点","source":"provided","span":{"end":267,"start":260},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":126}
{"kind":"parameter.observed","payload":{"frame_id":"f9","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","name":"长度","source":"provided","span":{"end":275,"start":268},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":127}
{"kind":"variable.assigned","payload":{"frame_id":"f9","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","name":"已写","span":{"end":447,"start":433},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":128}
{"kind":"variable.assigned","payload":{"frame_id":"f9","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","name":"失败","span":{"end":467,"start":449},"value_state":"not_requested","value_type":"Bool"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":129}
{"kind":"variable.assigned","payload":{"frame_id":"f9","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","name":"本次","span":{"end":511,"start":469},"value_state":"not_requested","value_type":"Map"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":130}
{"kind":"variable.assigned","payload":{"frame_id":"f9","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","name":"错误结果","span":{"end":610,"start":513},"value_state":"not_requested","value_type":"Map"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":131}
{"kind":"loop.iteration","payload":{"decision":"continue","frame_id":"f9","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","span":{"end":635,"start":612}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":132}
{"kind":"variable.assigned","payload":{"frame_id":"f9","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","name":"剩余","span":{"end":665,"start":637},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":133}
{"kind":"stdout.chunk","payload":{"byte_count":6,"data_base64":"U1RBUlQK","encoding":"base64"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":134}
{"kind":"effect","payload":{"frame_id":"f9","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","operation":"resource.write","result_code":"ok","span":{"end":730,"start":678}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":135}
{"kind":"variable.assigned","payload":{"frame_id":"f9","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","name":"本次","span":{"end":732,"start":667},"value_state":"not_requested","value_type":"Map"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":136}
{"kind":"branch.eval","payload":{"frame_id":"f9","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","result":false,"span":{"end":752,"start":734}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":137}
{"kind":"branch.eval","payload":{"frame_id":"f9","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","result":true,"span":{"end":827,"start":821}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":138}
{"kind":"branch.eval","payload":{"frame_id":"f9","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","result":false,"span":{"end":856,"start":828}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":139}
{"kind":"branch.eval","payload":{"frame_id":"f9","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","result":true,"span":{"end":904,"start":898}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":140}
{"kind":"branch.eval","payload":{"frame_id":"f9","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","result":true,"span":{"end":914,"start":905}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":141}
{"kind":"variable.assigned","payload":{"frame_id":"f9","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","name":"已写","span":{"end":956,"start":916},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":142}
{"kind":"loop.iteration","payload":{"decision":"exit","frame_id":"f9","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","span":{"end":635,"start":612}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":143}
{"kind":"branch.eval","payload":{"frame_id":"f9","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","result":false,"span":{"end":993,"start":982}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":144}
{"kind":"branch.eval","payload":{"frame_id":"f9","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","result":true,"span":{"end":1024,"start":1018}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":145}
{"kind":"branch.eval","payload":{"frame_id":"f9","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","result":false,"span":{"end":1045,"start":1025}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":146}
{"kind":"branch.eval","payload":{"frame_id":"f9","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","result":true,"span":{"end":1076,"start":1070}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":147}
{"kind":"branch.eval","payload":{"frame_id":"f9","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","result":true,"span":{"end":1086,"start":1077}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":148}
{"kind":"return","payload":{"frame_id":"f9","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","span":{"end":1131,"start":1088},"value_type":"Map"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":149}
{"kind":"call.exit","payload":{"frame_id":"f9","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","span":{"end":1632,"start":1599},"status":"return"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":150}
{"kind":"variable.assigned","payload":{"frame_id":"f4","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","name":"写结果","span":{"end":1634,"start":1585},"value_state":"not_requested","value_type":"Map"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":151}
{"kind":"effect","payload":{"frame_id":"f4","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","operation":"resource.close","result_code":"ok","span":{"end":1666,"start":1647}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":152}
{"kind":"variable.assigned","payload":{"frame_id":"f4","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","name":"关闭","span":{"end":1668,"start":1636},"value_state":"not_requested","value_type":"Map"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":153}
{"kind":"branch.eval","payload":{"frame_id":"f4","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","result":false,"span":{"end":1691,"start":1670}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":154}
{"kind":"branch.eval","payload":{"frame_id":"f4","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","result":true,"span":{"end":1719,"start":1713}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":155}
{"kind":"branch.eval","payload":{"frame_id":"f4","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","result":false,"span":{"end":1738,"start":1720}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":156}
{"kind":"branch.eval","payload":{"frame_id":"f4","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","result":true,"span":{"end":1763,"start":1757}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":157}
{"kind":"branch.eval","payload":{"frame_id":"f4","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","result":true,"span":{"end":1773,"start":1764}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":158}
{"kind":"return","payload":{"frame_id":"f4","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","span":{"end":1818,"start":1775},"value_type":"Map"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":159}
{"kind":"call.exit","payload":{"frame_id":"f4","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io.mq.md","span":{"end":430,"start":387},"status":"return"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":160}
{"kind":"return","payload":{"frame_id":"f2","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io.mq.md","span":{"end":431,"start":379},"value_type":"Map"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":161}
{"kind":"call.exit","payload":{"frame_id":"f2","module_id":"root:default::basic.mq.md","span":{"end":72,"start":57},"status":"return"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":162}
{"kind":"variable.assigned","payload":{"frame_id":"f1","module_id":"root:default::basic.mq.md","name":"n","span":{"end":83,"start":75},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":163}
{"kind":"call.enter","payload":{"frame_id":"f10","function_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io.mq.md::io.写值","module_id":"root:default::basic.mq.md","parent_frame_id":"f1","span":{"end":100,"start":86}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":164}
{"kind":"parameter.observed","payload":{"frame_id":"f10","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io.mq.md","name":"值","source":"provided","span":{"end":315,"start":312},"value_state":"not_requested","value_type":"Text"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":165}
{"kind":"call.enter","payload":{"frame_id":"f11","function_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md::format.显示","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io.mq.md","parent_frame_id":"f10","span":{"end":422,"start":404}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":166}
{"kind":"parameter.observed","payload":{"frame_id":"f11","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","name":"值","source":"provided","span":{"end":489,"start":486},"value_state":"not_requested","value_type":"Text"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":167}
{"kind":"variable.assigned","payload":{"frame_id":"f11","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","name":"类别","span":{"end":701,"start":677},"value_state":"not_requested","value_type":"Text"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":168}
{"kind":"branch.eval","payload":{"frame_id":"f11","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","result":false,"span":{"end":724,"start":703}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":169}
{"kind":"branch.eval","payload":{"frame_id":"f11","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","result":true,"span":{"end":749,"start":743}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":170}
{"kind":"branch.eval","payload":{"frame_id":"f11","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","result":false,"span":{"end":771,"start":750}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":171}
{"kind":"branch.eval","payload":{"frame_id":"f11","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","result":true,"span":{"end":796,"start":790}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":172}
{"kind":"branch.eval","payload":{"frame_id":"f11","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","result":true,"span":{"end":818,"start":797}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":173}
{"kind":"return","payload":{"frame_id":"f11","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","span":{"end":832,"start":820},"value_type":"Text"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":174}
{"kind":"call.exit","payload":{"frame_id":"f11","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io.mq.md","span":{"end":422,"start":404},"status":"return"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":175}
{"kind":"call.enter","payload":{"frame_id":"f12","function_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md::stream.写文本","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io.mq.md","parent_frame_id":"f10","span":{"end":430,"start":387}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":176}
{"kind":"parameter.observed","payload":{"frame_id":"f12","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","name":"文本","source":"provided","span":{"end":1178,"start":1172},"value_state":"not_requested","value_type":"Text"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":177}
{"kind":"call.enter","payload":{"frame_id":"f13","function_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md::format.字节长度","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","parent_frame_id":"f12","span":{"end":1418,"start":1391}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":178}
{"kind":"parameter.observed","payload":{"frame_id":"f13","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","name":"文本","source":"provided","span":{"end":46,"start":40},"value_state":"not_requested","value_type":"Text"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":179}
{"kind":"variable.assigned","payload":{"frame_id":"f13","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","name":"点","span":{"end":84,"start":51},"value_state":"not_requested","value_type":"List"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":180}
{"kind":"variable.assigned","payload":{"frame_id":"f13","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","name":"总字节","span":{"end":103,"start":86},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":181}
{"kind":"variable.assigned","payload":{"frame_id":"f13","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","name":"下标","span":{"end":119,"start":105},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":182}
{"kind":"loop.iteration","payload":{"decision":"continue","frame_id":"f13","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","span":{"end":149,"start":121}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":183}
{"kind":"variable.assigned","payload":{"frame_id":"f13","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","name":"码点","span":{"end":175,"start":151},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":184}
{"kind":"branch.eval","payload":{"frame_id":"f13","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","result":true,"span":{"end":194,"start":177}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":185}
{"kind":"variable.assigned","payload":{"frame_id":"f13","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","name":"总字节","span":{"end":225,"start":196},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":186}
{"kind":"variable.assigned","payload":{"frame_id":"f13","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","name":"下标","span":{"end":440,"start":417},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":187}
{"kind":"loop.iteration","payload":{"decision":"continue","frame_id":"f13","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","span":{"end":149,"start":121}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":188}
{"kind":"variable.assigned","payload":{"frame_id":"f13","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","name":"码点","span":{"end":175,"start":151},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":189}
{"kind":"branch.eval","payload":{"frame_id":"f13","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","result":true,"span":{"end":194,"start":177}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":190}
{"kind":"variable.assigned","payload":{"frame_id":"f13","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","name":"总字节","span":{"end":225,"start":196},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":191}
{"kind":"variable.assigned","payload":{"frame_id":"f13","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","name":"下标","span":{"end":440,"start":417},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":192}
{"kind":"loop.iteration","payload":{"decision":"continue","frame_id":"f13","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","span":{"end":149,"start":121}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":193}
{"kind":"variable.assigned","payload":{"frame_id":"f13","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","name":"码点","span":{"end":175,"start":151},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":194}
{"kind":"branch.eval","payload":{"frame_id":"f13","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","result":true,"span":{"end":194,"start":177}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":195}
{"kind":"variable.assigned","payload":{"frame_id":"f13","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","name":"总字节","span":{"end":225,"start":196},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":196}
{"kind":"variable.assigned","payload":{"frame_id":"f13","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","name":"下标","span":{"end":440,"start":417},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":197}
{"kind":"loop.iteration","payload":{"decision":"continue","frame_id":"f13","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","span":{"end":149,"start":121}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":198}
{"kind":"variable.assigned","payload":{"frame_id":"f13","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","name":"码点","span":{"end":175,"start":151},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":199}
{"kind":"branch.eval","payload":{"frame_id":"f13","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","result":true,"span":{"end":194,"start":177}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":200}
{"kind":"variable.assigned","payload":{"frame_id":"f13","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","name":"总字节","span":{"end":225,"start":196},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":201}
{"kind":"variable.assigned","payload":{"frame_id":"f13","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","name":"下标","span":{"end":440,"start":417},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":202}
{"kind":"loop.iteration","payload":{"decision":"continue","frame_id":"f13","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","span":{"end":149,"start":121}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":203}
{"kind":"variable.assigned","payload":{"frame_id":"f13","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","name":"码点","span":{"end":175,"start":151},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":204}
{"kind":"branch.eval","payload":{"frame_id":"f13","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","result":true,"span":{"end":194,"start":177}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":205}
{"kind":"variable.assigned","payload":{"frame_id":"f13","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","name":"总字节","span":{"end":225,"start":196},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":206}
{"kind":"variable.assigned","payload":{"frame_id":"f13","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","name":"下标","span":{"end":440,"start":417},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":207}
{"kind":"loop.iteration","payload":{"decision":"exit","frame_id":"f13","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","span":{"end":149,"start":121}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":208}
{"kind":"return","payload":{"frame_id":"f13","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::format.mq.md","span":{"end":466,"start":448},"value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":209}
{"kind":"call.exit","payload":{"frame_id":"f13","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","span":{"end":1418,"start":1391},"status":"return"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":210}
{"kind":"variable.assigned","payload":{"frame_id":"f12","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","name":"字节数","span":{"end":1420,"start":1377},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":211}
{"kind":"call.enter","payload":{"frame_id":"f14","function_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md::stream.页数","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","parent_frame_id":"f12","span":{"end":1461,"start":1444}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":212}
{"kind":"parameter.observed","payload":{"frame_id":"f14","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","name":"字节","source":"provided","span":{"end":114,"start":108},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":213}
{"kind":"variable.assigned","payload":{"frame_id":"f14","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","name":"页","span":{"end":154,"start":119},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":214}
{"kind":"branch.eval","payload":{"frame_id":"f14","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","result":false,"span":{"end":169,"start":156}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":215}
{"kind":"branch.eval","payload":{"frame_id":"f14","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","result":true,"span":{"end":189,"start":183}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":216}
{"kind":"branch.eval","payload":{"frame_id":"f14","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","result":true,"span":{"end":199,"start":190}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":217}
{"kind":"return","payload":{"frame_id":"f14","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","span":{"end":213,"start":201},"value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":218}
{"kind":"call.exit","payload":{"frame_id":"f14","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","span":{"end":1461,"start":1444},"status":"return"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":219}
{"kind":"call.enter","payload":{"frame_id":"f15","function_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md::stream.页数","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","parent_frame_id":"f12","span":{"end":1480,"start":1463}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":220}
{"kind":"parameter.observed","payload":{"frame_id":"f15","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","name":"字节","source":"provided","span":{"end":114,"start":108},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":221}
{"kind":"variable.assigned","payload":{"frame_id":"f15","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","name":"页","span":{"end":154,"start":119},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":222}
{"kind":"branch.eval","payload":{"frame_id":"f15","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","result":false,"span":{"end":169,"start":156}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":223}
{"kind":"branch.eval","payload":{"frame_id":"f15","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","result":true,"span":{"end":189,"start":183}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":224}
{"kind":"branch.eval","payload":{"frame_id":"f15","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","result":true,"span":{"end":199,"start":190}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":225}
{"kind":"return","payload":{"frame_id":"f15","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","span":{"end":213,"start":201},"value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":226}
{"kind":"call.exit","payload":{"frame_id":"f15","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","span":{"end":1480,"start":1463},"status":"return"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":227}
{"kind":"effect","payload":{"frame_id":"f12","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","operation":"memory.new","result_code":"ok","span":{"end":1481,"start":1433}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":228}
{"kind":"variable.assigned","payload":{"frame_id":"f12","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","name":"内存","span":{"end":1483,"start":1422},"value_state":"not_requested","value_type":"Memory"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":229}
{"kind":"call.enter","payload":{"frame_id":"f16","function_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md::utf8.编码","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","parent_frame_id":"f12","span":{"end":1526,"start":1496}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":230}
{"kind":"parameter.observed","payload":{"frame_id":"f16","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","name":"文本","source":"provided","span":{"end":260,"start":254},"value_state":"not_requested","value_type":"Text"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":231}
{"kind":"parameter.observed","payload":{"frame_id":"f16","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","name":"内存","source":"provided","span":{"end":268,"start":261},"value_state":"not_requested","value_type":"Memory"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":232}
{"kind":"parameter.observed","payload":{"frame_id":"f16","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","name":"基址","source":"provided","span":{"end":276,"start":269},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":233}
{"kind":"variable.assigned","payload":{"frame_id":"f16","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","name":"点","span":{"end":466,"start":433},"value_state":"not_requested","value_type":"List"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":234}
{"kind":"variable.assigned","payload":{"frame_id":"f16","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","name":"下标","span":{"end":482,"start":468},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":235}
{"kind":"variable.assigned","payload":{"frame_id":"f16","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","name":"偏移","span":{"end":498,"start":484},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":236}
{"kind":"loop.iteration","payload":{"decision":"continue","frame_id":"f16","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","span":{"end":528,"start":500}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":237}
{"kind":"variable.assigned","payload":{"frame_id":"f16","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","name":"码点","span":{"end":554,"start":530},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":238}
{"kind":"branch.eval","payload":{"frame_id":"f16","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","result":true,"span":{"end":573,"start":556}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":239}
{"kind":"effect","payload":{"frame_id":"f16","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","operation":"memory.write","result_code":"ok","span":{"end":601,"start":578}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":240}
{"kind":"variable.assigned","payload":{"frame_id":"f16","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","name":"偏移","span":{"end":638,"start":615},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":241}
{"kind":"variable.assigned","payload":{"frame_id":"f16","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","name":"下标","span":{"end":1347,"start":1324},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":242}
{"kind":"loop.iteration","payload":{"decision":"continue","frame_id":"f16","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","span":{"end":528,"start":500}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":243}
{"kind":"variable.assigned","payload":{"frame_id":"f16","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","name":"码点","span":{"end":554,"start":530},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":244}
{"kind":"branch.eval","payload":{"frame_id":"f16","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","result":true,"span":{"end":573,"start":556}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":245}
{"kind":"effect","payload":{"frame_id":"f16","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","operation":"memory.write","result_code":"ok","span":{"end":601,"start":578}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":246}
{"kind":"variable.assigned","payload":{"frame_id":"f16","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","name":"偏移","span":{"end":638,"start":615},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":247}
{"kind":"variable.assigned","payload":{"frame_id":"f16","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","name":"下标","span":{"end":1347,"start":1324},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":248}
{"kind":"loop.iteration","payload":{"decision":"continue","frame_id":"f16","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","span":{"end":528,"start":500}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":249}
{"kind":"variable.assigned","payload":{"frame_id":"f16","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","name":"码点","span":{"end":554,"start":530},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":250}
{"kind":"branch.eval","payload":{"frame_id":"f16","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","result":true,"span":{"end":573,"start":556}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":251}
{"kind":"effect","payload":{"frame_id":"f16","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","operation":"memory.write","result_code":"ok","span":{"end":601,"start":578}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":252}
{"kind":"variable.assigned","payload":{"frame_id":"f16","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","name":"偏移","span":{"end":638,"start":615},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":253}
{"kind":"variable.assigned","payload":{"frame_id":"f16","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","name":"下标","span":{"end":1347,"start":1324},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":254}
{"kind":"loop.iteration","payload":{"decision":"continue","frame_id":"f16","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","span":{"end":528,"start":500}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":255}
{"kind":"variable.assigned","payload":{"frame_id":"f16","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","name":"码点","span":{"end":554,"start":530},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":256}
{"kind":"branch.eval","payload":{"frame_id":"f16","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","result":true,"span":{"end":573,"start":556}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":257}
{"kind":"effect","payload":{"frame_id":"f16","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","operation":"memory.write","result_code":"ok","span":{"end":601,"start":578}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":258}
{"kind":"variable.assigned","payload":{"frame_id":"f16","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","name":"偏移","span":{"end":638,"start":615},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":259}
{"kind":"variable.assigned","payload":{"frame_id":"f16","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","name":"下标","span":{"end":1347,"start":1324},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":260}
{"kind":"loop.iteration","payload":{"decision":"continue","frame_id":"f16","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","span":{"end":528,"start":500}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":261}
{"kind":"variable.assigned","payload":{"frame_id":"f16","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","name":"码点","span":{"end":554,"start":530},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":262}
{"kind":"branch.eval","payload":{"frame_id":"f16","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","result":true,"span":{"end":573,"start":556}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":263}
{"kind":"effect","payload":{"frame_id":"f16","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","operation":"memory.write","result_code":"ok","span":{"end":601,"start":578}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":264}
{"kind":"variable.assigned","payload":{"frame_id":"f16","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","name":"偏移","span":{"end":638,"start":615},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":265}
{"kind":"variable.assigned","payload":{"frame_id":"f16","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","name":"下标","span":{"end":1347,"start":1324},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":266}
{"kind":"loop.iteration","payload":{"decision":"exit","frame_id":"f16","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","span":{"end":528,"start":500}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":267}
{"kind":"return","payload":{"frame_id":"f16","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::text/utf8.mq.md","span":{"end":1370,"start":1355},"value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":268}
{"kind":"call.exit","payload":{"frame_id":"f16","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","span":{"end":1526,"start":1496},"status":"return"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":269}
{"kind":"variable.assigned","payload":{"frame_id":"f12","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","name":"长度","span":{"end":1528,"start":1485},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":270}
{"kind":"effect","payload":{"frame_id":"f12","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","operation":"resource.open","result_code":"ok","span":{"end":1581,"start":1538}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":271}
{"kind":"variable.assigned","payload":{"frame_id":"f12","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","name":"流","span":{"end":1583,"start":1530},"value_state":"not_requested","value_type":"Resource"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":272}
{"kind":"call.enter","payload":{"frame_id":"f17","function_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md::stream.写全部","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","parent_frame_id":"f12","span":{"end":1632,"start":1599}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":273}
{"kind":"parameter.observed","payload":{"frame_id":"f17","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","name":"流","source":"provided","span":{"end":251,"start":248},"value_state":"not_requested","value_type":"Resource"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":274}
{"kind":"parameter.observed","payload":{"frame_id":"f17","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","name":"内存","source":"provided","span":{"end":259,"start":252},"value_state":"not_requested","value_type":"Memory"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":275}
{"kind":"parameter.observed","payload":{"frame_id":"f17","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","name":"起点","source":"provided","span":{"end":267,"start":260},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":276}
{"kind":"parameter.observed","payload":{"frame_id":"f17","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","name":"长度","source":"provided","span":{"end":275,"start":268},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":277}
{"kind":"variable.assigned","payload":{"frame_id":"f17","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","name":"已写","span":{"end":447,"start":433},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":278}
{"kind":"variable.assigned","payload":{"frame_id":"f17","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","name":"失败","span":{"end":467,"start":449},"value_state":"not_requested","value_type":"Bool"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":279}
{"kind":"variable.assigned","payload":{"frame_id":"f17","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","name":"本次","span":{"end":511,"start":469},"value_state":"not_requested","value_type":"Map"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":280}
{"kind":"variable.assigned","payload":{"frame_id":"f17","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","name":"错误结果","span":{"end":610,"start":513},"value_state":"not_requested","value_type":"Map"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":281}
{"kind":"loop.iteration","payload":{"decision":"continue","frame_id":"f17","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","span":{"end":635,"start":612}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":282}
{"kind":"variable.assigned","payload":{"frame_id":"f17","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","name":"剩余","span":{"end":665,"start":637},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":283}
{"kind":"stdout.chunk","payload":{"byte_count":5,"data_base64":"RE9ORQo=","encoding":"base64"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":284}
{"kind":"effect","payload":{"frame_id":"f17","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","operation":"resource.write","result_code":"ok","span":{"end":730,"start":678}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":285}
{"kind":"variable.assigned","payload":{"frame_id":"f17","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","name":"本次","span":{"end":732,"start":667},"value_state":"not_requested","value_type":"Map"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":286}
{"kind":"branch.eval","payload":{"frame_id":"f17","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","result":false,"span":{"end":752,"start":734}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":287}
{"kind":"branch.eval","payload":{"frame_id":"f17","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","result":true,"span":{"end":827,"start":821}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":288}
{"kind":"branch.eval","payload":{"frame_id":"f17","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","result":false,"span":{"end":856,"start":828}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":289}
{"kind":"branch.eval","payload":{"frame_id":"f17","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","result":true,"span":{"end":904,"start":898}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":290}
{"kind":"branch.eval","payload":{"frame_id":"f17","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","result":true,"span":{"end":914,"start":905}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":291}
{"kind":"variable.assigned","payload":{"frame_id":"f17","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","name":"已写","span":{"end":956,"start":916},"value_state":"not_requested","value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":292}
{"kind":"loop.iteration","payload":{"decision":"exit","frame_id":"f17","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","span":{"end":635,"start":612}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":293}
{"kind":"branch.eval","payload":{"frame_id":"f17","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","result":false,"span":{"end":993,"start":982}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":294}
{"kind":"branch.eval","payload":{"frame_id":"f17","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","result":true,"span":{"end":1024,"start":1018}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":295}
{"kind":"branch.eval","payload":{"frame_id":"f17","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","result":false,"span":{"end":1045,"start":1025}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":296}
{"kind":"branch.eval","payload":{"frame_id":"f17","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","result":true,"span":{"end":1076,"start":1070}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":297}
{"kind":"branch.eval","payload":{"frame_id":"f17","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","result":true,"span":{"end":1086,"start":1077}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":298}
{"kind":"return","payload":{"frame_id":"f17","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","span":{"end":1131,"start":1088},"value_type":"Map"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":299}
{"kind":"call.exit","payload":{"frame_id":"f17","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","span":{"end":1632,"start":1599},"status":"return"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":300}
{"kind":"variable.assigned","payload":{"frame_id":"f12","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","name":"写结果","span":{"end":1634,"start":1585},"value_state":"not_requested","value_type":"Map"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":301}
{"kind":"effect","payload":{"frame_id":"f12","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","operation":"resource.close","result_code":"ok","span":{"end":1666,"start":1647}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":302}
{"kind":"variable.assigned","payload":{"frame_id":"f12","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","name":"关闭","span":{"end":1668,"start":1636},"value_state":"not_requested","value_type":"Map"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":303}
{"kind":"branch.eval","payload":{"frame_id":"f12","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","result":false,"span":{"end":1691,"start":1670}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":304}
{"kind":"branch.eval","payload":{"frame_id":"f12","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","result":true,"span":{"end":1719,"start":1713}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":305}
{"kind":"branch.eval","payload":{"frame_id":"f12","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","result":false,"span":{"end":1738,"start":1720}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":306}
{"kind":"branch.eval","payload":{"frame_id":"f12","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","result":true,"span":{"end":1763,"start":1757}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":307}
{"kind":"branch.eval","payload":{"frame_id":"f12","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","result":true,"span":{"end":1773,"start":1764}},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":308}
{"kind":"return","payload":{"frame_id":"f12","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io/stream.mq.md","span":{"end":1818,"start":1775},"value_type":"Map"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":309}
{"kind":"call.exit","payload":{"frame_id":"f12","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io.mq.md","span":{"end":430,"start":387},"status":"return"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":310}
{"kind":"return","payload":{"frame_id":"f10","module_id":"std:marqdo-stdlib@0.2.0#db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7::io.mq.md","span":{"end":431,"start":379},"value_type":"Map"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":311}
{"kind":"call.exit","payload":{"frame_id":"f10","module_id":"root:default::basic.mq.md","span":{"end":100,"start":86},"status":"return"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":312}
{"kind":"return","payload":{"frame_id":"f1","module_id":"root:default::basic.mq.md","span":{"end":113,"start":103},"value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":313}
{"kind":"call.exit","payload":{"frame_id":"f1","module_id":"root:default::basic.mq.md","span":null,"status":"return"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":314}
{"kind":"run.completed","payload":{"status":"ok","value":{"decimal":"10","type":"int"},"value_type":"Int"},"run_id":"9-1795713570566476436","schema":"marqdo.observation","schema_version":1,"seq":315}
+24 -4
View File
@@ -12,6 +12,8 @@ jobs:
test: test:
name: fmt + clippy + test (Linux x86_64) name: fmt + clippy + test (Linux x86_64)
runs-on: ubuntu-latest runs-on: ubuntu-latest
env:
MARQDO_TEST_STDLIB_BUNDLE: ${{ github.workspace }}/target/ecosystem-stdlib
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable - uses: dtolnay/rust-toolchain@stable
@@ -19,6 +21,10 @@ jobs:
components: rustfmt, clippy components: rustfmt, clippy
- name: Rust cache - name: Rust cache
uses: Swatinem/rust-cache@v2 uses: Swatinem/rust-cache@v2
- name: Materialize the pinned ecosystem stdlib Bundle
run: python3 tools/ci/fetch_ecosystem_bundle.py --out target/ecosystem-stdlib
- name: Verify the pinned stdlib Bundle
run: python3 tools/stdlib/bundle.py --stdlib-dir target/ecosystem-stdlib
- name: Formatting - name: Formatting
run: cargo fmt --all -- --check run: cargo fmt --all -- --check
- name: Clippy - name: Clippy
@@ -47,7 +53,7 @@ jobs:
run: python3 tools/ci/check_plugin_sdk.py run: python3 tools/ci/check_plugin_sdk.py
- name: CI evidence tool tests - name: CI evidence tool tests
run: python3 -m unittest discover -s tools/ci -p "test_*.py" run: python3 -m unittest discover -s tools/ci -p "test_*.py"
- name: Whole stdlib product tests - name: Whole stdlib product tests (explicit pinned Bundle)
run: cargo test -p marqdo-cli --test stdlib_product run: cargo test -p marqdo-cli --test stdlib_product
- name: Validate public JSON schemas - name: Validate public JSON schemas
run: | run: |
@@ -99,6 +105,16 @@ jobs:
--trust-native-plugin \ --trust-native-plugin \
--allow-plugin demo.solver --allow-plugin demo.solver
independent-build:
name: independent CLI/worker build (no stdlib source)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Build from a copy without stdlib and run a language-only program
run: python3 tools/ci/independent_build.py
schema: schema:
name: schema instance validation + consumers name: schema instance validation + consumers
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -220,6 +236,8 @@ jobs:
persist-credentials: false persist-credentials: false
- uses: dtolnay/rust-toolchain@stable - uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2 - uses: Swatinem/rust-cache@v2
- name: Materialize the pinned ecosystem stdlib Bundle
run: python3 tools/ci/fetch_ecosystem_bundle.py --out target/ecosystem-stdlib
- name: Build and check the frozen archive - name: Build and check the frozen archive
shell: bash shell: bash
run: | run: |
@@ -227,7 +245,8 @@ jobs:
cargo build --release --locked -p marqdo-cli -p marqdo-provider-worker cargo build --release --locked -p marqdo-cli -p marqdo-provider-worker
version="$(cargo metadata --no-deps --format-version 1 --offline \ version="$(cargo metadata --no-deps --format-version 1 --offline \
| python3 -c 'import json,sys; print(next(p["version"] for p in json.load(sys.stdin)["packages"] if p["name"]=="marqdo-cli"))')" | python3 -c 'import json,sys; print(next(p["version"] for p in json.load(sys.stdin)["packages"] if p["name"]=="marqdo-cli"))')"
python3 tools/release/package.py --source-sha "$GITHUB_SHA" --version "$version" python3 tools/release/package.py --source-sha "$GITHUB_SHA" --version "$version" \
--stdlib-dir target/ecosystem-stdlib --bundle-pin tools/stdlib/bundle-pin.json
python3 tools/release/smoke.py --archive dist/marqdo-*.tar.gz python3 tools/release/smoke.py --archive dist/marqdo-*.tar.gz
tools/ci/run_frozen_extensions.sh dist/marqdo-*.tar.gz "$GITHUB_SHA" dist/frozen-extension-evidence.json tools/ci/run_frozen_extensions.sh dist/marqdo-*.tar.gz "$GITHUB_SHA" dist/frozen-extension-evidence.json
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v4
@@ -245,7 +264,7 @@ jobs:
release-evidence: release-evidence:
name: release evidence manifest name: release evidence manifest
needs: [test, schema, cross-platform, frozen-extensions] needs: [test, schema, cross-platform, frozen-extensions, independent-build]
if: always() if: always()
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@@ -258,6 +277,7 @@ jobs:
LINUX_RESULT: ${{ needs.test.result }} LINUX_RESULT: ${{ needs.test.result }}
SCHEMA_RESULT: ${{ needs.schema.result }} SCHEMA_RESULT: ${{ needs.schema.result }}
EXTENSIONS_RESULT: ${{ needs.frozen-extensions.result }} EXTENSIONS_RESULT: ${{ needs.frozen-extensions.result }}
INDEPENDENT_RESULT: ${{ needs.independent-build.result }}
run: | run: |
set -euo pipefail set -euo pipefail
state() { state() {
@@ -268,7 +288,7 @@ jobs:
esac esac
} }
linux="$(state "$LINUX_RESULT")" linux="$(state "$LINUX_RESULT")"
if [ "$(state "$SCHEMA_RESULT")" != "PASS" ] || [ "$(state "$EXTENSIONS_RESULT")" != "PASS" ]; then if [ "$(state "$SCHEMA_RESULT")" != "PASS" ] || [ "$(state "$EXTENSIONS_RESULT")" != "PASS" ] || [ "$(state "$INDEPENDENT_RESULT")" != "PASS" ]; then
linux="FAIL" linux="FAIL"
fi fi
python3 tools/ci/release_evidence.py --profile rc --target-sha "$TARGET_SHA" \ python3 tools/ci/release_evidence.py --profile rc --target-sha "$TARGET_SHA" \
+4
View File
@@ -42,3 +42,7 @@ __pycache__/
/tests/embedding/target/ /tests/embedding/target/
/tests/sdk-plugin/target/ /tests/sdk-plugin/target/
/.tmp/ /.tmp/
# Accidental curl/test capture files
/out
/log.txt
+22 -23
View File
@@ -13,51 +13,47 @@ steps:
image: rust:1.100-bookworm image: rust:1.100-bookworm
commands: commands:
- apt-get update - apt-get update
- apt-get install -y --no-install-recommends ca-certificates python3 python3-jsonschema - apt-get install -y --no-install-recommends ca-certificates git python3 python3-jsonschema
- cargo build --locked -p marqdo-cli -p marqdo-provider-worker - cargo build --locked -p marqdo-cli -p marqdo-provider-worker
- python3 tools/ci/check_dependency_boundaries.py - python3 tools/ci/check_dependency_boundaries.py
- | - python3 tools/ci/fetch_ecosystem_bundle.py --out target/ecosystem-stdlib
set -eux - MARQDO_TEST_STDLIB_BUNDLE="$PWD/target/ecosystem-stdlib" bash tools/ci/contract_lane.sh
./target/debug/marqdo check tests/consumers/fixtures/observation/basic.mq.md --emit /tmp/analysis.json
./target/debug/marqdo run tests/consumers/fixtures/observation/basic.mq.md --output jsonl --observation-file /tmp/observation.json > /tmp/observation.jsonl
python3 tests/consumers/analysis_consumer.py /tmp/analysis.json
python3 tests/consumers/observation_consumer.py --validate-schema /tmp/observation.jsonl
python3 tests/consumers/observation_consumer.py --snapshot --analysis /tmp/analysis.json /tmp/observation.json
./target/debug/marqdo check tests/conformance/semantics/85-nested-loop-control.mq.md --emit /tmp/control-analysis.json
./target/debug/marqdo run tests/conformance/semantics/85-nested-loop-control.mq.md --output jsonl --observation-file /tmp/control-observation.json > /tmp/control-events.jsonl
python3 tests/consumers/validate_protocols.py /tmp/control-analysis.json /tmp/control-observation.json examples/tool-unknown-name/tool.json
python3 tests/consumers/analysis_consumer.py /tmp/control-analysis.json --require-transfers
python3 tests/consumers/observation_consumer.py --snapshot --analysis /tmp/control-analysis.json /tmp/control-observation.json
python3 tests/consumers/observation_consumer.py --validate-schema --analysis /tmp/control-analysis.json /tmp/control-events.jsonl
- python3 tools/ci/verify_observation_stream.py /tmp/control-events.jsonl /tmp/control-observation.json
- python3 tools/ci/assert_stale_analysis.py /tmp/control-analysis.json /tmp/control-events.jsonl
test: test:
image: rust:1.100-bookworm image: rust:1.100-bookworm
commands: commands:
- rustup component add clippy rustfmt - rustup component add clippy rustfmt
- apt-get update - apt-get update
- apt-get install -y --no-install-recommends curl ca-certificates python3 python3-jsonschema build-essential gcc-mingw-w64-x86-64 - apt-get install -y --no-install-recommends curl ca-certificates git python3 python3-jsonschema build-essential gcc-mingw-w64-x86-64
- curl -fsSL https://deb.nodesource.com/setup_22.x | bash - - curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
- apt-get install -y --no-install-recommends nodejs - apt-get install -y --no-install-recommends nodejs
- python3 tools/ci/fetch_ecosystem_bundle.py --out target/ecosystem-stdlib
- python3 tools/stdlib/bundle.py --stdlib-dir target/ecosystem-stdlib
- cargo fmt --all -- --check - cargo fmt --all -- --check
- cargo clippy --workspace --all-targets -- -D warnings - cargo clippy --workspace --all-targets -- -D warnings
# Provider CLI tests resolve a real provider worker next to the CLI # Provider CLI tests resolve a real provider worker next to the CLI
# binary. Build it once so the test harness does not need a nested build. # binary. Build it once so the test harness does not need a nested build.
- cargo build --locked -p marqdo-provider-worker - cargo build --locked -p marqdo-provider-worker
- cargo test --workspace --locked - MARQDO_TEST_STDLIB_BUNDLE="$PWD/target/ecosystem-stdlib" cargo test --workspace --locked
- cargo test -p marqdo-cli --test docs_consistency - MARQDO_TEST_STDLIB_BUNDLE="$PWD/target/ecosystem-stdlib" cargo test -p marqdo-cli --test docs_consistency
- cargo test -p marqdo-cli --test architecture_boundaries - MARQDO_TEST_STDLIB_BUNDLE="$PWD/target/ecosystem-stdlib" cargo test -p marqdo-cli --test architecture_boundaries
- python3 tools/ci/check_dependency_boundaries.py - python3 tools/ci/check_dependency_boundaries.py
- python3 tools/ci/check_engine_boundary.py - python3 tools/ci/check_engine_boundary.py
- python3 tools/ci/check_plugin_sdk.py - python3 tools/ci/check_plugin_sdk.py
- python3 -m unittest discover -s tools/ci -p "test_*.py" - MARQDO_TEST_STDLIB_BUNDLE="$PWD/target/ecosystem-stdlib" python3 -m unittest discover -s tools/ci -p "test_*.py"
- cargo test -p marqdo-cli --test stdlib_product - MARQDO_TEST_STDLIB_BUNDLE="$PWD/target/ecosystem-stdlib" cargo test -p marqdo-cli --test stdlib_product
# Windows compile gate: runtime lanes are native on GitHub; this catches # Windows compile gate: runtime lanes are native on GitHub; this catches
# cfg/compile regressions on the Linux CI without a Windows runner. # cfg/compile regressions on the Linux CI without a Windows runner.
- rustup target add x86_64-pc-windows-gnu - rustup target add x86_64-pc-windows-gnu
- cargo check --workspace --all-targets --target x86_64-pc-windows-gnu - cargo check --workspace --all-targets --target x86_64-pc-windows-gnu
independent-build:
image: rust:1.100-bookworm
commands:
- apt-get update
- apt-get install -y --no-install-recommends ca-certificates git python3
- python3 tools/ci/independent_build.py
minimum-rust: minimum-rust:
image: rust:1.89-bookworm image: rust:1.89-bookworm
commands: commands:
@@ -75,13 +71,16 @@ steps:
# only supported transport and resolution is a sibling-of-CLI lookup. # only supported transport and resolution is a sibling-of-CLI lookup.
- cargo build --release --locked -p marqdo-cli -p marqdo-provider-worker - cargo build --release --locked -p marqdo-cli -p marqdo-provider-worker
- test -x target/release/marqdo-provider-worker - test -x target/release/marqdo-provider-worker
- python3 tools/ci/fetch_ecosystem_bundle.py --out target/ecosystem-stdlib
- python3 tools/stdlib/bundle.py --stdlib-dir target/ecosystem-stdlib
# Build the deterministic archive from this exact commit and cold-install # Build the deterministic archive from this exact commit and cold-install
# smoke-test it; the package script refuses a dirty tree or wrong SHA. # smoke-test it; the package script refuses a dirty tree or wrong SHA.
- | - |
set -eu set -eu
version="$(cargo metadata --no-deps --format-version 1 --offline \ version="$(cargo metadata --no-deps --format-version 1 --offline \
| python3 -c 'import json,sys; print(next(p["version"] for p in json.load(sys.stdin)["packages"] if p["name"]=="marqdo-cli"))')" | python3 -c 'import json,sys; print(next(p["version"] for p in json.load(sys.stdin)["packages"] if p["name"]=="marqdo-cli"))')"
python3 tools/release/package.py --source-sha "$CI_COMMIT_SHA" --version "$version" python3 tools/release/package.py --source-sha "$CI_COMMIT_SHA" --version "$version" \
--stdlib-dir target/ecosystem-stdlib --bundle-pin tools/stdlib/bundle-pin.json
python3 tools/release/smoke.py --archive dist/marqdo-*.tar.gz python3 tools/release/smoke.py --archive dist/marqdo-*.tar.gz
tools/ci/run_frozen_extensions.sh dist/marqdo-*.tar.gz "$CI_COMMIT_SHA" dist/frozen-extension-evidence.json tools/ci/run_frozen_extensions.sh dist/marqdo-*.tar.gz "$CI_COMMIT_SHA" dist/frozen-extension-evidence.json
cat dist/frozen-extension-evidence.json cat dist/frozen-extension-evidence.json
+6 -2
View File
@@ -10,6 +10,8 @@ steps:
commands: commands:
- apt-get update - apt-get update
- apt-get install -y --no-install-recommends python3 util-linux ca-certificates git openssl build-essential - apt-get install -y --no-install-recommends python3 util-linux ca-certificates git openssl build-essential
- python3 tools/ci/fetch_ecosystem_bundle.py --out target/ecosystem-stdlib
- python3 tools/stdlib/bundle.py --stdlib-dir target/ecosystem-stdlib
- cargo build --release --locked -p marqdo-cli -p marqdo-provider-worker - cargo build --release --locked -p marqdo-cli -p marqdo-provider-worker
- | - |
set -eu set -eu
@@ -22,7 +24,8 @@ steps:
(cd "$perf_dir/beta" && cargo build --release --locked -p marqdo-cli) (cd "$perf_dir/beta" && cargo build --release --locked -p marqdo-cli)
version="$(target/release/marqdo --version | cut -d ' ' -f 2)" version="$(target/release/marqdo --version | cut -d ' ' -f 2)"
python3 tools/release/package.py --version "$version" --source-sha "$CI_COMMIT_SHA" --out-dir "$perf_dir" python3 tools/release/package.py --version "$version" --source-sha "$CI_COMMIT_SHA" \
--stdlib-dir target/ecosystem-stdlib --bundle-pin tools/stdlib/bundle-pin.json --out-dir "$perf_dir"
archive="$perf_dir/marqdo-$version-x86_64-unknown-linux-gnu.tar.gz" archive="$perf_dir/marqdo-$version-x86_64-unknown-linux-gnu.tar.gz"
(cd "$perf_dir" && sha256sum -c "$(basename "$archive.sha256")") (cd "$perf_dir" && sha256sum -c "$(basename "$archive.sha256")")
tar -xzf "$archive" -C "$perf_dir" tar -xzf "$archive" -C "$perf_dir"
@@ -37,7 +40,8 @@ steps:
(cd "$perf_dir/beta" && python3 tools/perf/runner.py --no-build \ (cd "$perf_dir/beta" && python3 tools/perf/runner.py --no-build \
--warmups 5 --samples 20 --platform-id woodpecker-agent-1 \ --warmups 5 --samples 20 --platform-id woodpecker-agent-1 \
--cpu-list "$cpu_list" --out "$perf_dir/beta.json" > /dev/null) --cpu-list "$cpu_list" --out "$perf_dir/beta.json" > /dev/null)
python3 tools/perf/runner.py --no-build --binary "$candidate/marqdo" --warmups 5 --samples 20 \ python3 tools/perf/runner.py --no-build --binary "$candidate/marqdo" \
--stdlib-dir "$candidate/stdlib" --warmups 5 --samples 20 \
--platform-id woodpecker-agent-1 --cpu-list "$cpu_list" \ --platform-id woodpecker-agent-1 --cpu-list "$cpu_list" \
--baseline "$perf_dir/beta.json" --out perf.json > /dev/null --baseline "$perf_dir/beta.json" --out perf.json > /dev/null
python3 - <<'PY' python3 - <<'PY'
+1 -1
View File
@@ -35,7 +35,7 @@ correctness and release evidence before expanding the surface.
10. Language semantics, package format, ABI, authorization defaults or public CLI behavior changes require an ADR + tests + spec updates. 10. Language semantics, package format, ABI, authorization defaults or public CLI behavior changes require an ADR + tests + spec updates.
11. RFC-LANG-0002 is implemented by the frontend, `marqdo-expression`, IR lowering, runtime and the bundled stdlib. Keep `spec/`, implementation, fixtures, stdlib digest and docs in lockstep; there is no legacy mapper or per-file syntax switch to fall back to. Do not make a release claim beyond the evidence recorded in `docs/STATUS.md`. 11. RFC-LANG-0002 is implemented by the frontend, `marqdo-expression`, IR lowering, runtime and the bundled stdlib. Keep `spec/`, implementation, fixtures, stdlib digest and docs in lockstep; there is no legacy mapper or per-file syntax switch to fall back to. Do not make a release claim beyond the evidence recorded in `docs/STATUS.md`.
12. The language engine depends on the neutral `marqdo-host-contract` only; it must never link `marqdo-host`, the sandbox, foreign kernels, the plugin loader/worker, package or CLI in normal/build dependencies. `marqdo-host-contract` depends on `Value`/`Span` only. The native host implements the contract and must not depend back on the runtime/frontend/IR. The plugin ABI crate is a contract (no `dlopen`/worker/manifest execution); the SDK consumes the contract only. CLI is the one assembly point. This is enforced by `tools/ci/check_dependency_boundaries.py`, `tools/ci/check_engine_boundary.py`, `tools/ci/check_plugin_sdk.py` and `crates/cli/tests/architecture_boundaries.rs`; see ADR-0071. 12. The language engine depends on the neutral `marqdo-host-contract` only; it must never link `marqdo-host`, the sandbox, foreign kernels, the plugin loader/worker, package or CLI in normal/build dependencies. `marqdo-host-contract` depends on `Value`/`Span` only. The native host implements the contract and must not depend back on the runtime/frontend/IR. The plugin ABI crate is a contract (no `dlopen`/worker/manifest execution); the SDK consumes the contract only. CLI is the one assembly point. This is enforced by `tools/ci/check_dependency_boundaries.py`, `tools/ci/check_engine_boundary.py`, `tools/ci/check_plugin_sdk.py` and `crates/cli/tests/architecture_boundaries.rs`; see ADR-0071.
13. Do not create empty candidate repositories (for example `marqdo-engine`/`marqdo-host`/`marqdo-cli-*`) to "solve" architecture. A repository split requires the issue #13 §9.2 evidence and a separate accepted ADR; "keep in workspace" is a valid recorded decision. Do not add a second Host trait, Value encoding, wire/RPC engine protocol or compatibility re-export path. 13. Do not create empty candidate repositories (for example `marqdo-engine`/`marqdo-host`/`marqdo-cli-*`) to "solve" architecture. A repository split requires the issue #13 §9.2 evidence and a separate accepted ADR; "keep in workspace" is a valid recorded decision. The plugin SDK stays in this CLI workspace as a contract-only crate (ADR-0073); do not re-create an independent SDK repository, mirror or submodule for the pre-stable line. Do not add a second Host trait, Value encoding, wire/RPC engine protocol or compatibility re-export path.
## Pre-stable protocol changes ## Pre-stable protocol changes
+33 -7
View File
@@ -64,6 +64,30 @@ cargo build -p marqdo-cli
# binary: target/debug/marqdo (or $CARGO_TARGET_DIR/debug/marqdo) # binary: target/debug/marqdo (or $CARGO_TARGET_DIR/debug/marqdo)
``` ```
The CLI and Provider Worker compile without any stdlib sources. The accepted
standard-library Bundle is assembled by the ecosystem repository
(`cflmy/marqdo`) from pinned component gitlinks; this repository has **no**
`stdlib/` source tree and no compile-time source fallback (ADR-0070 Phase B).
Every product test, package step and release names one explicit, verified
Bundle; `MARQDO_STDLIB_DIR` remains the explicit runtime override and the
installed `stdlib/` next to the binary is the default:
```bash
cargo build --release --locked -p marqdo-cli -p marqdo-provider-worker
# CI/maintainers materialize the exact pinned Bundle (commit + gitlinks):
python3 tools/ci/fetch_ecosystem_bundle.py --out target/ecosystem-stdlib
python3 tools/stdlib/bundle.py --stdlib-dir target/ecosystem-stdlib --print-path
python3 tools/release/package.py --source-sha "$(git rev-parse HEAD)" \
--version <version> --stdlib-dir target/ecosystem-stdlib \
--bundle-pin tools/stdlib/bundle-pin.json
```
Product tests and CI set `MARQDO_TEST_STDLIB_BUNDLE` to that materialized
Bundle; without it the product lane fails closed instead of reaching a source
tree.
See [`docs/releasing.md`](docs/releasing.md) for the full procedure.
## Quickstart ## Quickstart
```bash ```bash
@@ -156,15 +180,17 @@ rules are [`RFC-LANG-0002`](docs/architecture/RFC-LANG-0002-unified-semantics.md
`{ok:false,code,message}` as an ordinary Map, with a `.mq.md` first-fit `{ok:false,code,message}` as an ordinary Map, with a `.mq.md` first-fit
free-list allocator demonstrating reuse, splitting and `alloc.no_space` free-list allocator demonstrating reuse, splitting and `alloc.no_space`
recovery (ADR-0024). No `Result` type or exception syntax. recovery (ADR-0024). No `Result` type or exception syntax.
* **Bundled stdlib + official print aliases (RFC-CM CM-A07/A10)** — offline * **Bundled stdlib + official print aliases (RFC-CM CM-A07/A10)** — one
`stdlib/` with explicit `std:io`/`std:format`/`std:text` imports, SHA-256 offline, ecosystem-assembled Bundle (component-owned module sources) with
digest verification, Analysis identity and a frozen-CLI closure test; the explicit `std:io`/`std:format`/`std:text` imports, SHA-256 digest
verification, Analysis identity and a frozen-CLI closure test; the
`.mq.md` print chain is the only execution path for `打印`/`print` on an official install (ADR-0031), `.mq.md` print chain is the only execution path for `打印`/`print` on an official install (ADR-0031),
covering all 15 value types; `HostOp::Print` and the legacy formatter are covering all 15 value types; `HostOp::Print` and the legacy formatter are
removed (ADR-0027/0028/0029/0030/0031). removed (ADR-0027/0028/0029/0030/0031).
* **HTTP/1.1 framing in `.mq.md`** — `stdlib/net/http.mq.md` status/header/ * **HTTP/1.1 framing in `.mq.md`** — the `marqdo-ext-http` explicit Package
chunked parsing and request construction; a loopback TCP test runs a real provides status/header/chunked parsing and request construction; the CLI
exchange (ADR-0034; no TLS/host HTTP claim). keeps the generic TCP endpoint and a loopback round-trip test (ADR-0034; no
TLS/host HTTP claim).
* **Blocking TCP endpoint (RFC-CM P5 first slice)** — `resource.open("tcp", * **Blocking TCP endpoint (RFC-CM P5 first slice)** — `resource.open("tcp",
"<ip>:<port>", ["read","write"])` with exact IP grants, project mode and "<ip>:<port>", ["read","write"])` with exact IP grants, project mode and
5-second timeouts; DNS/TLS/UDP/server sockets excluded (ADR-0034). 5-second timeouts; DNS/TLS/UDP/server sockets excluded (ADR-0034).
@@ -493,7 +519,7 @@ extensions. Lock v3 requires an explicit `marqdo lock` migration. See
#### Official stdlib aliases, no print magic #### Official stdlib aliases, no print magic
`打印`/`print` are declared in the verified `stdlib/stdlib.json` `打印`/`print` are declared in the accepted Bundle's verified `stdlib.json`
(`public_aliases`, covered by `aliases_digest`) and bound as ordinary (`public_aliases`, covered by `aliases_digest`) and bound as ordinary
`Marqdo` calls to `io.mq.md::写值` (ADR-0058). There is no `Marqdo` calls to `io.mq.md::写值` (ADR-0058). There is no
`Program.print_override`, no AST-wide print scan and no runtime print branch; `Program.print_override`, no AST-wide print scan and no runtime print branch;
+66 -60
View File
@@ -45,24 +45,33 @@ pub struct StdlibBundle {
impl StdlibBundle { impl StdlibBundle {
/// Discover the bundle. /// Discover the bundle.
/// ///
/// Order: `MARQDO_STDLIB_DIR` (explicit, fail if invalid), a `stdlib` /// Order: `MARQDO_STDLIB_DIR` (explicit, fail if invalid) then a `stdlib`
/// directory next to the executable, and finally — **debug builds only** — the /// directory next to the executable. The official Bundle is an installed
/// compile-time source tree. A release binary never falls back to a build /// artifact next to the binary (RFC-EXT-0003 H-08, ADR-0070); there is no
/// machine path: the release archive must ship a verified `stdlib/` next to /// compile-time source-tree fallback in any build profile.
/// the binary (RFC-EXT-0003 H-08, ADR).
pub fn discover() -> Result<Option<Self>, String> { pub fn discover() -> Result<Option<Self>, String> {
if let Some(dir) = std::env::var_os(STDLIB_DIR_ENV) { let override_dir = std::env::var_os(STDLIB_DIR_ENV).map(PathBuf::from);
return Self::load(PathBuf::from(dir)).map(Some); let exe_dir = std::env::current_exe()
}
Self::discover_from_exe_dir(
std::env::current_exe()
.ok() .ok()
.and_then(|exe| exe.parent().map(Path::to_path_buf)), .and_then(|exe| exe.parent().map(Path::to_path_buf));
) Self::discover_with(override_dir, exe_dir)
}
/// Discovery with the explicit override and the executable directory passed
/// in. The override is authoritative: a bad `MARQDO_STDLIB_DIR` fails even
/// when a valid sibling Bundle exists (no silent fallback).
fn discover_with(
override_dir: Option<PathBuf>,
exe_dir: Option<PathBuf>,
) -> Result<Option<Self>, String> {
if let Some(dir) = override_dir {
return Self::load(dir).map(Some);
}
Self::discover_from_exe_dir(exe_dir)
} }
/// Discover from the directory that holds the executable, without the explicit /// Discover from the directory that holds the executable, without the explicit
/// environment override. Release builds do not read the source tree. /// environment override. Only the installed sibling Bundle is considered.
fn discover_from_exe_dir(exe_dir: Option<PathBuf>) -> Result<Option<Self>, String> { fn discover_from_exe_dir(exe_dir: Option<PathBuf>) -> Result<Option<Self>, String> {
if let Some(parent) = exe_dir { if let Some(parent) = exe_dir {
let candidate = parent.join("stdlib"); let candidate = parent.join("stdlib");
@@ -70,16 +79,6 @@ impl StdlibBundle {
return Self::load(candidate).map(Some); return Self::load(candidate).map(Some);
} }
} }
#[cfg(debug_assertions)]
{
let dev = PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.join("..")
.join("..")
.join("stdlib");
if dev.is_dir() {
return Self::load(dev).map(Some);
}
}
Ok(None) Ok(None)
} }
@@ -454,21 +453,41 @@ pub fn aliases_digest(aliases: &[PublicAlias]) -> String {
mod tests { mod tests {
use super::*; use super::*;
fn dev_bundle() -> PathBuf { /// A small synthetic Bundle so loader unit tests never depend on the
PathBuf::from(env!("CARGO_MANIFEST_DIR")) /// product tree (ADR-0070 test-lane separation).
.join("..") fn write_synthetic_bundle(root: &Path) {
.join("..") for (relative, body) in [
.join("stdlib") ("io.mq.md", "## @knowledge test\n"),
("io/console.mq.md", "## @knowledge console\n"),
] {
let path = root.join(relative);
std::fs::create_dir_all(path.parent().unwrap()).unwrap();
std::fs::write(path, body).unwrap();
}
let digest = tree_digest(root).unwrap();
let manifest = serde_json::json!({
"name": "test-stdlib",
"version": "0.0.0-test",
"digest": digest,
});
std::fs::write(
root.join("stdlib.json"),
serde_json::to_vec(&manifest).unwrap(),
)
.unwrap();
} }
#[test] #[test]
fn dev_bundle_verifies_and_resolves() { fn synthetic_bundle_verifies_and_resolves() {
let bundle = StdlibBundle::load(dev_bundle()).unwrap(); let dir = tempfile::tempdir().unwrap();
assert!(bundle.digest.starts_with("sha256:")); write_synthetic_bundle(dir.path());
let bundle = StdlibBundle::load(dir.path()).unwrap();
assert_eq!(bundle.version(), "0.0.0-test");
let io = bundle.resolve("io").unwrap(); let io = bundle.resolve("io").unwrap();
assert_eq!(io.relative_path, "io.mq.md"); assert_eq!(io.relative_path, "io.mq.md");
assert!(io.package.instance_id.starts_with("std:marqdo-stdlib@")); assert!(io.package.instance_id.starts_with("std:test-stdlib@"));
assert!(bundle.resolve("../escape").is_err()); assert!(bundle.resolve("../escape").is_err());
assert!(bundle.resolve("/absolute").is_err());
} }
#[test] #[test]
@@ -476,44 +495,31 @@ mod tests {
let dir = tempfile::tempdir().unwrap(); let dir = tempfile::tempdir().unwrap();
let bundle = dir.path().join("stdlib"); let bundle = dir.path().join("stdlib");
std::fs::create_dir_all(&bundle).unwrap(); std::fs::create_dir_all(&bundle).unwrap();
for entry in std::fs::read_dir(dev_bundle()).unwrap() { write_synthetic_bundle(&bundle);
let entry = entry.unwrap();
let target = bundle.join(entry.file_name());
if entry.path().is_dir() {
copy_dir(&entry.path(), &target);
} else {
std::fs::copy(entry.path(), target).unwrap();
}
}
let found = StdlibBundle::discover_from_exe_dir(Some(dir.path().to_path_buf())) let found = StdlibBundle::discover_from_exe_dir(Some(dir.path().to_path_buf()))
.unwrap() .unwrap()
.expect("sibling stdlib"); .expect("sibling stdlib");
assert_eq!(found.root, bundle.canonicalize().unwrap()); assert_eq!(found.root(), bundle.canonicalize().unwrap());
} }
fn copy_dir(source: &std::path::Path, target: &std::path::Path) { #[test]
std::fs::create_dir_all(target).unwrap(); fn bad_override_fails_closed_even_with_a_valid_sibling() {
for entry in std::fs::read_dir(source).unwrap() { let dir = tempfile::tempdir().unwrap();
let entry = entry.unwrap(); let sibling = dir.path().join("stdlib");
let destination = target.join(entry.file_name()); std::fs::create_dir_all(&sibling).unwrap();
if entry.path().is_dir() { write_synthetic_bundle(&sibling);
copy_dir(&entry.path(), &destination); let error = StdlibBundle::discover_with(
} else { Some(dir.path().join("missing")),
std::fs::copy(entry.path(), destination).unwrap(); Some(dir.path().to_path_buf()),
} )
} .unwrap_err();
assert!(error.contains("cannot open stdlib directory"), "{error}");
} }
#[test] #[test]
fn digest_tamper_is_rejected() { fn digest_tamper_is_rejected() {
let dir = tempfile::tempdir().unwrap(); let dir = tempfile::tempdir().unwrap();
let source = dev_bundle(); write_synthetic_bundle(dir.path());
for entry in std::fs::read_dir(&source).unwrap() {
let entry = entry.unwrap();
if entry.path().is_file() {
std::fs::copy(entry.path(), dir.path().join(entry.file_name())).unwrap();
}
}
std::fs::write(dir.path().join("io.mq.md"), "## @knowledge tampered\n").unwrap(); std::fs::write(dir.path().join("io.mq.md"), "## @knowledge tampered\n").unwrap();
let error = StdlibBundle::load(dir.path()).unwrap_err(); let error = StdlibBundle::load(dir.path()).unwrap_err();
assert!(error.contains("digest mismatch"), "{error}"); assert!(error.contains("digest mismatch"), "{error}");
+3 -5
View File
@@ -3,6 +3,8 @@
//! These drive the real CLI binary: exact source/AST/scope projection, explicit //! These drive the real CLI binary: exact source/AST/scope projection, explicit
//! reference states, output safety, Observation digest binding, independent //! reference states, output safety, Observation digest binding, independent
//! consumers and schema/semantic mutation rejection. //! consumers and schema/semantic mutation rejection.
#[path = "support/stdlib.rs"]
pub mod stdlib_support;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::process::{Command, Output}; use std::process::{Command, Output};
@@ -50,12 +52,8 @@ impl Drop for TempDir {
} }
} }
fn binary() -> &'static str {
env!("CARGO_BIN_EXE_marqdo")
}
fn cli(dir: &Path, args: &[&str]) -> Output { fn cli(dir: &Path, args: &[&str]) -> Output {
Command::new(binary()) stdlib_support::cli_command()
.args(args) .args(args)
.current_dir(dir) .current_dir(dir)
.output() .output()
+3 -5
View File
@@ -1,5 +1,7 @@
//! Public Analysis and Observation black-box contracts (spec/analysis.md, //! Public Analysis and Observation black-box contracts (spec/analysis.md,
//! spec/observation.md). //! spec/observation.md).
#[path = "support/stdlib.rs"]
pub mod stdlib_support;
#[path = "support/observation.rs"] #[path = "support/observation.rs"]
pub mod observation; pub mod observation;
@@ -34,12 +36,8 @@ impl Drop for TempDir {
} }
} }
fn binary() -> &'static str {
env!("CARGO_BIN_EXE_marqdo")
}
fn cli(dir: &Path, args: &[&str]) -> Output { fn cli(dir: &Path, args: &[&str]) -> Output {
Command::new(binary()) stdlib_support::cli_command()
.args(args) .args(args)
.current_dir(dir) .current_dir(dir)
.output() .output()
+31 -9
View File
@@ -2,11 +2,14 @@
//! //!
//! These checks pin the documented layering: the engine depends on the neutral //! These checks pin the documented layering: the engine depends on the neutral
//! Host contract (never the native host), the plugin ABI contract carries no //! Host contract (never the native host), the plugin ABI contract carries no
//! loader/worker execution side, the bundled stdlib stays in this repository, //! loader/worker execution side, the stdlib Bundle is an explicit ecosystem
//! `std:` import targets resolve only inside the bundle, and the host keeps the //! input rather than an in-repo source tree, `std:` import targets resolve only
//! inside the bundle, and the host keeps the
//! documented stdio/file/TCP resource endpoints. They are source and digest //! documented stdio/file/TCP resource endpoints. They are source and digest
//! checks, not an OS-sandbox proof; `tools/ci/check_dependency_boundaries.py` //! checks, not an OS-sandbox proof; `tools/ci/check_dependency_boundaries.py`
//! adds the Cargo-metadata graph gate. //! adds the Cargo-metadata graph gate.
#[path = "support/stdlib.rs"]
pub mod stdlib_support;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
@@ -137,23 +140,42 @@ fn engine_depends_on_the_neutral_host_contract_only() {
} }
#[test] #[test]
fn bundled_stdlib_stays_in_this_repository_and_matches_its_digest() { fn stdlib_sources_live_in_the_ecosystem_not_in_this_repository() {
let root = repo_root().join("stdlib"); // Phase B (ADR-0070): the in-repo source tree is gone. The accepted Bundle
// identity is the ecosystem pin; product tests consume an explicit, verified
// Bundle (CI materializes it with tools/ci/fetch_ecosystem_bundle.py).
assert!(
!repo_root().join("stdlib").exists(),
"Phase B must not carry an in-repo stdlib source tree"
);
let pin = stdlib_support::BundlePin::committed();
assert!(
pin.source_path.is_none(),
"the accepted Bundle pin must name the ecosystem source, not a vendored path"
);
assert_eq!(pin.name, "marqdo-stdlib");
assert_eq!(pin.version, "0.2.0");
assert_eq!(pin.source_commit.len(), 40);
let root = stdlib_support::bundle_dir();
let manifest: serde_json::Value = let manifest: serde_json::Value =
serde_json::from_slice(&std::fs::read(root.join("stdlib.json")).unwrap()).unwrap(); serde_json::from_slice(&std::fs::read(root.join("stdlib.json")).unwrap()).unwrap();
assert_eq!(manifest["name"], "marqdo-stdlib"); assert_eq!(manifest["name"], pin.name);
assert_eq!(manifest["version"], "0.1.0"); assert_eq!(manifest["version"], pin.version);
let declared = manifest["digest"].as_str().expect("digest string"); let declared = manifest["digest"].as_str().expect("digest string");
assert_eq!(
declared, pin.tree_digest,
"the resolved Bundle must match the pin"
);
let actual = format!("sha256:{}", tree_digest(&root).unwrap()); let actual = format!("sha256:{}", tree_digest(&root).unwrap());
assert_eq!( assert_eq!(
actual, declared, actual, declared,
"stdlib digest mismatch; regenerate it with tools/pack-stdlib.py and commit the digest" "stdlib digest mismatch; rebuild the Bundle from the pinned ecosystem gitlinks"
); );
} }
#[test] #[test]
fn stdlib_imports_resolve_inside_the_bundle() { fn stdlib_imports_resolve_inside_the_bundle() {
let root = repo_root().join("stdlib"); let root = stdlib_support::bundle_dir();
for entry in walk_markdown(&root) { for entry in walk_markdown(&root) {
let is_test = entry.starts_with(root.join("tests")); let is_test = entry.starts_with(root.join("tests"));
let text = read(&entry); let text = read(&entry);
@@ -488,7 +510,7 @@ const _: fn(marqdo_value::Value) = |value| match value {
/// hard-coded runtime names. Recompute the canonical metadata digest. /// hard-coded runtime names. Recompute the canonical metadata digest.
#[test] #[test]
fn official_stdlib_public_aliases_are_verified_metadata() { fn official_stdlib_public_aliases_are_verified_metadata() {
let root = repo_root().join("stdlib"); let root = stdlib_support::bundle_dir();
let manifest: serde_json::Value = let manifest: serde_json::Value =
serde_json::from_slice(&std::fs::read(root.join("stdlib.json")).unwrap()).unwrap(); serde_json::from_slice(&std::fs::read(root.join("stdlib.json")).unwrap()).unwrap();
let aliases = manifest["public_aliases"] let aliases = manifest["public_aliases"]
+4 -1
View File
@@ -4,6 +4,9 @@
//! point is to prove that `check` and `run` share one static resolution and //! point is to prove that `check` and `run` share one static resolution and
//! that the runtime never guesses a plugin from a dotted string prefix. //! that the runtime never guesses a plugin from a dotted string prefix.
#![cfg(unix)] #![cfg(unix)]
#[path = "support/stdlib.rs"]
pub mod stdlib_support;
#[path = "support/observation.rs"] #[path = "support/observation.rs"]
pub mod observation; pub mod observation;
@@ -49,7 +52,7 @@ fn repo() -> PathBuf {
} }
fn cli(args: &[&str], dir: &Path) -> Output { fn cli(args: &[&str], dir: &Path) -> Output {
Command::new(env!("CARGO_BIN_EXE_marqdo")) stdlib_support::cli_command()
.args(args) .args(args)
.current_dir(dir) .current_dir(dir)
.output() .output()
+5 -2
View File
@@ -18,8 +18,11 @@
//! Developer note: `UPDATE_SEMANTICS_GOLDENS=1` rewrites `value`/`stdout` from //! Developer note: `UPDATE_SEMANTICS_GOLDENS=1` rewrites `value`/`stdout` from
//! the implementation. Never use it without hand-checking every rewritten //! the implementation. Never use it without hand-checking every rewritten
//! expectation; the checked-in goldens were reviewed individually. //! expectation; the checked-in goldens were reviewed individually.
#[path = "support/stdlib.rs"]
pub mod stdlib_support;
use std::fs; use std::fs;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use marqdo_host::{Capabilities, StdHost}; use marqdo_host::{Capabilities, StdHost};
@@ -292,7 +295,7 @@ fn normalise_relative(path: &Path) -> String {
/// unique registry, run the single binding pass and install its table. There is /// unique registry, run the single binding pass and install its table. There is
/// no `print_override` and no runtime name guessing. /// no `print_override` and no runtime name guessing.
fn bind_calls_with_stdlib_aliases(program: &mut Program) { fn bind_calls_with_stdlib_aliases(program: &mut Program) {
let root = repo_root().join("stdlib"); let root = stdlib_support::bundle_dir();
let mut loaded = std::collections::BTreeSet::new(); let mut loaded = std::collections::BTreeSet::new();
let mut official = Vec::new(); let mut official = Vec::new();
if root.join("stdlib.json").is_file() { if root.join("stdlib.json").is_file() {
@@ -429,7 +432,7 @@ fn install_entry_stdlib_imports(
module_id: &ModuleId, module_id: &ModuleId,
analysis: &marqdo_frontend::AnalysisResult, analysis: &marqdo_frontend::AnalysisResult,
) { ) {
let root = repo_root().join("stdlib"); let root = stdlib_support::bundle_dir();
let Some(imports) = analysis let Some(imports) = analysis
.document .document
.frontmatter() .frontmatter()
+7 -30
View File
@@ -1,11 +1,13 @@
//! R6 integration examples that do not require an official external repo. //! R6 integration examples that do not require an official external repo.
#![cfg(unix)] #![cfg(unix)]
#[path = "support/stdlib.rs"]
pub mod stdlib_support;
#[path = "support/observation.rs"] #[path = "support/observation.rs"]
pub mod observation; pub mod observation;
use std::path::Path; use std::path::Path;
use std::process::{Command, Output}; use std::process::Output;
fn repo() -> &'static Path { fn repo() -> &'static Path {
Path::new(env!("CARGO_MANIFEST_DIR")) Path::new(env!("CARGO_MANIFEST_DIR"))
@@ -16,7 +18,7 @@ fn repo() -> &'static Path {
} }
fn cli(args: &[&str]) -> Output { fn cli(args: &[&str]) -> Output {
Command::new(env!("CARGO_BIN_EXE_marqdo")) stdlib_support::cli_command()
.args(args) .args(args)
.current_dir(repo()) .current_dir(repo())
.output() .output()
@@ -27,31 +29,6 @@ fn stderr(output: &Output) -> String {
String::from_utf8_lossy(&output.stderr).to_string() String::from_utf8_lossy(&output.stderr).to_string()
} }
#[test]
fn mqmd_stdlib_print_output_matches_builtin_print() {
let output = cli(&["run", "stdlib/demo.mq.md"]);
assert_eq!(output.status.code(), Some(0), "{}", stderr(&output));
let stdout = String::from_utf8_lossy(&output.stdout);
let lines: Vec<&str> = stdout.lines().collect();
assert_eq!(lines.len(), 6, "{stdout:?}");
for pair in [(0, 1), (2, 3), (4, 5)] {
assert_eq!(
lines[pair.0], lines[pair.1],
"stdlib formatting differs from 打印 at line {}",
pair.0
);
}
assert_eq!(
lines[0],
r#"["文本", 2, 1.5, [3, true], {a: 1, b: "x"}, None]"#
);
assert_eq!(lines[2], "Table[名称 | 分数]{甲 | 87; 乙 | 92}");
assert_eq!(
lines[4],
r#"[Formula("a = 1"), Code("text", 9 bytes), FunctionRef(root:default::demo.mq.md::演示函数)]"#
);
}
#[test] #[test]
fn addressable_memory_example_runs_through_the_cli() { fn addressable_memory_example_runs_through_the_cli() {
let output = cli(&["run", "examples/memory-buffer.mq.md", "--output", "json"]); let output = cli(&["run", "examples/memory-buffer.mq.md", "--output", "json"]);
@@ -113,14 +90,14 @@ fn unknown_tool_name_installs_and_dispatches() {
.unwrap() .unwrap()
.as_nanos() .as_nanos()
)); ));
let install = Command::new(env!("CARGO_BIN_EXE_marqdo")) let install = stdlib_support::cli_command()
.args(["tool", "install", "examples/tool-unknown-name/tool.json"]) .args(["tool", "install", "examples/tool-unknown-name/tool.json"])
.env("MARQDO_TOOL_HOME", &home) .env("MARQDO_TOOL_HOME", &home)
.current_dir(repo()) .current_dir(repo())
.output() .output()
.unwrap(); .unwrap();
assert_eq!(install.status.code(), Some(0), "{}", stderr(&install)); assert_eq!(install.status.code(), Some(0), "{}", stderr(&install));
let run = Command::new(env!("CARGO_BIN_EXE_marqdo")) let run = stdlib_support::cli_command()
.args(["benchmark", "run", "."]) .args(["benchmark", "run", "."])
.env("MARQDO_TOOL_HOME", &home) .env("MARQDO_TOOL_HOME", &home)
.current_dir(repo()) .current_dir(repo())
@@ -128,7 +105,7 @@ fn unknown_tool_name_installs_and_dispatches() {
.unwrap(); .unwrap();
assert_eq!(run.status.code(), Some(0), "{}", stderr(&run)); assert_eq!(run.status.code(), Some(0), "{}", stderr(&run));
assert!(String::from_utf8_lossy(&run.stdout).contains("arg=run")); assert!(String::from_utf8_lossy(&run.stdout).contains("arg=run"));
let remove = Command::new(env!("CARGO_BIN_EXE_marqdo")) let remove = stdlib_support::cli_command()
.args(["tool", "remove", "benchmark"]) .args(["tool", "remove", "benchmark"])
.env("MARQDO_TOOL_HOME", &home) .env("MARQDO_TOOL_HOME", &home)
.current_dir(repo()) .current_dir(repo())
+3 -1
View File
@@ -4,6 +4,8 @@
//! sources, `marqdo lock` records their exact identity, and `check`/`run` //! sources, `marqdo lock` records their exact identity, and `check`/`run`
//! compare the current declaration with the lock before using any extension. //! compare the current declaration with the lock before using any extension.
#![cfg(unix)] #![cfg(unix)]
#[path = "support/stdlib.rs"]
pub mod stdlib_support;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::process::{Command, Output}; use std::process::{Command, Output};
@@ -47,7 +49,7 @@ fn repo() -> PathBuf {
} }
fn cli(args: &[&str], dir: &Path) -> Output { fn cli(args: &[&str], dir: &Path) -> Output {
Command::new(env!("CARGO_BIN_EXE_marqdo")) stdlib_support::cli_command()
.args(args) .args(args)
.current_dir(dir) .current_dir(dir)
.output() .output()
+4 -2
View File
@@ -5,9 +5,11 @@
//! binary and assert that `check --emit`, `run` and `call` agree. //! binary and assert that `check --emit`, `run` and `call` agree.
#![cfg(unix)] #![cfg(unix)]
#[path = "support/stdlib.rs"]
pub mod stdlib_support;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::process::{Command, Output}; use std::process::Output;
use std::sync::atomic::{AtomicU32, Ordering}; use std::sync::atomic::{AtomicU32, Ordering};
static COUNTER: AtomicU32 = AtomicU32::new(0); static COUNTER: AtomicU32 = AtomicU32::new(0);
@@ -41,7 +43,7 @@ impl Drop for TempDir {
} }
fn cli(args: &[&str], dir: &Path) -> Output { fn cli(args: &[&str], dir: &Path) -> Output {
Command::new(env!("CARGO_BIN_EXE_marqdo")) stdlib_support::cli_command()
.args(args) .args(args)
.current_dir(dir) .current_dir(dir)
.output() .output()
+4 -2
View File
@@ -8,6 +8,8 @@
//! //!
//! Temporary directories live under the OS temp directory and are removed on //! Temporary directories live under the OS temp directory and are removed on
//! drop; the repository itself is never modified. //! drop; the repository itself is never modified.
#[path = "support/stdlib.rs"]
pub mod stdlib_support;
#[path = "support/observation.rs"] #[path = "support/observation.rs"]
pub mod observation; pub mod observation;
@@ -75,7 +77,7 @@ impl Drop for TempDir {
/// Run the CLI in `dir`. /// Run the CLI in `dir`.
fn cli(dir: &Path, args: &[&str]) -> Output { fn cli(dir: &Path, args: &[&str]) -> Output {
Command::new(env!("CARGO_BIN_EXE_marqdo")) stdlib_support::cli_command()
.args(args) .args(args)
.current_dir(dir) .current_dir(dir)
.output() .output()
@@ -84,7 +86,7 @@ fn cli(dir: &Path, args: &[&str]) -> Output {
/// Run the CLI in `dir` with one extra environment variable. /// Run the CLI in `dir` with one extra environment variable.
fn cli_env(dir: &Path, args: &[&str], key: &str, value: &str) -> Output { fn cli_env(dir: &Path, args: &[&str], key: &str, value: &str) -> Output {
Command::new(env!("CARGO_BIN_EXE_marqdo")) stdlib_support::cli_command()
.args(args) .args(args)
.current_dir(dir) .current_dir(dir)
.env(key, value) .env(key, value)
+4 -2
View File
@@ -4,9 +4,11 @@
//! checked-in examples. //! checked-in examples.
#![cfg(unix)] #![cfg(unix)]
#[path = "support/stdlib.rs"]
pub mod stdlib_support;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::process::{Command, Output}; use std::process::Output;
use std::sync::atomic::{AtomicU32, Ordering}; use std::sync::atomic::{AtomicU32, Ordering};
static COUNTER: AtomicU32 = AtomicU32::new(0); static COUNTER: AtomicU32 = AtomicU32::new(0);
@@ -49,7 +51,7 @@ fn repo() -> PathBuf {
} }
fn cli(args: &[&str], dir: &Path) -> Output { fn cli(args: &[&str], dir: &Path) -> Output {
Command::new(env!("CARGO_BIN_EXE_marqdo")) stdlib_support::cli_command()
.args(args) .args(args)
.current_dir(dir) .current_dir(dir)
.output() .output()
+5 -3
View File
@@ -4,6 +4,8 @@
//! stdout line stream exactly like an external consumer. They cover the P0 //! stdout line stream exactly like an external consumer. They cover the P0
//! envelope/lifecycle/byte-fidelity contract and the P1 frame/value policy, //! envelope/lifecycle/byte-fidelity contract and the P1 frame/value policy,
//! plus snapshot equivalence, truncation, live delivery and a broken pipe. //! plus snapshot equivalence, truncation, live delivery and a broken pipe.
#[path = "support/stdlib.rs"]
pub mod stdlib_support;
use std::fs; use std::fs;
use std::io::{BufRead, BufReader, Read}; use std::io::{BufRead, BufReader, Read};
@@ -51,7 +53,7 @@ impl Drop for TempDir {
} }
fn cli(dir: &Path, args: &[&str]) -> std::process::Output { fn cli(dir: &Path, args: &[&str]) -> std::process::Output {
Command::new(env!("CARGO_BIN_EXE_marqdo")) stdlib_support::cli_command()
.args(args) .args(args)
.current_dir(dir) .current_dir(dir)
.output() .output()
@@ -670,7 +672,7 @@ fn live_chunks_arrive_while_the_program_is_still_running() {
let dir = TempDir::new("live"); let dir = TempDir::new("live");
let source = "## @exec main\n\n`打印(\"READY\")`\n\n`i = 0`\n\n`while i < 2000000`\n\n`i = i + 1`\n\n`end`\n\n`打印(\"FINISH\")`\n\n`return i`\n"; let source = "## @exec main\n\n`打印(\"READY\")`\n\n`i = 0`\n\n`while i < 2000000`\n\n`i = i + 1`\n\n`end`\n\n`打印(\"FINISH\")`\n\n`return i`\n";
dir.write("index.mq.md", source); dir.write("index.mq.md", source);
let mut child = Command::new(env!("CARGO_BIN_EXE_marqdo")) let mut child = stdlib_support::cli_command()
.args([ .args([
"run", "run",
"index.mq.md", "index.mq.md",
@@ -723,7 +725,7 @@ fn broken_pipe_makes_the_run_fail_instead_of_running_forever() {
let dir = TempDir::new("pipe"); let dir = TempDir::new("pipe");
let source = "## @exec main\n\n`打印(\"START\")`\n\n`i = 0`\n\n`while i < 5000000`\n\n`i = i + 1`\n\n`end`\n\n`return i`\n"; let source = "## @exec main\n\n`打印(\"START\")`\n\n`i = 0`\n\n`while i < 5000000`\n\n`i = i + 1`\n\n`end`\n\n`return i`\n";
dir.write("index.mq.md", source); dir.write("index.mq.md", source);
let mut child = Command::new(env!("CARGO_BIN_EXE_marqdo")) let mut child = stdlib_support::cli_command()
.args([ .args([
"run", "run",
"index.mq.md", "index.mq.md",
+5 -38
View File
@@ -1,10 +1,11 @@
//! RFC-CM P2 closure lane: C01–C06/C11/C12 in a pure, no-Foreign/no-Plugin host. //! RFC-CM P2 closure lane: C01–C06/C11/C12 in a pure, no-Foreign/no-Plugin host.
#[path = "support/stdlib.rs"]
pub mod stdlib_support;
#[path = "support/observation.rs"] #[path = "support/observation.rs"]
pub mod observation; pub mod observation;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::process::Command;
fn repo_root() -> PathBuf { fn repo_root() -> PathBuf {
Path::new(env!("CARGO_MANIFEST_DIR")) Path::new(env!("CARGO_MANIFEST_DIR"))
@@ -72,7 +73,7 @@ fn p2_algorithms_run_in_a_pure_no_foreign_no_plugin_host() {
"{criterion} fixture {name} uses forbidden host shortcut `{forbidden}`" "{criterion} fixture {name} uses forbidden host shortcut `{forbidden}`"
); );
} }
let output = Command::new(env!("CARGO_BIN_EXE_marqdo")) let output = stdlib_support::cli_command()
.args([ .args([
"run", "run",
path.to_str().unwrap(), path.to_str().unwrap(),
@@ -107,40 +108,6 @@ fn p2_algorithms_run_in_a_pure_no_foreign_no_plugin_host() {
} }
} }
#[test]
fn p2_stdlib_table_also_runs_in_pure_mode() {
let path = repo_root().join("stdlib").join("tests").join("table.mq.md");
let output = Command::new(env!("CARGO_BIN_EXE_marqdo"))
.args([
"run",
path.to_str().unwrap(),
"--mode",
"pure",
"--output",
"json",
])
.current_dir(repo_root().join("stdlib"))
.env("MARQDO_STDLIB_DIR", repo_root().join("stdlib"))
.output()
.expect("run table self-test");
assert_eq!(
output.status.code(),
Some(0),
"{}",
String::from_utf8_lossy(&output.stderr)
);
let report: serde_json::Value = serde_json::from_slice(&output.stdout).expect("json");
assert_eq!(report["run"]["status"], "ok");
let items = observation::terminal(&report)["value"]["items"]
.as_array()
.expect("table test list");
assert_eq!(items.len(), 9);
assert_eq!(
items[8]["value"],
"| 名称 | 分数 |\n| --- | --- |\n| 甲 | 87 |\n| 乙 | 92 |\n| 丙 | 71 |"
);
}
#[test] #[test]
fn foreign_and_plugin_shortcuts_are_unavailable_in_the_pure_lane() { fn foreign_and_plugin_shortcuts_are_unavailable_in_the_pure_lane() {
let dir = tempfile::tempdir().unwrap(); let dir = tempfile::tempdir().unwrap();
@@ -150,7 +117,7 @@ fn foreign_and_plugin_shortcuts_are_unavailable_in_the_pure_lane() {
"## @knowledge 代码\n\n```python\nprint(1)\n```\n\n## @exec main\n\n`return foreign.call(ref(\"#代码\"), None)`\n", "## @knowledge 代码\n\n```python\nprint(1)\n```\n\n## @exec main\n\n`return foreign.call(ref(\"#代码\"), None)`\n",
) )
.unwrap(); .unwrap();
let output = Command::new(env!("CARGO_BIN_EXE_marqdo")) let output = stdlib_support::cli_command()
.args([ .args([
"run", "run",
foreign.to_str().unwrap(), foreign.to_str().unwrap(),
@@ -176,7 +143,7 @@ fn foreign_and_plugin_shortcuts_are_unavailable_in_the_pure_lane() {
"## @exec main\n\n`plugin.invoke(\"missing.export\", {})`\n\n`return None`\n", "## @exec main\n\n`plugin.invoke(\"missing.export\", {})`\n\n`return None`\n",
) )
.unwrap(); .unwrap();
let output = Command::new(env!("CARGO_BIN_EXE_marqdo")) let output = stdlib_support::cli_command()
.args([ .args([
"run", "run",
plugin.to_str().unwrap(), plugin.to_str().unwrap(),
+3 -5
View File
@@ -1,6 +1,8 @@
//! Package instance identity, transitive imports, pinned Git and environment //! Package instance identity, transitive imports, pinned Git and environment
//! materialization (M0.6 R1/R5). //! materialization (M0.6 R1/R5).
#![cfg(unix)] #![cfg(unix)]
#[path = "support/stdlib.rs"]
pub mod stdlib_support;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::process::{Command, Output}; use std::process::{Command, Output};
@@ -32,12 +34,8 @@ impl Drop for TempDir {
} }
} }
fn binary() -> &'static str {
env!("CARGO_BIN_EXE_marqdo")
}
fn cli(dir: &Path, args: &[&str]) -> Output { fn cli(dir: &Path, args: &[&str]) -> Output {
Command::new(binary()) stdlib_support::cli_command()
.args(args) .args(args)
.current_dir(dir) .current_dir(dir)
.output() .output()
+5 -3
View File
@@ -1,5 +1,7 @@
//! Isolated plugin worker transport (ADR-0010). //! Isolated plugin worker transport (ADR-0010).
#![cfg(unix)] #![cfg(unix)]
#[path = "support/stdlib.rs"]
pub mod stdlib_support;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::process::{Command, Output}; use std::process::{Command, Output};
@@ -118,7 +120,7 @@ fn write_manifest(dir: &Path, sha: &str) {
} }
fn run(dir: &Path) -> Output { fn run(dir: &Path) -> Output {
Command::new(env!("CARGO_BIN_EXE_marqdo")) stdlib_support::cli_command()
.args([ .args([
"run", "run",
dir.join("doc.mq.md").to_str().unwrap(), dir.join("doc.mq.md").to_str().unwrap(),
@@ -167,7 +169,7 @@ fn worker_crash_is_isolated_from_the_host() {
"{stderr}" "{stderr}"
); );
// The host process survived and still runs a native Marqdo program. // The host process survived and still runs a native Marqdo program.
let survivor = Command::new(env!("CARGO_BIN_EXE_marqdo")) let survivor = stdlib_support::cli_command()
.args(["run", "examples/hello.mq.md"]) .args(["run", "examples/hello.mq.md"])
.current_dir(repo()) .current_dir(repo())
.output() .output()
@@ -235,7 +237,7 @@ fn write_capability_manifest(dir: &Path, sha: &str) {
} }
fn run_capability(dir: &Path, allow_read: bool) -> Output { fn run_capability(dir: &Path, allow_read: bool) -> Output {
let mut command = Command::new(env!("CARGO_BIN_EXE_marqdo")); let mut command = stdlib_support::cli_command();
command.args([ command.args([
"run", "run",
dir.join("doc.mq.md").to_str().unwrap(), dir.join("doc.mq.md").to_str().unwrap(),
+4 -2
View File
@@ -1,7 +1,9 @@
//! Compat-B `打印` routing tests (ADR-0030). //! Compat-B `打印` routing tests (ADR-0030).
#[path = "support/stdlib.rs"]
pub mod stdlib_support;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::process::{Command, Output}; use std::process::Output;
struct TempDir(PathBuf); struct TempDir(PathBuf);
@@ -25,7 +27,7 @@ impl Drop for TempDir {
} }
fn cli(dir: &Path, args: &[&str]) -> Output { fn cli(dir: &Path, args: &[&str]) -> Output {
Command::new(env!("CARGO_BIN_EXE_marqdo")) stdlib_support::cli_command()
.args(args) .args(args)
.current_dir(dir) .current_dir(dir)
.output() .output()
+4 -1
View File
@@ -15,6 +15,9 @@
//! Other platforms must keep this file compiling but run no provider //! Other platforms must keep this file compiling but run no provider
//! assertions; the CLI itself fails closed with `ext.platform_unsupported`. //! assertions; the CLI itself fails closed with `ext.platform_unsupported`.
#![cfg(all(target_os = "linux", target_arch = "x86_64"))] #![cfg(all(target_os = "linux", target_arch = "x86_64"))]
#[path = "support/stdlib.rs"]
pub mod stdlib_support;
#[path = "support/observation.rs"] #[path = "support/observation.rs"]
pub mod observation; pub mod observation;
@@ -400,7 +403,7 @@ fn marker_text(path: &Path) -> String {
} }
fn run_cli(dir: &Path, args: &[&str], marker: &Path) -> Output { fn run_cli(dir: &Path, args: &[&str], marker: &Path) -> Output {
Command::new(cli_binary()) stdlib_support::cli_command()
.args(args) .args(args)
.current_dir(dir) .current_dir(dir)
.env(MARKER_ENV, marker) .env(MARKER_ENV, marker)
+5 -3
View File
@@ -1,11 +1,13 @@
//! End-to-end resource stream tests through the CLI. //! End-to-end resource stream tests through the CLI.
#[path = "support/stdlib.rs"]
pub mod stdlib_support;
#[path = "support/observation.rs"] #[path = "support/observation.rs"]
pub mod observation; pub mod observation;
use std::io::Write; use std::io::Write;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::process::{Command, Output, Stdio}; use std::process::{Output, Stdio};
struct TempDir(PathBuf); struct TempDir(PathBuf);
@@ -30,7 +32,7 @@ impl Drop for TempDir {
} }
fn cli(dir: &Path, args: &[&str]) -> Output { fn cli(dir: &Path, args: &[&str]) -> Output {
Command::new(env!("CARGO_BIN_EXE_marqdo")) stdlib_support::cli_command()
.args(args) .args(args)
.current_dir(dir) .current_dir(dir)
.output() .output()
@@ -38,7 +40,7 @@ fn cli(dir: &Path, args: &[&str]) -> Output {
} }
fn cli_with_stdin(dir: &Path, args: &[&str], input: &[u8]) -> Output { fn cli_with_stdin(dir: &Path, args: &[&str], input: &[u8]) -> Output {
let mut child = Command::new(env!("CARGO_BIN_EXE_marqdo")) let mut child = stdlib_support::cli_command()
.args(args) .args(args)
.current_dir(dir) .current_dir(dir)
.stdin(Stdio::piped()) .stdin(Stdio::piped())
+5 -12
View File
@@ -4,9 +4,11 @@
//! in the verified `stdlib.json` metadata. There is no `print_override`, no //! in the verified `stdlib.json` metadata. There is no `print_override`, no
//! runtime name special case and no hard-coded per-function scan. //! runtime name special case and no hard-coded per-function scan.
#![cfg(unix)] #![cfg(unix)]
#[path = "support/stdlib.rs"]
pub mod stdlib_support;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::process::{Command, Output}; use std::process::Output;
use std::sync::atomic::{AtomicU32, Ordering}; use std::sync::atomic::{AtomicU32, Ordering};
static COUNTER: AtomicU32 = AtomicU32::new(0); static COUNTER: AtomicU32 = AtomicU32::new(0);
@@ -35,17 +37,8 @@ impl Drop for TempDir {
} }
} }
fn repo() -> PathBuf {
Path::new(env!("CARGO_MANIFEST_DIR"))
.parent()
.unwrap()
.parent()
.unwrap()
.to_path_buf()
}
fn cli(args: &[&str], dir: &Path, env: &[(&str, &Path)]) -> Output { fn cli(args: &[&str], dir: &Path, env: &[(&str, &Path)]) -> Output {
let mut command = Command::new(env!("CARGO_BIN_EXE_marqdo")); let mut command = stdlib_support::cli_command();
command.args(args).current_dir(dir); command.args(args).current_dir(dir);
for (key, value) in env { for (key, value) in env {
command.env(key, value); command.env(key, value);
@@ -62,7 +55,7 @@ fn stdout(output: &Output) -> String {
} }
fn copy_stdlib(target: &Path) { fn copy_stdlib(target: &Path) {
let source = repo().join("stdlib"); let source = stdlib_support::bundle_dir();
std::fs::create_dir_all(target).unwrap(); std::fs::create_dir_all(target).unwrap();
for entry in std::fs::read_dir(&source).unwrap() { for entry in std::fs::read_dir(&source).unwrap() {
let entry = entry.unwrap(); let entry = entry.unwrap();
+4 -12
View File
@@ -1,27 +1,19 @@
//! Bundled stdlib (`std:`) and frozen-CLI closure tests (CM-A10). //! Bundled stdlib (`std:`) and frozen-CLI closure tests (CM-A10).
#[path = "support/stdlib.rs"]
pub mod stdlib_support;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::process::Command;
fn repo_root() -> PathBuf {
Path::new(env!("CARGO_MANIFEST_DIR"))
.parent()
.unwrap()
.parent()
.unwrap()
.to_path_buf()
}
fn binary() -> &'static str { fn binary() -> &'static str {
env!("CARGO_BIN_EXE_marqdo") env!("CARGO_BIN_EXE_marqdo")
} }
fn stdlib_dir() -> PathBuf { fn stdlib_dir() -> PathBuf {
repo_root().join("stdlib") stdlib_support::bundle_dir()
} }
fn run(dir: &Path, stdlib: &Path, args: &[&str]) -> std::process::Output { fn run(dir: &Path, stdlib: &Path, args: &[&str]) -> std::process::Output {
Command::new(binary()) stdlib_support::cli_command()
.args(args) .args(args)
.current_dir(dir) .current_dir(dir)
.env("MARQDO_STDLIB_DIR", stdlib) .env("MARQDO_STDLIB_DIR", stdlib)
-48
View File
@@ -1,48 +0,0 @@
//! CM-A08/P5 stdlib HTTP framing module tests.
#[path = "support/observation.rs"]
pub mod observation;
use std::path::Path;
use std::process::Command;
fn repo_root() -> std::path::PathBuf {
Path::new(env!("CARGO_MANIFEST_DIR"))
.parent()
.unwrap()
.parent()
.unwrap()
.to_path_buf()
}
#[test]
fn stdlib_http_parses_chunked_responses_and_builds_requests() {
let output = Command::new(env!("CARGO_BIN_EXE_marqdo"))
.args(["run", "tests/http.mq.md", "--output", "json"])
.current_dir(repo_root().join("stdlib"))
.env("MARQDO_STDLIB_DIR", repo_root().join("stdlib"))
.output()
.expect("run http self-test");
assert_eq!(
output.status.code(),
Some(0),
"{}",
String::from_utf8_lossy(&output.stderr)
);
let report: serde_json::Value = serde_json::from_slice(&output.stdout).expect("json");
assert_eq!(report["run"]["status"], "ok");
let items = observation::terminal(&report)["value"]["items"]
.as_array()
.expect("list");
assert_eq!(items[0]["decimal"], "200");
assert_eq!(items[1]["value"], "OK");
assert_eq!(items[2]["value"], "text/plain");
assert_eq!(items[3]["value"], "hello world");
assert_eq!(
items[4]["value"],
"POST /echo HTTP/1.1\r\nHost: example.test\r\nContent-Length: 2\r\n\r\nok"
);
assert_eq!(items[5]["decimal"], "200");
assert_eq!(items[6]["value"], "你好");
assert_eq!(items[7]["value"], "POST / HTTP/1.1\r\n\r\nAB");
}
+120 -533
View File
@@ -1,570 +1,157 @@
//! Product-level tests for the whole bundled `marqdo-stdlib` tree. //! CLI product lane against the accepted external stdlib Bundle (ADR-0070 Phase B).
//! //!
//! Every public module in `stdlib/README.md` has a `.mq.md` self-test under //! The standard-library module sources and their self-tests live in the
//! `stdlib/tests/`, and this lane runs the whole directory through the real //! component repositories; this lane proves what the CLI still owns: it loads
//! user import path (`std:` + the verified bundle), not through a conformance //! one verified offline Bundle, resolves the public `std:` surface, and routes
//! fixture or a Rust shortcut. //! the official `print`/`打印` aliases through the ordinary target function.
//! The Bundle is an explicit input (`MARQDO_TEST_STDLIB_BUNDLE`) verified
//! against `tools/stdlib/bundle-pin.json`; there is no in-repo fallback.
#[path = "support/observation.rs"] #[path = "support/observation.rs"]
pub mod observation; pub mod observation;
use std::io::Write; #[path = "support/stdlib.rs"]
use std::path::{Path, PathBuf}; pub mod stdlib_support;
use std::process::{Command, Stdio};
use std::sync::{Mutex, MutexGuard};
fn repo_root() -> PathBuf { use std::process::{Command, Output};
Path::new(env!("CARGO_MANIFEST_DIR"))
.parent()
.unwrap()
.parent()
.unwrap()
.to_path_buf()
}
static FS_LOCK: Mutex<()> = Mutex::new(()); fn run_fixture(name: &str) -> (serde_json::Value, String) {
let bundle = stdlib_support::bundle_dir();
fn lock_fs(name: &str) -> Option<MutexGuard<'static, ()>> { let fixture = stdlib_support::repo_root()
if name == "fs.mq.md" { .join("tests")
Some(FS_LOCK.lock().unwrap_or_else(|error| error.into_inner())) .join("product-stdlib")
} else { .join(format!("{name}.mq.md"));
None let output: Output = Command::new(env!("CARGO_BIN_EXE_marqdo"))
} .args([
} "run",
fixture.to_str().expect("utf-8 fixture path"),
fn stdlib_dir() -> PathBuf { "--output",
repo_root().join("stdlib") "json",
} ])
.env("MARQDO_STDLIB_DIR", &bundle)
struct TestFile { .current_dir(stdlib_support::repo_root())
name: String, .output()
stdin: &'static str, .expect("run marqdo");
stdout: &'static str,
args: Vec<String>,
env: Vec<(String, String)>,
}
fn product_tests() -> Vec<TestFile> {
let dir = stdlib_dir().join("tests");
let mut files: Vec<TestFile> = std::fs::read_dir(&dir)
.expect("read stdlib tests")
.map(|entry| {
let path = entry.unwrap().path();
if !path.is_file() {
return TestFile {
name: String::new(),
stdin: "",
stdout: "",
args: Vec::new(),
env: Vec::new(),
};
}
let name = path.file_name().unwrap().to_string_lossy().to_string();
let (stdin, stdout) = match name.as_str() {
"console.mq.md" => ("hello\n", ""),
"io.mq.md" => ("", "stdlib self-test\n"),
"stream.mq.md" => ("", "stream\n"),
_ => ("", ""),
};
let text_args = |values: &[&str]| -> Vec<String> {
values.iter().map(|value| value.to_string()).collect()
};
let (args, env) = if name == "fs.mq.md" {
(
text_args(&[
"--allow-read",
"out",
"--allow-read",
"out/**",
"--allow-write",
"out",
"--allow-write",
"out/**",
]),
Vec::new(),
)
} else if name == "env.mq.md" {
(
text_args(&[
"--allow-env",
"MARQDO_TEST_ENV",
"--allow-env",
"MARQDO_MISSING_ENV",
]),
vec![("MARQDO_TEST_ENV".to_string(), "env-value".to_string())],
)
} else if name == "process.mq.md" {
// Use the test binary itself as the granted program: it exists
// on every native platform, unlike the old `/bin/echo` fixture.
let program = env!("CARGO_BIN_EXE_marqdo").to_string();
(
vec![
"--allow-env".to_string(),
"MARQDO_TEST_PROCESS_PROGRAM".to_string(),
"--allow-process".to_string(),
program.clone(),
],
vec![("MARQDO_TEST_PROCESS_PROGRAM".to_string(), program)],
)
} else if name == "random.mq.md" {
(text_args(&["--allow-random"]), Vec::new())
} else {
(Vec::new(), Vec::new())
};
TestFile {
name,
stdin,
stdout,
args,
env,
}
})
.filter(|file| !file.name.is_empty())
.collect();
files.sort_by(|left, right| left.name.cmp(&right.name));
files
}
fn run_product_test(file: &TestFile) -> serde_json::Value {
if file.name == "fs.mq.md" {
let _ = std::fs::remove_dir_all(stdlib_dir().join("tests/out"));
}
let mut child = Command::new(env!("CARGO_BIN_EXE_marqdo"))
.args(["run"])
.arg(stdlib_dir().join("tests").join(&file.name))
.args(file.args.iter())
.args(["--output", "json"])
.current_dir(stdlib_dir())
.env("MARQDO_STDLIB_DIR", stdlib_dir())
.envs(
file.env
.iter()
.map(|(key, value)| (key.as_str(), value.as_str())),
)
.stdin(Stdio::piped())
.stdout(Stdio::piped())
.stderr(Stdio::piped())
.spawn()
.expect("spawn marqdo");
child
.stdin
.as_mut()
.unwrap()
.write_all(file.stdin.as_bytes())
.unwrap();
let output = child.wait_with_output().expect("wait marqdo");
assert_eq!( assert_eq!(
output.status.code(), output.status.code(),
Some(0), Some(0),
"{} failed: {}", "{name} failed: {}",
file.name,
String::from_utf8_lossy(&output.stderr) String::from_utf8_lossy(&output.stderr)
); );
serde_json::from_slice(&output.stdout).expect("json report") let report: serde_json::Value = serde_json::from_slice(&output.stdout).expect("json report");
assert_eq!(report["run"]["status"], "ok", "{name}");
let stdout = observation::text(&report, "stdout.chunk");
(report, stdout)
} }
#[test] #[test]
fn every_public_stdlib_module_has_a_product_test() { fn the_accepted_bundle_is_external_and_has_the_required_surface() {
let names: Vec<String> = product_tests().into_iter().map(|file| file.name).collect(); let pin = stdlib_support::BundlePin::committed();
assert_eq!( assert!(
names, pin.source_path.is_none(),
vec![ "Phase B: the accepted Bundle must not be vendored in this repository"
"clock.mq.md",
"compress.mq.md",
"console.mq.md",
"csv.mq.md",
"datetime.mq.md",
"demo.mq.md",
"env.mq.md",
"format.mq.md",
"fs.mq.md",
"http.mq.md",
"io.mq.md",
"json.mq.md",
"path.mq.md",
"process.mq.md",
"random.mq.md",
"regex.mq.md",
"stream.mq.md",
"table.mq.md",
"text.mq.md",
"utf8.mq.md",
],
"a public stdlib module is missing a product test"
); );
} let bundle = stdlib_support::bundle_dir();
let manifest: serde_json::Value =
#[test] serde_json::from_slice(&std::fs::read(bundle.join("stdlib.json")).unwrap()).unwrap();
fn the_whole_bundled_library_runs_through_std_imports() { assert_eq!(manifest["name"], pin.name);
for file in product_tests() { assert_eq!(manifest["version"], pin.version);
let _guard = lock_fs(&file.name); assert_eq!(manifest["digest"], pin.tree_digest);
let report = run_product_test(&file); assert_eq!(manifest["aliases_digest"], pin.aliases_digest);
assert_eq!(report["run"]["status"], "ok", "{}", file.name); for required in [
assert_eq!( "io.mq.md",
observation::text(&report, "stdout.chunk"), "io/console.mq.md",
file.stdout, "io/stream.mq.md",
"{} wrote unexpected stdout", "format.mq.md",
file.name "text.mq.md",
"text/utf8.mq.md",
"data/json.mq.md",
"collections/table.mq.md",
"data/table.mq.md",
"fs/file.mq.md",
"path.mq.md",
] {
assert!(
bundle.join(required).is_file(),
"the accepted Bundle is missing {required}"
); );
} }
}
#[test]
fn fs_test_exercises_the_file_operation_surface() {
let _guard = lock_fs("fs.mq.md");
let report = run_product_test(
product_tests()
.iter()
.find(|file| file.name == "fs.mq.md")
.expect("fs test"),
);
let items = observation::terminal(&report)["value"]["items"]
.as_array()
.expect("list");
assert_eq!(items[0]["value"], true);
assert_eq!(items[1]["decimal"], "7");
assert_eq!(items[2]["value"], true);
assert_eq!(items[3]["value"], "file");
assert_eq!(items[4]["decimal"], "7");
assert_eq!(items[5]["items"][0]["value"], "fs-a.txt");
assert_eq!(items[6]["value"], true);
assert_eq!(items[7]["value"], true);
assert_eq!(items[8]["value"], true);
assert_eq!(items[9]["value"], "你好\n");
assert_eq!(items[10]["decimal"], "7");
assert_eq!(items[11]["value"], "你好\n世界\n");
assert_eq!(items[12]["items"][0]["value"], "fs-b.txt");
assert_eq!(items[13]["value"], true);
assert_eq!(items[14]["value"], true);
assert!( assert!(
!stdlib_dir().join("tests/out").exists(), !bundle.join("tests").exists(),
"the fs test did not remove its directory" "the accepted Bundle must not ship component self-tests"
); );
} }
#[test] #[test]
fn json_test_parses_and_formats_nested_values() { fn official_print_aliases_match_the_target_function_output() {
let report = run_product_test( let (report, stdout) = run_fixture("print-routing");
product_tests() assert_eq!(report["run"]["status"], "ok");
.iter() let lines: Vec<&str> = stdout.lines().collect();
.find(|file| file.name == "json.mq.md") assert_eq!(lines.len(), 6, "{stdout:?}");
.expect("json test"), for pair in [(0, 1), (2, 3), (4, 5)] {
);
let items = observation::terminal(&report)["value"]["items"]
.as_array()
.expect("list");
assert_eq!(items[0]["value"], true);
assert_eq!(items[1]["decimal"], "1");
assert_eq!(items[2]["value"], "说\"好");
assert_eq!( assert_eq!(
items[3]["value"], lines[pair.0], lines[pair.1],
"[1, 2.5, -300.0, 0.4, {\"a\": 1.0}, \"x\"]" "official alias formatting differs at line {}",
pair.0
);
}
assert_eq!(
lines[0],
r#"["文本", 2, 1.5, [3, true], {a: 1, b: "x"}, None]"#
);
assert_eq!(lines[2], "Table[名称 | 分数]{甲 | 87; 乙 | 92}");
assert_eq!(
lines[4],
r#"[Formula("a = 1"), Code("text", 9 bytes), FunctionRef(root:default::print-routing.mq.md::演示函数)]"#
); );
assert_eq!(items[4]["value"], false);
assert_eq!(items[5]["value"], "json.invalid_array");
assert_eq!(items[6]["value"], "json.trailing");
assert_eq!(items[7]["value"], false);
assert_eq!(items[8]["value"], "json.depth");
assert_eq!(items[9]["value"], true);
assert_eq!(items[10]["items"][2]["items"][0]["decimal"], "3");
} }
#[test] #[test]
fn csv_test_parses_and_formats_quoted_rows() { fn std_surface_executes_against_the_official_bundle() {
let report = run_product_test( let (report, stdout) = run_fixture("std-surface");
product_tests() assert_eq!(stdout, "");
.iter() assert_eq!(
.find(|file| file.name == "csv.mq.md") observation::terminal(&report)["value"],
.expect("csv test"), serde_json::json!({
"type": "list",
"items": [
{"type": "int", "decimal": "2"},
{"type": "text", "value": "é"},
{"type": "text", "value": "[1, 2]"},
{"type": "text", "value": "[\"ok\", 3]"},
{"type": "text", "value": "a/b"},
{"type": "text", "value": "2026-11-21T08:00:00.123Z"},
{"type": "text", "value": "| 名称 | 分数 |\n| --- | --- |\n| 甲 | 87 |\n| 乙 | 92 |"}
]
})
); );
let items = observation::terminal(&report)["value"]["items"]
.as_array()
.expect("list");
let row = items[0]["items"].as_array().expect("row");
assert_eq!(row.len(), 3);
assert_eq!(row[0]["value"], "甲");
assert_eq!(row[1]["value"], "乙,丙");
assert_eq!(row[2]["value"], "说\"好");
assert_eq!(items[1]["value"], "甲,\"乙,丙\",\"说\"\"好\"");
let empty = items[2]["items"].as_array().expect("empty row");
assert_eq!(empty.len(), 1);
assert_eq!(empty[0]["value"], "");
assert_eq!(items[3]["value"], "csv.unterminated_quote");
let quoted = items[4]["items"].as_array().expect("quoted row");
assert_eq!(quoted[0]["value"], "a");
assert_eq!(quoted[1]["value"], "b");
assert_eq!(items[5]["value"], true);
let rows = items[6]["items"].as_array().expect("rows");
assert_eq!(rows.len(), 2);
assert_eq!(rows[1]["items"][0]["value"], "说\"好");
assert_eq!(items[7]["value"], "甲,\"乙,丙\"\n\"说\"\"好\",2");
} }
#[test] #[test]
fn path_test_joins_and_normalizes_project_paths() { fn a_missing_explicit_bundle_fails_closed_without_fallback() {
let report = run_product_test( let missing = stdlib_support::repo_root()
product_tests() .join("target")
.iter() .join("does-not-exist-stdlib");
.find(|file| file.name == "path.mq.md") let fixture = stdlib_support::repo_root().join("tests/product-stdlib/std-surface.mq.md");
.expect("path test"), let output = Command::new(env!("CARGO_BIN_EXE_marqdo"))
); .args([
let items = observation::terminal(&report)["value"]["items"] "run",
.as_array() fixture.to_str().expect("utf-8 fixture path"),
.expect("list"); "--output",
assert_eq!(items[0]["value"], "a/b/c"); "json",
assert_eq!(items[1]["value"], "c.txt"); ])
assert_eq!(items[2]["value"], "a/b"); .env("MARQDO_STDLIB_DIR", &missing)
assert_eq!(items[3]["value"], "txt"); .current_dir(stdlib_support::repo_root())
assert_eq!(items[4]["value"], "a/c");
assert_eq!(items[5]["value"], "/a/c");
assert_eq!(items[6]["value"], "../a/b");
assert_eq!(items[7]["value"], true);
assert_eq!(items[8]["value"], false);
}
#[test]
fn regex_test_matches_anchors_classes_and_search() {
let report = run_product_test(
product_tests()
.iter()
.find(|file| file.name == "regex.mq.md")
.expect("regex test"),
);
let items = observation::terminal(&report)["value"]["items"]
.as_array()
.expect("list");
assert_eq!(items[0]["value"], true);
assert_eq!(items[1]["value"], false);
assert_eq!(items[2]["value"], true);
assert_eq!(items[3]["value"], true);
assert_eq!(items[4]["value"], true);
assert_eq!(items[5]["value"], true);
assert_eq!(items[6]["value"], true);
assert_eq!(items[7]["value"], true);
assert_eq!(items[8]["value"], true);
assert_eq!(items[9]["value"], false);
assert_eq!(items[10]["value"], "regex.invalid");
assert_eq!(items[11]["value"], "regex.unsupported");
assert_eq!(items[12]["value"], true);
assert_eq!(items[13]["value"], true);
let groups = items[14]["items"].as_array().expect("groups");
assert_eq!(groups[0]["value"], "aab");
assert_eq!(groups[1]["value"], "aa");
assert_eq!(groups[2]["value"], "b");
}
#[test]
fn datetime_test_formats_and_parses_utc_instants() {
let report = run_product_test(
product_tests()
.iter()
.find(|file| file.name == "datetime.mq.md")
.expect("datetime test"),
);
let items = observation::terminal(&report)["value"]["items"]
.as_array()
.expect("list");
assert_eq!(items[0]["value"], "1970-01-01T00:00:00Z");
assert_eq!(items[1]["value"], "2023-11-14T22:13:20.123Z");
assert_eq!(items[2]["decimal"], "0");
assert_eq!(items[3]["decimal"], "1795248000123");
assert_eq!(items[4]["value"], false);
assert_eq!(items[5]["value"], false);
assert_eq!(items[6]["value"], "1969-12-31T23:59:59.999Z");
}
#[test]
fn clock_test_reports_project_mode_unix_millis() {
let report = run_product_test(
product_tests()
.iter()
.find(|file| file.name == "clock.mq.md")
.expect("clock test"),
);
let items = observation::terminal(&report)["value"]["items"]
.as_array()
.expect("list");
assert_eq!(items[0]["value"], true);
assert_eq!(items[1]["value"], "Int");
assert_eq!(items[2]["value"], true);
}
#[test]
fn env_test_reads_only_granted_names() {
let report = run_product_test(
product_tests()
.iter()
.find(|file| file.name == "env.mq.md")
.expect("env test"),
);
let items = observation::terminal(&report)["value"]["items"]
.as_array()
.expect("list");
assert_eq!(items[0]["value"], true);
assert_eq!(items[1]["value"], true);
assert_eq!(items[2]["value"], true);
assert_eq!(items[3]["value"], "env-value");
assert_eq!(items[4]["value"], false);
assert_eq!(items[5]["value"], "env.not_found");
}
#[test]
fn process_test_runs_an_explicitly_granted_program() {
let report = run_product_test(
product_tests()
.iter()
.find(|file| file.name == "process.mq.md")
.expect("process test"),
);
let items = observation::terminal(&report)["value"]["items"]
.as_array()
.expect("list");
assert_eq!(items[0]["value"], true);
assert_eq!(items[1]["decimal"], "0");
let expected = Command::new(env!("CARGO_BIN_EXE_marqdo"))
.arg("--version")
.output() .output()
.expect("run marqdo --version"); .expect("run marqdo");
let expected_stdout = String::from_utf8_lossy(&expected.stdout); assert_ne!(
assert_eq!( output.status.code(),
items[2]["value"].as_str().expect("process stdout"), Some(0),
expected_stdout.as_ref(), "an invalid explicit MARQDO_STDLIB_DIR must fail even when a Bundle is installed"
"process stdout must match the granted program"
);
assert_eq!(items[3]["value"], "");
}
#[test]
fn random_test_reads_bounded_entropy() {
let report = run_product_test(
product_tests()
.iter()
.find(|file| file.name == "random.mq.md")
.expect("random test"),
);
let items = observation::terminal(&report)["value"]["items"]
.as_array()
.expect("list");
assert_eq!(items[0]["value"], true);
assert_eq!(items[1]["decimal"], "16");
assert_eq!(items[2]["value"], true);
assert_eq!(items[3]["value"], true);
assert_eq!(items[4]["value"], true);
}
#[test]
fn compress_test_round_trips_gzip_text() {
let report = run_product_test(
product_tests()
.iter()
.find(|file| file.name == "compress.mq.md")
.expect("compress test"),
);
let items = observation::terminal(&report)["value"]["items"]
.as_array()
.expect("list");
assert_eq!(items[0]["value"], true);
assert_eq!(items[1]["value"], true);
assert_eq!(items[2]["value"], true);
assert_eq!(items[3]["value"], "hello 世界");
}
#[test]
fn format_test_pins_value_semantics_and_handle_observation() {
let report = run_product_test(
product_tests()
.iter()
.find(|file| file.name == "format.mq.md")
.expect("format test"),
);
let items = observation::terminal(&report)["value"]["items"]
.as_array()
.expect("list");
assert_eq!(items[0]["decimal"], "3");
assert_eq!(items[1]["value"], "[\"文本\", 2, 1.5]");
assert_eq!(items[2]["value"], "{a: 1}");
assert_eq!(items[3]["value"], "[\"a\", 2]");
assert_eq!(items[4]["value"], "None");
}
#[test]
fn text_and_utf8_tests_agree_on_the_byte_encoding() {
let text = run_product_test(
product_tests()
.iter()
.find(|file| file.name == "text.mq.md")
.expect("text test"),
);
let utf8 = run_product_test(
product_tests()
.iter()
.find(|file| file.name == "utf8.mq.md")
.expect("utf8 test"),
);
assert_eq!(
observation::terminal(&text)["value"]["items"][0]["decimal"],
"2"
);
assert_eq!(
observation::terminal(&text)["value"]["items"][1]["decimal"],
"195"
);
assert_eq!(
observation::terminal(&text)["value"]["items"][2]["decimal"],
"169"
);
assert_eq!(
observation::terminal(&utf8)["value"]["items"][0]["decimal"],
"2"
);
assert_eq!(
observation::terminal(&utf8)["value"]["items"][1]["value"],
"é"
);
assert_eq!(
observation::terminal(&utf8)["value"]["items"][2]["value"],
false
);
}
#[test]
fn stream_and_console_use_the_resource_endpoints() {
let stream = run_product_test(
product_tests()
.iter()
.find(|file| file.name == "stream.mq.md")
.expect("stream test"),
);
assert_eq!(
observation::terminal(&stream)["value"]["items"][0]["value"],
true
);
assert_eq!(
observation::terminal(&stream)["value"]["items"][1]["decimal"],
"7"
);
let console = run_product_test(
product_tests()
.iter()
.find(|file| file.name == "console.mq.md")
.expect("console test"),
);
assert_eq!(
observation::terminal(&console)["value"]["items"][0]["value"],
true
);
assert_eq!(
observation::terminal(&console)["value"]["items"][1]["value"],
"hello"
); );
let stderr = String::from_utf8_lossy(&output.stderr);
assert!( assert!(
console["events"] stderr.contains("stdlib") || stderr.contains("cannot open"),
.as_array() "failure must name the Bundle: {stderr}"
.unwrap()
.iter()
.any(|event| event["payload"]["operation"] == "resource.read"
|| event["payload"]["operation"] == "resource.open"),
"console test did not go through a resource endpoint"
); );
} }
-77
View File
@@ -1,77 +0,0 @@
//! CM-A08 table stdlib module tests.
#[path = "support/observation.rs"]
pub mod observation;
use std::path::Path;
use std::process::Command;
fn repo_root() -> std::path::PathBuf {
Path::new(env!("CARGO_MANIFEST_DIR"))
.parent()
.unwrap()
.parent()
.unwrap()
.to_path_buf()
}
fn run_table_self_test() -> serde_json::Value {
let output = Command::new(env!("CARGO_BIN_EXE_marqdo"))
.args(["run", "tests/table.mq.md", "--output", "json"])
.current_dir(repo_root().join("stdlib"))
.env("MARQDO_STDLIB_DIR", repo_root().join("stdlib"))
.output()
.expect("run table self-test");
assert_eq!(
output.status.code(),
Some(0),
"{}",
String::from_utf8_lossy(&output.stderr)
);
serde_json::from_slice(&output.stdout).expect("json output")
}
fn rows(value: &serde_json::Value) -> &Vec<serde_json::Value> {
value["rows"].as_array().expect("rows")
}
#[test]
fn stdlib_table_algorithms_rebuild_without_mutating_inputs() {
let report = run_table_self_test();
assert_eq!(report["run"]["status"], "ok");
let items = observation::terminal(&report)["value"]["items"]
.as_array()
.expect("list");
assert_eq!(items.len(), 9);
assert_eq!(items[0]["header"], serde_json::json!(["分数"]));
assert_eq!(items[0]["rows"].as_array().unwrap().len(), 3);
assert_eq!(rows(&items[1]).len(), 2);
assert_eq!(rows(&items[2]).len(), 3);
assert_eq!(rows(&items[2])[0][1]["decimal"], "71");
assert_eq!(rows(&items[3]).len(), 4);
assert_eq!(rows(&items[3])[3][0]["value"], "丁");
assert_eq!(rows(&items[4])[0][1]["decimal"], "99");
assert_eq!(rows(&items[5]).len(), 2);
assert_eq!(items[5]["header"].as_array().unwrap().len(), 4);
assert_eq!(
items[6]["entries"]["a"]["items"].as_array().unwrap().len(),
2
);
assert_eq!(
items[6]["entries"]["b"]["items"].as_array().unwrap().len(),
1
);
// Original input is unchanged.
assert_eq!(rows(&items[7]).len(), 3);
assert_eq!(rows(&items[7])[0][1]["decimal"], "87");
assert_eq!(
items[8]["value"],
"| 名称 | 分数 |\n| --- | --- |\n| 甲 | 87 |\n| 乙 | 92 |\n| 丙 | 71 |"
);
}
+407
View File
@@ -0,0 +1,407 @@
//! Pinned stdlib Bundle resolver shared by test harnesses (ADR-0070).
//!
//! Product tests consume one explicit Bundle whose identity is pinned in
//! `tools/stdlib/bundle-pin.json` (name, version, source commit, tree digest and
//! alias digest). `MARQDO_TEST_STDLIB_BUNDLE` may change the location, but the
//! Bundle must still match the pin; `MARQDO_TEST_BUNDLE_PIN` may change the pin
//! file. A bad explicit input fails even when the default location is valid —
//! there is no silent fallback.
use std::path::{Component, Path, PathBuf};
use sha2::{Digest, Sha256};
pub const BUNDLE_ENV: &str = "MARQDO_TEST_STDLIB_BUNDLE";
pub const PIN_ENV: &str = "MARQDO_TEST_BUNDLE_PIN";
/// The checkout root (this test support module lives in `crates/cli/tests`).
pub fn repo_root() -> PathBuf {
Path::new(env!("CARGO_MANIFEST_DIR"))
.parent()
.expect("crates directory")
.parent()
.expect("repository root")
.to_path_buf()
}
/// Pin file path, overridable for a candidate Bundle.
pub fn pin_path() -> PathBuf {
std::env::var_os(PIN_ENV)
.map(PathBuf::from)
.unwrap_or_else(|| {
repo_root()
.join("tools")
.join("stdlib")
.join("bundle-pin.json")
})
}
/// One pinned Bundle identity (`tools/stdlib/bundle-pin.json`).
#[derive(Debug, Clone)]
pub struct BundlePin {
pub name: String,
pub version: String,
pub source_commit: String,
/// None for the accepted ecosystem Bundle (Phase B): it is not vendored in
/// this repository, so product tests require an explicit verified Bundle.
pub source_path: Option<PathBuf>,
pub tree_digest: String,
pub aliases_digest: String,
}
impl BundlePin {
pub fn load(path: &Path) -> Self {
let text = std::fs::read_to_string(path)
.unwrap_or_else(|error| panic!("cannot read Bundle pin {}: {error}", path.display()));
let value: serde_json::Value = serde_json::from_str(&text)
.unwrap_or_else(|error| panic!("invalid Bundle pin {}: {error}", path.display()));
assert_eq!(
value.get("schema").and_then(serde_json::Value::as_str),
Some("marqdo.stdlib-bundle-pin"),
"{} must use the marqdo.stdlib-bundle-pin schema",
path.display()
);
assert_eq!(
value
.get("schema_version")
.and_then(serde_json::Value::as_u64),
Some(1),
"{} must use pin schema_version 1",
path.display()
);
let source = value
.get("source")
.unwrap_or_else(|| panic!("Bundle pin {} has no source object", path.display()));
let source_kind = source
.get("kind")
.and_then(serde_json::Value::as_str)
.unwrap_or("in-repo");
let source_path = match source_kind {
"in-repo" => {
let declared = source
.get("path")
.and_then(serde_json::Value::as_str)
.unwrap_or_else(|| {
panic!("in-repo Bundle pin {} has no source.path", path.display())
});
validate_relative(declared).unwrap_or_else(|error| {
panic!("Bundle pin {} source.path: {error}", path.display())
});
Some(PathBuf::from(declared))
}
"ecosystem" => {
for field in ["repository", "commit"] {
required_str(source, field, path);
}
None
}
other => panic!(
"Bundle pin {} has unknown source.kind {other:?}",
path.display()
),
};
Self {
name: required_str(&value, "name", path),
version: required_str(&value, "version", path),
source_commit: required_str(source, "commit", path),
source_path,
tree_digest: required_str(&value, "tree_digest", path),
aliases_digest: required_str(&value, "aliases_digest", path),
}
}
/// The committed pin for the current checkout.
pub fn committed() -> Self {
Self::load(&pin_path())
}
}
fn required_str(value: &serde_json::Value, field: &str, path: &Path) -> String {
value
.get(field)
.and_then(serde_json::Value::as_str)
.filter(|text| !text.is_empty())
.unwrap_or_else(|| panic!("Bundle pin {} has no `{field}`", path.display()))
.to_string()
}
/// One verified Bundle on disk.
#[derive(Debug, Clone)]
pub struct Bundle {
root: PathBuf,
pub name: String,
pub version: String,
pub tree_digest: String,
pub aliases_digest: String,
}
impl Bundle {
/// Resolve the Bundle for a product test: explicit override or pinned path,
/// verified against the pin.
pub fn pinned() -> Self {
let pin = BundlePin::committed();
let explicit = std::env::var_os(BUNDLE_ENV).map(PathBuf::from);
let root = match (explicit.clone(), pin.source_path.as_ref()) {
(Some(path), _) => path,
(None, Some(relative)) => repo_root().join(relative),
(None, None) => panic!(
"the accepted stdlib Bundle is not vendored in this repository; set \
{BUNDLE_ENV} to a Bundle produced from the pinned ecosystem commit {} \
(tools/ci/fetch_ecosystem_bundle.py)",
pin.source_commit
),
};
let bundle = Self::verify(&root).unwrap_or_else(|error| match &explicit {
Some(_) => panic!(
"{BUNDLE_ENV} does not name a valid stdlib Bundle at {}: {error}",
root.display()
),
None => panic!(
"pinned stdlib Bundle at {} is invalid: {error}",
root.display()
),
});
let mismatches = [
("name", &pin.name, &bundle.name),
("version", &pin.version, &bundle.version),
("tree_digest", &pin.tree_digest, &bundle.tree_digest),
(
"aliases_digest",
&pin.aliases_digest,
&bundle.aliases_digest,
),
];
for (field, expected, actual) in mismatches {
assert_eq!(
expected,
actual,
"stdlib Bundle at {} does not match the pin field `{field}`",
root.display()
);
}
for required in ["stdlib.json", "io.mq.md", "io/console.mq.md"] {
assert!(
bundle.root.join(required).is_file(),
"stdlib Bundle at {} is missing required file {required}",
bundle.root.display()
);
}
assert_eq!(
pin.source_commit.len(),
40,
"the pin must record a full source commit, got {:?}",
pin.source_commit
);
bundle
}
/// Verify one unpacked Bundle root.
pub fn verify(root: &Path) -> Result<Self, String> {
if !root.is_dir() {
return Err(format!("not a directory: {}", root.display()));
}
let manifest_path = root.join("stdlib.json");
if !manifest_path.is_file() {
return Err(format!("missing manifest: {}", manifest_path.display()));
}
let text = std::fs::read_to_string(&manifest_path)
.map_err(|error| format!("cannot read {}: {error}", manifest_path.display()))?;
let manifest: serde_json::Value = serde_json::from_str(&text)
.map_err(|error| format!("invalid {}: {error}", manifest_path.display()))?;
let name = manifest
.get("name")
.and_then(serde_json::Value::as_str)
.ok_or_else(|| format!("{} has no name", manifest_path.display()))?
.to_string();
let version = manifest
.get("version")
.and_then(serde_json::Value::as_str)
.ok_or_else(|| format!("{} has no version", manifest_path.display()))?
.to_string();
let declared = manifest
.get("digest")
.and_then(serde_json::Value::as_str)
.ok_or_else(|| format!("{} has no digest", manifest_path.display()))?
.to_string();
let actual = tree_digest(root)?;
if declared != actual {
return Err(format!(
"tree digest mismatch: stdlib.json declares {declared}, the files are {actual}"
));
}
let aliases = manifest
.get("public_aliases")
.and_then(serde_json::Value::as_array)
.cloned()
.unwrap_or_default();
let declared_aliases = manifest
.get("aliases_digest")
.and_then(serde_json::Value::as_str)
.map(ToString::to_string);
let actual_aliases = aliases_digest(&aliases);
match (declared_aliases, aliases.is_empty()) {
(Some(declared_aliases), _) => {
if declared_aliases != actual_aliases {
return Err(format!(
"alias digest mismatch: stdlib.json declares {declared_aliases}, \
the alias table is {actual_aliases}"
));
}
}
(None, false) => {
return Err(format!(
"{} declares public_aliases without aliases_digest",
manifest_path.display()
));
}
(None, true) => {}
}
Ok(Self {
root: root
.canonicalize()
.map_err(|error| format!("cannot canonicalize {}: {error}", root.display()))?,
name,
version,
tree_digest: actual,
aliases_digest: actual_aliases,
})
}
pub fn root(&self) -> &Path {
&self.root
}
}
/// Resolve and verify the pinned Bundle once per test process.
pub fn bundle() -> &'static Bundle {
static BUNDLE: std::sync::OnceLock<Bundle> = std::sync::OnceLock::new();
BUNDLE.get_or_init(Bundle::pinned)
}
/// Bundle root for fixtures and `MARQDO_STDLIB_DIR`.
pub fn bundle_dir() -> PathBuf {
bundle().root().to_path_buf()
}
/// Bundle root when one is configured, without failing tests that do not need
/// the standard library (Phase B has no in-repo source tree).
pub fn try_bundle_dir() -> Option<PathBuf> {
let pin = BundlePin::committed();
if let Some(explicit) = std::env::var_os(BUNDLE_ENV) {
return Some(PathBuf::from(explicit));
}
pin.source_path.map(|relative| repo_root().join(relative))
}
/// A real CLI command that names the verified Bundle explicitly when one is
/// configured; spawned programs never rely on a compile-time source fallback.
pub fn cli_command() -> std::process::Command {
let mut command = std::process::Command::new(env!("CARGO_BIN_EXE_marqdo"));
if let Some(root) = try_bundle_dir() {
command.env("MARQDO_STDLIB_DIR", root);
}
command
}
/// Content digest over all `.mq.md` files: sorted relative path, NUL, bytes, NUL.
pub fn tree_digest(root: &Path) -> Result<String, String> {
let mut files = Vec::new();
collect_markdown(root, root, &mut files)?;
files.sort();
let mut hasher = Sha256::new();
for (relative, path) in files {
let bytes = std::fs::read(&path)
.map_err(|error| format!("cannot read {}: {error}", path.display()))?;
hasher.update(relative.as_bytes());
hasher.update([0]);
hasher.update(&bytes);
hasher.update([0]);
}
Ok(format!("sha256:{}", hex(&hasher.finalize())))
}
/// Canonical digest over the official public-alias table.
pub fn aliases_digest(aliases: &[serde_json::Value]) -> String {
let mut entries: Vec<&serde_json::Value> = aliases.iter().collect();
entries.sort_by_key(|alias| {
(
alias["target_module"].as_str().unwrap_or("").to_string(),
alias["target_function"].as_str().unwrap_or("").to_string(),
)
});
let mut hasher = Sha256::new();
for alias in entries {
if let Some(module) = alias["target_module"].as_str() {
hasher.update(module.as_bytes());
}
hasher.update([0]);
if let Some(function) = alias["target_function"].as_str() {
hasher.update(function.as_bytes());
}
hasher.update([0]);
let mut names: Vec<&str> = alias["public_names"]
.as_array()
.map(|names| names.iter().filter_map(serde_json::Value::as_str).collect())
.unwrap_or_default();
names.sort();
for name in names {
hasher.update(name.as_bytes());
hasher.update([0]);
}
}
format!("sha256:{}", hex(&hasher.finalize()))
}
fn collect_markdown(
root: &Path,
dir: &Path,
out: &mut Vec<(String, PathBuf)>,
) -> Result<(), String> {
let entries = std::fs::read_dir(dir)
.map_err(|error| format!("cannot read {}: {error}", dir.display()))?;
for entry in entries {
let entry = entry.map_err(|error| format!("cannot read {}: {error}", dir.display()))?;
let path = entry.path();
if path.is_dir() {
collect_markdown(root, &path, out)?;
} else if path
.file_name()
.is_some_and(|name| name.to_string_lossy().ends_with(".mq.md"))
{
let relative = path
.strip_prefix(root)
.map_err(|_| "stdlib file escaped its root".to_string())?
.components()
.map(|component| component.as_os_str().to_string_lossy().to_string())
.collect::<Vec<_>>()
.join("/");
out.push((relative, path));
}
}
Ok(())
}
fn validate_relative(path: &str) -> Result<(), String> {
let mut normalised = PathBuf::new();
for component in Path::new(path).components() {
match component {
Component::Normal(part) => normalised.push(part),
Component::CurDir => {}
Component::ParentDir | Component::RootDir | Component::Prefix(_) => {
return Err("must be a relative path inside the repository".to_string())
}
}
}
if normalised.as_os_str().is_empty() {
return Err("must not be empty".to_string());
}
Ok(())
}
fn hex(bytes: &[u8]) -> String {
let mut out = String::with_capacity(bytes.len() * 2);
for byte in bytes {
out.push_str(&format!("{byte:02x}"));
}
out
}
@@ -1,4 +1,6 @@
//! C10/P5: a `.mq.md` HTTP client over the TCP resource endpoint. //! C10/P5: a `.mq.md` program round-trips bytes over the TCP resource endpoint.
#[path = "support/stdlib.rs"]
pub mod stdlib_support;
#[path = "support/observation.rs"] #[path = "support/observation.rs"]
pub mod observation; pub mod observation;
@@ -6,7 +8,6 @@ pub mod observation;
use std::io::{Read, Write}; use std::io::{Read, Write};
use std::net::TcpListener; use std::net::TcpListener;
use std::path::Path; use std::path::Path;
use std::process::Command;
struct TempDir(std::path::PathBuf); struct TempDir(std::path::PathBuf);
@@ -30,7 +31,11 @@ impl Drop for TempDir {
} }
#[test] #[test]
fn mqmd_http_client_parses_a_response_from_a_tcp_stream() { fn a_marqdo_program_round_trips_bytes_over_the_tcp_resource() {
// The CLI owns the TCP resource endpoint; the HTTP domain module now lives in
// the explicit `marqdo-ext-http` package, so this test exercises the generic
// endpoint directly instead of importing a domain module that is not part of
// the default Bundle.
let listener = TcpListener::bind("127.0.0.1:0").unwrap(); let listener = TcpListener::bind("127.0.0.1:0").unwrap();
let address = listener.local_addr().unwrap(); let address = listener.local_addr().unwrap();
let server = std::thread::spawn(move || { let server = std::thread::spawn(move || {
@@ -39,17 +44,14 @@ fn mqmd_http_client_parses_a_response_from_a_tcp_stream() {
let count = stream.read(&mut request).unwrap(); let count = stream.read(&mut request).unwrap();
assert!(String::from_utf8_lossy(&request[..count]).starts_with("GET / HTTP/1.1\r\n")); assert!(String::from_utf8_lossy(&request[..count]).starts_with("GET / HTTP/1.1\r\n"));
stream stream
.write_all( .write_all(b"HTTP/1.1 200 OK\r\nContent-Length: 5\r\n\r\nhello")
b"HTTP/1.1 200 OK\r\nContent-Type: text/plain\r\nContent-Length: 5\r\n\r\nhello",
)
.unwrap(); .unwrap();
}); });
let dir = TempDir::new("client"); let dir = TempDir::new("roundtrip");
let program = format!( let program = format!(
r#"--- r#"---
import: import:
http: "std:net/http"
编码: "std:text" 编码: "std:text"
--- ---
@@ -57,7 +59,7 @@ import:
`流 = resource.open("tcp", "{address}", ["read", "write"])` `流 = resource.open("tcp", "{address}", ["read", "write"])`
`请求 = http.构建请求("GET", "/", [["Host", "example.test"]], "")` `请求 = "GET / HTTP/1.1\r\nHost: example.test\r\n\r\n"`
`请求内存 = memory.new(1, 1)` `请求内存 = memory.new(1, 1)`
@@ -85,13 +87,11 @@ import:
`关闭 = resource.close(流)` `关闭 = resource.close(流)`
`响应 = http.解析响应(响应文本)` `return [写入.ok, 写入.value.count == 请求长度, 读出.ok, 数量 > 0, 响应文本, 关闭.ok]`
`return [写入.ok, 读出.ok, 响应.状态, 响应.头["Content-Type"], 响应.体, 关闭.ok]`
"# "#
); );
std::fs::write(dir.path().join("index.mq.md"), program).unwrap(); std::fs::write(dir.path().join("index.mq.md"), program).unwrap();
let output = Command::new(env!("CARGO_BIN_EXE_marqdo")) let output = stdlib_support::cli_command()
.args([ .args([
"run", "run",
"index.mq.md", "index.mq.md",
@@ -101,15 +101,6 @@ import:
"json", "json",
]) ])
.current_dir(dir.path()) .current_dir(dir.path())
.env(
"MARQDO_STDLIB_DIR",
Path::new(env!("CARGO_MANIFEST_DIR"))
.parent()
.unwrap()
.parent()
.unwrap()
.join("stdlib"),
)
.output() .output()
.expect("run marqdo"); .expect("run marqdo");
assert_eq!( assert_eq!(
@@ -126,9 +117,12 @@ import:
.expect("list"); .expect("list");
assert_eq!(items[0]["value"], true); assert_eq!(items[0]["value"], true);
assert_eq!(items[1]["value"], true); assert_eq!(items[1]["value"], true);
assert_eq!(items[2]["decimal"], "200"); assert_eq!(items[2]["value"], true);
assert_eq!(items[3]["value"], "text/plain"); assert_eq!(items[3]["value"], true);
assert_eq!(items[4]["value"], "hello"); assert_eq!(
items[4]["value"],
"HTTP/1.1 200 OK\r\nContent-Length: 5\r\n\r\nhello"
);
assert_eq!(items[5]["value"], true); assert_eq!(items[5]["value"], true);
server.join().unwrap(); server.join().unwrap();
} }
+6 -8
View File
@@ -2,6 +2,8 @@
//! //!
//! The tool fixture is compiled with rustc from `tests/fixtures/tool_echo.rs` //! The tool fixture is compiled with rustc from `tests/fixtures/tool_echo.rs`
//! rather than a shell script, so these tests run on Windows and macOS too. //! rather than a shell script, so these tests run on Windows and macOS too.
#[path = "support/stdlib.rs"]
pub mod stdlib_support;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::process::{Command, Output}; use std::process::{Command, Output};
@@ -36,12 +38,8 @@ impl Drop for TempDir {
} }
} }
fn binary() -> &'static str {
env!("CARGO_BIN_EXE_marqdo")
}
fn cli(home: &Path, args: &[&str]) -> Output { fn cli(home: &Path, args: &[&str]) -> Output {
Command::new(binary()) stdlib_support::cli_command()
.args(args) .args(args)
.env("MARQDO_TOOL_HOME", home) .env("MARQDO_TOOL_HOME", home)
.output() .output()
@@ -157,7 +155,7 @@ fn independent_sample_tools_consume_public_analysis_and_observation() {
let trace = dir.path().join("trace.json"); let trace = dir.path().join("trace.json");
let root = repo_root(); let root = repo_root();
let check = Command::new(binary()) let check = stdlib_support::cli_command()
.args([ .args([
"check", "check",
"examples/multi-module/index.mq.md", "examples/multi-module/index.mq.md",
@@ -169,7 +167,7 @@ fn independent_sample_tools_consume_public_analysis_and_observation() {
.output() .output()
.expect("run check"); .expect("run check");
assert!(check.status.success(), "check failed: {}", stderr(&check)); assert!(check.status.success(), "check failed: {}", stderr(&check));
let run = Command::new(binary()) let run = stdlib_support::cli_command()
.args([ .args([
"run", "run",
"examples/multi-module/index.mq.md", "examples/multi-module/index.mq.md",
@@ -354,7 +352,7 @@ fn tampered_binary_and_path_hijack_are_not_executed() {
permissions.set_mode(0o755); permissions.set_mode(0o755);
std::fs::set_permissions(&hijack, permissions).unwrap(); std::fs::set_permissions(&hijack, permissions).unwrap();
} }
let output = Command::new(binary()) let output = stdlib_support::cli_command()
.arg("hijack") .arg("hijack")
.env("MARQDO_TOOL_HOME", &home) .env("MARQDO_TOOL_HOME", &home)
.env("PATH", &path_dir) .env("PATH", &path_dir)
-1
View File
@@ -12,4 +12,3 @@ authors.workspace = true
marqdo-plugin-abi = { workspace = true } marqdo-plugin-abi = { workspace = true }
serde = { workspace = true } serde = { workspace = true }
serde_json = { workspace = true } serde_json = { workspace = true }
+107 -8
View File
@@ -75,6 +75,46 @@ The `spec/` tree contains only current contracts; retired specifications are in
Git history and tagged archives. The earlier release records below describe Git history and tagged archives. The earlier release records below describe
their tagged binaries and are not current protocol claims. their tagged binaries and are not current protocol claims.
## 0.11 Explicit stdlib Bundle input — issue #11 Phase A (unreleased)
Phase A lands the build-input boundary only: the stdlib production sources and
the debug source fallback are still in this repository, and Phase B (the
ecosystem-assembled Bundle, source removal and `std:` replacement) is **not**
claimed. Executed candidate:
`ab6b6b1a23ec064fbc7de943c52befca18142a56`; bundle source commit
`2cbde54602c07f62a62f341400bc9cb4764a93f8`.
* `tools/stdlib/bundle-pin.json` pins `marqdo-stdlib@0.1.0` with tree digest
`sha256:5407d3665ba2fe105820d0f1af5efaafa10c277a69eb819c3225719813c8c713`
and alias digest
`sha256:5f513c0fdbb3c1e9829be3c9fa23a2d1e89cb8510073fb5eb1e8e2f5265a83bb`;
`tools/stdlib/bundle.py` is the single resolver/verifier.
* `tools/pack-stdlib.py` and `tools/release/package.py` require
`--stdlib-dir` and accept `--bundle-pin`. A missing directory, missing
manifest, tree/alias digest mismatch, pin mismatch or symlink fails before
an archive is written; `RELEASE_INFO.json.stdlib.source` records the pinned
kind/repository/commit/path.
* Product, performance and release lanes resolve that Bundle
(`crates/cli/tests/support/stdlib.rs`, `tools/perf/runner.py`). An explicit
`MARQDO_TEST_STDLIB_BUNDLE`/`--stdlib-dir` changes the location but must match
the pin; a bad override fails even when the default is valid. Loader unit
tests build small synthetic Bundles.
* `tools/ci/independent_build.py` exports a clean copy without `stdlib/`,
builds `marqdo-cli` + `marqdo-provider-worker` with `--locked`, runs the
language-only `tests/independent/language-only.mq.md`, and requires a
stdlib-dependent run to fail closed with no sibling `stdlib/`. GitHub and
Woodpecker run the lane.
* Archive smoke and cold-install keep the missing-Bundle failure and now also
require the language-only `factorial` call to succeed after the shipped
`stdlib/` is moved aside. Two packaging runs from the same input and
toolchain are byte-identical.
Evidence:
[`evidence/2026-11-26-issue-11-phase-a.md`](evidence/2026-11-26-issue-11-phase-a.md).
Runtime discovery is unchanged: `MARQDO_STDLIB_DIR` (invalid values still fail
hard), then `stdlib/` next to the executable, then the debug-only source
fallback. Phase B is gated on ecosystem issue #2 and the extension replacement
evidence named by issue #11.
## 0.12 Engine / Host Contract boundary — issue #13 (unreleased candidate) ## 0.12 Engine / Host Contract boundary — issue #13 (unreleased candidate)
This is an **internal architecture candidate**, not a release. The product This is an **internal architecture candidate**, not a release. The product
@@ -120,10 +160,63 @@ Deliberately **UNVERIFIED** here: Windows/macOS native lanes, strict VM, WASM
probe (target std not installed; `E0463`, not a forbidden native dependency) probe (target std not installed; `E0463`, not a forbidden native dependency)
and performance/RSS. RC.4 evidence is not reused. and performance/RSS. RC.4 evidence is not reused.
Remaining, separately owned work: stdlib Bundle Phase B (issue #11/#12), Remaining, separately owned work at that snapshot: stdlib Bundle Phase B (issue #11/#12),
SDK physical repository after S07/S08, regex/compression replacement under SDK physical repository after S07/S08 (**superseded by §0.13 — the split was
ADR-0062, foreign F-B (ADR-0063), platform and strict evidence, and the Engine/ reverted and the remote repository deleted**), regex/compression replacement
Native Host split only if the ADR-0071 reopening conditions appear. under ADR-0062, foreign F-B (ADR-0063), platform and strict evidence, and the
Engine/Native Host split only if the ADR-0071 reopening conditions appear.
## 0.13 Plugin SDK remains in the CLI workspace — split reverted (unreleased candidate)
This is an architecture correction, not a product/protocol change. Decision:
[ADR-0073](adr/0073-sdk-stays-in-cli-workspace.md) (supersedes
[ADR-0072](adr/0072-sdk-independent-repository.md)). Evidence:
[`evidence/2026-11-26-issue-15-sdk-split-reverted.md`](evidence/2026-11-26-issue-15-sdk-split-reverted.md).
- The public `cflmy/marqdo-plugin-sdk` repository was **deleted**. The SDK
source is restored as the CLI workspace crate `crates/marqdo-plugin-sdk`, with
the same contract-only dependency graph (`marqdo-plugin-abi` + serde); it is
not a remote repository, mirror or submodule.
- The CLI keeps the atomic plugin-development surface: C header, `spec/`, the
`marqdo-plugin-abi` contract, SDK helpers, fixture and real CLI invocation
test change in one workspace/lock/candidate SHA. No cross-repository `rev`
pin remains.
- `tests/sdk-plugin` and `tools/ci/check_plugin_sdk.py` are restored; the gate
builds the fixture with only the public SDK and invokes it through the real
CLI with explicit trust/grant, rejecting a tampered artifact digest.
- Logical ADR-0071 boundaries are unchanged: the runtime depends only on the
neutral contract, `marqdo-plugin-abi` is a pure contract, loader/worker live
in `marqdo-host::plugin`, CLI is the single assembly point.
- External plugin access is unchanged: the CLI product and public repository
carry the header/spec/SDK/loader; plugin authors compile their plugin, not the
CLI. Engine/Native Host remain in the workspace; no other split is planned.
- ADR-0072 and the old issue-#15 evidence carry Superseded banners. The remote
replica is gone; Git history retains the decision/implementation record.
## 0.14 External ecosystem stdlib Bundle — issue #11 Phase B (unreleased candidate)
Phase B finishes the extraction ADR-0070 prepared: this repository has **no**
`stdlib/` source tree and no compile-time source fallback. The accepted Bundle
identity is the ecosystem pin:
`marqdo-stdlib@0.2.0`, source `cflmy/marqdo@48189243f7`, tree digest
`sha256:db905508...`, aliases digest `sha256:5f513c0f...` (17 modules, no
component self-tests). `tools/stdlib/bundle.py` requires an explicit
`--stdlib-dir`/`MARQDO_TEST_STDLIB_BUNDLE` for the accepted Bundle;
`tools/ci/fetch_ecosystem_bundle.py` materializes it from the pinned root
commit and component gitlinks.
Moved with their ownership: module self-tests and domain behaviour tests live
in the component repositories (six std repos, `marqdo-ext-http`,
`marqdo-ext-regex`, `marqdo-ext-archive`); the CLI product lane now verifies
the accepted Bundle's public surface and official `print`/`打印` routing
(`tests/product-stdlib/`), and the Table-split / print-format composition
assertions live in the root Bundle acceptance. The generic TCP endpoint
round-trip stays a CLI test (`tcp_round_trip.rs`); the HTTP-over-TCP domain
test moves to the HTTP package owner.
Runtime discovery is now only `MARQDO_STDLIB_DIR` then the installed sibling
`stdlib/` (no debug fallback). Bundle release packaging still ships the Bundle
next to the CLI, so installed behaviour is unchanged.
## 0.10 Closed public Analysis boundary — issue #10 (RC.4 released) ## 0.10 Closed public Analysis boundary — issue #10 (RC.4 released)
@@ -406,6 +499,9 @@ ownership / core resource kinds), ADR-0063 (foreign F-A). Executed evidence:
recompute both digests with the runtime algorithm and fail on mismatch; smoke recompute both digests with the runtime algorithm and fail on mismatch; smoke
removes the bundle and requires a fail-closed run (no source fallback). Release removes the bundle and requires a fail-closed run (no source fallback). Release
discovery only falls back to the compile-time source tree in debug builds. discovery only falls back to the compile-time source tree in debug builds.
Since issue #11 Phase A the Bundle is one required explicit build input
(`--stdlib-dir`) with a pinned identity and a recorded source commit
(ADR-0070); see §0.11.
- **H-04 core resource kinds:** `marqdo_host::CORE_RESOURCE_KINDS` is the single - **H-04 core resource kinds:** `marqdo_host::CORE_RESOURCE_KINDS` is the single
registry used by the CLI manifest validator and every trusted host registration registry used by the CLI manifest validator and every trusted host registration
path; all six core kinds are rejected as a provider name and as a declared kind path; all six core kinds are rejected as a provider name and as a declared kind
@@ -733,9 +829,11 @@ This is still a **local VM lane**, not a self-hosted GitHub Actions security URL
routed to the bundled stdlib (Compat-C, ADR-0030/0031); there is no legacy routed to the bundled stdlib (Compat-C, ADR-0030/0031); there is no legacy
host formatter. `tools/pack-stdlib.py` additionally emits a byte-deterministic host formatter. `tools/pack-stdlib.py` additionally emits a byte-deterministic
offline archive + descriptor as an extraction-ready artifact offline archive + descriptor as an extraction-ready artifact
([evidence](evidence/2026-11-20-stdlib-package.md)). The stdlib intentionally ([evidence](evidence/2026-11-20-stdlib-package.md)). Issue #11 Phase A now
stays in this repository for now (ADR-0039); extraction is a future option consumes the Bundle through one explicit `--stdlib-dir` and one pinned
when size/release cadence requires it, not a pending gate. identity (ADR-0070, §0.11); the production sources still stay in this
repository until Phase B, which is gated on ecosystem issue #2 and the
extension replacement evidence.
- Resource streams (RFC-CM CM-A06, ADR-0025/0026/0040): opaque host-issued - Resource streams (RFC-CM CM-A06, ADR-0025/0026/0040): opaque host-issued
`Resource` handles with `resource.open/read/write/close`; bytes move only `Resource` handles with `resource.open/read/write/close`; bytes move only
through `Memory`; stdin is read-only over one shared run cursor; stdout and through `Memory`; stdin is read-only over one shared run cursor; stdout and
@@ -754,7 +852,8 @@ This is still a **local VM lane**, not a self-hosted GitHub Actions security URL
snapshot; the current edge is `marqdo-runtime -> marqdo-host-contract` under snapshot; the current edge is `marqdo-runtime -> marqdo-host-contract` under
ADR-0071), the bundled stdlib digest and the stdio/file/TCP endpoints; `crates/cli/tests/stdlib_product.rs` ADR-0071), the bundled stdlib digest and the stdio/file/TCP endpoints; `crates/cli/tests/stdlib_product.rs`
runs every public stdlib module (`clock/compress/console/csv/datetime/demo/env/format/fs/http/io/json/path/process/random/regex/stream/table/text/utf8`) runs every public stdlib module (`clock/compress/console/csv/datetime/demo/env/format/fs/http/io/json/path/process/random/regex/stream/table/text/utf8`)
through `std:` imports over `stdlib/tests/*.mq.md`. `tools/pack-stdlib.py` through `std:` imports over `stdlib/tests/*.mq.md` resolved from the pinned
Bundle (`crates/cli/tests/support/stdlib.rs`). `tools/pack-stdlib.py`
now sorts `.mq.md` by the same relative path key as the CLI. Source/test baseline now sorts `.mq.md` by the same relative path key as the CLI. Source/test baseline
`0d40de7`; later docs-only commits keep code/test bytes identical. Evidence: `0d40de7`; later docs-only commits keep code/test bytes identical. Evidence:
[`docs-and-test-migration`](evidence/2026-11-21-docs-and-test-migration.md). [`docs-and-test-migration`](evidence/2026-11-21-docs-and-test-migration.md).
@@ -0,0 +1,149 @@
# ADR-0070 — One explicit stdlib Bundle build input (Phase A)
Status: **Phase A accepted and implemented (2026-11-26); Phase B accepted and
implemented on the 3.0 prerelease line (2026-11-27).**
Relates to: issue
[#11](https://git.cflmy.cn/cflmy/marqdo-cli/issues/11), ADR-0028 (bundled
stdlib and `std:` imports), ADR-0039 (deferred extraction), ADR-0058 (public
aliases), ADR-0062 (resource ownership), ADR-0068 (single current public
contracts).
Evidence:
[`docs/evidence/2026-11-26-stdlib-source-coupling-inventory.md`](../evidence/2026-11-26-stdlib-source-coupling-inventory.md).
## Context
Issue #11 starts the extraction that ADR-0039 deferred: the CLI and the
Provider Worker must build and run on their own, while a release is assembled
from one explicitly provided, verifiable stdlib Bundle. The extraction trigger
listed by ADR-0039 is now real: an ecosystem repository pins component commits
and assembles the production Bundle, and nine component repositories own module
sources.
At the implementation baseline `4bbefc92449ee480c8a2c89b0308feb4cda8d0e7` the
stdlib source directory is implicit in four different ways, documented in the
inventory linked above:
* both packaging entry points read the checkout's `stdlib/` with no build
argument (`tools/pack-stdlib.py`, `tools/release/package.py`);
* product tests, the semantic harness and the P2 closure lane rebuild
`repo_root()/stdlib` independently;
* the performance runner silently falls back to `ROOT / "stdlib"` when the
binary has no sibling bundle;
* the debug CLI resolves a compile-time source tree
(`CARGO_MANIFEST_DIR/../../stdlib`) after the explicit override and the
sibling directory.
Separating compile, package and product-test lanes later requires changing all
of them at once, and none of them records which Bundle commit produced a test
run. The runtime contracts themselves — `stdlib.json`, the
`marqdo.stdlib-package` descriptor, Analysis `project.stdlib` and Observation
identity — are not the problem and must not change.
## Decision
### 1. Explicit build input
`tools/pack-stdlib.py` and `tools/release/package.py` accept the same required
`--stdlib-dir PATH` argument. It names an unpacked Bundle root that contains
`stdlib.json`. There is no implicit default: a missing path, a missing manifest,
a tree-digest mismatch, an alias-digest mismatch or a missing required module
fails the command before any archive is written. Both entry points keep the
existing deterministic archive layout, descriptor fields, digest algorithms
and checksums.
Both entry points also accept an optional `--bundle-pin PATH`. When given, the
input must match the pinned identity and the release record names the pinned
source commit; the pin is not a substitute for verifying the Bundle's own
manifest.
### 2. One pinned Bundle identity
`tools/stdlib/bundle-pin.json` records the Bundle name, version, source
repository and commit, tree digest and alias digest. `tools/stdlib/bundle.py`
is the single resolver and verifier for source-side consumers: tests, the
performance runner and release CI resolve the Bundle through it instead of
concatenating `stdlib/`.
An explicit `MARQDO_TEST_STDLIB_BUNDLE` (tests) or `--stdlib-dir` (tools) takes
precedence over the pin's default location, but the input must still verify
against the pin's digests. An invalid explicit input fails even when a valid
sibling Bundle exists; silent fallback is forbidden. Phase B updates the pin to
the Bundle assembled by the ecosystem repository; the algorithm does not change.
### 3. Runtime contract unchanged
`MARQDO_STDLIB_DIR` remains the explicit runtime override (invalid values fail
hard), followed by `stdlib/` next to the executable. The debug-only
compile-time source fallback remains in Phase A so the development loop keeps
working; it is removed in Phase B together with the in-repo production sources.
`stdlib.json`, `marqdo.stdlib-package`, Analysis `project.stdlib`, module ids
and Observation identity keep their current shapes and values.
### 4. Separated test lanes
The lanes become explicit:
* **independent compilation** — `cargo build --locked -p marqdo-cli
-p marqdo-provider-worker` in a copy without `stdlib/`, then a language-only
program through the real CLI;
* **loader unit tests** — small synthetic bundles built in a temporary
directory, so loader logic does not depend on the product tree;
* **product tests** — the whole pinned Bundle through `std:` and the real CLI;
* **conformance** — the frozen, independent fixture corpus, unchanged.
### 5. Phase B gate
Phase B (switch to the ecosystem-assembled Bundle, delete the in-repo
production sources, the debug source fallback and the replaced `std:` entries)
requires the accepted component commits of ecosystem issue #2 and the extension
replacement evidence named by issue #11. This ADR records the Phase A input
boundary only; it does not authorize deleting sources or changing `std:`
semantics.
## Phase B implementation (2026-11-27)
The gate above was met by ecosystem issue #9's candidate combination, so the
pin and CI changed and the sources were removed:
* `tools/stdlib/bundle-pin.json` names
`source.kind = "ecosystem"`, `repository = cflmy/marqdo`, the exact root
commit that pins the component gitlinks, and the accepted digests. The pin no
longer records a vendored `source.path`.
* `crates/cli/src/stdlib.rs` has no compile-time source fallback in any build
profile; discovery is `MARQDO_STDLIB_DIR` then the installed sibling Bundle.
* The in-repo `stdlib/` tree is deleted. Module sources, self-tests and domain
behaviour tests live in the component repositories.
* `tools/ci/fetch_ecosystem_bundle.py` materializes the pinned Bundle from the
ecosystem root commit + stdlib gitlinks and verifies it against the pin;
Woodpecker and GitHub CI use it before product tests, packaging and
performance lanes.
* Product tests (`crates/cli/tests/stdlib_product.rs`) verify the CLI's own
responsibility against the external Bundle: required public surface,
`std:` execution and official alias routing. Composition fixtures whose
ownership is the ecosystem (Table split, print-format equivalence) live in
the root Bundle acceptance; removed CLI tests were not replaced by mocks.
* A missing `MARQDO_TEST_STDLIB_BUNDLE` fails the product lane closed; the
product contract never reads a sibling source tree.
## Consequences
* A packaging run can be pointed at a downloaded or separately built Bundle and
still produce the same deterministic archive and `RELEASE_INFO.json` record.
* Every product/perf CI run names the Bundle commit and digest it used; a
stale Bundle is visible instead of implicit.
* Phase B becomes a pin/CI change plus source removal, not a simultaneous
rewrite of the test lanes.
* The repository still carries the Bundle in Phase A, so the extraction is not
claimed as complete. `docs/STATUS.md` must record the Phase A state, not the
final externalized state.
## Non-goals
* Changing `std:` spelling, digest algorithms, module ids, public aliases or
the `stdlib.json`/descriptor shapes.
* Fetching a Bundle over the network, adding a package registry or a signature
scheme.
* Removing the debug source fallback, the in-repo `stdlib/` sources or any
`std:` entry in Phase A.
* Declaring the extraction, the external Conformance suite or the ecosystem
switch done before their evidence exists.
+108
View File
@@ -0,0 +1,108 @@
# ADR-0072 — Independent `marqdo-plugin-sdk` repository
Status: **Superseded by [ADR-0073](0073-sdk-stays-in-cli-workspace.md)**
(2026-11-26). The independent repository was deleted and the SDK returned to
the CLI workspace; this document is kept as decision history only.
Complements [ADR-0071](0071-engine-host-contract-boundary.md) and implements the
SDK follow-up tracked by issue [#15](https://git.cflmy.cn/cflmy/marqdo-cli/issues/15)
after the contract decoupling of issue #13.
## Context
Issue #13 / ADR-0071 separated the public plugin contract from its execution
side:
- `marqdo-plugin-abi` (CLI repository) now contains only the C ABI v1 layout,
the wire envelope and protocol errors;
- `dlopen`, manifest/artifact file handling, worker management and invocation
dispatch live in `marqdo-host::plugin`;
- `marqdo-plugin-sdk` consumed only the contract and was verified by a real
fixture loaded through the CLI.
The SDK is a leaf with a different consumer group (third-party plugin authors),
a different change cadence and an independent release need. Keeping it in the
CLI workspace made the architecture map imply that the CLI product owns SDK
publication and forced every SDK change through the CLI build. Issue #15
required either fixing the distribution input or recording a blocking ticket.
The CLI repository is public, so a fixed Cargo git `rev` is a fetchable
contract input; there is no need for a submodule, a vendored contract copy or a
second wire implementation.
This is a **deliberate, narrow repository split**, not a mechanical projection
of every crate: engine and native host remain in the CLI workspace (ADR-0071
reopening conditions unchanged), and no empty candidate repository is created.
## Decision
### Topology
| Item | Decision |
|---|---|
| SDK repository | Public `cflmy/marqdo-plugin-sdk` (`main`), own Cargo workspace and lock |
| Contract input | `marqdo-plugin-abi` from `https://git.cflmy.cn/cflmy/marqdo-cli.git` at exact `rev = 2585915e16906dac75f8571bed02e7f6f868c6bc` (the merge commit that landed ADR-0071) |
| CLI dependency on SDK | **None**. CLI normal/build/test lanes do not fetch or build the SDK |
| CLI workspace | `crates/marqdo-plugin-sdk` removed; the SDK is not a workspace member |
| Submodule/gitlink | **Not used** for this split; the SDK leaf must not create a CLI↔SDK identity cycle |
| Acceptance fixture | `tests/fixture` in the SDK repository only; real invocation uses a **frozen released CLI binary** via `tools/check_with_frozen_cli.py` |
| Contract authority | Unchanged: CLI owns the C header, Rust layout, Value Wire and error encodings; the SDK never defines a second contract |
| Publication | SDK releases are versioned independently against a contract generation; bumping the pinned CLI `rev` is a reviewed change |
### Rules
- The SDK repository must resolve and build from a clean clone without the CLI
checkout; only its fixed git dependency may reach the CLI repository.
- It must not depend on `libloading`, a native host, worker execution, sandbox
or CLI code.
- The SDK's fixture is a third-party plugin built with only the public SDK. It
is verified against a frozen CLI archive (same ABI 1.0 contract), not against a
locally rebuilt CLI.
- The CLI repository must not reintroduce the SDK as a workspace member, a
copied source tree or a compatibility path; `tools/ci/check_dependency_boundaries.py`
and `architecture_boundaries.rs` fail if it does.
- The CLI's public contract is authoritative; the SDK repository README and
AGENTS rules point back to `include/marqdo_plugin_abi_v1.h`,
`spec/plugin-abi.md` and the pinned commit.
- The existing security statement remains: a C ABI is not a sandbox, and native
loading requires explicit trust; the SDK grants no capability.
## Verification (candidate)
- SDK repository commit `b31187a` on `main`:
- clean-clone `cargo build --locked` and `cargo test --locked` pass;
- the fixture builds with only the SDK;
- `tools/check_with_frozen_cli.py --marqdo-bin <released marqdo 3.0.0-rc.4>`
returns `Int 42` and rejects a tampered artifact digest.
- CLI candidate removes the SDK crate, fixture and CLI-side gate; workspace
tests, architecture boundaries, docs consistency and dependency gates pass;
the SDK no longer appears in the workspace or lock file.
- Full evidence: `docs/evidence/2026-11-26-issue-15-sdk-independent-repository.md`.
## Rejected alternatives
- **Keep the SDK in the CLI workspace** while calling the contract "decoupled":
leaves two release cadences and ownership in one repo; issue #15 cannot close.
- **Git submodule/gitlink into the CLI repo**: CLI does not consume the SDK, so
a submodule would create an unnecessary recursive identity and checkout
failure mode.
- **Relative path dependency `../cli`**: not an independent build; forbidden by
issue #13 §6.2.
- **Copy `marqdo-plugin-abi`/Value Wire into the SDK repo**: would create a
second contract and wire encoder authority.
- **Publish the contract to a registry first**: no registry/release channel is
approved here; the public git `rev` is the available precise input. A future
published artifact can replace the git `rev` without changing authority.
## Consequences and rollback
- The architecture map now shows one CLI contract producer and one independent
SDK consumer; CLI CI no longer carries SDK-only checks, and SDK CI owns them.
- The SDK remains pinned to a CLI merge commit. Changing the contract or
advancing the pin is a deliberate cross-repository change with its own
evidence; a contract change must land in the CLI first, then the SDK pin is
bumped.
- Rollback is a complete known-good combination: keep the CLI commit and the SDK
pin that were verified together; do not restore a copied SDK or an old ABI.
- External SDK consumers can fetch the public CLI contract today. If a
registry-published contract or a different visibility policy is later chosen,
that is a new ADR, not an implicit change.
@@ -0,0 +1,99 @@
# ADR-0073 — Keep the plugin SDK in the CLI workspace; defer the repository split
Status: **Accepted** (2026-11-26).
Supersedes [ADR-0072](0072-sdk-independent-repository.md).
## Context
ADR-0072 split `marqdo-plugin-sdk` into the public repository
`cflmy/marqdo-plugin-sdk` and pinned it to one CLI contract `rev`. The
implementation itself was technically sound (clean-clone build, frozen-CLI
integration, no second ABI), but a re-evaluation against the pre-stable project's
architecture showed that the **repository boundary was premature**, even though
the **logical contract boundary is correct and stays**.
The relevant facts at this point in the prerelease line:
- the SDK is a small, contract-only consumer (six source files; dependencies are
`marqdo-plugin-abi`, `serde`, `serde_json`);
- plugin ABI 1.0, Value Wire 1 and the C header are frozen; the SDK has no
independent version or release story beyond the ABI generation;
- the C header, `spec/plugin-abi.md`, the `marqdo-plugin-abi` contract, the
loader/worker and the SDK helpers evolve together and are owned by the same
maintainers;
- no registry publication or independent maintenance exists for the SDK;
- the CLI product supports external plugin integration without the SDK (C ABI +
loader are in the CLI), so the SDK is a developer kit, not a runtime feature.
Under issue #13's own criteria, "keep in workspace" is a legal conclusion when
independent consumer/release evidence is absent. The split added a cross-repo
`rev` pin, a second CI lane, a second source location and a documentation
integrity burden (stale in-repo paths, weak entry links) without a current
release or consumer benefit. The CLI's developer-facing contract, header, spec,
SDK and examples should form one atomic change domain.
## Decision
1. **The plugin SDK returns to the CLI workspace** as
`crates/marqdo-plugin-sdk`, a contract-only crate. It keeps its current clean
dependency graph: `marqdo-plugin-abi` + `serde`/`serde_json`; no loader,
worker, host, sandbox or CLI dependency.
2. **The independent repository is deleted.** Its source was restored from CLI
Git history; no second copy of the SDK or contract remains. The SDK must not
be reintroduced as a remote repository or as a submodule in this stage.
3. **Logical boundaries stay exactly as ADR-0071 defined them**: the runtime
depends only on `marqdo-host-contract`; `marqdo-plugin-abi` is a pure
contract; execution-side loader/worker/manifest/artifact live in
`marqdo-host::plugin`; the CLI is the single assembly point.
4. **Atomicity is the priority for the pre-stable line.** ABI layout, header,
spec, contract crate, SDK helpers, fixture and the real CLI invocation test
land in one commit/PR/lock. There is no cross-repository pin to bump and no
second current source tree.
5. **External access remains in the CLI product.** The release archive and
repository carry the C header, public plugin spec, loader/worker and the SDK
source; plugin authors build their plugin against this repository (or use
the header from another language). The CLI itself is not compiled by plugin
users.
6. **Future extraction is a new decision, not an implicit step.** It requires
new evidence: independent SDK release (for example a published contract
artifact), a real non-CLI consumer/maintainer, or a distribution need that
the atomic workspace cannot serve. It then needs a new Accepted ADR and must
not create a CLI↔SDK gitlink cycle.
## Verification
- SDK crate, fixture, CLI-side SDK gate and workspace/lock are restored; the
CLI builds and tests them in the same workspace.
- `tools/ci/check_dependency_boundaries.py` enforces the SDK's contract-only
normal/build dependencies and its presence in the workspace as a reviewed
crate.
- `tools/ci/check_plugin_sdk.py` builds the SDK fixture with only the public SDK
and loads it through the real CLI with explicit trust/grant; a tampered
artifact digest is rejected.
- The remote split repository was deleted after this decision; no temporary
branch was created for the revert.
- Full evidence: `docs/evidence/2026-11-26-issue-15-sdk-split-reverted.md`.
## Rejected alternatives
- **Keep the split because it was already implemented.** Sunk-cost reasoning;
it does not satisfy the "necessary split" criterion for this stage.
- **Keep the remote repository as a mirror/copy.** Two current SDK sources and
a second contract consumer tree are explicitly forbidden; Git history already
preserves ADR-0072's implementation.
- **Make the SDK a submodule of the CLI.** Inverts the dependency direction and
risks the CLI gitlink ↔ SDK → CLI contract cycle; the CLI does not consume
the SDK at build time.
- **Turn the SDK into a prebuilt binary so users need not compile.** Native
plugins are compiled by their authors by definition; the SDK is a source-level
helper. A prebuilt SDK is neither a plugin nor a compiler target.
## Consequences
- One atomic language/plugin-development change domain; one lock and one
candidate SHA for ABI/header/spec/SDK/loader changes.
- External plugin integration keeps working through the CLI's contract and
loader; the SDK is discoverable in the same public repository as the header
and spec.
- The split work remains in Git history (ADR-0072, former PR #16) as decision
history; it is not current architecture.
+8
View File
@@ -70,6 +70,14 @@ Files: `0001`–`0050`, plus:
pre-stable public boundary, replaced in place; pre-stable public boundary, replaced in place;
* [0069](0069-public-analysis-boundary.md) — one public Analysis projection for * [0069](0069-public-analysis-boundary.md) — one public Analysis projection for
independent document, lint and knowledge consumers. independent document, lint and knowledge consumers.
* [0070](0070-explicit-stdlib-bundle-build-input.md) — Phase A of the stdlib
extraction: one required `--stdlib-dir` build input, one pinned Bundle
identity for tests/perf/release CI; runtime contracts unchanged.
* [0071](0071-engine-host-contract-boundary.md) — Engine / Host Contract / * [0071](0071-engine-host-contract-boundary.md) — Engine / Host Contract /
Native Host / CLI responsibilities, dependency rules, plugin ABI contract split Native Host / CLI responsibilities, dependency rules, plugin ABI contract split
and the keep-in-workspace repository decision. and the keep-in-workspace repository decision.
* [0072](0072-sdk-independent-repository.md) — **superseded**: the independent
public SDK repository was deleted and the SDK returned to the CLI workspace.
* [0073](0073-sdk-stays-in-cli-workspace.md) — keep the plugin SDK in the CLI
workspace for the pre-stable atomic line; repository split deferred.
+17 -8
View File
@@ -19,7 +19,8 @@ resources, OS adapters and trusted extension execution; `crates/cli` remains the
single product assembly. The plugin ABI crate is a public contract only: native single product assembly. The plugin ABI crate is a public contract only: native
loading, artifact/manifest execution and worker processes live in loading, artifact/manifest execution and worker processes live in
`marqdo-host::plugin`. The SDK depends on the contract, not on a loader or a `marqdo-host::plugin`. The SDK depends on the contract, not on a loader or a
host. host, and stays in this workspace as a contract-only developer crate
([ADR-0073](../adr/0073-sdk-stays-in-cli-workspace.md)).
The Engine and the Native Host stay in **this workspace**. Issue #13 §9.2 The Engine and the Native Host stay in **this workspace**. Issue #13 §9.2
admission for a separate repository is not met yet: there is no real external admission for a separate repository is not met yet: there is no real external
@@ -185,8 +186,11 @@ Layer rules:
or a third-party plugin path. or a third-party plugin path.
2. The platform layer owns I/O, clocks, entropy, sockets and file handles. It must 2. The platform layer owns I/O, clocks, entropy, sockets and file handles. It must
not own JSON parsing, text formatting or memory allocation policy. not own JSON parsing, text formatting or memory allocation policy.
3. The stdlib is `.mq.md` and ships in this repository. New ordinary algorithms 3. The stdlib is `.mq.md` and ships in this repository during Phase A of
go to `stdlib/` + tests + docs; they do not become Rust builtins. issue #11. New ordinary algorithms go to `stdlib/` + tests + docs; they do
not become Rust builtins. Packaging and product tests take it as one
explicit, pinned Bundle input (ADR-0070); Phase B moves the production
sources to the ecosystem assembly after issue #2 acceptance.
4. The CLI selects inputs, resolves configuration, assembles the host and routes 4. The CLI selects inputs, resolves configuration, assembles the host and routes
human/machine output. It is not a semantic policy centre. human/machine output. It is not a semantic policy centre.
5. Callable Plugin and Resource Provider share one registry/authorization/audit 5. Callable Plugin and Resource Provider share one registry/authorization/audit
@@ -280,7 +284,7 @@ that a phase is complete.
| Priority | Gap | State | | Priority | Gap | State |
|---|---|---| |---|---|---|
| P0 | **Language syntax migration**: RFC-LANG-0002 single contract | **closed at `9c1723d`**; implementation, stdlib digest, examples and fixtures green; platform/strict evidence remains separate | | P0 | **Language syntax migration**: RFC-LANG-0002 single contract | **closed at `9c1723d`**; implementation, stdlib digest, examples and fixtures green; platform/strict evidence remains separate |
| P0 | Stdlib release is a bundle in this repo; extraction is deferred (ADR-0039) | accepted, keep in repo | | P0 | Stdlib extraction (issue #11): explicit `--stdlib-dir` + one pinned Bundle for tests/perf/release CI | **Phase A implemented** (ADR-0070); Phase B (ecosystem assembly, source removal) waits on ecosystem issue #2 and the extension replacement evidence |
| P0 | Documentation drift between `STATUS.md`, the architecture index and the evidence | being fixed by this migration and the docs gate | | P0 | Documentation drift between `STATUS.md`, the architecture index and the evidence | being fixed by this migration and the docs gate |
| P1 | Domain service ownership ledger (issue #13 §7): host-held `regex.*` and `compress.*` are ADR-0062 services, not a precedent for new domain operations | **DEFERRED** to the responsible `marqdo-ext-regex`/`marqdo-ext-archive` replacement issues; old entries stay until a real replacement passes authorization/negative tests | | P1 | Domain service ownership ledger (issue #13 §7): host-held `regex.*` and `compress.*` are ADR-0062 services, not a precedent for new domain operations | **DEFERRED** to the responsible `marqdo-ext-regex`/`marqdo-ext-archive` replacement issues; old entries stay until a real replacement passes authorization/negative tests |
| P1 | `std:fs/file` read/write/copy, metadata/directory, append/read_at/walk are implemented; watch and binary offset reads remain open | open | | P1 | `std:fs/file` read/write/copy, metadata/directory, append/read_at/walk are implemented; watch and binary offset reads remain open | open |
@@ -326,15 +330,17 @@ that a phase is complete.
|---|---|---| |---|---|---|
| Engine (`span`/`value`/`expression`/`markdown`/`ir`/`frontend`/`runtime`/`host-contract`) | **Keep in this workspace** as one atomic semantic-change domain | A real, non-in-repo consumer needs independent build/release, and the semantic change cost is acceptable | | Engine (`span`/`value`/`expression`/`markdown`/`ir`/`frontend`/`runtime`/`host-contract`) | **Keep in this workspace** as one atomic semantic-change domain | A real, non-in-repo consumer needs independent build/release, and the semantic change cost is acceptable |
| Native Host (`host`/`sandbox`/`foreign`/plugin loader) | **Keep in this workspace**, dependent on the neutral contract | An independent platform maintainer or second product consumes it; security/conformance can be verified separately | | Native Host (`host`/`sandbox`/`foreign`/plugin loader) | **Keep in this workspace**, dependent on the neutral contract | An independent platform maintainer or second product consumes it; security/conformance can be verified separately |
| `marqdo-plugin-sdk` | Contract decoupled; physical move to an independent repository is a follow-up after the §6.3 external build and pinned-artifact mechanism | A clean-directory build against a fixed contract revision without the CLI checkout passes (S07/S08) | | `marqdo-plugin-sdk` | **Keep in this workspace** as a contract-only developer crate. The ADR-0072 independent repository was deleted and the source restored ([ADR-0073](../adr/0073-sdk-stays-in-cli-workspace.md)); atomic ABI/header/spec/SDK changes are the priority for the pre-stable line | Independent SDK release/registry publication, a real non-CLI consumer or maintainer, and a new Accepted ADR. No submodule/gitlink |
| Stdlib | Separate issue #11/#12 (Phase A build input); runtime contract unchanged | Ecosystem-assembled Bundle and extension replacement accepted; then retire the in-repo source authority | | Stdlib | Separate issue #11/#12 (Phase A build input); runtime contract unchanged | Ecosystem-assembled Bundle and extension replacement accepted; then retire the in-repo source authority |
| Regex/compression domain services | **DEFERRED** under ADR-0062 ownership; no new domain operation may be added | A separately installable extension replaces the host-held service and the old entries are removed atomically | | Regex/compression domain services | **DEFERRED** under ADR-0062 ownership; no new domain operation may be added | A separately installable extension replaces the host-held service and the old entries are removed atomically |
| Foreign F-A | Retained; no F-B, session or new transport in this change | Separate ADR and milestone | | Foreign F-A | Retained; no F-B, session or new transport in this change | Separate ADR and milestone |
No candidate empty `marqdo-engine`, `marqdo-host` or `marqdo-cli-*` repository No candidate empty `marqdo-engine`, `marqdo-host` or `marqdo-cli-*` repository
is created by this decision. Git repository boundaries are ownership and release is created by this decision. The former independent SDK repository was deleted
boundaries, not a mechanical projection of Cargo crates. The engine and native under ADR-0073; the SDK is back in this workspace and no remote copy is kept.
host are one source tree until the reopening evidence above exists. Git repository boundaries are ownership and release boundaries, not a mechanical
projection of Cargo crates. The engine, native host and plugin developer kit are
one source tree until the reopening evidence above exists.
## 8. References ## 8. References
@@ -358,7 +364,10 @@ host are one source tree until the reopening evidence above exists.
- [Compute-machine RFC-0001](../MARQDO_COMPUTE_MACHINE_RFC_0001.md) and [core/stdlib RFC-0002](../MARQDO_COMPUTE_CORE_STDLIB_MIGRATION_RFC_0002.md) — design input. - [Compute-machine RFC-0001](../MARQDO_COMPUTE_MACHINE_RFC_0001.md) and [core/stdlib RFC-0002](../MARQDO_COMPUTE_CORE_STDLIB_MIGRATION_RFC_0002.md) — design input.
- [Architecture audit and refactor RFC](Marqdo_CLI_Latest_Architecture_Audit_and_Refactor_RFC.md) — historical review input; the current boundary decision is ADR-0071. - [Architecture audit and refactor RFC](Marqdo_CLI_Latest_Architecture_Audit_and_Refactor_RFC.md) — historical review input; the current boundary decision is ADR-0071.
- [ADR-0071: Engine / Host Contract / Native Host boundaries](../adr/0071-engine-host-contract-boundary.md) — accepted responsibility split and keep-in-workspace decision for issue #13. - [ADR-0071: Engine / Host Contract / Native Host boundaries](../adr/0071-engine-host-contract-boundary.md) — accepted responsibility split and keep-in-workspace decision for issue #13.
- [ADR-0073: Keep the plugin SDK in the CLI workspace](../adr/0073-sdk-stays-in-cli-workspace.md) — current decision: SDK atomicity, no split, no remote copy; supersedes ADR-0072.
- [ADR-0072: Independent SDK repository](../adr/0072-sdk-independent-repository.md) — **superseded** decision history; the repository was deleted.
- [Issue #13 engine/host evidence](../evidence/2026-11-26-issue-13-engine-host-boundary.md) — executed candidate commands and results. - [Issue #13 engine/host evidence](../evidence/2026-11-26-issue-13-engine-host-boundary.md) — executed candidate commands and results.
- [Issue #15 SDK split-revert evidence](../evidence/2026-11-26-issue-15-sdk-split-reverted.md) — repository deletion, source restoration and gates.
- [RFC-EXT-0001](RFC-EXT-0001.md) — extensibility closure task specification (implementation status tracked here and in STATUS). - [RFC-EXT-0001](RFC-EXT-0001.md) — extensibility closure task specification (implementation status tracked here and in STATUS).
- [ADR-0054: single callable binding](../adr/0054-callable-binding-single-source.md) — one registry/binding pass, runtime dispatch by identity. - [ADR-0054: single callable binding](../adr/0054-callable-binding-single-source.md) — one registry/binding pass, runtime dispatch by identity.
- [ADR-0055: resource provider CLI v2](../adr/0055-resource-provider-cli-v2.md) — provider v2 manifest/worker CLI closure and trust boundary. - [ADR-0055: resource provider CLI v2](../adr/0055-resource-provider-cli-v2.md) — provider v2 manifest/worker CLI closure and trust boundary.
+2
View File
@@ -83,6 +83,8 @@ The implemented first slices of these RFCs are recorded in `CURRENT.md` and
| Resource operations and core kinds | [0062](../adr/0062-resource-operation-ownership-and-core-kinds.md) | Accepted and implemented; architecture gate pins the reviewed lists | | Resource operations and core kinds | [0062](../adr/0062-resource-operation-ownership-and-core-kinds.md) | Accepted and implemented; architecture gate pins the reviewed lists |
| Foreign F-A transition | [0063](../adr/0063-foreign-kernel-transition-fa.md) | Accepted: retained F-A primitive; F-B deferred | | Foreign F-A transition | [0063](../adr/0063-foreign-kernel-transition-fa.md) | Accepted: retained F-A primitive; F-B deferred |
| Stable core inventory and external gate | [0064](../adr/0064-stable-core-extension-boundary.md) | Accepted and wired into Linux CI | | Stable core inventory and external gate | [0064](../adr/0064-stable-core-extension-boundary.md) | Accepted and wired into Linux CI |
| Independent plugin SDK repository | [0072](../adr/0072-sdk-independent-repository.md) | **Superseded by ADR-0073**: repository deleted, SDK restored to the CLI workspace |
| Plugin SDK stays in the CLI workspace | [0073](../adr/0073-sdk-stays-in-cli-workspace.md) | Accepted: atomic pre-stable changes, no split, no remote copy |
| Engine / Host Contract / Native Host / CLI boundaries | [0071](../adr/0071-engine-host-contract-boundary.md) | Accepted and implemented by issue #13: runtime depends on the neutral contract, native host implements it, plugin ABI is contract-only, keep-in-workspace repository decision | | Engine / Host Contract / Native Host / CLI boundaries | [0071](../adr/0071-engine-host-contract-boundary.md) | Accepted and implemented by issue #13: runtime depends on the neutral contract, native host implements it, plugin ABI is contract-only, keep-in-workspace repository decision |
| Manifest-driven Resource Control | [0065](../adr/0065-resource-control-vnext.md) | Proposed | | Manifest-driven Resource Control | [0065](../adr/0065-resource-control-vnext.md) | Proposed |
| Structured Tasks and Channels | [0066](../adr/0066-structured-tasks-v1.md) | Proposed | | Structured Tasks and Channels | [0066](../adr/0066-structured-tasks-v1.md) | Proposed |
+20 -4
View File
@@ -14,24 +14,29 @@
The default Docker pipeline runs on push and pull request. A fast `contract` The default Docker pipeline runs on push and pull request. A fast `contract`
lane exercises the public Analysis/Observation contracts through the real CLI lane exercises the public Analysis/Observation contracts through the real CLI
and the independent Python consumers; the full `test` lane runs the Rust gates and the independent Python consumers; the full `test` lane runs the Rust gates
and the Windows cross-target compile check; `build` packages the archive, runs and the Windows cross-target compile check; `independent-build` exports the
the from-archive smoke and the frozen external conformance suite. commit without `stdlib/` and proves both shipped binaries still build and run a
language-only program; `build` packages the archive from the pinned stdlib
Bundle, runs the from-archive smoke and the frozen external conformance suite.
```text ```text
contract (rust:1.100-bookworm, python3-jsonschema, both shipped binaries): contract (rust:1.100-bookworm, python3-jsonschema, both shipped binaries):
cargo build --locked -p marqdo-cli -p marqdo-provider-worker cargo build --locked -p marqdo-cli -p marqdo-provider-worker
real CLI check/run over the Observation fixtures bash tools/ci/contract_lane.sh (real CLI check/run over the Observation fixtures)
analysis_consumer / observation_consumer / validate_protocols analysis_consumer / observation_consumer / validate_protocols
stream==snapshot assertion (tools/ci/verify_observation_stream.py) stream==snapshot assertion (tools/ci/verify_observation_stream.py)
stale-Analysis rejection stale-Analysis rejection
dependency-direction gate (tools/ci/check_dependency_boundaries.py) dependency-direction gate (tools/ci/check_dependency_boundaries.py)
test (rust:1.100-bookworm, clippy/rustfmt, Node.js 22, MinGW, both binaries): test (rust:1.100-bookworm, clippy/rustfmt, Node.js 22, MinGW, both binaries):
python3 tools/ci/fetch_ecosystem_bundle.py (materialize the pinned ecosystem Bundle)
python3 tools/stdlib/bundle.py --stdlib-dir target/ecosystem-stdlib
cargo fmt --all -- --check cargo fmt --all -- --check
cargo clippy --workspace --all-targets -- -D warnings cargo clippy --workspace --all-targets -- -D warnings
cargo build --locked -p marqdo-provider-worker cargo build --locked -p marqdo-provider-worker
cargo test --workspace --locked cargo test --workspace --locked
docs_consistency / architecture_boundaries / stdlib_product docs_consistency / architecture_boundaries / stdlib_product
stdlib_product again with MARQDO_TEST_STDLIB_BUNDLE + MARQDO_TEST_BUNDLE_PIN
check_dependency_boundaries.py (Cargo-metadata responsibility graph) check_dependency_boundaries.py (Cargo-metadata responsibility graph)
check_engine_boundary.py (independent consumer build/run + CLI differential) check_engine_boundary.py (independent consumer build/run + CLI differential)
check_plugin_sdk.py (real third-party SDK plugin via the real CLI) check_plugin_sdk.py (real third-party SDK plugin via the real CLI)
@@ -39,12 +44,18 @@ test (rust:1.100-bookworm, clippy/rustfmt, Node.js 22, MinGW, both binaries):
rustup target add x86_64-pc-windows-gnu rustup target add x86_64-pc-windows-gnu
cargo check --workspace --all-targets --target x86_64-pc-windows-gnu cargo check --workspace --all-targets --target x86_64-pc-windows-gnu
independent-build (rust:1.100-bookworm, git, python3):
git archive HEAD, no stdlib source tree exists, no ecosystem checkout
cargo build --locked -p marqdo-cli -p marqdo-provider-worker
language-only check/call through the built CLI
stdlib-dependent run must fail closed; no stdlib/ next to the binary
minimum-rust (rust:1.89-bookworm): minimum-rust (rust:1.89-bookworm):
cargo check --locked --workspace --all-targets cargo check --locked --workspace --all-targets
build (depends on test, minimum-rust, contract): build (depends on test, minimum-rust, contract):
cargo build --release --locked -p marqdo-cli -p marqdo-provider-worker cargo build --release --locked -p marqdo-cli -p marqdo-provider-worker
package the deterministic archive for $CI_COMMIT_SHA materialize the pinned Bundle; package --stdlib-dir target/ecosystem-stdlib --bundle-pin ...
from-archive smoke (tools/release/smoke.py) from-archive smoke (tools/release/smoke.py)
frozen external conformance (tools/ci/run_frozen_extensions.sh, 7/7) frozen external conformance (tools/ci/run_frozen_extensions.sh, 7/7)
``` ```
@@ -97,6 +108,11 @@ syntax; Debian bookworm's Node 18 fails those tests.
workspace tests so the provider CLI tests use the real helper, and adds a workspace tests so the provider CLI tests use the real helper, and adds a
`cargo check --workspace --all-targets --target x86_64-pc-windows-gnu` `cargo check --workspace --all-targets --target x86_64-pc-windows-gnu`
compile gate (native Windows/macOS runtime lanes stay on the GitHub matrix). compile gate (native Windows/macOS runtime lanes stay on the GitHub matrix).
* **ADR-0070 explicit Bundle:** the `test` lane verifies
`tools/stdlib/bundle-pin.json`, materializes the pinned ecosystem Bundle and
runs the product suite with an explicit `MARQDO_TEST_STDLIB_BUNDLE`; the
`independent-build` lane builds both binaries with no Bundle checkout and requires the stdlib-dependent
program to fail closed.
* The Woodpecker **build** lane and the GitHub **release-candidate** lane build * The Woodpecker **build** lane and the GitHub **release-candidate** lane build
`marqdo` **and** `marqdo-provider-worker` and package both as siblings; the `marqdo` **and** `marqdo-provider-worker` and package both as siblings; the
provider transport resolves only that sibling (no PATH fallback), so an provider transport resolves only that sibling (no PATH fallback), so an
@@ -0,0 +1,195 @@
# Issue #11 Phase A — one explicit stdlib Bundle input
Date: 2026-11-26.
Implementation baseline: `4bbefc92449ee480c8a2c89b0308feb4cda8d0e7`.
Bundle source commit: `2cbde54602c07f62a62f341400bc9cb4764a93f8`.
Decision: [ADR-0070](../adr/0070-explicit-stdlib-bundle-build-input.md).
Inventory:
[`2026-11-26-stdlib-source-coupling-inventory.md`](2026-11-26-stdlib-source-coupling-inventory.md).
Candidate commits (in order):
| Commit | Change |
|---|---|
| `b9c72e1` | ADR-0070 + source-coupling inventory |
| `1b9d9c4` | `tools/stdlib/bundle.py`, `bundle-pin.json`, required `pack-stdlib.py --stdlib-dir` |
| `422b9de` | `package.py --stdlib-dir/--bundle-pin`, `RELEASE_INFO.stdlib.source` |
| `3a68260` | pinned test resolver, synthetic loader tests, product/conformance rewiring |
| `ab6b6b1` | independent-build lane, perf Bundle pin, CI and docs |
| `0e1efc7` | archive smoke/cold-install keep the language-only run after removing the Bundle |
The documentation commit that adds this record also updates `STATUS.md`, the
architecture overview, `README.md` and `tests/README.md`. CI follow-up commit
`2acaaef` folds the `independent-build` job into the existing `linux` evidence
gate (the release-evidence schema accepts only its declared gate names).
Executed host: Linux x86_64 (glibc 2.43), `rustc 1.100.0 (0ef1bc386
2026-11-09)`, `cargo 1.100.0 (3acc79c0c 2026-11-05)`, Python 3.14.4; the
cold-install container is `ubuntu:24.04` (glibc 2.39) with `--network none`.
## 1. Pinned Bundle identity
```console
$ python3 tools/stdlib/bundle.py
{
"aliases_digest": "sha256:5f513c0fdbb3c1e9829be3c9fa23a2d1e89cb8510073fb5eb1e8e2f5265a83bb",
"file_count": 42,
"name": "marqdo-stdlib",
"root": "<checkout>/stdlib",
"source_commit": "2cbde54602c07f62a62f341400bc9cb4764a93f8",
"tree_digest": "sha256:5407d3665ba2fe105820d0f1af5efaafa10c277a69eb819c3225719813c8c713",
"version": "0.1.0"
}
```
`tools/stdlib/bundle-pin.json` records the same identity. The resolver accepts
an explicit location but never an explicit identity: a valid-but-unpinned
Bundle is rejected.
## 2. Failure paths (tools/ci/test_stdlib_bundle_tools.py)
64 `tools/ci` unit tests pass. The new cases cover:
* `--stdlib-dir` is required and a missing input fails before any output;
* a missing `stdlib.json`, a tree-digest mismatch, an alias-digest mismatch and
`public_aliases` without `aliases_digest` fail;
* a symlink inside the Bundle is rejected;
* an explicit Bundle that does not match the pin fails, even when the pinned
default is valid;
* a bad pin schema fails;
* the `bundle.py` CLI exits 1 on an invalid explicit input and 0 with
`--print-path` otherwise.
The runtime override rule is pinned by the loader unit test
`bad_override_fails_closed_even_with_a_valid_sibling` (a bad
`MARQDO_STDLIB_DIR` fails although a valid sibling `stdlib/` exists).
## 3. Deterministic packaging
Two standalone stdlib packs from the same explicit input and toolchain are
byte-identical:
```console
$ python3 tools/pack-stdlib.py --stdlib-dir stdlib \
--bundle-pin tools/stdlib/bundle-pin.json --out-dir <a>
$ python3 tools/pack-stdlib.py --stdlib-dir stdlib \
--bundle-pin tools/stdlib/bundle-pin.json --out-dir <b>
$ sha256sum <a>/marqdo-stdlib-0.1.0.tar.gz <b>/marqdo-stdlib-0.1.0.tar.gz
f6dc8e7ad92bc58b815635aea923069919d6f5495078e53828ae4723d925a565 <a>/marqdo-stdlib-0.1.0.tar.gz
f6dc8e7ad92bc58b815635aea923069919d6f5495078e53828ae4723d925a565 <b>/marqdo-stdlib-0.1.0.tar.gz
```
Two release archives built from `ab6b6b1` with `--skip-example-build` (the
host-built example artifacts were already present) are byte-identical:
`f37e01c44e668a6daf0538b32e9825cc74392f0ccbd65362af2783629b6d2c48`.
`RELEASE_INFO.json.stdlib.source` records
`{"kind":"in-repo","repository":"cflmy/marqdo-cli","commit":"2cbde54602c07f62a62f341400bc9cb4764a93f8","path":"stdlib"}`
and the tree/alias digests equal `stdlib.json`.
## 4. Product and performance lanes
The product, HTTP, table, alias-routing, P2 closure and semantic harnesses
resolve the pinned Bundle through `crates/cli/tests/support/stdlib.rs`
(`MARQDO_TEST_STDLIB_BUNDLE`/`MARQDO_TEST_BUNDLE_PIN` overrides are verified
against the pin). Loader unit tests build synthetic Bundles instead of the
product tree.
```console
$ cargo test -p marqdo-cli --bin marqdo stdlib --offline
4 passed (synthetic loader tests)
$ cargo test -p marqdo-cli --test stdlib_product --offline
16 passed
$ cargo test -p marqdo-cli --test stdlib_bundle --test stdlib_http \
--test stdlib_table --test stdlib_alias_routing --offline
13 passed
$ cargo test -p marqdo-cli --test architecture_boundaries \
--test conformance_semantics --test p2_closure --offline
16 passed
$ python3 tools/perf/runner.py --no-build --binary target/debug/marqdo \
--warmups 1 --samples 3 --allow-smoke --only hello-check ...
correctness=VERIFIED status=SMOKE
stdlib={... "source_commit":"2cbde54602c07f62a62f341400bc9cb4764a93f8" ...}
```
## 5. Independent build (clean copy without stdlib)
`tools/ci/independent_build.py` exported `ab6b6b1` with `git archive`, removed
`stdlib/`, and built both binaries with `--locked`:
```json
{
"status": "PASS",
"source_sha": "ab6b6b1a23ec064fbc7de943c52befca18142a56",
"binaries": {
"marqdo": {"sha256": "428c25c60caa7762348bcffad96558591adf52440d44549a645390c927558757"},
"marqdo-provider-worker": {"sha256": "3787942de6d35ce1c7f03c0848c8e08b6037495e98005c62704d34e664da795c"}
},
"checks": {
"stdlib_source_removed": true,
"language_only_check": "PASS",
"language_only_call": "PASS:3",
"stdlib_dependent_missing_bundle": "PASS",
"no_sibling_stdlib": true
}
}
```
The stdlib-dependent `run examples/hello.mq.md` failed with an explicit
stdlib/print diagnostic instead of falling back to a source tree; the built
`target/debug` directory contains no `stdlib/`.
## 6. Archive smoke and cold install
```console
$ python3 tools/release/smoke.py --archive <archive>
smoke: verified stdlib 0.1.0 tree=sha256:5407d36... aliases=sha256:5f513c0... files=42
smoke: archive version 3.0.0-rc.4, source ab6b6b1a23ec064fbc7de943c52befca18142a56
smoke: bundled stdlib missing -> fail-closed OK
smoke: language-only program runs without the bundled stdlib
smoke: PASS
```
```console
$ bash tools/release/cold-install.sh <archive> ab6b6b1a23ec064fbc7de943c52befca18142a56
你好,Marqdo
checked 2 module(s): ok
checked 1 module(s): ok
6
runtime error[kernel.unavailable]: 打印 requires the bundled stdlib print module; install the official CLI bundle
<language-only factorial call still prints 120>
```
The container is `ubuntu:24.04`, `--network none`, user `65534:65534`, with no
Cargo and no source checkout; only the archive bytes are mounted. Moving the
shipped `stdlib/` aside keeps the language-only factorial call working and
makes the `打印` program fail with the explicit `kernel.unavailable` message.
## 7. Gates on the candidate tree
```console
$ cargo fmt --all -- --check
FMT_OK
$ cargo clippy --workspace --all-targets --offline -- -D warnings
exit=0
$ cargo test --workspace --locked --offline
exit=0
634 passed, 0 failed, 2 ignored across 72 test binaries
```
The workspace run includes `docs_consistency` (7 passed),
`architecture_boundaries`, the frozen conformance suites and every product
lane. It was executed on the candidate tree plus this documentation change and
is reproducible with `cargo test --workspace --locked`. Platform-native
Windows/macOS runs were not re-executed for this docs-only candidate; the
existing GitHub matrix remains the lane for them.
## 8. Not claimed
* Phase B: switching to the ecosystem-assembled Bundle, removing the in-repo
production sources, removing the debug source fallback and deleting replaced
`std:` entries. It is gated on ecosystem issue #2 and the extension
replacement evidence named by issue #11.
* Any `std:`/`stdlib.json`/`marqdo.stdlib-package`/Analysis/Observation shape
change; none was made.
* A docker cold-install on a Windows/macOS host or a native Windows/macOS
product run for this candidate.
@@ -0,0 +1,84 @@
# Evidence — issue #15 independent `marqdo-plugin-sdk` repository
> **Superseded.** This snapshot records the (later reverted) ADR-0072 split.
> The SDK is back in the CLI workspace under
> [ADR-0073](../adr/0073-sdk-stays-in-cli-workspace.md); the remote repository
> was deleted. See `2026-11-26-issue-15-sdk-split-reverted.md`. Do not read this
> file as current architecture.
Date: 2026-11-26 (Asia/Shanghai)
Tracking issue: <https://git.cflmy.cn/cflmy/marqdo-cli/issues/15>
Decision: [ADR-0072](../adr/0072-sdk-independent-repository.md)
Parent: issue #13 / [ADR-0071](../adr/0071-engine-host-contract-boundary.md)
## Topology and identity
| Object | Exact identity |
|---|---|
| SDK repository | `cflmy/marqdo-plugin-sdk` (public), `main` at `b31187a` |
| CLI contract input | `marqdo-plugin-abi` from `https://git.cflmy.cn/cflmy/marqdo-cli.git` `rev = 2585915e16906dac75f8571bed02e7f6f868c6bc` (merge of PR #14) |
| CLI candidate | `architecture/sdk-independent-repository`; PR/CI SHA recorded by the PR |
| Frozen CLI acceptance binary | `marqdo` 3.0.0-rc.4 Linux x86_64 release archive, SHA-256 from the release `.sha256` asset |
| ABI | Plugin ABI 1.0 / Value Wire 1 / package + provider formats unchanged |
The SDK repository is its own Cargo workspace and lock. The CLI does not depend
on it, and the SDK does not depend on the CLI checkout, the native host, a
loader/worker, a sandbox or the CLI product.
## SDK repository verification (clean clone, independent of CLI checkout)
Commands run in a fresh `git clone https://git.cflmy.cn/cflmy/marqdo-plugin-sdk.git`
outside this repository:
| Gate | Command | Result |
|---|---|---|
| Locked build | `cargo build --locked` | PASS (contract fetched from the pinned public CLI git `rev`) |
| SDK tests | `cargo test --locked` | PASS (4 unit tests + 1 doc-test, 2 ignored doc examples) |
| Third-party fixture | `cargo build --locked --manifest-path tests/fixture/Cargo.toml` | PASS (built only from the SDK) |
| Frozen CLI invocation (S04/S07) | `python3 tools/check_with_frozen_cli.py --marqdo-bin frozen/marqdo` | PASS — real CLI returns `Int 42` |
| Tampered artifact (S05/S06) | same script, `sha256` replaced | PASS — rejected with artifact/sha256 diagnostic |
The frozen binary was the released 3.0.0-rc.4 archive, not a locally rebuilt CLI;
the plugin ABI is unchanged across the #13 decoupling, which is exactly the
cross-repository compatibility being tested.
SDK repository CI (`.woodpecker/main.yml`) repeats the workspace checks, the
fixture build and the frozen-CLI integration after downloading that released
archive. Enabling the Woodpecker project/webhook for the new repository is a
repository-administration step outside this change; the pipeline definition is
checked in and the same commands were executed manually above.
## CLI repository verification (this change)
| Gate | Command | Result |
|---|---|---|
| Workspace resolution | `cargo check --workspace --locked` | PASS; `marqdo-plugin-sdk` no longer appears in `Cargo.lock` |
| Formatting | `cargo fmt --all -- --check` | PASS |
| Clippy | `cargo clippy --workspace --all-targets --locked -- -D warnings` | PASS |
| Rust tests | `cargo test --workspace --locked --no-fail-fast` | PASS — 631 passed / 0 failed / 0 ignored (the removed SDK 4 unit + 1 doc test now run in the SDK repository; the two previously ignored SDK doc examples moved with them) |
| Architecture boundaries | `cargo test -p marqdo-cli --test architecture_boundaries --locked` | PASS — SDK absence/moved-repository assertion |
| Docs consistency | `cargo test -p marqdo-cli --test docs_consistency --locked` | PASS |
| Dependency direction | `python3 tools/ci/check_dependency_boundaries.py` | PASS — SDK no longer a workspace member; negative case added |
| Tools unit tests | `python3 -m unittest discover -s tools/ci -p "test_*.py"` | PASS |
| Engine differential | `python3 tools/ci/check_engine_boundary.py` | PASS (unchanged) |
Removed from the CLI workspace/repository in the same integration:
- `crates/marqdo-plugin-sdk/` (moved to the independent repository);
- `tests/sdk-plugin/` (fixture moved to `tests/fixture` in the SDK repository);
- `tools/ci/check_plugin_sdk.py` (its superset lives in the SDK repository and
uses a frozen CLI binary);
- workspace/lock entry, architecture/layer docs, CI lane entries and current
developer references.
## Not verified / follow-ups
- **Woodpecker activation** for the new public repository is administrative; the
pipeline definition is committed, but no remote pipeline run is claimed here.
- **Registry publication** of the contract crate is not introduced; the public
CLI git `rev` is the precise, fetchable input. A future published artifact
would be a new decision and would not change contract authority.
- Engine/Native Host remain in the CLI workspace under ADR-0071; this split does
not reopen that decision.
- No second ABI, wire encoder, loader or host copy exists in the SDK repository;
no compatibility/submodule path was added to the CLI repository.
@@ -0,0 +1,62 @@
# Evidence — issue #15 plugin SDK split reverted to the CLI workspace
Date: 2026-11-26 (Asia/Shanghai)
Tracking issue: <https://git.cflmy.cn/cflmy/marqdo-cli/issues/15>
Decision: [ADR-0073](../adr/0073-sdk-stays-in-cli-workspace.md) (supersedes
[ADR-0072](../adr/0072-sdk-independent-repository.md))
Parent: issue #13 / [ADR-0071](../adr/0071-engine-host-contract-boundary.md)
## Decision
Parent CLI contract merge: `2585915e16906dac75f8571bed02e7f6f868c6bc`.
Deleted split repository commits: `b31187a` / `c3134e4` (kept in Git history
of the former repository only; no source copy remains).
The plugin SDK stays in the CLI workspace as a contract-only crate. The public
repository `cflmy/marqdo-plugin-sdk` created by ADR-0072 was deleted; its source
was restored from CLI Git history. The pre-stable line prioritizes atomic
ABI/header/spec/SDK/loader changes in one workspace, lock and candidate SHA.
The logical ADR-0071 boundaries are unchanged.
## Actions executed
| Step | Result |
|---|---|
| Restore `crates/marqdo-plugin-sdk` from CLI history | Restored contract-only crate (`marqdo-plugin-abi` + serde/serde_json); no loader/host/worker dependency |
| Restore workspace member and lock | `cargo check --workspace --all-targets --locked` resolves the SDK in the workspace; `Cargo.lock` contains it again |
| Restore `tests/sdk-plugin` and `tools/ci/check_plugin_sdk.py` | Real fixture/gate back in the CLI; builds only against the public SDK and invokes via the real CLI |
| Restore architecture/dependency/docs references | `architecture_boundaries.rs`, `check_dependency_boundaries.py`, `docs_consistency` paths, README/AGENTS/spec/developer guides point at the in-repo crate again |
| Delete remote `cflmy/marqdo-plugin-sdk` | Authorized by the maintainer; the repository and its branches are gone, no mirror remains |
| No temporary branch | The revert is committed directly on `master` and pushed; old merged feature branches are deleted separately |
| Record superseded history | ADR-0072 and the old issue-#15 evidence carry Superseded banners; ADR-0073 is the current decision |
## Verification (local, Linux x86_64, Rust 1.100)
| Gate | Command | Result |
|---|---|---|
| Formatting | `cargo fmt --all -- --check` | PASS |
| Clippy | `cargo clippy --workspace --all-targets --locked -- -D warnings` | PASS |
| Rust tests | `cargo test --workspace --locked --offline --no-fail-fast` | PASS — **636 passed / 0 failed / 2 ignored** (same as the pre-split workspace) |
| Architecture boundaries | `cargo test -p marqdo-cli --test architecture_boundaries --locked` | PASS |
| Docs consistency | `cargo test -p marqdo-cli --test docs_consistency --locked` | PASS |
| Dependency direction | `python3 tools/ci/check_dependency_boundaries.py` | PASS — SDK back in the reviewed workspace allowlist with contract-only edges |
| SDK real consumption | `python3 tools/ci/check_plugin_sdk.py` | PASS — builds fixture with only the SDK; real CLI returns `Int 42`; tampered digest rejected |
| Engine differential | `python3 tools/ci/check_engine_boundary.py` | PASS |
| Tools unit tests | `python3 -m unittest discover -s tools/ci -p "test_*.py"` | PASS |
Remote CI on the code commit `98d256f`: Woodpecker push pipeline **#112**
success (contract/test/minimum-rust/build) and Gitea commit status `success`.
This evidence-only follow-up does not change code, lock or protocol bytes. No
split repository, mirror or submodule exists after the deletion.
## Current architecture facts
- `marqdo-plugin-abi` is still the pure public contract; loader/worker/manifest/
artifact remain in `marqdo-host::plugin` (ADR-0071).
- `marqdo-plugin-sdk` is a CLI workspace member with normal/build dependencies
only on the contract + serde; the CLI product is the only assembly point.
- Plugin authors get header, spec, SDK, examples and loader from one public CLI
repository/release; they compile their plugin, not the CLI.
- The CLI runtime does not depend on the SDK; external plugin loading remains
available (C ABI header + `--plugin`/`--trust-native-plugin`/`--allow-plugin`
+ worker transport).
@@ -0,0 +1,72 @@
# Stdlib source-directory coupling inventory (issue #11, Phase A)
Date: 2026-11-26.
Implementation baseline: `4bbefc92449ee480c8a2c89b0308feb4cda8d0e7` (current
`master`). Bundle source commit: `2cbde54602c07f62a62f341400bc9cb4764a93f8`
(the last commit that touched `stdlib/` at the baseline). Pinned Bundle:
`marqdo-stdlib` `0.1.0`, tree digest
`sha256:5407d3665ba2fe105820d0f1af5efaafa10c277a69eb819c3225719813c8c713`,
alias digest
`sha256:5f513c0fdbb3c1e9829be3c9fa23a2d1e89cb8510073fb5eb1e8e2f5265a83bb`.
This file inventories every direct reference to the checkout's stdlib source
directory found for issue #11 Phase A, before the explicit build-input change.
It is an inventory, not a claim that Phase A is finished; the executed evidence
is recorded separately when the work lands. Decision:
[ADR-0070](../adr/0070-explicit-stdlib-bundle-build-input.md).
## Packaging and release tooling
| Entry point | Reference | Phase A disposition |
|---|---|---|
| `tools/pack-stdlib.py` | `STDLIB = ROOT / "stdlib"` (line 17); used by the tree digest, manifest read, file list, archive and descriptor (lines 37–97) | required `--stdlib-dir`, optional `--bundle-pin`; shared digest/verify helper |
| `tools/release/package.py` | `STDLIB = ROOT / "stdlib"` (line 37); `verify_stdlib` (lines 110–141), staging copy (line 229), `RELEASE_INFO.stdlib` (lines 245–264) | required `--stdlib-dir`, optional `--bundle-pin`; `RELEASE_INFO.stdlib.source` records the pinned commit |
| `tools/release/smoke.py` | reads only the extracted archive's `install/stdlib` (lines 81–116) | unchanged; it stays an independent verifier of the shipped bytes |
| `tools/perf/runner.py` | pops `MARQDO_STDLIB_DIR`, then falls back to `ROOT / "stdlib"` when the binary has no sibling bundle (lines 327–330) | resolve the pinned Bundle explicitly and always export `MARQDO_STDLIB_DIR`; no silent repo fallback |
| `tools/ci/test_release_archive.py` | reads `ROOT/stdlib/stdlib.json` and `ROOT/stdlib` (lines 33, 40, 54) | pass the explicit/pinned path; add failure-path assertions |
| `.github/workflows/ci.yml` | `package.py` invocation without a Bundle argument (line 224); product lane (lines 44–45) | pass `--stdlib-dir` + `--bundle-pin`; verify the pin in the product lane |
| `.woodpecker/main.yml` | product lane (line 51), `package.py` invocation (line 80) | same as above |
| `.woodpecker/performance.yml` | `package.py` invocation (line 25) | pass `--stdlib-dir` + `--bundle-pin`; perf runner resolves the pin |
| `docs/releasing.md` | release command without a Bundle argument (line 119) | document the required input and the pin |
## Runtime and development discovery
| Entry point | Reference | Phase A disposition |
|---|---|---|
| `crates/cli/src/stdlib.rs` | debug-only `CARGO_MANIFEST_DIR/../../stdlib` fallback after `MARQDO_STDLIB_DIR` and the sibling directory (lines 73–82) | keep for the development loop; remove in Phase B |
| `crates/cli/src/stdlib.rs` unit tests | `dev_bundle()` loads the whole in-repo tree (lines 457–492) | replace with synthetic small bundles so loader tests do not depend on the product tree |
## Test harnesses that rebuild `repo_root()/stdlib`
| Harness | Reference | Role | Phase A disposition |
|---|---|---|---|
| `crates/cli/tests/stdlib_product.rs` | `stdlib_dir()` (lines 35–37), fixtures (line 48), cwd/`MARQDO_STDLIB_DIR` (lines 130–138) | product | pinned resolver |
| `crates/cli/tests/stdlib_bundle.rs` | `stdlib_dir()` (lines 19–20) | product | pinned resolver |
| `crates/cli/tests/stdlib_http.rs` | cwd and `MARQDO_STDLIB_DIR` (lines 22–23) | product | pinned resolver |
| `crates/cli/tests/stdlib_table.rs` | cwd and `MARQDO_STDLIB_DIR` (lines 21–22) | product | pinned resolver |
| `crates/cli/tests/stdlib_alias_routing.rs` | copies `repo()/stdlib` (lines 64–65) | product | pinned resolver |
| `crates/cli/tests/p2_closure.rs` | table self-test path, cwd and env (lines 112, 122–123) | product | pinned resolver |
| `crates/cli/tests/conformance_semantics.rs` | alias binding (line 294), entry `std:` imports (line 431) | conformance | pinned resolver |
| `crates/cli/tests/architecture_boundaries.rs` | in-repo digest/import gates (lines 90–114, 442–477) | architecture gate | pinned resolver plus the Phase A in-repo assertion |
## References that are intentionally not build inputs
* `crates/cli/src/analysis/*`, `crates/cli/src/loader.rs` and
`crates/cli/src/commands.rs` consume the verified `StdlibBundle` identity at
run time; they do not read the source directory.
* `crates/marqdo-runtime/src/builtins_impl.rs` and
`crates/marqdo-sandbox/*` mention stdlib only in diagnostics/tests.
* `docs/evidence/*` and historical ADRs keep their recorded paths; they are
decision history, not executable inputs.
## Acceptance for Phase A
1. A clean copy without `stdlib/` and without an ecosystem checkout builds
`marqdo-cli` and `marqdo-provider-worker` with `--locked`.
2. Both packaging entries fail without `--stdlib-dir`, and fail on a missing
directory, a missing `stdlib.json`, a tree-digest mismatch, an alias-digest
mismatch or a pin mismatch.
3. Product tests, the performance runner and release CI resolve the Bundle
through `tools/stdlib/bundle.py` and name its pinned commit and digest.
4. The frozen Conformance corpus and the independent `tools/release/smoke.py`
checks stay in place.
@@ -0,0 +1,76 @@
# Issue #11 Phase B — the accepted Bundle is the ecosystem artifact
Date: 2026-11-27.
Decision: [ADR-0070](../adr/0070-explicit-stdlib-bundle-build-input.md).
Parent: ecosystem issue [#9](https://git.cflmy.cn/cflmy/marqdo/issues/9) and
CLI issue [#11](https://git.cflmy.cn/cflmy/marqdo-cli/issues/11).
This is a **candidate record** for the Phase B change set. The repository has no
`stdlib/` source tree; the accepted Bundle identity is pinned to the ecosystem
root commit. CI evidence is recorded on the PR; the numbers below are the local
candidate host results.
## 1. Bundle identity
```json
{
"schema": "marqdo.stdlib-bundle-pin",
"schema_version": 1,
"name": "marqdo-stdlib",
"version": "0.2.0",
"source": {
"kind": "ecosystem",
"repository": "cflmy/marqdo",
"commit": "48189243f747d5f73d5a38a565010e64e2db74e7",
"producer": "scripts/build-stdlib.py"
},
"tree_digest": "sha256:db905508dde89763b9d43b47fc5d52c6a1d5445a91f3c86a550ced43e8aac9d7",
"aliases_digest": "sha256:5f513c0fdbb3c1e9829be3c9fa23a2d1e89cb8510073fb5eb1e8e2f5265a83bb"
}
```
`tools/ci/fetch_ecosystem_bundle.py` fetches that root commit, initializes the
six stdlib component gitlinks it records, runs the root-owned
`scripts/build-stdlib.py`, and verifies the produced Bundle against the pin.
The CLI never builds the Bundle from a branch or an unknown checkout.
## 2. Source ownership after Phase B
| Source | Owner |
| --- | --- |
| 17 default-Bundle modules (`clock`, `datetime`, `env`, `process`, `random`, `format`, `io*`, `path`, `fs/file`, `data/json`, `data/csv`, `collections/table`, `data/table`, `text*`) | six `marqdo-std-*` repositories |
| HTTP / regex / gzip domain modules | `marqdo-ext-http`, `marqdo-ext-regex`, `marqdo-ext-archive` explicit Packages |
| Module self-tests and domain behaviour tests | the owning component repository |
| Bundle assembly, digest/alias manifest, composition acceptance | `cflmy/marqdo` (root) |
| CLI loader/runtime, `std:` resolution, official alias routing, generic resources | `marqdo-cli` |
Removed from the CLI: `stdlib/` sources and self-tests, the debug source
fallback, `stdlib_http.rs`/`stdlib_table.rs`/`http_over_tcp.rs` domain tests and
the `stdlib/demo.mq.md` formatting test. The print/format equality and Table
split assertions moved to the root composition lane; the generic TCP round-trip
stays a CLI test (`tcp_round_trip.rs`); the HTTP loopback client test follows
the HTTP package owner (tracked as a follow-up on `marqdo-ext-http`).
## 3. Local candidate verification
Host: Linux x86_64, `rustc 1.100.0`, Python 3.14; Bundle materialized by
`tools/ci/fetch_ecosystem_bundle.py --out /root/work/marqdo/.build/cli-ecosystem-bundle`.
| Gate | Command | Result |
| --- | --- | --- |
| Bundle identity | `python3 tools/stdlib/bundle.py --stdlib-dir <bundle>` | PASS (matches pin) |
| Formatting | `cargo fmt --all -- --check` | PASS |
| Lints | `cargo clippy --workspace --all-targets -- -D warnings` | PASS |
| Workspace tests | `MARQDO_TEST_STDLIB_BUNDLE=<bundle> cargo test --workspace --locked` | 72 test binaries, 0 failed |
| Python tool tests | `MARQDO_TEST_STDLIB_BUNDLE=<bundle> python3 -m unittest discover -s tools/ci -p "test_*.py"` | 75 tests, OK |
| Product lane | `cargo test -p marqdo-cli --test stdlib_product` | 4 tests PASS (surface, aliases, `std:` execution, missing-Bundle fail-closed) |
| Independent build | `python3 tools/ci/independent_build.py` | see CI/PR record |
## 4. Unverified / follow-ups
- CI execution of this candidate is the gating evidence; it is recorded on the
PR rather than in this file.
- Release archive cold-install with the new Bundle and the root candidate
promotion are part of MIG-RELEASE (ecosystem issue #9), not this candidate.
- HTTP-over-TCP domain test migration to `marqdo-ext-http` and multi-platform
release evidence remain open; they are not claimed here.
+6 -3
View File
@@ -27,9 +27,12 @@ dominated by emulation and is not comparable with native or KVM.
## Tool ## Tool
`tools/perf/runner.py` (schema `marqdo.perf.v2`) builds one release binary, `tools/perf/runner.py` (schema `marqdo.perf.v2`) builds one release binary,
records its SHA256/Cargo.lock/rustc/source SHA, verifies every workload's exact records its SHA256/Cargo.lock/rustc/source SHA, resolves one pinned stdlib
wire digest **before** timing, then reports warmups/samples, p50, p95, MAD, Bundle (name, version, tree/alias digests, source commit) and passes it to every
CPU user/sys, peak RSS and the environment manifest. See workload as `MARQDO_STDLIB_DIR`, verifies every workload's exact wire digest
**before** timing, then reports warmups/samples, p50, p95, MAD, CPU user/sys,
peak RSS and the environment manifest. A bad Bundle input or digest mismatch
fails before any workload runs; there is no checkout fallback (ADR-0070). See
[`tools/perf/README.md`](../tools/perf/README.md). [`tools/perf/README.md`](../tools/perf/README.md).
Rules enforced by the tool: Rules enforced by the tool:
+11 -4
View File
@@ -116,7 +116,8 @@ The archive is built deterministically from a clean tree at `SOURCE_SHA`:
version="$(cargo metadata --no-deps --format-version 1 --offline \ version="$(cargo metadata --no-deps --format-version 1 --offline \
| python3 -c 'import json,sys; print(next(p["version"] for p in json.load(sys.stdin)["packages"] if p["name"]=="marqdo-cli"))')" | python3 -c 'import json,sys; print(next(p["version"] for p in json.load(sys.stdin)["packages"] if p["name"]=="marqdo-cli"))')"
sha="$(git rev-parse HEAD)" sha="$(git rev-parse HEAD)"
python3 tools/release/package.py --version "$version" --source-sha "$sha" python3 tools/release/package.py --version "$version" --source-sha "$sha" \
--stdlib-dir target/ecosystem-stdlib --bundle-pin tools/stdlib/bundle-pin.json
# dist/marqdo-<version>-x86_64-unknown-linux-gnu.tar.gz(+.sha256) # dist/marqdo-<version>-x86_64-unknown-linux-gnu.tar.gz(+.sha256)
``` ```
@@ -128,9 +129,15 @@ and self-test), `LICENSE-APACHE`, `README.md`, `CHANGELOG.md`, `COMPATIBILITY.md
artifacts so the examples run without a compiler) and `tests/consumers/`. artifacts so the examples run without a compiler) and `tests/consumers/`.
`RELEASE_INFO.json` records the stdlib `name`, `version`, `tree_digest`, `RELEASE_INFO.json` records the stdlib `name`, `version`, `tree_digest`,
`aliases_digest`, `file_count` and `files`. `package.py` recomputes both digests `aliases_digest`, `file_count` and `files`, plus `stdlib.source` (kind,
with the same canonical algorithm as the runtime and refuses to package a mismatch repository, commit, path) when `--bundle-pin` is given. `--stdlib-dir` is a
with `stdlib/stdlib.json` (RFC-EXT-0003 H-08 / T-PKG-04). required build input and names the unpacked Bundle root; `package.py` verifies
its manifest and recomputes both digests with the same canonical algorithm as
the runtime, and fails on a missing directory, a missing `stdlib.json`, a
tree/alias digest mismatch or a pin mismatch before it stages anything
(ADR-0070, RFC-EXT-0003 H-08 / T-PKG-04). The pin itself is resolved and
verified by `python3 tools/stdlib/bundle.py`; tests, the performance runner and
release CI use the same resolver instead of an implicit checkout path.
The `protocols.analysis` field identifies the default Analysis major. The `protocols.analysis` field identifies the default Analysis major.
`protocols.analysis_versions` lists all majors the archive can emit. `protocols.analysis_versions` lists all majors the archive can emit.
The archive smoke exercises a published example and a consumer for each major. The bundled stdlib is a The archive smoke exercises a published example and a consumer for each major. The bundled stdlib is a
View File
Whitespace-only changes.
-1
View File
@@ -1 +0,0 @@
{"id":186,"number":102,"author":"cflmy","parent":100,"event":"push","event_reason":null,"status":"pending","errors":null,"created":1795689775,"updated":1795689775,"started":0,"finished":0,"deploy_to":"","deploy_task":"","commit":"9b4f0a08228e9932bf3b0a8c5cf80e0d04626ccb","branch":"architecture/issue-13-engine-host-boundary","rerun_count":1,"ref":"refs/heads/architecture/issue-13-engine-host-boundary","refspec":"","author_avatar":"https://git.cflmy.cn/avatars/a03c2a29ffe40645c340184922645d9774759236871a8ba9a7fb1f6bd87f31ef","forge_url":"https://git.cflmy.cn/cflmy/marqdo-cli/commit/9b4f0a08228e9932bf3b0a8c5cf80e0d04626ccb","reviewed_by":"","reviewed":0,"workflows":[{"id":150,"pipeline_id":186,"pid":1,"name":"main","state":"pending","children":[{"id":513,"uuid":"01M8BQ708CS0DNFASR3FCFFBQ6","pipeline_id":186,"pid":2,"ppid":1,"name":"clone","state":"pending","exit_code":0,"type":"clone"},{"id":514,"uuid":"01M8BQ708CS0DNFASR3HYYVV9B","pipeline_id":186,"pid":3,"ppid":1,"name":"contract","state":"pending","exit_code":0,"type":"commands"},{"id":515,"uuid":"01M8BQ708CS0DNFASR3MCRV9KH","pipeline_id":186,"pid":4,"ppid":1,"name":"test","state":"pending","exit_code":0,"type":"commands"},{"id":516,"uuid":"01M8BQ708CS0DNFASR3QDE0WCS","pipeline_id":186,"pid":5,"ppid":1,"name":"minimum-rust","state":"pending","exit_code":0,"type":"commands"},{"id":517,"uuid":"01M8BQ708CS0DNFASR3R5CWAKR","pipeline_id":186,"pid":6,"ppid":1,"name":"build","state":"pending","exit_code":0,"type":"commands","depends_on":["test","minimum-rust","contract"]}]}],"changed_files":["crates/marqdo-host-contract/Cargo.toml","crates/marqdo-host-contract/src/context.rs","crates/marqdo-host-contract/src/host.rs","crates/marqdo-host-contract/src/lib.rs","crates/marqdo-host-contract/src/observe.rs","crates/marqdo-host-contract/src/resource.rs","crates/marqdo-host/src/plugin/artifact.rs","crates/marqdo-host/src/plugin/loader.rs","crates/marqdo-host/src/plugin/manifest.rs","crates/marqdo-host/src/plugin/mod.rs","crates/marqdo-host/src/plugin/worker.rs","crates/marqdo-host/tests/loader_unix.rs","docs/adr/0071-engine-host-contract-boundary.md","docs/evidence/2026-11-26-issue-13-engine-host-boundary.md","tests/embedding/Cargo.lock","tests/embedding/Cargo.toml","tests/embedding/README.md","tests/embedding/program.mq.md","tests/embedding/src/main.rs","tests/sdk-plugin/Cargo.lock","tests/sdk-plugin/Cargo.toml","tests/sdk-plugin/call.mq.md","tests/sdk-plugin/src/lib.rs","tools/ci/check_dependency_boundaries.py","tools/ci/check_engine_boundary.py","tools/ci/check_plugin_sdk.py","tools/ci/test_dependency_boundaries.py","crates/marqdo-host/src/context.rs","crates/marqdo-plugin-abi/src/artifact.rs","crates/marqdo-plugin-abi/src/loader.rs","crates/marqdo-plugin-abi/src/manifest.rs","crates/marqdo-plugin-abi/src/worker.rs","crates/marqdo-plugin-abi/tests/loader_unix.rs",".github/workflows/ci.yml",".gitignore",".woodpecker/main.yml","AGENTS.md","Cargo.lock","Cargo.toml","README.md","crates/cli/Cargo.toml","crates/cli/src/commands.rs","crates/cli/src/commands/run.rs","crates/cli/src/commands/tool.rs","crates/cli/src/extension_descriptors.rs","crates/cli/src/extension_selection.rs","crates/cli/src/main.rs","crates/cli/src/observation.rs","crates/cli/src/provider_manifest.rs","crates/cli/tests/architecture_boundaries.rs","crates/cli/tests/callable_resolution.rs","crates/cli/tests/conformance_semantics.rs","crates/cli/tests/extension_selection.rs","crates/cli/tests/integration_cli.rs","crates/cli/tests/observation.rs","crates/cli/tests/plugin_worker.rs","crates/cli/tests/provider_cli.rs","crates/marqdo-host/Cargo.toml","crates/marqdo-host/src/host.rs","crates/marqdo-host/src/kernels.rs","crates/marqdo-host/src/lib.rs","crates/marqdo-host/src/observe.rs","crates/marqdo-host/src/plugin_worker.rs","crates/marqdo-host/src/process.rs","crates/marqdo-host/src/provider_c.rs","crates/marqdo-host/src/provider_worker.rs","crates/marqdo-host/src/resource.rs","crates/marqdo-host/tests/c_provider.rs","crates/marqdo-host/tests/capability_broker.rs","crates/marqdo-host/tests/observation.rs","crates/marqdo-host/tests/plugin_exports.rs","crates/marqdo-host/tests/resource_streams.rs","crates/marqdo-host/tests/worker_provider.rs","crates/marqdo-plugin-abi/Cargo.toml","crates/marqdo-plugin-abi/src/abi.rs","crates/marqdo-plugin-abi/src/lib.rs","crates/marqdo-provider-worker/Cargo.toml","crates/marqdo-provider-worker/tests/worker_binding.rs","crates/marqdo-runtime/Cargo.toml","crates/marqdo-runtime/src/builtins_impl.rs","crates/marqdo-runtime/src/interpreter.rs","crates/marqdo-runtime/src/lib.rs","crates/marqdo-runtime/tests/interpreter.rs","crates/marqdo-runtime/tests/observation.rs","docs/DEVELOPMENT_BLUEPRINT.md","docs/STATUS.md","docs/adr/README.md","docs/architecture/CURRENT.md","docs/architecture/README.md","docs/ci.md","docs/developers/README.md","examples/plugin-demo/README.md","spec/plugin-abi.md","spec/security.md","tests/README.md"],"version":"3.20.1","title":"","message":"refactor: extractLine truncated
-102
View File
@@ -1,102 +0,0 @@
# marqdo-stdlib (bundled first slice)
This directory is the official, offline `marqdo-stdlib` bundle consumed by
`std:<path>` imports. The CLI verifies `stdlib.json.digest` before loading any
module; a mismatch is a hard error.
> **Migration status (RFC-LANG-0002): the sources here are still pre-RFC and
> do not yet use the current language syntax.** Every `.mq.md` module in this
> directory is written in the superseded mapping (unmarked H2 as function,
> `Strong` as execution, `Emph` as return, ordered-list branches, bullet-list
> loops, block-quote calls, first code-span signatures). They are **not**
> valid sources for the target language and are not syntax examples to copy.
> The bundled stdlib will be migrated together with the Rust frontend and
> expression parser; `stdlib.json` and this digest will then be regenerated in
> the same change. Do not claim the stdlib already uses the new syntax.
> Authority:
> [`docs/architecture/RFC-LANG-0002-unified-semantics.md`](../docs/architecture/RFC-LANG-0002-unified-semantics.md),
> normative summary [`spec/mapping.md`](../spec/mapping.md), status
> [`docs/STATUS.md`](../docs/STATUS.md).
- `format.mq.md` — value formatting (`显示`, list/map/table display, escaping)
- `text.mq.md` — compatibility UTF-8 encoding into `Memory`
- `text/utf8.mq.md` — `.mq.md` UTF-8 encoder and validating decoder
- `io.mq.md` — compatibility facade over `stream` and `console`
- `fs/file.mq.md` — bounded project-file read/write/copy over `resource.*`
- `io/stream.mq.md` — `写全部` / `写文本` with short-write and close checking
- `io/console.mq.md` — `读取行` / `打印` over `stdio/stdin` and `stdio/stdout`
- `demo.mq.md` — side-by-side comparison with builtin `打印`
- `data/json.mq.md` — recursive JSON parser/formatter, 128-depth bound, multi-value
- `data/csv.mq.md` — quoted single/multi-row CSV parser and formatter
- `data/table.mq.md` — value-returning table select/filter/sort/append/set/join/group/GFM
- `env.mq.md` — explicitly granted `env.get` names over `resource.request`
- `process.mq.md` — explicitly granted `process.run` with timeout/output caps
- `compress.mq.md` — deterministic gzip compress/decompress over byte lists
- `random.mq.md` — explicitly granted OS entropy bytes/integers
- `datetime.mq.md` — UTC ISO-8601 format/parse over Unix milliseconds (pure)
- `clock.mq.md` — project-mode `clock.now` over `resource.request`
- `path.mq.md` — lexical join/basename/dirname/extension/normalize (no I/O)
- `regex.mq.md` — pure subset matcher + host-backed groups/alternation/captures
- `net/http.mq.md` — byte-exact HTTP/1.1 parsing (chunked) and request builder
- `tests/` — product self-tests for every public module
(`clock`, `compress`, `console`, `csv`, `datetime`, `demo`, `env`, `format`, `fs`, `http`,
`io`, `json`, `path`, `process`, `random`, `regex`, `stream`, `table`, `text`, `utf8`)
The digest is a SHA-256 over sorted `*.mq.md` relative paths, a NUL, file
bytes, and a NUL. It excludes `stdlib.json` and non-`.mq.md` files. After any
module change, regenerate it with:
```bash
python3 - stdlib <<'PY'
import hashlib, json, sys
from pathlib import Path
root=Path(sys.argv[1])
h=hashlib.sha256()
for p in sorted(root.rglob('*.mq.md'), key=lambda p: p.relative_to(root).as_posix()):
h.update(p.relative_to(root).as_posix().encode()); h.update(b'\0')
h.update(p.read_bytes()); h.update(b'\0')
manifest=json.loads((root/'stdlib.json').read_text())
manifest['digest']='sha256:'+h.hexdigest()
(root/'stdlib.json').write_text(json.dumps(manifest, indent=2)+'\n')
PY
```
The version/digest are part of each stdlib module's package instance id, so a
different bundle cannot silently masquerade as the one a project was checked
against.
## Official public aliases (`public_aliases`)
`stdlib.json` can declare language-surface aliases that are bound as ordinary
`Marqdo` functions (ADR-0058). The current table contains:
```json
"public_aliases": [
{
"public_names": ["print", "打印"],
"target_module": "io.mq.md",
"target_function": "写值",
"expected_signature": "params(值)",
"effects": ["host"]
}
],
"aliases_digest": "sha256:<64 lowercase hex>"
```
Rules:
* Only this verified bundle may declare a public alias. Third-party packages
cannot claim `打印`/`print`, `std.*` or `marqdo.*` names.
* `aliases_digest` is the SHA-256 of the canonical alias encoding: for each
alias sorted by `(target_module, target_function)`, module bytes + NUL,
function bytes + NUL, then each public name sorted + NUL. The loader verifies
it together with the `.mq.md` tree digest before loading any module; a
tampered table is a load error.
* The loader loads `target_module` only when the program references one of the
`public_names`, then binds the call to the ordinary target `FunctionId`; the
runtime has no print branch and `Program.print_override` does not exist.
* `expected_signature` is checked against the target function's declared
parameters; a mismatch is a load error.
* Output/error/Trace behavior must remain byte-identical for an official
install; `tools/pack-stdlib.py` refuses to package a bundle whose
`aliases_digest` does not match `public_aliases`.
-10
View File
@@ -1,10 +0,0 @@
# @exec clock
## 现在
`params()`
返回项目模式下的 UTC Unix 毫秒。pure/strict 返回
permission.denied,与 resource.request 的其他操作一致。
`return resource.request("clock.now", [])`
-19
View File
@@ -1,19 +0,0 @@
# @exec compress
## 压缩
`params(文本)`
把 UTF-8 文本压缩为 gzip 字节列表(List<Int>,0–255)。输入上限
8 MiB;结果确定(不写入时间戳/文件名)。
`return resource.request("compress.gzip", [文本])`
## 解压
`params(字节列表)`
解压 gzip 字节列表并校验 UTF-8。输出上限 8 MiB;坏 gzip 返回
compress.invalid,非 UTF-8 返回 compress.not_utf8。
`return resource.request("compress.gunzip", [字节列表])`
-354
View File
@@ -1,354 +0,0 @@
# @exec csv
## 成功
`params(值)`
`return {ok: true, value: 值}`
## 失败
`params(代码, 消息)`
`return {ok: false, code: 代码, message: 消息}`
## 解析行
`params(文本)`
解析单行 CSV:逗号分隔、双引号包裹、"" 表示一个字面双引号。
不处理换行、多行字段或首尾空白。未闭合引号和未加引号字段中的双引号
返回可恢复错误。
**点 = text.codepoints(文本)**
**下标 = 0**
**字段 = ""**
**字段表 = []**
**引号内 = false**
**错误 = ""**
`while 下标 < 长度(点) and 错误 == ""`
**字符 = text.from_codepoint(点[下标])**
`if 引号内 and 字符 == "\""`
`if 下标 + 1 < 长度(点) and text.from_codepoint(点[下标 + 1]) == "\""`
**`字段 = 字段 + "\""`**
**下标 = 下标 + 2**
`else`
`if true`
**引号内 = false**
**下标 = 下标 + 1**
`end`
`end`
`else`
`if 引号内`
**字段 = 字段 + 字符**
**下标 = 下标 + 1**
`else`
`if 字符 == "\""`
`if 字段 == ""`
**引号内 = true**
**下标 = 下标 + 1**
`else`
`if true`
**错误 = "csv.invalid_quote"**
`end`
`end`
`else`
`if 字符 == ","`
**字段表 = list.append(字段表, 字段)**
**字段 = ""**
**下标 = 下标 + 1**
`else`
`if true`
**字段 = 字段 + 字符**
**下标 = 下标 + 1**
`end`
`end`
`end`
`end`
`end`
`end`
`if 错误 != ""`
`return 失败(错误, "未加引号字段中出现双引号")`
`else`
`if 引号内`
`return 失败("csv.unterminated_quote", "引号未闭合")`
`end`
`end`
`return 成功(list.concat(字段表, [字段]))`
## 格式化字段
`params(文本)`
含逗号、双引号、换行或回车的字段加引号,内部双引号写成 ""。
**点 = text.codepoints(文本)**
**下标 = 0**
**需要引号 = false**
`while 下标 < 长度(点) and not 需要引号`
**码点 = 点[下标]**
`if 码点 == 34 or 码点 == 44 or 码点 == 10 or 码点 == 13`
**需要引号 = true**
`else`
`if true`
**忽略 = 0**
`end`
`end`
**下标 = 下标 + 1**
`end`
`if not 需要引号`
`return 文本`
`end`
**`结果 = "\""`**
**下标 = 0**
`while 下标 < 长度(点)`
`if 点[下标] == 34`
**`结果 = 结果 + "\"\""`**
`else`
`if true`
**结果 = 结果 + text.from_codepoint(点[下标])**
`end`
`end`
**下标 = 下标 + 1**
`end`
``return 结果 + "\""``
## 格式化行
`params(列表)`
**结果 = ""**
**下标 = 0**
`while 下标 < 长度(列表)`
`if 下标 > 0`
**结果 = 结果 + ","**
`else`
`if true`
**忽略 = 0**
`end`
`end`
**结果 = 结果 + 格式化字段(文本(列表[下标]))**
**下标 = 下标 + 1**
`end`
`return 结果`
## 解析
`params(文本)`
解析多行 CSV(逗号分隔、双引号、"" 转义、CRLF/LF 行尾,引号内可含
换行)。返回 {ok:true, value:List<List<Text>>};未闭合引号和不合法
引号返回可恢复错误。
**点 = text.codepoints(文本)**
**下标 = 0**
**字段 = ""**
**当前行 = []**
**行 = []**
**引号内 = false**
**错误 = ""**
`while 下标 < 长度(点) and 错误 == ""`
**字符 = text.from_codepoint(点[下标])**
`if 引号内 and 字符 == "\""`
`if 下标 + 1 < 长度(点) and text.from_codepoint(点[下标 + 1]) == "\""`
**`字段 = 字段 + "\""`**
**下标 = 下标 + 2**
`else`
`if true`
**引号内 = false**
**下标 = 下标 + 1**
`end`
`end`
`else`
`if 引号内`
**字段 = 字段 + 字符**
**下标 = 下标 + 1**
`else`
`if 字符 == "\""`
`if 字段 == ""`
**引号内 = true**
**下标 = 下标 + 1**
`else`
`if true`
**错误 = "csv.invalid_quote"**
`end`
`end`
`else`
`if 字符 == ","`
**当前行 = list.append(当前行, 字段)**
**字段 = ""**
**下标 = 下标 + 1**
`else`
`if 字符 == "\n"`
**当前行 = list.append(当前行, 字段)**
**行 = list.append(行, 当前行)**
**当前行 = []**
**字段 = ""**
**下标 = 下标 + 1**
`else`
`if 字符 == "\r"`
**下标 = 下标 + 1**
`else`
`if true`
**字段 = 字段 + 字符**
**下标 = 下标 + 1**
`end`
`end`
`end`
`end`
`end`
`end`
`end`
`end`
`if 错误 != ""`
`return 失败(错误, "未加引号字段中出现双引号")`
`else`
`if 引号内`
`return 失败("csv.unterminated_quote", "引号未闭合")`
`else`
`if 字段 != "" or 长度(当前行) > 0`
**当前行 = list.append(当前行, 字段)**
**行 = list.append(行, 当前行)**
`end`
`end`
`end`
`return 成功(行)`
## 格式化
`params(行列表)`
**结果 = ""**
**行号 = 0**
`while 行号 < 长度(行列表)`
`if 行号 > 0`
**结果 = 结果 + "\n"**
`else`
`if true`
**忽略 = 0**
`end`
`end`
**结果 = 结果 + 格式化行(行列表[行号])**
**行号 = 行号 + 1**
`end`
`return 结果`
-920
View File
@@ -1,920 +0,0 @@
# @exec json
## 嵌套深度
`params(文本)`
按未转义字符串之外的 {/[ 计算最大嵌套深度。
**点 = text.codepoints(文本)**
**下标 = 0**
**深度 = 0**
**最大 = 0**
**字符串内 = false**
**转义 = false**
`while 下标 < 长度(点)`
**码点 = 点[下标]**
`if 字符串内`
`if 转义`
**转义 = false**
`else`
`if 码点 == 92`
**转义 = true**
`else`
`if 码点 == 34`
**字符串内 = false**
`else`
`if true`
**忽略 = 0**
`end`
`end`
`end`
`end`
`else`
`if 码点 == 34`
**字符串内 = true**
`else`
`if 码点 == 123 or 码点 == 91`
**深度 = 深度 + 1**
`if 深度 > 最大`
**最大 = 深度**
`else`
`if true`
**忽略 = 0**
`end`
`end`
`else`
`if 码点 == 125 or 码点 == 93`
`if 深度 > 0`
**深度 = 深度 - 1**
`else`
`if true`
**忽略 = 0**
`end`
`end`
`else`
`if true`
**忽略 = 0**
`end`
`end`
`end`
`end`
`end`
**下标 = 下标 + 1**
`end`
`return 最大`
## 解析
`params(文本)`
解析一个完整的 JSON 文本。值之后只允许空白;多余输入返回
json.trailing,嵌套超过 128 层返回 json.depth。成功结果只保留
{ok, value},不暴露内部游标。
**点 = text.codepoints(文本)**
`if 嵌套深度(文本) > 128`
`return 失败("json.depth", "嵌套深度超过 128")`
`end`
**结果 = 解析值(点, 0)**
`if not 结果.ok`
`return 结果`
`end`
**位置 = 跳过空白(点, 结果.next)**
`if 位置 != 长度(点)`
`return 失败("json.trailing", "值后存在多余输入")`
`end`
`return {ok: true, value: 结果.value}`
## 成功值
`params(值, 下一位置)`
`return {ok: true, value: 值, next: 下一位置}`
## 失败
`params(代码, 消息)`
`return {ok: false, code: 代码, message: 消息}`
## 是空白
`params(码点)`
`return 码点 == 32 or 码点 == 9 or 码点 == 10 or 码点 == 13`
## 是数字
`params(码点)`
`return 码点 >= 48 and 码点 <= 57`
## 跳过空白
`params(点, 位置)`
**当前 = 位置**
`while 当前 < 长度(点) and 是空白(点[当前])`
**当前 = 当前 + 1**
`end`
`return 当前`
## 匹配
`params(点, 位置, 文本)`
**目标 = text.codepoints(文本)**
**下标 = 0**
**结果 = true**
`while 下标 < 长度(目标) and 结果`
`if 位置 + 下标 >= 长度(点)`
**结果 = false**
`else`
`if 点[位置 + 下标] != 目标[下标]`
**结果 = false**
`else`
`if true`
**继续 = 0**
`end`
`end`
`end`
**下标 = 下标 + 1**
`end`
`return 结果`
## 片段
`params(点, 起点, 终点)`
**结果 = ""**
**下标 = 起点**
`while 下标 < 终点`
**结果 = 结果 + text.from_codepoint(点[下标])**
**下标 = 下标 + 1**
`end`
`return 结果`
## 解析数字
`params(点, 位置)`
JSON 数字:可选负号、整数位、可选小数位、可选指数;含 ./e 返回 Float。
**开始 = 位置**
**当前 = 位置**
`if text.from_codepoint(点[当前]) == "-"`
**当前 = 当前 + 1**
`else`
`if true`
**非负 = 0**
`end`
`end`
**整数位 = 0**
`while 当前 < 长度(点) and 是数字(点[当前])`
**整数位 = 整数位 + 1**
**当前 = 当前 + 1**
`end`
**有小数 = false**
**小数位 = 0**
`if 当前 < 长度(点) and text.from_codepoint(点[当前]) == "."`
**有小数 = true**
**当前 = 当前 + 1**
`while 当前 < 长度(点) and 是数字(点[当前])`
**小数位 = 小数位 + 1**
**当前 = 当前 + 1**
`end`
`else`
`if true`
**忽略 = 0**
`end`
`end`
**指数位 = 0**
**指数标记 = false**
`if 当前 < 长度(点) and (text.from_codepoint(点[当前]) == "e" or text.from_codepoint(点[当前]) == "E")`
**有小数 = true**
**指数标记 = true**
**当前 = 当前 + 1**
`if 当前 < 长度(点) and (text.from_codepoint(点[当前]) == "+" or text.from_codepoint(点[当前]) == "-")`
**当前 = 当前 + 1**
`else`
`if true`
**忽略指数符号 = 0**
`end`
`end`
`while 当前 < 长度(点) and 是数字(点[当前])`
**指数位 = 指数位 + 1**
**当前 = 当前 + 1**
`end`
`else`
`if 整数位 == 0`
`return 失败("json.invalid_number", "数字缺少整数位")`
`else`
`if 有小数 and not 指数标记 and 小数位 == 0`
`return 失败("json.invalid_number", "小数缺少位数")`
`else`
`if 指数标记 and 指数位 == 0`
`return 失败("json.invalid_number", "指数缺少位数")`
`end`
`end`
`end`
`end`
**原文 = 片段(点, 开始, 当前)**
`if 有小数`
`return 成功值(小数(原文), 当前)`
`end`
`return 成功值(整数(原文), 当前)`
## 十六进制值
`params(码点)`
`if 码点 >= 48 and 码点 <= 57`
`return 码点 - 48`
`else`
`if 码点 >= 65 and 码点 <= 70`
`return 码点 - 55`
`else`
`if 码点 >= 97 and 码点 <= 102`
`return 码点 - 87`
`end`
`end`
`end`
`return 0 - 1`
## 解析字符串
`params(点, 位置)`
**当前 = 位置 + 1**
**结果 = ""**
**完成 = false**
**错误 = ""**
`while 当前 < 长度(点) and not 完成 and 错误 == ""`
**码点 = 点[当前]**
`if 码点 == 34`
**完成 = true**
**当前 = 当前 + 1**
`else`
`if 码点 == 92`
`if 当前 + 1 >= 长度(点)`
**错误 = "json.invalid_escape"**
`else`
`if true`
**转义码点 = 点[当前 + 1]**
`if 转义码点 == 34`
**结果 = 结果 + text.from_codepoint(34)**
**当前 = 当前 + 2**
`else`
`if 转义码点 == 92`
**结果 = 结果 + text.from_codepoint(92)**
**当前 = 当前 + 2**
`else`
`if 转义码点 == 47`
**结果 = 结果 + text.from_codepoint(47)**
**当前 = 当前 + 2**
`else`
`if 转义码点 == 98`
**结果 = 结果 + text.from_codepoint(8)**
**当前 = 当前 + 2**
`else`
`if 转义码点 == 102`
**结果 = 结果 + text.from_codepoint(12)**
**当前 = 当前 + 2**
`else`
`if 转义码点 == 110`
**结果 = 结果 + text.from_codepoint(10)**
**当前 = 当前 + 2**
`else`
`if 转义码点 == 114`
**结果 = 结果 + text.from_codepoint(13)**
**当前 = 当前 + 2**
`else`
`if 转义码点 == 116`
**结果 = 结果 + text.from_codepoint(9)**
**当前 = 当前 + 2**
`else`
`if 转义码点 == 117`
`if 当前 + 5 >= 长度(点)`
**错误 = "json.invalid_escape"**
`else`
`if true`
**数字 = 十六进制值(点[当前 + 2]) * 4096 + 十六进制值(点[当前 + 3]) * 256 + 十六进制值(点[当前 + 4]) * 16 + 十六进制值(点[当前 + 5])**
`if 数字 < 0 or (数字 >= 55296 and 数字 <= 57343)`
**错误 = "json.invalid_escape"**
`else`
`if true`
**结果 = 结果 + text.from_codepoint(数字)**
**当前 = 当前 + 6**
`end`
`end`
`end`
`end`
`else`
`if true`
**错误 = "json.invalid_escape"**
`end`
`end`
`end`
`end`
`end`
`end`
`end`
`end`
`end`
`end`
`end`
`end`
`else`
`if true`
**结果 = 结果 + text.from_codepoint(码点)**
**当前 = 当前 + 1**
`end`
`end`
`end`
`end`
`if 错误 != ""`
`return 失败("json.invalid_string", "字符串转义无效")`
`else`
`if not 完成`
`return 失败("json.unexpected_eof", "字符串未闭合")`
`end`
`end`
`return 成功值(结果, 当前)`
## 解析对象
`params(点, 位置)`
`return 解析对象项(点, 位置 + 1, {})`
## 解析对象项
`params(点, 位置, 已解析)`
**位置 = 跳过空白(点, 位置)**
`if 位置 >= 长度(点)`
`return 失败("json.unexpected_eof", "对象未闭合")`
`end`
**当前 = text.from_codepoint(点[位置])**
`if 当前 == "}"`
`return 成功值(已解析, 位置 + 1)`
`end`
**键结果 = 解析字符串(点, 位置)**
`if not 键结果.ok`
`return 键结果`
`end`
**键 = 键结果.value**
**位置 = 跳过空白(点, 键结果.next)**
`if 位置 >= 长度(点)`
`return 失败("json.unexpected_eof", "对象缺少冒号")`
`else`
`if text.from_codepoint(点[位置]) != ":"`
`return 失败("json.invalid_object", "对象缺少冒号")`
`end`
`end`
**位置 = 跳过空白(点, 位置 + 1)**
**值结果 = 解析值(点, 位置)**
`if not 值结果.ok`
`return 值结果`
`end`
**新的已解析 = map.set(已解析, 键, 值结果.value)**
**位置 = 跳过空白(点, 值结果.next)**
`if 位置 >= 长度(点)`
`return 失败("json.unexpected_eof", "对象未闭合")`
`end`
**分隔 = text.from_codepoint(点[位置])**
`if 分隔 == ","`
`return 解析对象项(点, 位置 + 1, 新的已解析)`
`else`
`if 分隔 == "}"`
`return 成功值(新的已解析, 位置 + 1)`
`else`
`if true`
`return 失败("json.invalid_object", "对象缺少逗号或 }")`
`end`
`end`
`end`
## 解析值
`params(点, 位置)`
**位置 = 跳过空白(点, 位置)**
`if 位置 >= 长度(点)`
`return 失败("json.unexpected_eof", "需要值")`
`end`
**首 = text.from_codepoint(点[位置])**
**首码点 = 点[位置]**
`if 首码点 == 34`
`return 解析字符串(点, 位置)`
`else`
`if 首码点 == 123`
`return 解析对象(点, 位置)`
`else`
`if 首 == "["`
`return 解析数组(点, 位置)`
`else`
`if 首 == "-" or 是数字(点[位置])`
`return 解析数字(点, 位置)`
`else`
`if 首 == "t"`
`if 匹配(点, 位置, "true")`
`return 成功值(true, 位置 + 4)`
`else`
`if true`
`return 失败("json.invalid_literal", "无效字面量")`
`end`
`end`
`else`
`if 首 == "f"`
`if 匹配(点, 位置, "false")`
`return 成功值(false, 位置 + 5)`
`else`
`if true`
`return 失败("json.invalid_literal", "无效字面量")`
`end`
`end`
`else`
`if 首 == "n"`
`if 匹配(点, 位置, "null")`
`return 成功值(None, 位置 + 4)`
`else`
`if true`
`return 失败("json.invalid_literal", "无效字面量")`
`end`
`end`
`else`
`if true`
`return 失败("json.unexpected_token", "不支持的值")`
`end`
`end`
`end`
`end`
`end`
`end`
`end`
`end`
## 解析数组
`params(点, 位置)`
`return 解析数组项(点, 位置 + 1, [])`
## 解析数组项
`params(点, 位置, 已解析)`
**位置 = 跳过空白(点, 位置)**
`if 位置 >= 长度(点)`
`return 失败("json.unexpected_eof", "数组未闭合")`
`end`
**当前 = text.from_codepoint(点[位置])**
`if 当前 == "]"`
`return 成功值(已解析, 位置 + 1)`
`end`
**项 = 解析值(点, 位置)**
`if not 项.ok`
`return 项`
`end`
**新的已解析 = list.append(已解析, 项.value)**
**位置 = 跳过空白(点, 项.next)**
`if 位置 >= 长度(点)`
`return 失败("json.unexpected_eof", "数组未闭合")`
`end`
**分隔 = text.from_codepoint(点[位置])**
`if 分隔 == ","`
`return 解析数组项(点, 位置 + 1, 新的已解析)`
`else`
`if 分隔 == "]"`
`return 成功值(新的已解析, 位置 + 1)`
`else`
`if true`
`return 失败("json.invalid_array", "数组缺少逗号或 ]")`
`end`
`end`
`end`
## 格式化文本
`params(文本)`
**点 = text.codepoints(文本)**
**`结果 = "\""`**
**下标 = 0**
`while 下标 < 长度(点)`
**码点 = 点[下标]**
`if 码点 == 34`
**`结果 = 结果 + "\\\""`**
`else`
`if 码点 == 92`
**`结果 = 结果 + "\\\\"`**
`else`
`if 码点 == 10`
**`结果 = 结果 + "\\n"`**
`else`
`if 码点 == 9`
**`结果 = 结果 + "\\t"`**
`else`
`if 码点 == 13`
**`结果 = 结果 + "\\r"`**
`else`
`if true`
**结果 = 结果 + text.from_codepoint(码点)**
`end`
`end`
`end`
`end`
`end`
`end`
**下标 = 下标 + 1**
`end`
``return 结果 + "\""``
## 格式化列表
`params(列表)`
**结果 = "["**
**下标 = 0**
`while 下标 < 长度(列表)`
`if 下标 > 0`
**结果 = 结果 + ", "**
`else`
`if true`
**忽略 = 0**
`end`
`end`
**结果 = 结果 + 格式化(列表[下标])**
**下标 = 下标 + 1**
`end`
`return 结果 + "]"`
## 格式化对象
`params(映射)`
**键列表 = map.keys(映射)**
**结果 = "{"**
**下标 = 0**
`while 下标 < 长度(键列表)`
`if 下标 > 0`
**结果 = 结果 + ", "**
`else`
`if true`
**忽略 = 0**
`end`
`end`
**当前键 = 键列表[下标]**
**结果 = 结果 + 格式化文本(当前键) + ": " + 格式化(map.get(映射, 当前键))**
**下标 = 下标 + 1**
`end`
`return 结果 + "}"`
## 格式化
`params(值)`
**类别 = 类型(值)**
`if 类别 == "Text"`
`return 格式化文本(值)`
`else`
`if 类别 == "None"`
`return "null"`
`else`
`if 类别 == "Bool" or 类别 == "Int" or 类别 == "Float"`
`return 文本(值)`
`else`
`if 类别 == "List"`
`return 格式化列表(值)`
`else`
`if 类别 == "Map"`
`return 格式化对象(值)`
`end`
`end`
`end`
`end`
`end`
`return "null"`
## 解析多个
`params(文本)`
解析连续多个 JSON 值(空白分隔),返回 {ok:true, value:List}。
任一项失败时返回该项的错误,不返回部分结果。
**点 = text.codepoints(文本)**
**位置 = 跳过空白(点, 0)**
**结果 = []**
`while 位置 < 长度(点)`
**项 = 解析值(点, 位置)**
`if not 项.ok`
`return 项`
`end`
**结果 = list.append(结果, 项.value)**
**位置 = 跳过空白(点, 项.next)**
`end`
`return {ok: true, value: 结果}`
-416
View File
@@ -1,416 +0,0 @@
# @exec table
## 选择列
`params(数据, 列)`
**列名 = table.columns(数据)**
**结果行 = []**
**行号 = 0**
`while 行号 < 长度(数据)`
**行 = table.row(数据, 行号)**
**结果行 = list.append(结果行, [行[列]])**
**行号 = 行号 + 1**
`end`
`return 表([列名[列]], 结果行)`
## 过滤数值大于
`params(数据, 列, 阈值)`
**列名 = table.columns(数据)**
**结果行 = []**
**行号 = 0**
`while 行号 < 长度(数据)`
**行 = table.row(数据, 行号)**
`if 行[列] > 阈值`
**结果行 = list.append(结果行, 行)**
`else`
`if true`
**忽略 = 0**
`end`
`end`
**行号 = 行号 + 1**
`end`
`return 表(列名, 结果行)`
## 插入有序
`params(已排序, 行, 列)`
**新列表 = []**
**已插入 = false**
**下标 = 0**
`while 下标 < 长度(已排序)`
**当前行 = 已排序[下标]**
`if not 已插入 and 当前行[列] > 行[列]`
**新列表 = list.append(新列表, 行)**
**新列表 = list.append(新列表, 当前行)**
**已插入 = true**
`else`
`if true`
**新列表 = list.append(新列表, 当前行)**
`end`
`end`
**下标 = 下标 + 1**
`end`
`if not 已插入`
**新列表 = list.append(新列表, 行)**
`else`
`if true`
**忽略 = 0**
`end`
`end`
`return 新列表`
## 排序
`params(数据, 列)`
**列名 = table.columns(数据)**
**行数 = 长度(数据)**
**已排序 = []**
**下标 = 0**
`while 下标 < 行数`
**已排序 = 插入有序(已排序, table.row(数据, 下标), 列)**
**下标 = 下标 + 1**
`end`
`return 表(列名, 已排序)`
## 追加行
`params(数据, 行)`
**列名 = table.columns(数据)**
**所有行 = []**
**行号 = 0**
`while 行号 < 长度(数据)`
**所有行 = list.append(所有行, table.row(数据, 行号))**
**行号 = 行号 + 1**
`end`
`return 表(列名, list.append(所有行, 行))`
## 设置单元格
`params(数据, 目标行, 目标列, 值)`
**列名 = table.columns(数据)**
**新行表 = []**
**行号 = 0**
`while 行号 < 长度(数据)`
**行 = table.row(数据, 行号)**
`if 行号 == 目标行`
**新行 = []**
**列号 = 0**
`while 列号 < 长度(行)`
`if 列号 == 目标列`
**新行 = list.append(新行, 值)**
`else`
`if true`
**新行 = list.append(新行, 行[列号])**
`end`
`end`
**列号 = 列号 + 1**
`end`
**新行表 = list.append(新行表, 新行)**
`else`
`if true`
**新行表 = list.append(新行表, 行)**
`end`
`end`
**行号 = 行号 + 1**
`end`
`return 表(列名, 新行表)`
## 连接
`params(左, 右, 左列, 右列)`
**表头 = list.concat(table.columns(左), table.columns(右))**
**结果行 = []**
**左行号 = 0**
`while 左行号 < 长度(左)`
**左行 = table.row(左, 左行号)**
**键 = 左行[左列]**
**右行号 = 0**
`while 右行号 < 长度(右)`
**右行 = table.row(右, 右行号)**
`if 右行[右列] == 键`
**结果行 = list.append(结果行, list.concat(左行, 右行))**
`else`
`if true`
**忽略 = 0**
`end`
`end`
**右行号 = 右行号 + 1**
`end`
**左行号 = 左行号 + 1**
`end`
`return 表(表头, 结果行)`
## 分组
`params(数据, 键列, 值列)`
**结果 = {}**
**行号 = 0**
`while 行号 < 长度(数据)`
**行 = table.row(数据, 行号)**
**键 = 行[键列]**
**当前 = map.get(结果, 键)**
**列表 = []**
`if map.has(结果, 键)`
**列表 = 当前**
`else`
`if true`
**忽略 = 0**
`end`
`end`
**列表 = list.append(列表, 行[值列])**
**结果 = map.set(结果, 键, 列表)**
**行号 = 行号 + 1**
`end`
`return 结果`
## 连接片段
`params(片段)`
**结果 = ""**
**下标 = 0**
`while 下标 < 长度(片段)`
`if 下标 > 0`
**结果 = 结果 + " | "**
`else`
`if true`
**忽略 = 0**
`end`
`end`
**结果 = 结果 + 片段[下标]**
**下标 = 下标 + 1**
`end`
`return 结果`
## 连接行
`params(行列表)`
**结果 = ""**
**下标 = 0**
`while 下标 < 长度(行列表)`
`if 下标 > 0`
**结果 = 结果 + "\n"**
`else`
`if true`
**忽略 = 0**
`end`
`end`
**结果 = 结果 + 行列表[下标]**
**下标 = 下标 + 1**
`end`
`return 结果`
## 转义单元格
`params(值)`
**文本值 = 文本(值)**
**点 = text.codepoints(文本值)**
**结果 = ""**
**下标 = 0**
`while 下标 < 长度(点)`
`if 点[下标] == 124`
**结果 = 结果 + text.from_codepoint(92) + "|"**
`else`
`if 点[下标] == 10 or 点[下标] == 13`
**结果 = 结果 + " "**
`else`
`if true`
**结果 = 结果 + text.from_codepoint(点[下标])**
`end`
`end`
`end`
**下标 = 下标 + 1**
`end`
`return 结果`
## 转GFM
`params(数据)`
**列名 = table.columns(数据)**
**表头 = []**
**下标 = 0**
`while 下标 < 长度(列名)`
**表头 = list.append(表头, 转义单元格(列名[下标]))**
**下标 = 下标 + 1**
`end`
**行列表 = []**
**行列表 = list.append(行列表, "| " + 连接片段(表头) + " |")**
**分隔 = []**
**下标 = 0**
`while 下标 < 长度(列名)`
**分隔 = list.append(分隔, "---")**
**下标 = 下标 + 1**
`end`
**行列表 = list.append(行列表, "| " + 连接片段(分隔) + " |")**
**行号 = 0**
`while 行号 < 长度(数据)`
**行 = table.row(数据, 行号)**
**单元格 = []**
**列号 = 0**
`while 列号 < 长度(行)`
**单元格 = list.append(单元格, 转义单元格(行[列号]))**
**列号 = 列号 + 1**
`end`
**行列表 = list.append(行列表, "| " + 连接片段(单元格) + " |")**
**行号 = 行号 + 1**
`end`
`return 连接行(行列表)`
-340
View File
@@ -1,340 +0,0 @@
# @exec datetime
## 失败
`params(消息)`
`return {ok: false, code: "datetime.invalid", message: 消息}`
## 闰年
`params(年)`
`return 年 % 4 == 0 and (年 % 100 != 0 or 年 % 400 == 0)`
## 每月天数
`params(年, 月)`
`if 月 == 2`
`if 闰年(年)`
`return 29`
`end`
`return 28`
`else`
`if 月 == 4 or 月 == 6 or 月 == 9 or 月 == 11`
`return 30`
`end`
`end`
`return 31`
## 补零2
`params(值)`
`if 值 < 10`
`return "0" + 文本(值)`
`end`
`return 文本(值)`
## 补零3
`params(值)`
`if 值 < 10`
`return "00" + 文本(值)`
`else`
`if 值 < 100`
`return "0" + 文本(值)`
`end`
`end`
`return 文本(值)`
## 补零4
`params(值)`
`if 值 < 10`
`return "000" + 文本(值)`
`else`
`if 值 < 100`
`return "00" + 文本(值)`
`else`
`if 值 < 1000`
`return "0" + 文本(值)`
`end`
`end`
`end`
`return 文本(值)`
## 月份
`params(mp)`
`if mp < 10`
`return mp + 3`
`end`
`return mp - 9`
## 年份
`params(年, 月)`
`if 月 <= 2`
`return 年 + 1`
`end`
`return 年`
## 日期部件
`params(天)`
Howard Hinnant 的 civil-from-days 算法,输入为 1970-01-01 起的天数。
**z = 天 + 719468**
**era = z // 146097**
**doe = z - era * 146097**
**yoe = (doe - doe // 1460 + doe // 36524 - doe // 146096) // 365**
**年 = yoe + era * 400**
**doy = doe - (365 * yoe + yoe // 4 - yoe // 100)**
**mp = (5 * doy + 2) // 153**
**日 = doy - (153 * mp + 2) // 5 + 1**
**月 = 月份(mp)**
`return {年: 年份(年, 月), 月: 月, 日: 日}`
## 日期序号
`params(年, 月, 日)`
**y = 年**
`if 月 <= 2`
**y = y - 1**
`else`
`if true`
**忽略 = 0**
`end`
`end`
**era = y // 400**
**yoe = y - era * 400**
**m = 月**
`if 月 > 2`
**m = 月 - 3**
`else`
`if true`
**m = 月 + 9**
`end`
`end`
**doy = (153 * m + 2) // 5 + 日 - 1**
**doe = yoe * 365 + yoe // 4 - yoe // 100 + doy**
`return era * 146097 + doe - 719468`
## 是数字串
`params(文本)`
**点 = text.codepoints(文本)**
**结果 = 长度(点) > 0**
**下标 = 0**
`while 下标 < 长度(点) and 结果`
`if 点[下标] < 48 or 点[下标] > 57`
**结果 = false**
`else`
`if true`
**忽略 = 0**
`end`
`end`
**下标 = 下标 + 1**
`end`
`return 结果`
## 片段
`params(点, 起点, 终点)`
**结果 = ""**
**下标 = 起点**
`while 下标 < 终点`
**结果 = 结果 + text.from_codepoint(点[下标])**
**下标 = 下标 + 1**
`end`
`return 结果`
## 格式化
`params(毫秒)`
输出 UTC ISO-8601:YYYY-MM-DDTHH:MM:SSZ;毫秒非零时追加
.mmm。负数毫秒按 1970 前的 UTC 时间处理。
**秒 = 毫秒 // 1000**
**毫 = 毫秒 % 1000**
**天 = 秒 // 86400**
**日内 = 秒 % 86400**
**时 = 日内 // 3600**
**分 = 日内 % 3600 // 60**
**秒数 = 日内 % 60**
**日期 = 日期部件(天)**
**基 = 补零4(日期.年) + "-" + 补零2(日期.月) + "-" + 补零2(日期.日) + "T" + 补零2(时) + ":" + 补零2(分) + ":" + 补零2(秒数)**
`if 毫 == 0`
`return 基 + "Z"`
`end`
`return 基 + "." + 补零3(毫) + "Z"`
## 解析
`params(文本)`
解析 YYYY-MM-DDTHH:MM:SSZ 或带 .mmm 的 UTC 文本,返回 Unix 毫秒。
范围、闰年和格式错误都是可恢复 datetime.invalid。
**点 = text.codepoints(文本)**
`if 长度(点) < 20 or 长度(点) > 24`
`return 失败("长度不是 20–24 个码点")`
`else`
`if 点[4] != 45 or 点[7] != 45 or 点[10] != 84 or 点[13] != 58 or 点[16] != 58`
`return 失败("分隔符不符合 YYYY-MM-DDTHH:MM:SS")`
`end`
`end`
**年文本 = 片段(点, 0, 4)**
**月文本 = 片段(点, 5, 7)**
**日文本 = 片段(点, 8, 10)**
**时文本 = 片段(点, 11, 13)**
**分文本 = 片段(点, 14, 16)**
**秒文本 = 片段(点, 17, 19)**
`if not 是数字串(年文本) or not 是数字串(月文本) or not 是数字串(日文本) or not 是数字串(时文本) or not 是数字串(分文本) or not 是数字串(秒文本)`
`return 失败("日期时间分量必须是数字")`
`end`
**年 = 整数(年文本)**
**月 = 整数(月文本)**
**日 = 整数(日文本)**
**时 = 整数(时文本)**
**分 = 整数(分文本)**
**秒 = 整数(秒文本)**
**毫文本 = "0"**
**结束 = 20**
`if 长度(点) >= 24 and 点[19] == 46 and 点[23] == 90`
**毫文本 = 片段(点, 20, 23)**
**结束 = 24**
`else`
`if 长度(点) != 结束 or 点[结束 - 1] != 90`
`return 失败("必须以 Z 结尾")`
`else`
`if not 是数字串(毫文本)`
`return 失败("毫秒必须是数字")`
`end`
`end`
`end`
**毫 = 整数(毫文本)**
`if 年 < 1970 or 月 < 1 or 月 > 12 or 日 < 1 or 日 > 每月天数(年, 月)`
`return 失败("日期超出范围")`
`else`
`if 时 < 0 or 时 > 23 or 分 < 0 or 分 > 59 or 秒 < 0 or 秒 > 59`
`return 失败("时间超出范围")`
`end`
`end`
**毫秒 = 日期序号(年, 月, 日) * 86400000 + 时 * 3600000 + 分 * 60000 + 秒 * 1000 + 毫**
`return {ok: true, value: 毫秒}`
-30
View File
@@ -1,30 +0,0 @@
# @exec env
## 读取
`params(名称)`
读取一个显式授权的环境变量。名称是精确匹配,不支持 glob;未授权是
permission.denied,未设置是 env.not_found,非 UTF-8 是
env.not_unicode。
`return resource.request("env.get", [名称])`
## 存在
`params(名称)`
**结果 = 读取(名称)**
`if 结果.ok`
`return {ok: true, value: true}`
`else`
`if 结果.code == "env.not_found"`
`return {ok: true, value: false}`
`end`
`end`
`return 结果`
-334
View File
@@ -1,334 +0,0 @@
# @exec format
## 字节长度
`params(文本)`
**点 = text.codepoints(文本)**
**总字节 = 0**
**下标 = 0**
`while 下标 < 长度(点)`
**码点 = 点[下标]**
`if 码点 < 128`
**总字节 = 总字节 + 1**
`else`
`if 码点 < 2048`
**总字节 = 总字节 + 2**
`else`
`if 码点 < 65536`
**总字节 = 总字节 + 3**
`else`
`if true`
**总字节 = 总字节 + 4**
`end`
`end`
`end`
`end`
**下标 = 下标 + 1**
`end`
`return 总字节`
## 显示
`params(值)`
按语言值语义格式化,用于与内置 打印 的输出对照。
覆盖 Unit/None/Bool/Int/Float/Text/List/Map/Table/Formula/Code/
FunctionRef/PluginHandle/Memory/Resource。
**类别 = 类型(值)**
`if 类别 == "Unit"`
`return "Unit"`
`else`
`if 类别 == "None"`
`return "None"`
`else`
`if 类别 == "Text"`
`return 值`
`else`
`if 类别 == "List"`
`return 列表显示(值)`
`else`
`if 类别 == "Map"`
`return 映射显示(值)`
`else`
`if 类别 == "Table"`
`return 表格显示(值)`
`else`
`if 类别 == "Formula"`
`return "Formula(" + 转义文本(值.latex) + ")"`
`else`
`if 类别 == "Code"`
`return "Code(" + 转义文本(值.language) + ", " + 文本(字节长度(值.source)) + " bytes)"`
`else`
`if 类别 == "FunctionRef"`
`return "FunctionRef(" + 值.module + "::" + 值.name + ")"`
`else`
`if 类别 == "PluginHandle"`
`return "PluginHandle(" + 值.plugin + "::" + 值.export + ")"`
`else`
`if 类别 == "Memory"`
`return "Memory"`
`else`
`if 类别 == "Resource"`
`return "Resource"`
`else`
`if true`
`return 文本(值)`
`end`
`end`
`end`
`end`
`end`
`end`
`end`
`end`
`end`
`end`
`end`
`end`
`end`
## 列表显示
`params(列表)`
**结果 = "["**
**下标 = 0**
`while 下标 < 长度(列表)`
`if 下标 > 0`
**结果 = 结果 + ", "**
`else`
`if true`
**忽略 = 0**
`end`
`end`
**结果 = 结果 + 值显示(列表[下标])**
**下标 = 下标 + 1**
`end`
`return 结果 + "]"`
## 映射显示
`params(映射)`
**键 = map.keys(映射)**
**结果 = "{"**
**下标 = 0**
`while 下标 < 长度(键)`
`if 下标 > 0`
**结果 = 结果 + ", "**
`else`
`if true`
**忽略 = 0**
`end`
`end`
**当前键 = 键[下标]**
**结果 = 结果 + 当前键 + ": " + 值显示(map.get(映射, 当前键))**
**下标 = 下标 + 1**
`end`
`return 结果 + "}"`
## 表格显示
`params(表格)`
**列 = table.columns(表格)**
**结果 = "Table[" + 连接文本(列, " | ") + "]{"**
**行号 = 0**
`while 行号 < 长度(表格)`
`if 行号 > 0`
**结果 = 结果 + "; "**
`else`
`if true`
**忽略 = 0**
`end`
`end`
**行 = table.row(表格, 行号)**
**单元格 = []**
**列号 = 0**
`while 列号 < 长度(行)`
**单元格 = list.append(单元格, 显示(行[列号]))**
**列号 = 列号 + 1**
`end`
**结果 = 结果 + 连接文本(单元格, " | ")**
**行号 = 行号 + 1**
`end`
`return 结果 + "}"`
## 连接文本
`params(列表, 分隔)`
**结果 = ""**
**下标 = 0**
`while 下标 < 长度(列表)`
`if 下标 > 0`
**结果 = 结果 + 分隔**
`else`
`if true`
**忽略 = 0**
`end`
`end`
**结果 = 结果 + 列表[下标]**
**下标 = 下标 + 1**
`end`
`return 结果`
## 值显示
`params(值)`
列表/映射/表格内部使用 repr 语义:Text 带引号并转义,其它值递归显示。
**类别 = 类型(值)**
`if 类别 == "Text"`
`return 转义文本(值)`
`else`
`if true`
`return 显示(值)`
`end`
`end`
## 转义文本
`params(文本)`
**点 = text.codepoints(文本)**
**`结果 = "\""`**
**下标 = 0**
`while 下标 < 长度(点)`
**码点 = 点[下标]**
`if 码点 == 34`
**`结果 = 结果 + "\\\""`**
`else`
`if 码点 == 92`
**`结果 = 结果 + "\\\\"`**
`else`
`if 码点 == 10`
**`结果 = 结果 + "\\n"`**
`else`
`if 码点 == 9`
**`结果 = 结果 + "\\t"`**
`else`
`if 码点 == 13`
**`结果 = 结果 + "\\r"`**
`else`
`if true`
**结果 = 结果 + text.from_codepoint(码点)**
`end`
`end`
`end`
`end`
`end`
`end`
**下标 = 下标 + 1**
`end`
``return 结果 + "\""``
-237
View File
@@ -1,237 +0,0 @@
---
import:
utf8: "../text/utf8.mq.md"
---
# @exec file
## 读文本
`params(路径)`
以 UTF-8 读取一个有界的项目文件。文件在打开时整文件载入,上限 8 MiB;
结果使用可恢复 Result 形状。
**流 = resource.open("file", 路径, ["read"])**
**内存 = memory.new(128, 128)**
**读取 = resource.read(流, 内存, 0, 8388608)**
**关闭 = resource.close(流)**
`if not 读取.ok`
`return 读取`
`else`
`if not 关闭.ok`
`return 关闭`
`else`
`if true`
**文本 = utf8.解码(内存, 0, 读取.value.count)**
`if not 文本.ok`
`return 文本`
`else`
`if true`
`return {ok: true, value: 文本.value}`
`end`
`end`
`end`
`end`
`end`
## 写文本
`params(路径, 文本)`
把文本按 UTF-8 写入项目文件。路径必须已经通过 fs_write 授权;
文件只在 resource.close 成功时创建或覆盖,写入缓冲上限 8 MiB。
**内存 = memory.new(128, 128)**
**长度 = utf8.编码(文本, 内存, 0)**
**流 = resource.open("file", 路径, ["write"])**
**写入 = resource.write(流, 内存, 0, 长度)**
**关闭 = resource.close(流)**
`if not 写入.ok`
`return 写入`
`else`
`if not 关闭.ok`
`return 关闭`
`else`
`if true`
`return {ok: true, value: {count: 写入.value.count}}`
`end`
`end`
`end`
## 复制文件
`params(源, 目标)`
按字节复制一个有界的项目文件。源读取和目标写入分别需要
fs_read/fs_write 授权,结果值与 [写文本](#写文本) 相同。
**输入 = resource.open("file", 源, ["read"])**
**内存 = memory.new(128, 128)**
**读取 = resource.read(输入, 内存, 0, 8388608)**
**关闭输入 = resource.close(输入)**
`if not 读取.ok`
`return 读取`
`else`
`if not 关闭输入.ok`
`return 关闭输入`
`else`
`if true`
**输出 = resource.open("file", 目标, ["write"])**
**写入 = resource.write(输出, 内存, 0, 读取.value.count)**
**关闭输出 = resource.close(输出)**
`if not 写入.ok`
`return 写入`
`else`
`if not 关闭输出.ok`
`return 关闭输出`
`else`
`if true`
`return {ok: true, value: {count: 写入.value.count}}`
`end`
`end`
`end`
`end`
`end`
`end`
## 存在
`params(路径)`
`return resource.request("fs.exists", [路径])`
## 元数据
`params(路径)`
`return resource.request("fs.metadata", [路径])`
## 是文件
`params(路径)`
**元数据 = resource.request("fs.metadata", [路径])**
`if not 元数据.ok`
`return 元数据`
`else`
`if true`
`return {ok: true, value: 元数据.value.kind == "file"}`
`end`
`end`
## 是目录
`params(路径)`
**元数据 = resource.request("fs.metadata", [路径])**
`if not 元数据.ok`
`return 元数据`
`else`
`if true`
`return {ok: true, value: 元数据.value.kind == "directory"}`
`end`
`end`
## 列出目录
`params(路径)`
`return resource.request("fs.list", [路径])`
## 创建目录
`params(路径)`
`return resource.request("fs.mkdir", [路径])`
## 删除
`params(路径)`
删除一个文件或空目录。非空目录返回 fs.not_empty,不递归删除。
`return resource.request("fs.remove", [路径])`
## 重命名
`params(源, 目标)`
目标已存在时返回 fs.exists,不覆盖。
`return resource.request("fs.rename", [源, 目标])`
## 追加文本
`params(路径, 文本)`
把文本追加到项目文件;文件不存在时创建。仍受 8 MiB 单次读取上限和
fs_write 授权约束。
`return resource.request("fs.append", [路径, 文本])`
## 读取片段
`params(路径, 偏移, 长度)`
从偏移处读取最多 长度 字节,按 UTF-8 解码后返回文本。偏移/长度必须
是非负整数,长度上限 8 MiB。
`return resource.request("fs.read_at", [路径, 偏移, 长度])`
## 遍历
`params(路径)`
递归列出目录下的普通文件,返回相对项目根的路径列表。跳过符号链接,
深度上限 64,条目上限 4096。
`return resource.request("fs.walk", [路径])`
-40
View File
@@ -1,40 +0,0 @@
---
import:
format: "./format.mq.md"
stream: "./io/stream.mq.md"
console: "./io/console.mq.md"
---
# @exec io
## 写文本
`params(文本)`
`return stream.写文本(文本)`
## 写全部
`params(流, 内存, 起点, 长度)`
`return stream.写全部(流, 内存, 起点, 长度)`
## 写值
`params(值)`
按语言值语义格式化后输出,并追加换行。
`return stream.写文本(format.显示(值) + "\n")`
## 读取行
`params()`
`return console.读取行()`
## 打印
`params(值)`
`return console.打印(值)`
-146
View File
@@ -1,146 +0,0 @@
---
import:
format: "../format.mq.md"
stream: "./stream.mq.md"
utf8: "../text/utf8.mq.md"
---
# @exec console
## 读取行
`params()`
从已授权的 stdio/stdin 资源读取一行。按有界块读取并增量解码 UTF-8;
EOF 返回 {ok:false, code:"io.eof"},无效 UTF-8 返回可恢复错误。
**流 = resource.open("stdio", "stdin", ["read"])**
**内存 = memory.new(1, 1)**
**字节 = []**
**结束 = false**
**错误 = ""**
`while not 结束`
**读取 = resource.read(流, 内存, 0, 1)**
`if not 读取.ok`
**结束 = true**
**错误 = 读取.code**
`else`
`if 读取.value.eof and 读取.value.count == 0`
**结束 = true**
`else`
`if 内存[0] == 10`
**结束 = true**
`else`
`if true`
**字节 = list.append(字节, 内存[0])**
`end`
`end`
`end`
`end`
`end`
**关闭 = resource.close(流)**
`if 错误 != ""`
`return {ok: false, code: 错误, message: "stdin read failed"}`
`else`
`if not 关闭.ok`
`return 关闭`
`else`
`if 长度(字节) == 0`
`return {ok: false, code: "io.eof", message: "end of input"}`
`else`
`if true`
**数据长度 = 长度(字节)**
`if 数据长度 > 0 and 字节[数据长度 - 1] == 13`
**数据长度 = 数据长度 - 1**
`else`
`if true`
**忽略 = 0**
`end`
`end`
**页 = (数据长度 + 65535) // 65536**
**数据 = memory.new(页, 页)**
**下标 = 0**
`while 下标 < 数据长度`
**`数据[下标] = 字节[下标]`**
**下标 = 下标 + 1**
`end`
**解码 = utf8.解码(数据, 0, 数据长度)**
`if not 解码.ok`
`return 解码`
`else`
`if true`
`return {ok: true, value: 解码.value}`
`end`
`end`
`end`
`end`
`end`
`end`
## 打印
`params(值)`
**结果 = stream.写文本(format.显示(值) + "\n")**
`if not 结果.ok`
`return 结果`
`else`
`if true`
`return {ok: true, value: None}`
`end`
`end`
## 写文本
`params(文本)`
`return stream.写文本(文本)`
## 写全部
`params(流, 内存, 起点, 长度)`
`return stream.写全部(流, 内存, 起点, 长度)`
-122
View File
@@ -1,122 +0,0 @@
---
import:
format: "../format.mq.md"
utf8: "../text/utf8.mq.md"
---
# @exec stream
## 页数
`params(字节)`
**页 = (字节 + 65535) // 65536**
`if 页 == 0`
`return 1`
`else`
`if true`
`return 页`
`end`
`end`
## 写全部
`params(流, 内存, 起点, 长度)`
把 长度 字节从 内存 写到资源流。短写只返回实际数量,调用方继续;
零进度返回 io.write_zero,不静默吞掉失败。
**已写 = 0**
**失败 = false**
**本次 = {ok: true, value: {count: 0}}**
**错误结果 = {ok: false, code: "io.write_zero", message: "resource.write made no progress"}**
`while 已写 < 长度`
**剩余 = 长度 - 已写**
**本次 = resource.write(流, 内存, 起点 + 已写, 剩余)**
`if not 本次.ok`
**失败 = true**
**错误结果 = 本次**
**已写 = 长度**
`else`
`if 本次.value.count == 0`
**失败 = true**
**已写 = 长度**
`else`
`if true`
**已写 = 已写 + 本次.value.count**
`end`
`end`
`end`
`end`
`if 失败`
`return 错误结果`
`else`
`if 已写 < 长度`
`return 错误结果`
`else`
`if true`
`return {ok: true, value: {count: 长度}}`
`end`
`end`
`end`
## 写文本
`params(文本)`
把文本编码为 UTF-8 并写入已授权的 stdout 资源流。内存按实际字节长度增长,
写入循环检查 {ok,count};只有全部字节写完并关闭成功才返回成功。
**字节数 = format.字节长度(文本)**
**内存 = memory.new(页数(字节数), 页数(字节数))**
**长度 = utf8.编码(文本, 内存, 0)**
**流 = resource.open("stdio", "stdout", ["write"])**
**写结果 = 写全部(流, 内存, 0, 长度)**
**关闭 = resource.close(流)**
`if not 写结果.ok`
`return 写结果`
`else`
`if not 关闭.ok`
`return 关闭`
`else`
`if true`
`return {ok: true, value: {count: 长度}}`
`end`
`end`
`end`
-436
View File
@@ -1,436 +0,0 @@
---
import:
utf8: "../text/utf8.mq.md"
---
# @exec http
## 切片字节
`params(字节, 起, 止)`
**结果 = []**
**下标 = 起**
`while 下标 < 止 and 下标 < 长度(字节)`
**结果 = list.append(结果, 字节[下标])**
**下标 = 下标 + 1**
`end`
`return 结果`
## 找子串
`params(字节, 子, 起点)`
**结果 = 0 - 1**
**下标 = 起点**
`while 下标 + 长度(子) <= 长度(字节) and 结果 < 0`
**偏移 = 0**
**匹配 = true**
`while 偏移 < 长度(子) and 匹配`
`if 字节[下标 + 偏移] != 子[偏移]`
**匹配 = false**
`else`
`if true`
**忽略 = 0**
`end`
`end`
**偏移 = 偏移 + 1**
`end`
`if 匹配`
**结果 = 下标**
`else`
`if true`
**忽略 = 0**
`end`
`end`
**下标 = 下标 + 1**
`end`
`return 结果`
## 找字符
`params(字节, 值, 起点)`
**结果 = 0 - 1**
**下标 = 起点**
`while 下标 < 长度(字节) and 结果 < 0`
`if 字节[下标] == 值`
**结果 = 下标**
`else`
`if true`
**忽略 = 0**
`end`
`end`
**下标 = 下标 + 1**
`end`
`return 结果`
## 十六进制值
`params(字节)`
**数值 = 0**
**下标 = 0**
`while 下标 < 长度(字节)`
**值 = 字节[下标]**
`if 值 >= 48 and 值 <= 57`
**数值 = 数值 * 16 + 值 - 48**
`else`
`if 值 >= 65 and 值 <= 70`
**数值 = 数值 * 16 + 值 - 55**
`else`
`if 值 >= 97 and 值 <= 102`
**数值 = 数值 * 16 + 值 - 87**
`else`
`if true`
**忽略 = 0**
`end`
`end`
`end`
`end`
**下标 = 下标 + 1**
`end`
`return 数值`
## 文本字节
`params(文本)`
把 UTF-8 文本编码为字节列表,上限 8 MiB。
**内存 = memory.new(128, 128)**
**字节数 = utf8.编码(文本, 内存, 0)**
**结果 = []**
**下标 = 0**
`while 下标 < 字节数`
**结果 = list.append(结果, 内存[下标])**
**下标 = 下标 + 1**
`end`
`return 结果`
## 字节文本
`params(字节)`
把字节列表按 UTF-8 解码为文本,上限 8 MiB。
**长度值 = 长度(字节)**
`if 长度值 == 0`
`return {ok: true, value: ""}`
`end`
**页 = (长度值 + 65535) // 65536**
**内存 = memory.new(页, 页)**
**下标 = 0**
`while 下标 < 长度值`
**内存[下标] = 字节[下标]**
**下标 = 下标 + 1**
`end`
`return utf8.解码(内存, 0, 长度值)`
## 解码分块字节
`params(体)`
**结果 = []**
**位置 = 0**
**错误 = ""**
`while 位置 < 长度(体) and 错误 == ""`
**行尾 = 找子串(体, [13, 10], 位置)**
`if 行尾 < 0`
**错误 = "http.chunked"**
`else`
`if true`
**大小 = 十六进制值(切片字节(体, 位置, 行尾))**
`if 大小 == 0`
**位置 = 长度(体)**
`else`
`if 位置 + 大小 + 4 > 长度(体)`
**错误 = "http.chunked"**
`else`
`if true`
**结果 = list.concat(结果, 切片字节(体, 行尾 + 2, 行尾 + 2 + 大小))**
**位置 = 行尾 + 2 + 大小 + 2**
`end`
`end`
`end`
`end`
`end`
`end`
`if 错误 != ""`
`return {ok: false, code: 错误, message: "分块长度无效"}`
`end`
`return {ok: true, value: 结果}`
## 解析响应字节
`params(字节)`
解析 HTTP/1.1 响应字节。头部按 ASCII 解析,正文保持原始字节;chunked
长度以字节计。成功返回 {ok:true, value:{status, reason, headers, body}}。
**头部结束 = 找子串(字节, [13, 10, 13, 10], 0)**
`if 头部结束 < 0`
`return {ok: false, code: "http.invalid", message: "缺少头部结束"}`
`end`
**头部 = 切片字节(字节, 0, 头部结束)**
**体 = 切片字节(字节, 头部结束 + 4, 长度(字节))**
**行列表 = []**
**行起 = 0**
**下一行 = 找子串(头部, [13, 10], 0)**
`while 下一行 >= 0`
**行列表 = list.append(行列表, 切片字节(头部, 行起, 下一行))**
**行起 = 下一行 + 2**
**下一行 = 找子串(头部, [13, 10], 行起)**
`end`
**行列表 = list.append(行列表, 切片字节(头部, 行起, 长度(头部)))**
`if 长度(行列表) == 0`
`return {ok: false, code: "http.invalid", message: "缺少状态行"}`
`end`
**状态行 = 字节文本(行列表[0])**
`if not 状态行.ok`
`return {ok: false, code: "http.invalid", message: "状态行不是 ASCII"}`
`end`
**状态字节 = 行列表[0]**
**第一空格 = 找字符(状态字节, 32, 0)**
**第二空格 = 找字符(状态字节, 32, 第一空格 + 1)**
`if 第一空格 < 0 or 第二空格 < 0`
`return {ok: false, code: "http.invalid", message: "状态行格式无效"}`
`end`
**状态文本 = 字节文本(切片字节(状态字节, 第一空格 + 1, 第二空格))**
`if not 状态文本.ok`
`return {ok: false, code: "http.invalid", message: "状态码不是 ASCII"}`
`end`
**状态 = 整数(状态文本.value)**
**原因 = 字节文本(切片字节(状态字节, 第二空格 + 1, 长度(状态字节)))**
`if not 原因.ok`
`return {ok: false, code: "http.invalid", message: "原因短语不是 ASCII"}`
`end`
**头 = {}**
**行号 = 1**
`while 行号 < 长度(行列表)`
**行 = 行列表[行号]**
**冒号 = 找字符(行, 58, 0)**
`if 冒号 >= 0`
**名 = 字节文本(切片字节(行, 0, 冒号))**
**值 = 字节文本(切片字节(行, 冒号 + 2, 长度(行)))**
`if 名.ok and 值.ok`
**头 = map.set(头, 名.value, 值.value)**
`else`
`if true`
**忽略 = 0**
`end`
`end`
`else`
`if true`
**忽略 = 0**
`end`
`end`
**行号 = 行号 + 1**
`end`
**传输 = map.get(头, "Transfer-Encoding")**
**解码后 = 体**
`if 传输 == "chunked"`
**分块 = 解码分块字节(体)**
`if not 分块.ok`
`return 分块`
`end`
**解码后 = 分块.value**
`else`
`if true`
**忽略 = 0**
`end`
`end`
`return {ok: true, value: {status: 状态, reason: 原因.value, headers: 头, body: 解码后}}`
## 解析响应
`params(文本)`
兼容文本 API:按字节解析后,把正文按 UTF-8 解码。
**响应 = 解析响应字节(文本字节(文本))**
`if not 响应.ok`
`return {状态: 0, 原因: "", 头: {}, 体: ""}`
`end`
**正文 = 字节文本(响应.value.body)**
`if not 正文.ok`
`return {状态: 响应.value.status, 原因: 响应.value.reason, 头: 响应.value.headers, 体: ""}`
`end`
`return {状态: 响应.value.status, 原因: 响应.value.reason, 头: 响应.value.headers, 体: 正文.value}`
## 构建请求字节
`params(方法, 路径, 头列表, 体字节)`
构建 HTTP/1.1 请求字节。方法、路径、头名/值按 UTF-8 编码;正文使用
传入的字节列表。
**结果 = 文本字节(方法 + " " + 路径 + " HTTP/1.1" + "\r\n")**
**下标 = 0**
`while 下标 < 长度(头列表)`
**头 = 头列表[下标]**
**结果 = list.concat(结果, 文本字节(文本(头[0]) + ": " + 文本(头[1]) + "\r\n"))**
**下标 = 下标 + 1**
`end`
**结果 = list.concat(结果, [13, 10])**
`return list.concat(结果, 体字节)`
## 构建请求
`params(方法, 路径, 头列表, 体文本)`
兼容文本 API,正文按 UTF-8 编码。
**请求 = 构建请求字节(方法, 路径, 头列表, 文本字节(体文本))**
**文本结果 = 字节文本(请求)**
`if not 文本结果.ok`
`return ""`
`end`
`return 文本结果.value`
-211
View File
@@ -1,211 +0,0 @@
# @exec path
## 是否绝对
`params(路径)`
**点 = text.codepoints(路径)**
`if 长度(点) == 0`
`return false`
`else`
`if 点[0] == 47`
`return true`
`end`
`end`
`return false`
## 分割
`params(文本, 分隔码点)`
**点 = text.codepoints(文本)**
**结果 = []**
**当前 = ""**
**下标 = 0**
`while 下标 < 长度(点)`
`if 点[下标] == 分隔码点`
**结果 = list.append(结果, 当前)**
**当前 = ""**
`else`
`if true`
**当前 = 当前 + text.from_codepoint(点[下标])**
`end`
`end`
**下标 = 下标 + 1**
`end`
`return list.append(结果, 当前)`
## 连接
`params(片段列表)`
空片段被跳过,片段之间只插入一个 /。
**结果 = ""**
**下标 = 0**
`while 下标 < 长度(片段列表)`
**片段 = 文本(片段列表[下标])**
`if 片段 != ""`
`if 结果 == ""`
**结果 = 片段**
`else`
`if true`
**结果 = 结果 + "/" + 片段**
`end`
`end`
`else`
`if true`
**忽略 = 0**
`end`
`end`
**下标 = 下标 + 1**
`end`
`return 结果`
## 文件名
`params(路径)`
**片段 = 分割(路径, 47)**
`return 片段[长度(片段) - 1]`
## 目录名
`params(路径)`
**片段 = 分割(路径, 47)**
**结果 = []**
**下标 = 0**
`while 下标 < 长度(片段) - 1`
**结果 = list.append(结果, 片段[下标])**
**下标 = 下标 + 1**
`end`
`return 连接(结果)`
## 扩展名
`params(路径)`
**名字 = 文件名(路径)**
**点列表 = 分割(名字, 46)**
`if 长度(点列表) <= 1`
`return ""`
`end`
`return 点列表[长度(点列表) - 1]`
## 去尾
`params(列表)`
**结果 = []**
**下标 = 0**
`while 下标 < 长度(列表) - 1`
**结果 = list.append(结果, 列表[下标])**
**下标 = 下标 + 1**
`end`
`return 结果`
## 规范
`params(路径)`
词法规范化:折叠 .、空片段和重复 /,用 .. 消去前一片段;
绝对路径保留前导 /。不访问文件系统。
**片段 = 分割(路径, 47)**
**绝对 = 是否绝对(路径)**
**栈 = []**
**下标 = 0**
`while 下标 < 长度(片段)`
**段 = 片段[下标]**
`if 段 == "" or 段 == "."`
**忽略 = 0**
`else`
`if 段 == ".."`
`if 长度(栈) > 0 and 栈[长度(栈) - 1] != ".."`
**栈 = 去尾(栈)**
`else`
`if not 绝对`
**栈 = list.append(栈, 段)**
`else`
`if true`
**忽略绝对根 = 0**
`end`
`end`
`end`
`else`
`if true`
**栈 = list.append(栈, 段)**
`end`
`end`
`end`
**下标 = 下标 + 1**
`end`
`if 绝对`
`return "/" + 连接(栈)`
`end`
`return 连接(栈)`
-12
View File
@@ -1,12 +0,0 @@
# @exec process
## 运行
`params(程序, 参数列表)`
在项目模式下运行一个显式授权的可执行文件。程序路径必须与
--allow-process PROGRAM 精确匹配;不经过 shell,清空环境变量,
工作目录是项目根,stdin 为空。5 秒超时、1 MiB stdout/stderr 上限,
结果形状为 {status, stdout, stderr}。
`return resource.request("process.run", [程序, 参数列表])`
-42
View File
@@ -1,42 +0,0 @@
# @exec random
## 字节
`params(数量)`
读取 数量 个 OS 熵字节,返回 List<Int>(每个 0–255)。仅项目模式,
需要显式 --allow-random;pure/strict 拒绝。
`return resource.request("random.bytes", [数量])`
## 整数
`params(上限)`
返回 0 <= 值 < 上限 的整数。上限 必须大于 0;使用 8 个熵字节
组合后取模(无偏拒绝采样尚未实现)。
`if 上限 <= 0`
`return {ok: false, code: "random.invalid", message: "上限必须大于 0"}`
`end`
**字节结果 = 字节(8)**
`if not 字节结果.ok`
`return 字节结果`
`end`
**值 = 0**
**下标 = 0**
`while 下标 < 8`
**值 = 值 * 256 + 字节结果.value[下标]**
**下标 = 下标 + 1**
`end`
`return {ok: true, value: 值 % 上限}`
-541
View File
@@ -1,541 +0,0 @@
# @exec regex
## 成功
`params(值)`
`return {ok: true, value: 值}`
## 失败
`params(代码, 消息)`
`return {ok: false, code: 代码, message: 消息}`
## 包含
`params(列表, 值)`
**结果 = false**
**下标 = 0**
`while 下标 < 长度(列表) and not 结果`
`if 列表[下标] == 值`
**结果 = true**
`else`
`if true`
**忽略 = 0**
`end`
`end`
**下标 = 下标 + 1**
`end`
`return 结果`
## 去头
`params(列表)`
**结果 = []**
**下标 = 1**
`while 下标 < 长度(列表)`
**结果 = list.append(结果, 列表[下标])**
**下标 = 下标 + 1**
`end`
`return 结果`
## 设置最后
`params(列表, 值)`
**结果 = []**
**下标 = 0**
`while 下标 < 长度(列表)`
`if 下标 + 1 == 长度(列表)`
**结果 = list.append(结果, 值)**
`else`
`if true`
**结果 = list.append(结果, 列表[下标])**
`end`
`end`
**下标 = 下标 + 1**
`end`
`return 结果`
## 片段
`params(点, 起点, 终点)`
**结果 = ""**
**下标 = 起点**
`while 下标 < 终点`
**结果 = 结果 + text.from_codepoint(点[下标])**
**下标 = 下标 + 1**
`end`
`return 结果`
## 是数字
`params(码点)`
`return 码点 >= 48 and 码点 <= 57`
## 字面令牌
`params(码点)`
包含数量词,默认恰好一次。
`return {kind: "literal", value: 码点, neg: false, min: 1, max: 1}`
## 任意令牌
`params()`
`return {kind: "any", value: 0, neg: false, min: 1, max: 1}`
## 类令牌
`params(集合, 否定)`
`return {kind: "class", value: 集合, neg: 否定, min: 1, max: 1}`
## 锚点令牌
`params(方向)`
`return {kind: "anchor", value: 方向, neg: false, min: 1, max: 1}`
## 设置量词
`params(令牌, 码点)`
`if 码点 == 42`
`return {kind: 令牌.kind, value: 令牌.value, neg: 令牌.neg, min: 0, max: -1}`
`else`
`if 码点 == 43`
`return {kind: 令牌.kind, value: 令牌.value, neg: 令牌.neg, min: 1, max: -1}`
`end`
`end`
`return {kind: 令牌.kind, value: 令牌.value, neg: 令牌.neg, min: 0, max: 1}`
## 编译类
`params(点, 位置)`
**当前 = 位置 + 1**
**否定 = false**
`if 当前 < 长度(点) and 点[当前] == 94`
**否定 = true**
**当前 = 当前 + 1**
`else`
`if true`
**忽略否定 = 0**
`end`
`end`
**集合 = []**
**完成 = false**
**错误 = ""**
`while 当前 < 长度(点) and not 完成 and 错误 == ""`
**码点 = 点[当前]**
`if 码点 == 93`
**完成 = true**
**当前 = 当前 + 1**
`else`
`if 码点 == 92`
`if 当前 + 1 >= 长度(点)`
**错误 = "regex.invalid"**
`else`
`if true`
**集合 = list.append(集合, 点[当前 + 1])**
**当前 = 当前 + 2**
`end`
`end`
`else`
`if 当前 + 2 < 长度(点) and 点[当前 + 1] == 45 and 点[当前 + 2] != 93`
**开始 = 码点**
**结束 = 点[当前 + 2]**
`if 开始 > 结束`
**错误 = "regex.invalid"**
`else`
`if true`
**值 = 开始**
`while 值 <= 结束`
**集合 = list.append(集合, 值)**
**值 = 值 + 1**
`end`
**当前 = 当前 + 3**
`end`
`end`
`else`
`if true`
**集合 = list.append(集合, 码点)**
**当前 = 当前 + 1**
`end`
`end`
`end`
`end`
`end`
`if not 完成`
`return 失败("regex.invalid", "字符类未闭合")`
`else`
`if 错误 != ""`
`return 失败(错误, "字符类范围无效")`
`end`
`end`
`return 成功({set: 集合, neg: 否定, next: 当前})`
## 编译
`params(点, 位置)`
**令牌表 = []**
**当前 = 位置**
**错误 = ""**
**代码 = ""**
`while 当前 < 长度(点) and 错误 == ""`
**码点 = 点[当前]**
`if 码点 == 94`
**令牌表 = list.append(令牌表, 锚点令牌("start"))**
**当前 = 当前 + 1**
`else`
`if 码点 == 36`
**令牌表 = list.append(令牌表, 锚点令牌("end"))**
**当前 = 当前 + 1**
`else`
`if 码点 == 91`
**类结果 = 编译类(点, 当前)**
`if not 类结果.ok`
**错误 = 类结果.code**
**代码 = 类结果.message**
`else`
`if true`
**令牌表 = list.append(令牌表, 类令牌(类结果.value.set, 类结果.value.neg))**
**当前 = 类结果.value.next**
`end`
`end`
`else`
`if 码点 == 92`
`if 当前 + 1 >= 长度(点)`
**错误 = "regex.invalid"**
**代码 = "转义缺少字符"**
`else`
`if true`
**令牌表 = list.append(令牌表, 字面令牌(点[当前 + 1]))**
**当前 = 当前 + 2**
`end`
`end`
`else`
`if 码点 == 46`
**令牌表 = list.append(令牌表, 任意令牌())**
**当前 = 当前 + 1**
`else`
`if 码点 == 40 or 码点 == 41 or 码点 == 124`
**错误 = "regex.unsupported"**
**代码 = "不支持分组或选择"**
`else`
`if 码点 == 42 or 码点 == 43 or 码点 == 63`
**错误 = "regex.invalid"**
**代码 = "量词没有前一项"**
`else`
`if true`
**令牌表 = list.append(令牌表, 字面令牌(码点))**
**当前 = 当前 + 1**
`end`
`end`
`end`
`end`
`end`
`end`
`end`
`end`
`while 错误 == "" and 当前 < 长度(点) and (点[当前] == 42 or 点[当前] == 43 or 点[当前] == 63)`
**令牌表 = 设置最后(令牌表, 设置量词(令牌表[长度(令牌表) - 1], 点[当前]))**
**当前 = 当前 + 1**
`while 当前 < 长度(点) and (点[当前] == 42 or 点[当前] == 43 or 点[当前] == 63)`
**错误 = "regex.invalid"**
**代码 = "连续量词无效"**
`end`
`end`
`end`
`if 错误 != ""`
`return 失败(错误, 代码)`
`end`
`return 成功(令牌表)`
## 单字符匹配
`params(令牌, 码点)`
**类别 = 令牌.kind**
`if 类别 == "any"`
`return true`
`else`
`if 类别 == "literal"`
`return 令牌.value == 码点`
`else`
`if 类别 == "class"`
`return 包含(令牌.value, 码点) != 令牌.neg`
`end`
`end`
`end`
`return false`
## 尝试匹配
`params(令牌, 下标, 当前, 点, 位置, 次数, 要求结束)`
**下限 = 当前.min**
**上限 = 当前.max**
`if 次数 >= 下限 and 匹配序列(令牌, 下标 + 1, 点, 位置, 要求结束)`
`return true`
`else`
`if 上限 >= 0 and 次数 >= 上限`
`return false`
`else`
`if 位置 < 长度(点) and 单字符匹配(当前, 点[位置])`
`return 尝试匹配(令牌, 下标, 当前, 点, 位置 + 1, 次数 + 1, 要求结束)`
`end`
`end`
`end`
`return false`
## 匹配序列
`params(令牌, 下标, 点, 位置, 要求结束)`
`if 下标 >= 长度(令牌)`
`if 要求结束`
`return 位置 == 长度(点)`
`end`
`return true`
`end`
**当前 = 令牌[下标]**
`if 当前.kind == "anchor"`
`if 当前.value == "start" and 位置 == 0`
`return 匹配序列(令牌, 下标 + 1, 点, 位置, 要求结束)`
`else`
`if 当前.value == "end" and 位置 == 长度(点)`
`return 匹配序列(令牌, 下标 + 1, 点, 位置, 要求结束)`
`end`
`end`
`return false`
`end`
`return 尝试匹配(令牌, 下标, 当前, 点, 位置, 0, 要求结束)`
## 匹配
`params(模式, 文本)`
编译后要求整个文本匹配。支持 ^、$、.、*、+、?、
[...] 和 \\ 转义;不支持分组和选择。
**编译结果 = 编译(text.codepoints(模式), 0)**
`if not 编译结果.ok`
`return 编译结果`
`end`
`return {ok: true, value: 匹配序列(编译结果.value, 0, text.codepoints(文本), 0, true)}`
## 搜索
`params(模式, 文本)`
**编译结果 = 编译(text.codepoints(模式), 0)**
`if not 编译结果.ok`
`return 编译结果`
`end`
**令牌 = 编译结果.value**
**点 = text.codepoints(文本)**
**下标 = 0**
**结果 = false**
`while 下标 <= 长度(点) and not 结果`
`if 匹配序列(令牌, 0, 点, 下标, false)`
**结果 = true**
`else`
`if true`
**忽略 = 0**
`end`
`end`
**下标 = 下标 + 1**
`end`
`return 成功(结果)`
## 扩展匹配
`params(模式, 文本)`
使用宿主正则引擎(支持分组、选择、\\d 等)判断是否匹配。模式无效时
返回 regex.invalid。仅项目模式;纯 .mq.md 子集仍由 匹配/搜索 提供。
`return resource.request("regex.match", [模式, 文本])`
## 扩展搜索
`params(模式, 文本)`
`return resource.request("regex.match", [模式, 文本])`
## 捕获
`params(模式, 文本)`
返回 {ok:true, value:{matched:Bool, groups:List<Text|None>}}。下标 0 是
完整匹配;未参与匹配的分组是 None。
`return resource.request("regex.captures", [模式, 文本])`
-20
View File
@@ -1,20 +0,0 @@
{
"name": "marqdo-stdlib",
"version": "0.1.0",
"digest": "sha256:5407d3665ba2fe105820d0f1af5efaafa10c277a69eb819c3225719813c8c713",
"public_aliases": [
{
"public_names": [
"print",
"打印"
],
"target_module": "io.mq.md",
"target_function": "写值",
"expected_signature": "params(值)",
"effects": [
"host"
]
}
],
"aliases_digest": "sha256:5f513c0fdbb3c1e9829be3c9fa23a2d1e89cb8510073fb5eb1e8e2f5265a83bb"
}
-12
View File
@@ -1,12 +0,0 @@
---
import:
clock: "std:clock"
---
# @exec clock
## main
**现在 = clock.现在()**
`return [现在.ok, 类型(现在.value), 现在.value > 1600000000000]`
-14
View File
@@ -1,14 +0,0 @@
---
import:
compress: "std:compress"
---
# @exec compress
## main
**压缩结果 = compress.压缩("hello 世界")**
**解压结果 = compress.解压(压缩结果.value)**
`return [压缩结果.ok, 长度(压缩结果.value) > 0, 解压结果.ok, 解压结果.value]`
-12
View File
@@ -1,12 +0,0 @@
---
import:
console: "std:io/console"
---
# @exec console
## main
**行 = console.读取行()**
`return [行.ok, 行.value]`
-22
View File
@@ -1,22 +0,0 @@
---
import:
csv: "std:data/csv"
---
# @exec csv
## main
**`行 = csv.解析行("甲,\"乙,丙\",\"说\"\"好\"")`**
**`空 = csv.解析行("")`**
**`坏 = csv.解析行("\"a")`**
**`框 = csv.解析行("a,\"b\"")`**
**`多行 = csv.解析("甲,\"乙,丙\"\n\"说\"\"好\",2")`**
**格式化 = csv.格式化(多行.value)**
`return [行.value, csv.格式化行(行.value), 空.value, 坏.code, 框.value, 多行.ok, 多行.value, 格式化]`
-10
View File
@@ -1,10 +0,0 @@
---
import:
datetime: "std:datetime"
---
# @exec datetime
## main
`return [datetime.格式化(0), datetime.格式化(1700000000123), datetime.解析("1970-01-01T00:00:00Z").value, datetime.解析("2026-11-21T08:00:00.123Z").value, datetime.解析("2026-13-01T00:00:00Z").ok, datetime.解析("2026-02-29T00:00:00Z").ok, datetime.格式化(-1)]`
-10
View File
@@ -1,10 +0,0 @@
---
import:
demo: "std:demo"
---
# @exec demo
## main
`return demo.演示函数()`
-16
View File
@@ -1,16 +0,0 @@
---
import:
env: "std:env"
---
# @exec env
## main
**存在 = env.存在("MARQDO_TEST_ENV")**
**读取 = env.读取("MARQDO_TEST_ENV")**
**缺失 = env.读取("MARQDO_MISSING_ENV")**
`return [存在.ok, 存在.value, 读取.ok, 读取.value, 缺失.ok, 缺失.code]`
-10
View File
@@ -1,10 +0,0 @@
---
import:
format: "std:format"
---
# @exec format
## main
`return [format.字节长度("Aé"), format.显示(["文本", 2, 1.5]), format.显示({a: 1}), format.列表显示(["a", 2]), format.显示(None)]`
-38
View File
@@ -1,38 +0,0 @@
---
import:
fs_lib: "std:fs/file"
---
# @exec fs
## main
**创建 = fs_lib.创建目录("out")**
**写入 = fs_lib.写文本("out/fs-a.txt", "你好\n")**
**存在 = fs_lib.存在("out/fs-a.txt")**
**元数据 = fs_lib.元数据("out/fs-a.txt")**
**列表 = fs_lib.列出目录("out")**
**是文件 = fs_lib.是文件("out/fs-a.txt")**
**是目录 = fs_lib.是目录("out")**
**重命名 = fs_lib.重命名("out/fs-a.txt", "out/fs-b.txt")**
**读取 = fs_lib.读文本("out/fs-b.txt")**
**追加 = fs_lib.追加文本("out/fs-b.txt", "世界\n")**
**片段 = fs_lib.读取片段("out/fs-b.txt", 0, 100)**
**遍历 = fs_lib.遍历("out")**
**删除 = fs_lib.删除("out/fs-b.txt")**
**删除目录 = fs_lib.删除("out")**
`return [创建.ok, 写入.value.count, 存在.value, 元数据.value.kind, 元数据.value.size, 列表.value, 是文件.value, 是目录.value, 重命名.ok, 读取.value, 追加.value, 片段.value, 遍历.value, 删除.ok, 删除目录.ok]`
-24
View File
@@ -1,24 +0,0 @@
---
import:
http: "std:net/http"
---
# @exec http
## main
**响应文本 = "HTTP/1.1 200 OK\r\nContent-Type: text/plain\r\nTransfer-Encoding: chunked\r\n\r\n5\r\nhello\r\n6\r\n world\r\n0\r\n\r\n"**
**响应 = http.解析响应(响应文本)**
**请求 = http.构建请求("POST", "/echo", [["Host", "example.test"], ["Content-Length", "2"]], "ok")**
**响应字节 = http.解析响应字节(http.文本字节("HTTP/1.1 200 OK\r\nTransfer-Encoding: chunked\r\n\r\n6\r\n你好\r\n0\r\n\r\n"))**
**正文 = http.字节文本(响应字节.value.body)**
**请求字节 = http.构建请求字节("POST", "/", [], [65, 66])**
**请求文本 = http.字节文本(请求字节)**
`return [响应.状态, 响应.原因, 响应.头["Content-Type"], 响应.体, 请求, 响应字节.value.status, 正文.value, 请求文本.value]`
-12
View File
@@ -1,12 +0,0 @@
---
import:
io: "std:io"
---
# @exec io
## main
> **io.写值("stdlib self-test")**
`return None`
-42
View File
@@ -1,42 +0,0 @@
---
import:
json: "std:data/json"
---
# @exec json
## main
**`对象 = json.解析("{\"a\": 1, \"b\": [true, null, \"说\\\"好\"]}")`**
**`浮点 = json.解析("[1, 2.5, -3e2, 4E-1, {\"a\": 1.0}, \"x\"]")`**
**`失败 = json.解析("[1 2]")`**
**`尾随 = json.解析("1 2")`**
**深度文本 = ""**
**深度下标 = 0**
`while 深度下标 < 130`
**深度文本 = 深度文本 + "["**
**深度下标 = 深度下标 + 1**
`end`
**深度下标 = 0**
`while 深度下标 < 130`
**深度文本 = 深度文本 + "]"**
**深度下标 = 深度下标 + 1**
`end`
**深度 = json.解析(深度文本)**
**`多个 = json.解析多个("1 2 [3]")`**
`return [对象.ok, 对象.value.a, 对象.value.b[2], json.格式化(浮点.value), 失败.ok, 失败.code, 尾随.code, 深度.ok, 深度.code, 多个.ok, 多个.value]`
-10
View File
@@ -1,10 +0,0 @@
---
import:
path: "std:path"
---
# @exec path
## main
`return [path.连接(["a", "", "b", "c"]), path.文件名("a/b/c.txt"), path.目录名("a/b/c.txt"), path.扩展名("a/b/c.txt"), path.规范("./a//b/../c"), path.规范("/a/./b/../c"), path.规范("../a/b"), path.是否绝对("/a"), path.是否绝对("a")]`
-15
View File
@@ -1,15 +0,0 @@
---
import:
env: "std:env"
process: "std:process"
---
# @exec process
## main
**程序 = env.读取("MARQDO_TEST_PROCESS_PROGRAM")**
**结果 = process.运行(程序.value, ["--version"])**
`return [结果.ok, 结果.value.status, 结果.value.stdout, 结果.value.stderr]`
-14
View File
@@ -1,14 +0,0 @@
---
import:
random: "std:random"
---
# @exec random
## main
**字节结果 = random.字节(16)**
**整数结果 = random.整数(100)**
`return [字节结果.ok, 长度(字节结果.value), 整数结果.ok, 整数结果.value >= 0, 整数结果.value < 100]`
-36
View File
@@ -1,36 +0,0 @@
---
import:
regex: "std:regex"
---
# @exec regex
## main
**`星号 = regex.匹配("a*b", "aaab")`**
**`加号 = regex.匹配("a+b", "b")`**
**`锚点 = regex.匹配("^a.*z$", "abcz")`**
**`类 = regex.匹配("[a-c]+", "abc")`**
**`否定类 = regex.匹配("[^0-9]", "a")`**
**`任意 = regex.匹配("a.a", "aba")`**
**`可选 = regex.匹配("a?b", "b")`**
**`转义 = regex.匹配("\\.", ".")`**
**`搜索 = regex.搜索("b+c", "xxbbcyy")`**
**`无效 = regex.匹配("[a", "a")`**
**`不支持 = regex.匹配("(a)", "a")`**
**扩展 = regex.扩展匹配("^(a+)(b|c)$", "aab")**
**捕获 = regex.捕获("^(a+)(b|c)$", "aab")**
`return [星号.value, 加号.value, 锚点.value, 类.value, 否定类.value, 任意.value, 可选.value, 转义.value, 搜索.value, 无效.ok, 无效.code, 不支持.code, 扩展.value, 捕获.value.matched, 捕获.value.groups]`
-12
View File
@@ -1,12 +0,0 @@
---
import:
stream: "std:io/stream"
---
# @exec stream
## main
**结果 = stream.写文本("stream\n")**
`return [结果.ok, 结果.value.count]`
-30
View File
@@ -1,30 +0,0 @@
---
import:
table_lib: "std:data/table"
---
# @exec table
## main
**数据 = 表(["名称", "分数"], [["甲", 87], ["乙", 92], ["丙", 71]])**
**选择 = table_lib.选择列(数据, 1)**
**过滤 = table_lib.过滤数值大于(数据, 1, 80)**
**排序 = table_lib.排序(数据, 1)**
**追加 = table_lib.追加行(数据, ["丁", 65])**
**设置 = table_lib.设置单元格(数据, 0, 1, 99)**
**左 = 表(["名称", "分数"], [["甲", 87], ["乙", 92]])**
**右 = 表(["名称", "等级"], [["乙", "A"], ["甲", "B"]])**
**连接 = table_lib.连接(左, 右, 0, 0)**
**分组 = table_lib.分组(表(["类别", "值"], [["a", 1], ["b", 2], ["a", 3]]), 0, 1)**
`return [选择, 过滤, 排序, 追加, 设置, 连接, 分组, 数据, table_lib.转GFM(数据)]`
-14
View File
@@ -1,14 +0,0 @@
---
import:
text_lib: "std:text"
---
# @exec text
## main
**内存 = memory.new(1, 1)**
**长度 = text_lib.utf8编码("é", 内存, 0)**
`return [长度, 内存[0], 内存[1]]`
-14
View File
@@ -1,14 +0,0 @@
---
import:
utf8: "std:text/utf8"
---
# @exec utf8
## main
**内存 = memory.new(1, 1)**
**长度 = utf8.编码("é", 内存, 0)**
`return [长度, utf8.解码(内存, 0, 长度).value, utf8.解码(内存, 0, 1).ok]`
-65
View File
@@ -1,65 +0,0 @@
# @exec text
## utf8编码
`params(文本, 内存, 基址)`
把 Unicode 标量序列按 UTF-8 写入 Memory,返回字节长度。
**点 = text.codepoints(文本)**
**下标 = 0**
**偏移 = 0**
`while 下标 < 长度(点)`
**码点 = 点[下标]**
`if 码点 < 128`
**`内存[基址 + 偏移] = 码点`**
**偏移 = 偏移 + 1**
`else`
`if 码点 < 2048`
**`内存[基址 + 偏移] = 192 + 码点 // 64`**
**`内存[基址 + 偏移 + 1] = 128 + 码点 % 64`**
**偏移 = 偏移 + 2**
`else`
`if 码点 < 65536`
**`内存[基址 + 偏移] = 224 + 码点 // 4096`**
**`内存[基址 + 偏移 + 1] = 128 + 码点 // 64 % 64`**
**`内存[基址 + 偏移 + 2] = 128 + 码点 % 64`**
**偏移 = 偏移 + 3**
`else`
`if true`
**`内存[基址 + 偏移] = 240 + 码点 // 262144`**
**`内存[基址 + 偏移 + 1] = 128 + 码点 // 4096 % 64`**
**`内存[基址 + 偏移 + 2] = 128 + 码点 // 64 % 64`**
**`内存[基址 + 偏移 + 3] = 128 + 码点 % 64`**
**偏移 = 偏移 + 4**
`end`
`end`
`end`
`end`
**下标 = 下标 + 1**
`end`
`return 偏移`
-258
View File
@@ -1,258 +0,0 @@
# @exec utf8
## 成功
`params(值)`
`return {ok: true, value: 值}`
## 失败
`params(代码, 消息)`
`return {ok: false, code: 代码, message: 消息}`
## 续字节
`params(字节)`
`return 字节 >= 128 and 字节 < 192`
## 编码
`params(文本, 内存, 基址)`
把 Unicode 标量序列按 UTF-8 写入 Memory,返回字节长度。
这是 .mq.md 自己实现的编码逻辑,不是 Rust 内建 UTF-8 转换。
**点 = text.codepoints(文本)**
**下标 = 0**
**偏移 = 0**
`while 下标 < 长度(点)`
**码点 = 点[下标]**
`if 码点 < 128`
**`内存[基址 + 偏移] = 码点`**
**偏移 = 偏移 + 1**
`else`
`if 码点 < 2048`
**`内存[基址 + 偏移] = 192 + 码点 // 64`**
**`内存[基址 + 偏移 + 1] = 128 + 码点 % 64`**
**偏移 = 偏移 + 2**
`else`
`if 码点 < 65536`
**`内存[基址 + 偏移] = 224 + 码点 // 4096`**
**`内存[基址 + 偏移 + 1] = 128 + 码点 // 64 % 64`**
**`内存[基址 + 偏移 + 2] = 128 + 码点 % 64`**
**偏移 = 偏移 + 3**
`else`
`if true`
**`内存[基址 + 偏移] = 240 + 码点 // 262144`**
**`内存[基址 + 偏移 + 1] = 128 + 码点 // 4096 % 64`**
**`内存[基址 + 偏移 + 2] = 128 + 码点 // 64 % 64`**
**`内存[基址 + 偏移 + 3] = 128 + 码点 % 64`**
**偏移 = 偏移 + 4**
`end`
`end`
`end`
`end`
**下标 = 下标 + 1**
`end`
`return 偏移`
## 解码2
`params(内存, 基址, 长度, 偏移, 文本)`
`if 偏移 + 1 >= 长度`
`return [文本, 偏移, "utf8.truncated"]`
`end`
**b1 = 内存[基址 + 偏移 + 1]**
`if not 续字节(b1)`
`return [文本, 偏移, "utf8.invalid_continuation"]`
`end`
**码点 = (内存[基址 + 偏移] - 192) * 64 + (b1 - 128)**
`if 码点 < 128`
`return [文本, 偏移, "utf8.invalid_scalar"]`
`end`
`return [文本 + text.from_codepoint(码点), 偏移 + 2, ""]`
## 解码3
`params(内存, 基址, 长度, 偏移, 文本)`
`if 偏移 + 2 >= 长度`
`return [文本, 偏移, "utf8.truncated"]`
`end`
**b1 = 内存[基址 + 偏移 + 1]**
**b2 = 内存[基址 + 偏移 + 2]**
`if not (续字节(b1) and 续字节(b2))`
`return [文本, 偏移, "utf8.invalid_continuation"]`
`end`
**码点 = (内存[基址 + 偏移] - 224) * 4096 + (b1 - 128) * 64 + (b2 - 128)**
`if 码点 < 2048 or (码点 >= 55296 and 码点 <= 57343)`
`return [文本, 偏移, "utf8.invalid_scalar"]`
`end`
`return [文本 + text.from_codepoint(码点), 偏移 + 3, ""]`
## 解码4
`params(内存, 基址, 长度, 偏移, 文本)`
`if 偏移 + 3 >= 长度`
`return [文本, 偏移, "utf8.truncated"]`
`end`
**b1 = 内存[基址 + 偏移 + 1]**
**b2 = 内存[基址 + 偏移 + 2]**
**b3 = 内存[基址 + 偏移 + 3]**
`if not (续字节(b1) and 续字节(b2) and 续字节(b3))`
`return [文本, 偏移, "utf8.invalid_continuation"]`
`end`
**码点 = (内存[基址 + 偏移] - 240) * 262144 + (b1 - 128) * 4096 + (b2 - 128) * 64 + (b3 - 128)**
`if 码点 < 65536 or 码点 > 1114111`
`return [文本, 偏移, "utf8.invalid_scalar"]`
`end`
`return [文本 + text.from_codepoint(码点), 偏移 + 4, ""]`
## 解码
`params(内存, 基址, 长度)`
**偏移 = 0**
**文本 = ""**
**错误 = ""**
`while 偏移 < 长度 and 错误 == ""`
**首 = 内存[基址 + 偏移]**
`if 首 < 128`
**文本 = 文本 + text.from_codepoint(首)**
**偏移 = 偏移 + 1**
`else`
`if 首 < 194`
**错误 = "utf8.invalid_lead"**
`else`
`if 首 < 224`
**结果 = 解码2(内存, 基址, 长度, 偏移, 文本)**
**文本 = 结果[0]**
**偏移 = 结果[1]**
**错误 = 结果[2]**
`else`
`if 首 < 240`
**结果 = 解码3(内存, 基址, 长度, 偏移, 文本)**
**文本 = 结果[0]**
**偏移 = 结果[1]**
**错误 = 结果[2]**
`else`
`if 首 < 245`
**结果 = 解码4(内存, 基址, 长度, 偏移, 文本)**
**文本 = 结果[0]**
**偏移 = 结果[1]**
**错误 = 结果[2]**
`else`
`if true`
**错误 = "utf8.invalid_lead"**
`end`
`end`
`end`
`end`
`end`
`end`
`end`
`if 错误 == ""`
`return 成功(文本)`
`else`
`if true`
`return 失败(错误, "UTF-8 解码失败")`
`end`
`end`
## utf8编码
`params(文本, 内存, 基址)`
`return 编码(文本, 内存, 基址)`
## utf8解码
`params(内存, 基址, 长度)`
`return 解码(内存, 基址, 长度)`
+18
View File
@@ -57,6 +57,24 @@ Rust harnesses (all in `crates/cli/tests/`):
| `integration_cli.rs` | Real CLI contract: `init`, `check`, `run`, `call`, `inspect`, `fmt`, multi-module imports/cycles, `lock`/`sync --locked`, plugin inspection and explicitly trusted plugin invocation. | | `integration_cli.rs` | Real CLI contract: `init`, `check`, `run`, `call`, `inspect`, `fmt`, multi-module imports/cycles, `lock`/`sync --locked`, plugin inspection and explicitly trusted plugin invocation. |
| `execution_events.rs` | Execution Events v1 black-box contract: pure JSONL, seq/terminal ordering, byte-exact base64 chunks, live delivery before exit, value redaction/selection, trace coexistence, truncation, output budget and broken-pipe failure. | | `execution_events.rs` | Execution Events v1 black-box contract: pure JSONL, seq/terminal ordering, byte-exact base64 chunks, live delivery before exit, value redaction/selection, trace coexistence, truncation, output budget and broken-pipe failure. |
## Stdlib Bundle lanes (ADR-0070)
The product lane consumes one pinned Bundle, never an implicit checkout path:
* `tools/stdlib/bundle-pin.json` pins the Bundle name, version, source commit,
tree digest and alias digest; `tools/stdlib/bundle.py` resolves and verifies
it.
* `crates/cli/tests/support/stdlib.rs` gives the product/conformance harnesses
the same Bundle. `MARQDO_TEST_STDLIB_BUNDLE` or `--stdlib-dir` changes the
location but the Bundle must still match the pin; `MARQDO_TEST_BUNDLE_PIN`
changes the pin file. A bad explicit input fails even when the default
location is valid.
* Loader unit tests in `crates/cli/src/stdlib.rs` build small synthetic
Bundles, so loader logic does not depend on the product tree.
* `tests/independent/language-only.mq.md` is the program
`tools/ci/independent_build.py` runs through a CLI built from a copy without
`stdlib/`; a stdlib-dependent program must fail closed in that copy.
## Running ## Running
Use the workspace cargo cache/target as documented in `AGENTS.md`: Use the workspace cargo cache/target as documented in `AGENTS.md`:
@@ -1,6 +1,6 @@
--- ---
import: import:
数据表: "std:data/table" 数据表: "std:collections/table"
--- ---
## @exec 转表 ## @exec 转表
+12
View File
@@ -0,0 +1,12 @@
# Language-only program
This fixture uses only the language itself: no `std:` import, no host
capability, no foreign kernel and no plugin. It is the program the
independent-build lane runs through a real CLI built from a copy without the
`stdlib/` tree (ADR-0070).
## @exec main
`值 = 1 + 2`
`return 值`
Loaded 100 of 115 files, more files were not shown because too many files have changed in this diff. Show more