feat: migrate corpus to file-scoped occlusion
This commit is contained in:
1 parent
c773503938
commit
aea86746e7
485 files changed
+1160
-340
No files matched your search
@@ -1,3 +1,7 @@
|
||||
---
|
||||
markup: occlusion
|
||||
---
|
||||
|
||||
# main
|
||||
|
||||
> 加一 "七"
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
---
|
||||
markup: occlusion
|
||||
---
|
||||
|
||||
# main
|
||||
|
||||
`列说明` =
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
---
|
||||
markup: occlusion
|
||||
---
|
||||
|
||||
# main
|
||||
|
||||
| 字段 | 类型 | 可空 |
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
---
|
||||
markup: occlusion
|
||||
---
|
||||
|
||||
# main
|
||||
|
||||
**结果 = > 加一 3**
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
---
|
||||
markup: occlusion
|
||||
---
|
||||
|
||||
# main
|
||||
|
||||
**结果 = > 转换 "七"**
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
---
|
||||
markup: occlusion
|
||||
---
|
||||
|
||||
# main
|
||||
|
||||
| 字段 | 类型 | 可空 |
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: Resolve configuration
|
||||
capability: config.resolve
|
||||
status: stable
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: Normalize settings (near-duplicate)
|
||||
status: stable
|
||||
---
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: bad arity
|
||||
---
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: bad int
|
||||
---
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: empty split sep
|
||||
---
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: division by zero
|
||||
---
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: footnote missing map key
|
||||
---
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: footnote list out of range
|
||||
---
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: footnote [^0] invalid
|
||||
---
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: cyclic inheritance
|
||||
---
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: unknown base type
|
||||
---
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: path to instance method needs receiver
|
||||
import:
|
||||
helpers: ../structure/ns/helpers.mq.md
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: undefined variable
|
||||
---
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: unknown function
|
||||
---
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: agent constitution markers (Wave B1 offline)
|
||||
description: Assert call_site / source / protocol order in build_step_context.
|
||||
import:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: agent context budget + progressive disclose (A3 offline)
|
||||
description: source/skill briefs truncate with markers; READ:skill deepen; step protocol mentions READ.
|
||||
import:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: dump_step_context (Wave B1 offline)
|
||||
description: Assert dump_step_context exposes call_site + prompt without LLM.
|
||||
import:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: agent inspect_workbook (offline)
|
||||
description: Parse named writeback slots from a fixture workbook path.
|
||||
import:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: OKF agent-kb alias lookup (offline)
|
||||
description: Promote resource; patch Task aliases; variant goal hits same resource.
|
||||
import:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: OKF agent-kb near_match (offline)
|
||||
description: Promote trip resource; near-dupe goals hit match=near; unrelated misses.
|
||||
import:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: OKF plan llm_free hit + list_tasks curation (A1 offline)
|
||||
description: Promote solidified workbook; plan same goal takes cache=hit; near→soft-hit; list_tasks exposes status/llm_free.
|
||||
import:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: OKF agent-kb promote + lookup + spawn (offline)
|
||||
description: Promote a solidified workbook, lookup by goal, spawn without parent LLM.
|
||||
import:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: Parent CALL:lib whitelist (offline)
|
||||
description: lib.fs.exists + ARGS; reject lib.net; catalog callable.
|
||||
import:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: agent / llm soft transport errors
|
||||
description: >-
|
||||
Regression (2026-10): unreachable OpenAI upstream must not abort the VM.
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: agent MCP stdio client (offline)
|
||||
description: Oneshoot list+call against python mock MCP server.
|
||||
import:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: agent mcp server smoke helpers
|
||||
description: Tool target for MCP server smoke.
|
||||
---
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: agent mcp server smoke
|
||||
description: Offline assemble mcp_server + one tool (no serve).
|
||||
import:
|
||||
@@ -18,15 +19,15 @@ import:
|
||||
|
||||
**srv = > agent.mcp_server name="marqdo-test"**
|
||||
**srv = > `srv`.tool name="ping" fn="demo.ping" description="ping tool"**
|
||||
**tools = [tools](srv)**
|
||||
**tools = [tools](access(srv, "tools"))**
|
||||
**n = > len value=`tools`**
|
||||
1. `n` == 1
|
||||
> print text=mcp-tool-ok
|
||||
2. *
|
||||
> print text=mcp-tool-fail
|
||||
|
||||
**t0 = [1](tools)**
|
||||
**fn = [fn](t0)**
|
||||
**t0 = [1](access(tools, "1"))**
|
||||
**fn = [fn](access(t0, "fn"))**
|
||||
1. `fn` == "demo.ping"
|
||||
> print text=mcp-fn-ok
|
||||
2. *
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: Agent Framework P4 — Adaptive Routing + Policy Compilation (offline)
|
||||
description: Learn skill, compile policy from skill-tagged episodes, route via marqdo backend without Jev/LLM.
|
||||
import:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: agent plan confirm (offline)
|
||||
description: Create workbook skeleton with confirm=True; no LLM spawn loop.
|
||||
import:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: agent plan decision + dual skeleton (offline)
|
||||
description: extract_plan_decision/summary; dual skeleton contains research+writer; patch apply on fixture.
|
||||
import:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: ext/agent plan live (DeepSeek)
|
||||
description: Full plan loop — spawn workbook, inspect, secondary plan; simple pong goal.
|
||||
import:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: parent observation excerpt + deepen (offline)
|
||||
import:
|
||||
agent: ext/ai/agent.mq.md
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: plan must not overwrite existing llm_free resources
|
||||
description: force+confirm plan keeps a pre-seeded compiled skill workbook intact (offline).
|
||||
import:
|
||||
@@ -28,12 +29,12 @@ import:
|
||||
**_ = 1**
|
||||
> fs.make_dirs path=`kb`
|
||||
**parts = > json.parse text={"res":"/resources/","ext":".mq.md","dir":"/resources"}**
|
||||
**res_dir = kb + [dir](`parts`)**
|
||||
**res_dir = kb + [dir](access(`parts`, "dir"))**
|
||||
> fs.make_dirs path=`res_dir`
|
||||
|
||||
**goal = "Preserve compiled skill body under force plan"**
|
||||
**slug = > agent_goal_slug goal=`goal`**
|
||||
**res = kb + [res](`parts`) + slug + [ext](`parts`)**
|
||||
**res = kb + [res](access(`parts`, "res")) + slug + [ext](access(`parts`, "ext"))**
|
||||
**body = > fs.read_text path="fixtures/preserve-skill.mq.md"**
|
||||
> fs.write_text path=`res` text=`body`
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: agent plan stream helpers + confirm (offline)
|
||||
description: plan_append_*/plan_finish_stream; confirm=True with stream attaches done event.
|
||||
import:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: agent resume checkpoint (offline)
|
||||
description: save / load / list / clear under .marqdo/agent-resume-test
|
||||
import:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: agent.run cold OKF — resolve llm_free + self.preflight
|
||||
description: >-
|
||||
Regression for qdagent-facing bugs (2026-10):
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: ext/agent step (DeepSeek)
|
||||
description: Real agent.step with tool via lib/subtask; default writeback to ok/error slots.
|
||||
import:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: agent trial sandbox opt-in — host unchanged until commit
|
||||
description: >
|
||||
O1: agent.trial write stays upper until commit=True.
|
||||
@@ -24,8 +25,8 @@ Reset leftover workspace from prior runs.
|
||||
Trial with `commit=False`: upper write must not touch the host tree.
|
||||
|
||||
**dry = agent.trial root="_sbx_optin" write_path="proof.txt" text=optin-ok commit=False**
|
||||
**dry_ok = [ok](dry)**
|
||||
**dry_committed = [committed](dry)**
|
||||
**dry_ok = [ok](access(dry, "ok"))**
|
||||
**dry_committed = [committed](access(dry, "committed"))**
|
||||
> print text=`dry_ok`
|
||||
> print text=`dry_committed`
|
||||
|
||||
@@ -35,8 +36,8 @@ Trial with `commit=False`: upper write must not touch the host tree.
|
||||
Trial with `commit=True`: host sees the file after success.
|
||||
|
||||
**wet = agent.trial root="_sbx_optin" write_path="proof.txt" text=optin-ok commit=True**
|
||||
**wet_ok = [ok](wet)**
|
||||
**wet_committed = [committed](wet)**
|
||||
**wet_ok = [ok](access(wet, "ok"))**
|
||||
**wet_committed = [committed](access(wet, "committed"))**
|
||||
> print text=`wet_ok`
|
||||
> print text=`wet_committed`
|
||||
|
||||
@@ -45,6 +46,6 @@ Trial with `commit=True`: host sees the file after success.
|
||||
|
||||
Profile row is attached (link-index readable).
|
||||
|
||||
**prof = [profile](wet)**
|
||||
**pname = [name](prof)**
|
||||
**prof = [profile](access(wet, "profile"))**
|
||||
**pname = [name](access(prof, "name"))**
|
||||
> print text=`pname`
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: agent small-llm route request (offline)
|
||||
description: router=small-llm returns needs_llm + prompt; jev alias same shape.
|
||||
import:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: ext/agent framework smoke
|
||||
description: Real llm handle from tests/ext/.env; context, extract_tool_name, run_tool via subtask.
|
||||
import:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: OKF soft_match protocol parse (offline)
|
||||
description: REUSE/NEW + SLUG extractors; no network.
|
||||
import:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: O3 step_route table backends
|
||||
description: lookup → marqdo; net → llm; default → auto.
|
||||
import:
|
||||
@@ -8,13 +9,13 @@ import:
|
||||
# main
|
||||
|
||||
**a = agent.step_route kind="lookup"**
|
||||
**ba = [backend](a)**
|
||||
**ba = [backend](access(a, "backend"))**
|
||||
> print text=`ba`
|
||||
|
||||
**b = agent.step_route kind="net"**
|
||||
**bb = [backend](b)**
|
||||
**bb = [backend](access(b, "backend"))**
|
||||
> print text=`bb`
|
||||
|
||||
**c = agent.step_route kind="default"**
|
||||
**bc = [backend](c)**
|
||||
**bc = [backend](access(c, "backend"))**
|
||||
> print text=`bc`
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: agent corpus_search + mcp fixture tools (A4 offline)
|
||||
description: Local RAG-lite corpus search and MCP fixture call; authority stays workbook.
|
||||
import:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: Agent Framework v2 — episode → learn → compile (offline)
|
||||
description: Record three identical successes, maybe_learn compiles llm_free skill, resolve hits compiled path.
|
||||
import:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: agent workbook multi-CONTINUE patch + solidify (A0 offline)
|
||||
description: Two precise CONTINUE patches then agent_workbook_solidify freezes step workbook.
|
||||
import:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: writeback param must not shadow writeback module
|
||||
description: Regression — step/plan param writeback=True used to break > writeback.record (bool is not a map). Use a non-colliding import alias.
|
||||
import:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: Agent zero-LLM execution after policy/skill compile
|
||||
description: After Skill+Policy compilation, run with router=marqdo records llm_calls=0.
|
||||
import:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: eng preflight offline
|
||||
import:
|
||||
plugin: lib/plugin.mq.md
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
type: skill
|
||||
status: compiled
|
||||
llm_free: true
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
type: prompt
|
||||
title: marqdo-one-liner
|
||||
---
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: fs text_patch / apply_patch_blocks (offline)
|
||||
import:
|
||||
fs: lib/fs.mq.md
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: linalg basic smoke (L2)
|
||||
description: from_formula, det, solve 2×2, explicit mul.
|
||||
import:
|
||||
@@ -39,8 +40,8 @@ $$
|
||||
> print text=trace-fail
|
||||
|
||||
**`sol` = > la.solve a=`A` b=`b`**
|
||||
**`x` = [x](sol)**
|
||||
**`data` = [data](x)**
|
||||
**`x` = [x](access(sol, "x"))**
|
||||
**`data` = [data](access(x, "data"))**
|
||||
**`row0` = > at value=`data` index=0**
|
||||
**`x0` = > at value=`row0` index=0**
|
||||
**`e0` = > math.sub a=`x0` b=2**
|
||||
@@ -53,7 +54,7 @@ $$
|
||||
**`I` = > la.eye n=2**
|
||||
**`P` = > la.mul a=`A` b=`I`**
|
||||
**`E` = > la.explicit expr=`P`**
|
||||
**`ed` = [data](E)**
|
||||
**`ed` = [data](access(E, "data"))**
|
||||
**`ed0` = > at value=`ed` index=0**
|
||||
**`ed00` = > at value=`ed0` index=0**
|
||||
**`ee` = > math.sub a=`ed00` b=2**
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: linalg block/kron smoke (L3)
|
||||
description: Lazy kron ascii; block*block collapse.
|
||||
import:
|
||||
@@ -43,7 +44,7 @@ import:
|
||||
> print text=`ct`
|
||||
|
||||
**`ping` = > la.ping**
|
||||
**`ok` = [ok](ping)**
|
||||
**`ok` = [ok](access(ping, "ok"))**
|
||||
1. `ok`
|
||||
> print text=ping-ok
|
||||
2. *
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: linalg formula-doc smoke (F1)
|
||||
description: Run-implies-correct — (AB)^T ascii without explicit simplify.
|
||||
import:
|
||||
@@ -29,8 +30,8 @@ Narration: \((AB)^\top = B^\top A^\top\). The identity is checked by running thi
|
||||
| 2 | Y | 2 | 2 |
|
||||
|
||||
**`env` = > la.declare table=`shapes`**
|
||||
**`X` = [X](env)**
|
||||
**`Y` = [Y](env)**
|
||||
**`X` = [X](access(env, "X"))**
|
||||
**`Y` = [Y](access(env, "Y"))**
|
||||
**`S` = `X` + `Y`**
|
||||
**`st` = > la.ascii expr=`S`**
|
||||
1. `st` == "X + Y"
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: linalg factor smoke (L4)
|
||||
description: eig factorize, structure SVG, LU reuse solve.
|
||||
import:
|
||||
@@ -17,13 +18,13 @@ $$
|
||||
**`eps` = > math.div a=1 b=1000**
|
||||
|
||||
**`f` = > la.factorize matrix=`M` kind="eig"**
|
||||
**`kind` = [kind](f)**
|
||||
**`kind` = [kind](access(f, "kind"))**
|
||||
1. `kind` == eig
|
||||
> print text=eig-kind-ok
|
||||
2. *
|
||||
> print text=eig-kind-fail
|
||||
|
||||
**`evals` = [eigenvalues](f)**
|
||||
**`evals` = [eigenvalues](access(f, "eigenvalues"))**
|
||||
**`ev0` = > at value=`evals` index=0**
|
||||
**`e0` = > math.sub a=`ev0` b=3**
|
||||
**`e0` = > math.abs value=`e0`**
|
||||
@@ -33,13 +34,13 @@ $$
|
||||
> print text=eig-val-fail
|
||||
|
||||
**`img` = > la.draw factor=`f` kind="eig" path="linalg-factor-eig.svg"**
|
||||
**`ik` = [kind](img)**
|
||||
**`ik` = [kind](access(img, "kind"))**
|
||||
1. `ik` == eig
|
||||
> print text=draw-kind-ok
|
||||
2. *
|
||||
> print text=draw-kind-fail
|
||||
|
||||
**`svg` = [svg](img)**
|
||||
**`svg` = [svg](access(img, "svg"))**
|
||||
**`parts` = > split value=`svg` sep="data-linalg=\"eig\""**
|
||||
**`pn` = > len value=`parts`**
|
||||
1. `pn` > 1
|
||||
@@ -61,8 +62,8 @@ $$
|
||||
**`b` = > la.from_formula formula=`b`**
|
||||
**`lu` = > la.factorize matrix=`A` kind="lu"**
|
||||
**`sol` = > la.solve factor=`lu` b=`b`**
|
||||
**`x` = [x](sol)**
|
||||
**`data` = [data](x)**
|
||||
**`x` = [x](access(sol, "x"))**
|
||||
**`data` = [data](access(x, "data"))**
|
||||
**`row0` = > at value=`data` index=0**
|
||||
**`x0` = > at value=`row0` index=0**
|
||||
**`xe` = > math.sub a=`x0` b=2**
|
||||
@@ -73,7 +74,7 @@ $$
|
||||
> print text=lu-solve-fail
|
||||
|
||||
**`svd` = > la.factorize matrix=`M` kind="svd"**
|
||||
**`sk` = [ascii](svd)**
|
||||
**`sk` = [ascii](access(svd, "ascii"))**
|
||||
1. `sk` == SVD
|
||||
> print text=svd-ok
|
||||
2. *
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: linalg formula smoke
|
||||
description: (AB)^T simplifies to B^T*A^T; ping ok.
|
||||
import:
|
||||
@@ -16,7 +17,7 @@ import:
|
||||
> print text=`txt`
|
||||
|
||||
**`ping` = > la.ping**
|
||||
**`ok` = [ok](ping)**
|
||||
**`ok` = [ok](access(ping, "ok"))**
|
||||
1. `ok`
|
||||
> print text=ping-ok
|
||||
2. *
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: linalg infix and matrix methods
|
||||
description: A+B / A*B dispatch; `A`.T method chain; display auto-simplify.
|
||||
import:
|
||||
@@ -18,7 +19,7 @@ import:
|
||||
**`st` = > `Pt`.ascii**
|
||||
> print text=`st`
|
||||
|
||||
**`ty` = [_type](C)**
|
||||
**`ty` = [_type](access(C, "_type"))**
|
||||
1. `ty` == matrix
|
||||
> print text=type-ok
|
||||
2. *
|
||||
@@ -36,7 +37,7 @@ $$
|
||||
|
||||
**`S` = `M` + `N`**
|
||||
**`Se` = > la.explicit expr=`S`**
|
||||
**`d` = [data](Se)**
|
||||
**`d` = [data](access(Se, "data"))**
|
||||
**`r0` = > at value=`d` index=0**
|
||||
**`x00` = > at value=`r0` index=0**
|
||||
**`xs` = > str value=`x00`**
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: linalg metrics smoke (L6)
|
||||
description: lstsq, norm, cond, rank, complex fro, themed draw.
|
||||
import:
|
||||
@@ -24,8 +25,8 @@ $$
|
||||
**`eps` = > math.div a=1 b=1000**
|
||||
|
||||
**`ls` = > la.lstsq a=`A` b=`b`**
|
||||
**`x` = [x](ls)**
|
||||
**`xd` = [data](x)**
|
||||
**`x` = [x](access(ls, "x"))**
|
||||
**`xd` = [data](access(x, "data"))**
|
||||
**`r0` = > at value=`xd` index=0**
|
||||
**`x0` = > at value=`r0` index=0**
|
||||
**`e0` = > math.sub a=`x0` b=1.1666666667**
|
||||
@@ -50,7 +51,7 @@ $$
|
||||
|
||||
**`D` = > la.from_formula formula=`D`**
|
||||
**`c` = > la.cond expr=`D`**
|
||||
**`cv` = [value](c)**
|
||||
**`cv` = [value](access(c, "value"))**
|
||||
**`ce` = > math.sub a=`cv` b=2**
|
||||
**`ce` = > math.abs value=`ce`**
|
||||
1. `ce` < `eps`
|
||||
@@ -66,7 +67,7 @@ $$
|
||||
|
||||
**`raw` = > json.parse text="[[[0,1],[1,0]],[[1,0],[0,-1]]]"**
|
||||
**`Z` = > la.from_list data=`raw`**
|
||||
**`dt` = [dtype](Z)**
|
||||
**`dt` = [dtype](access(Z, "dtype"))**
|
||||
1. `dt` == complex
|
||||
> print text=complex-dtype-ok
|
||||
2. *
|
||||
@@ -81,13 +82,13 @@ $$
|
||||
> print text=complex-norm-fail
|
||||
|
||||
**`img` = > la.draw factor=`D` kind="heatmap" theme="dark" path="linalg-metrics-heat.svg"**
|
||||
**`th` = [theme](img)**
|
||||
**`th` = [theme](access(img, "theme"))**
|
||||
1. `th` == dark
|
||||
> print text=theme-ok
|
||||
2. *
|
||||
> print text=theme-fail
|
||||
|
||||
**`svg` = [svg](img)**
|
||||
**`svg` = [svg](access(img, "svg"))**
|
||||
**`parts` = > split value=`svg` sep="data-theme=\"dark\""**
|
||||
**`pn` = > len value=`parts`**
|
||||
1. `pn` > 1
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: 线性代数公式冒烟
|
||||
description: (AB)^T 化简为 B^T*A^T;探测 ok。
|
||||
import:
|
||||
@@ -16,7 +17,7 @@ import:
|
||||
> 打印 内容=`txt`
|
||||
|
||||
**`ping` = > la.探测**
|
||||
**`ok` = [ok](ping)**
|
||||
**`ok` = [ok](access(ping, "ok"))**
|
||||
1. `ok`
|
||||
> 打印 内容=探测-ok
|
||||
2. *
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: llm create + collect offline
|
||||
description: Factory create + collect alias; no network.
|
||||
import:
|
||||
@@ -9,8 +10,8 @@ import:
|
||||
# main
|
||||
|
||||
**model = > llm.create**
|
||||
> print text=[model](`model`)
|
||||
> print text=[backend](`model`)
|
||||
> print text=[model](access(`model`, "model"))
|
||||
> print text=[backend](access(`model`, "backend"))
|
||||
|
||||
**fixture = "data: {\"choices\":[{\"delta\":{\"content\":\"Hi\"}}]}\n\ndata: {\"choices\":[{\"delta\":{\"content\":\"!\"}}]}\n\ndata: [DONE]\n"**
|
||||
**events = > net.openai_sse_parse text=`fixture`**
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: ext llm DeepSeek complete
|
||||
description: OpenAI-compatible chat via DeepSeek. Credentials from tests/ext/.env.
|
||||
import:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: llm constructor offline
|
||||
description: Build llm handle from env + defaults; no network.
|
||||
import:
|
||||
@@ -8,5 +9,5 @@ import:
|
||||
# main
|
||||
|
||||
**model = > llm.llm**
|
||||
> print text=[model](`model`)
|
||||
> print text=[suffix](`model`)
|
||||
> print text=[model](access(`model`, "model"))
|
||||
> print text=[suffix](access(`model`, "suffix"))
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
type: prompt
|
||||
title: entry prompt offline
|
||||
import:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: ext llm import
|
||||
import:
|
||||
llm: ext/ai/llm.mq.md
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: llm meta binding offline
|
||||
description: Create handle from Artifact Metadata (model / api_key); no network.
|
||||
type: llm
|
||||
@@ -11,5 +12,5 @@ import:
|
||||
# main
|
||||
|
||||
**h = > llm.llm**
|
||||
> print text=[model](`h`)
|
||||
> print text=[api_key](`h`)
|
||||
> print text=[model](access(`h`, "model"))
|
||||
> print text=[api_key](access(`h`, "api_key"))
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: llm named handles + prompt_load offline
|
||||
description: fast/reasoning names, ollama backend tag, and type:prompt body load; no network.
|
||||
import:
|
||||
@@ -9,16 +10,16 @@ import:
|
||||
# main
|
||||
|
||||
**fast = > llm.fast model="qwen-fast-test"**
|
||||
> print text=[name](`fast`)
|
||||
> print text=[model](`fast`)
|
||||
> print text=[name](access(`fast`, "name"))
|
||||
> print text=[model](access(`fast`, "model"))
|
||||
|
||||
**reason = > llm.reasoning model="gpt-reason-test"**
|
||||
> print text=[name](`reason`)
|
||||
> print text=[model](`reason`)
|
||||
> print text=[name](access(`reason`, "name"))
|
||||
> print text=[model](access(`reason`, "model"))
|
||||
|
||||
**ollama = > llm.create backend="ollama" model="llama3.2"**
|
||||
> print text=[backend](`ollama`)
|
||||
> print text=[model](`ollama`)
|
||||
> print text=[backend](access(`ollama`, "backend"))
|
||||
> print text=[model](access(`ollama`, "model"))
|
||||
|
||||
**prompt = > llm.prompt_load path="fixtures/prompt-marqdo.md"**
|
||||
**has = > text.contains text=`prompt` sub="Explain Marqdo"**
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: ext llm DeepSeek stream live
|
||||
description: Live SSE complete with echo; credentials from tests/ext/.env.
|
||||
import:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: llm stream_result offline
|
||||
description: No network — SSE fixture via net.openai_sse_parse + llm.stream_result
|
||||
import:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: llm tool_calls offline
|
||||
description: Parse OpenAI-shaped tool_calls into a list; no network.
|
||||
import:
|
||||
@@ -13,11 +14,11 @@ import:
|
||||
**tc = > openai.tool_calls_from data=`data`**
|
||||
**n = > len value=`tc`**
|
||||
> print text=`n`
|
||||
**first = [1](tc)**
|
||||
> print text=[id](`first`)
|
||||
> print text=[type](`first`)
|
||||
**fn = [function](first)**
|
||||
> print text=[name](`fn`)
|
||||
**first = [1](access(tc, "1"))**
|
||||
> print text=[id](access(`first`, "id"))
|
||||
> print text=[type](access(`first`, "type"))
|
||||
**fn = [function](access(first, "function"))**
|
||||
> print text=[name](access(`fn`, "name"))
|
||||
|
||||
**empty_data = > json.parse text={"choices":[{"message":{"role":"assistant","content":"hi"}}]}**
|
||||
**empty = > openai.tool_calls_from data=`empty_data`**
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: quantum amplitude damping smoke
|
||||
description: X then amplitude_damping p=1 returns all shots to |0>.
|
||||
import:
|
||||
@@ -11,7 +12,7 @@ import:
|
||||
**qc = > `qc`.x qubit=0**
|
||||
**qc = > `qc`.noise kind="amplitude_damping" p=1**
|
||||
**r = > `qc`.run shots=32 seed=7**
|
||||
**c0 = [0]([counts](r))**
|
||||
**c0 = [0](access([counts](access(r, "counts")), "0"))**
|
||||
|
||||
1. `c0` == 32
|
||||
> print text=amp-ok
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: quantum amplitude damping zh smoke
|
||||
description: 泡利X 后 振幅阻尼 p=1 全部落回 |0⟩.
|
||||
导入:
|
||||
@@ -11,7 +12,7 @@ description: 泡利X 后 振幅阻尼 p=1 全部落回 |0⟩.
|
||||
**qc = > `qc`.泡利X 比特=0**
|
||||
**qc = > `qc`.噪声 种类="振幅阻尼" 概率=1**
|
||||
**r = > `qc`.运行 次数=32 种子=7**
|
||||
**c0 = [0]([counts](r))**
|
||||
**c0 = [0](access([counts](access(r, "counts")), "0"))**
|
||||
|
||||
1. `c0` == 32
|
||||
> print text=amp-ok
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: quantum author API smoke
|
||||
description: barrier, measure, append, state, draw meters.
|
||||
import:
|
||||
@@ -14,14 +15,14 @@ import:
|
||||
**qc = > `qc`.measure**
|
||||
|
||||
**st = > `qc`.state**
|
||||
**dim = [dim](st)**
|
||||
**dim = [dim](access(st, "dim"))**
|
||||
1. `dim` == 4
|
||||
> print text=state-ok
|
||||
2. *
|
||||
> print text=state-fail
|
||||
|
||||
**img = > `qc`.draw path="quantum-author-draw.svg"**
|
||||
**kind = [kind](img)**
|
||||
**kind = [kind](access(img, "kind"))**
|
||||
1. `kind` == circuit
|
||||
> print text=draw-ok
|
||||
2. *
|
||||
@@ -30,7 +31,7 @@ import:
|
||||
**other = > quantum.circuit qubits=2**
|
||||
**other = > `other`.x qubit=1**
|
||||
**qc2 = > `qc`.append op=`other`**
|
||||
**ops = [ops](qc2)**
|
||||
**ops = [ops](access(qc2, "ops"))**
|
||||
**n = > len `ops`**
|
||||
1. `n` == 5
|
||||
> print text=append-ok
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: quantum author API zh smoke
|
||||
description: 屏障 / 测量 / 追加 / 态 / 绘图.
|
||||
导入:
|
||||
@@ -14,14 +15,14 @@ description: 屏障 / 测量 / 追加 / 态 / 绘图.
|
||||
**qc = > `qc`.测量**
|
||||
|
||||
**st = > `qc`.态**
|
||||
**dim = [dim](st)**
|
||||
**dim = [dim](access(st, "dim"))**
|
||||
1. `dim` == 4
|
||||
> print text=state-ok
|
||||
2. *
|
||||
> print text=state-fail
|
||||
|
||||
**img = > `qc`.绘图 路径="quantum-author-zh-draw.svg"**
|
||||
**kind = [kind](img)**
|
||||
**kind = [kind](access(img, "kind"))**
|
||||
1. `kind` == circuit
|
||||
> print text=draw-ok
|
||||
2. *
|
||||
@@ -30,7 +31,7 @@ description: 屏障 / 测量 / 追加 / 态 / 绘图.
|
||||
**other = > 量子.电路 比特数=2**
|
||||
**other = > `other`.泡利X 比特=1**
|
||||
**qc2 = > `qc`.追加 操作=`other`**
|
||||
**ops = [ops](qc2)**
|
||||
**ops = [ops](access(qc2, "ops"))**
|
||||
**n = > len `ops`**
|
||||
1. `n` == 5
|
||||
> print text=append-ok
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: quantum bell smoke
|
||||
description: H+CX Bell state probabilities ≈ 1/2 each.
|
||||
import:
|
||||
@@ -13,8 +14,8 @@ import:
|
||||
**qc = > `qc`.cx control=0 target=1**
|
||||
**p = > `qc`.probabilities**
|
||||
|
||||
**p00 = [00](p)**
|
||||
**p11 = [11](p)**
|
||||
**p00 = [00](access(p, "00"))**
|
||||
**p11 = [11](access(p, "11"))**
|
||||
**lo = > math.div a=2 b=5**
|
||||
**hi = > math.div a=3 b=5**
|
||||
|
||||
@@ -35,7 +36,7 @@ import:
|
||||
> print text=p11-fail
|
||||
|
||||
**ping = > quantum_ping**
|
||||
**ok = [ok](ping)**
|
||||
**ok = [ok](access(ping, "ok"))**
|
||||
1. `ok`
|
||||
> print text=ping-ok
|
||||
2. *
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: quantum custom gate from formula matrix
|
||||
description: $$ H matrix $$ → gate matrix= → apply → probs match built-in H.
|
||||
import:
|
||||
@@ -17,7 +18,7 @@ $$
|
||||
**qc = > quantum.circuit qubits=1**
|
||||
**qc = > `qc`.apply gate=`U` qubits=0**
|
||||
**p = > `qc`.probabilities**
|
||||
**p0 = [0](p)**
|
||||
**p0 = [0](access(p, "0"))**
|
||||
**lo = > math.div a=4 b=10**
|
||||
**hi = > math.div a=6 b=10**
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: quantum custom gate zh from formula
|
||||
description: $$ 矩阵 $$ → 门 矩阵= → 施加.
|
||||
导入:
|
||||
@@ -17,7 +18,7 @@ $$
|
||||
**qc = > 量子.电路 比特数=1**
|
||||
**qc = > `qc`.施加 门=`U` 比特=0**
|
||||
**p = > `qc`.概率**
|
||||
**p0 = [0](p)**
|
||||
**p0 = [0](access(p, "0"))**
|
||||
**lo = > math.div a=4 b=10**
|
||||
**hi = > math.div a=6 b=10**
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: quantum draw probs/bloch smoke
|
||||
description: draw kind=probs and kind=bloch return matching kind tags.
|
||||
import:
|
||||
@@ -16,7 +17,7 @@ import:
|
||||
|
||||
**qc = > quantum.circuit qubits=2 steps=`steps`**
|
||||
**img = > `qc`.draw kind="probs" path="quantum-draw-probs.svg"**
|
||||
**kind = [kind](img)**
|
||||
**kind = [kind](access(img, "kind"))**
|
||||
|
||||
1. `kind` == probs
|
||||
> print text=probs-ok
|
||||
@@ -26,7 +27,7 @@ import:
|
||||
**qc1 = > quantum.circuit qubits=1**
|
||||
**qc1 = > `qc1`.h qubit=0**
|
||||
**bloch = > `qc1`.draw kind="bloch" path="quantum-draw-bloch.svg"**
|
||||
**bk = [kind](bloch)**
|
||||
**bk = [kind](access(bloch, "kind"))**
|
||||
|
||||
1. `bk` == bloch
|
||||
> print text=bloch-ok
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: quantum gate matrix heatmap smoke
|
||||
description: gate.draw kind=matrix writes SVG heatmap.
|
||||
import:
|
||||
@@ -9,7 +10,7 @@ import:
|
||||
|
||||
**H = > quantum.gate name="H"**
|
||||
**img = > `H`.draw kind="matrix" path="quantum-gate-heatmap.svg"**
|
||||
**kind = [kind](img)**
|
||||
**kind = [kind](access(img, "kind"))**
|
||||
|
||||
1. `kind` == matrix
|
||||
> print text=heatmap-ok
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: quantum gate matches_matrix smoke
|
||||
description: Named H matches an explicit 2x2 nested list.
|
||||
import:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: quantum gates + run smoke
|
||||
description: Z sandwich, Ry(pi), seeded Bell run counts.
|
||||
import:
|
||||
@@ -15,7 +16,7 @@ H-Z-H on |0⟩ → |1⟩.
|
||||
**qc = > `qc`.z qubit=0**
|
||||
**qc = > `qc`.h qubit=0**
|
||||
**p = > `qc`.probabilities**
|
||||
**p1 = [1](p)**
|
||||
**p1 = [1](access(p, "1"))**
|
||||
**lo = > math.div a=9 b=10**
|
||||
|
||||
1. `p1` > `lo`
|
||||
@@ -29,7 +30,7 @@ Ry(π) on |0⟩ → |1⟩.
|
||||
**ry = > quantum.circuit qubits=1**
|
||||
**ry = > `ry`.ry qubit=0 theta=`pi`**
|
||||
**rp = > `ry`.probabilities**
|
||||
**rp1 = [1](rp)**
|
||||
**rp1 = [1](access(rp, "1"))**
|
||||
|
||||
1. `rp1` > `lo`
|
||||
> print text=ry-ok
|
||||
@@ -42,10 +43,10 @@ Bell run with fixed seed: both 00 and 11 appear; shots sum.
|
||||
**bell = > `bell`.h qubit=0**
|
||||
**bell = > `bell`.cx control=0 target=1**
|
||||
**res = > `bell`.run shots=200 seed=42**
|
||||
**counts = [counts](res)**
|
||||
**c00 = [00](counts)**
|
||||
**c11 = [11](counts)**
|
||||
**shots = [shots](res)**
|
||||
**counts = [counts](access(res, "counts"))**
|
||||
**c00 = [00](access(counts, "00"))**
|
||||
**c11 = [11](access(counts, "11"))**
|
||||
**shots = [shots](access(res, "shots"))**
|
||||
|
||||
1. `c00`
|
||||
1. `c11`
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: quantum linalg smoke
|
||||
description: Q7a density / partial_trace / expect / schmidt / purity
|
||||
import:
|
||||
@@ -41,7 +42,7 @@ import:
|
||||
> print text=expect-fail
|
||||
|
||||
**sch = > `qc`.schmidt cut=1**
|
||||
**ent = [entropy](sch)**
|
||||
**ent = [entropy](access(sch, "entropy"))**
|
||||
**elo = > math.div a=1 b=2**
|
||||
1. `ent` > `elo`
|
||||
> print text=schmidt-ok
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: quantum noise smoke
|
||||
description: bitflip p=1 after I flips |0> to |1| for all shots.
|
||||
import:
|
||||
@@ -11,7 +12,7 @@ import:
|
||||
**qc = > `qc`.i qubit=0**
|
||||
**qc = > `qc`.noise kind="bitflip" p=1**
|
||||
**r = > `qc`.run shots=32 seed=3**
|
||||
**c1 = [1]([counts](r))**
|
||||
**c1 = [1](access([counts](access(r, "counts")), "1"))**
|
||||
|
||||
1. `c1` == 32
|
||||
> print text=noise-ok
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: quantum noise zh smoke
|
||||
description: 噪声 bitflip p=1 后 I 使全部射中 |1⟩.
|
||||
导入:
|
||||
@@ -11,7 +12,7 @@ description: 噪声 bitflip p=1 后 I 使全部射中 |1⟩.
|
||||
**qc = > `qc`.单位 比特=0**
|
||||
**qc = > `qc`.噪声 种类="bitflip" 概率=1**
|
||||
**r = > `qc`.运行 次数=32 种子=3**
|
||||
**c1 = [1]([counts](r))**
|
||||
**c1 = [1](access([counts](access(r, "counts")), "1"))**
|
||||
|
||||
1. `c1` == 32
|
||||
> print text=noise-ok
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: quantum steps + draw smoke
|
||||
description: steps= Bell table + draw SVG via record_plot.
|
||||
import:
|
||||
@@ -17,7 +18,7 @@ import:
|
||||
|
||||
**qc = > quantum.circuit qubits=2 steps=`steps`**
|
||||
**p = > `qc`.probabilities**
|
||||
**p00 = [00](p)**
|
||||
**p00 = [00](access(p, "00"))**
|
||||
**lo = > math.div a=2 b=5**
|
||||
**hi = > math.div a=3 b=5**
|
||||
|
||||
@@ -30,7 +31,7 @@ import:
|
||||
> print text=steps-fail
|
||||
|
||||
**img = > `qc`.draw path="quantum-steps-draw.svg"**
|
||||
**kind = [kind](img)**
|
||||
**kind = [kind](access(img, "kind"))**
|
||||
|
||||
1. `kind` == circuit
|
||||
> print text=draw-ok
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: quantum viz advanced smoke
|
||||
description: Q7b hinton / qsphere / multibloch SVG markers
|
||||
import:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: quantum zh API smoke
|
||||
description: Chinese 量子.电路 泡利Z sandwich.
|
||||
导入:
|
||||
@@ -13,7 +14,7 @@ description: Chinese 量子.电路 泡利Z sandwich.
|
||||
**电路 = > `电路`.泡利Z 比特=0**
|
||||
**电路 = > `电路`.哈达玛 比特=0**
|
||||
**概率 = > `电路`.概率**
|
||||
**p1 = [1](概率)**
|
||||
**p1 = [1](access(概率, "1"))**
|
||||
**lo = > math.div a=9 b=10**
|
||||
|
||||
1. `p1` > `lo`
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: sandbox CoW — write stays upper until commit
|
||||
description: >
|
||||
Readable trial: seed on disk, mutate in session, host tree unchanged,
|
||||
@@ -22,7 +23,7 @@ Prepare a tiny workspace under this test directory (reset leftovers from prior r
|
||||
> fs.write_text path="_sbx_cow/seed.txt" text=seed-lower
|
||||
|
||||
**sb = sandbox.open root="_sbx_cow"**
|
||||
**id = [id](sb)**
|
||||
**id = [id](access(sb, "id"))**
|
||||
|
||||
Session edits (upper / whiteout only).
|
||||
|
||||
@@ -53,7 +54,7 @@ Commit applies upper + whiteout.
|
||||
Discard must not touch the host.
|
||||
|
||||
**sb2 = sandbox.open root="_sbx_cow"**
|
||||
**id2 = [id](sb2)**
|
||||
**id2 = [id](access(sb2, "id"))**
|
||||
> sandbox.write id=`id2` path="new.txt" text=should-discard
|
||||
> sandbox.discard id=`id2`
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: sandbox.run — plugin.load denied; inspect lists notes
|
||||
description: >
|
||||
Guest that loads a native plugin must fail with unavailable in sandbox.
|
||||
@@ -10,11 +11,11 @@ import:
|
||||
# main
|
||||
|
||||
**sb = sandbox.open root="sandbox-fixtures"**
|
||||
**id = [id](sb)**
|
||||
**id = [id](access(sb, "id"))**
|
||||
|
||||
**ret = sandbox.run id=`id` path="guest-plugin.mq.md"**
|
||||
**ok = [ok](ret)**
|
||||
**err = [error](ret)**
|
||||
**ok = [ok](access(ret, "ok"))**
|
||||
**err = [error](access(ret, "error"))**
|
||||
> print text=`ok`
|
||||
|
||||
**parts = split value=`err` sep="unavailable in sandbox"**
|
||||
@@ -25,7 +26,7 @@ import:
|
||||
> print text=`err`
|
||||
|
||||
**info = sandbox.inspect id=`id`**
|
||||
**notes = [notes](info)**
|
||||
**notes = [notes](access(info, "notes"))**
|
||||
**nn = len value=`notes`**
|
||||
1. `nn` > 0
|
||||
> print text=inspect-ok
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
import:
|
||||
json: lib/json.mq.md
|
||||
---
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
import:
|
||||
plugin: lib/plugin.mq.md
|
||||
---
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: promote-bad
|
||||
proof: promote-bad.mq.md
|
||||
---
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: promote-ok
|
||||
type: skill
|
||||
applies_when: demo
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: sandbox.run — core lib/json inside the trial
|
||||
description: Guest fixture imports lib/json; print ok and guest stdout via link index.
|
||||
import:
|
||||
@@ -10,13 +11,13 @@ import:
|
||||
Open a session on the fixture directory (guest programs live here).
|
||||
|
||||
**sb = sandbox.open root="sandbox-fixtures"**
|
||||
**id = [id](sb)**
|
||||
**id = [id](access(sb, "id"))**
|
||||
|
||||
Run the guest that imports `lib/json` and prints `1`.
|
||||
|
||||
**ret = sandbox.run id=`id` path="guest-json.mq.md"**
|
||||
**ok = [ok](ret)**
|
||||
**out = [stdout](ret)**
|
||||
**ok = [ok](access(ret, "ok"))**
|
||||
**out = [stdout](access(ret, "stdout"))**
|
||||
> print text=`ok`
|
||||
> print text=`out`
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
markup: occlusion
|
||||
type: web
|
||||
title: artifact document gold
|
||||
route: /
|
||||
|
||||
Loaded 100 of 485 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user