feat(web): Document/Endpoint/Resource artifact rewrite (ADR 0007)

Replace the monolithic compose_*/configure author surface with file-level
web|endpoint artifacts, split ext/{web,data,security,net}, and lock
no-degrade rules so the model cannot regress to God-object APIs.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cflmyandCursor committed 2026-09-28 11:06:38 +08:00
1 parent 33f8b94bb0
commit 67bac1bf02
54 files changed
+4642 -2505

No files matched your search

+11
View File
@@ -0,0 +1,11 @@
---
type: web
title: artifact document gold
route: /
method: GET
description: Core recognizes type:web without # main (ADR 0007).
---
# Artifact Document
This file is a Web Document. Running it returns a Result summary.
+10
View File
@@ -0,0 +1,10 @@
---
type: endpoint
method: POST
path: /api/ping
request: json
response: json
description: Core recognizes type:endpoint without # main (ADR 0007).
---
Endpoint body is documentation + handler when served.
+39
View File
@@ -0,0 +1,39 @@
---
title: web artifact render smoke
description: Unified View nodes + document render (ADR 0007); offline, no listen.
import web:ext/web/web.mq.md
import text:lib/text.mq.md
---
# main
`nodes` =
| type | slot | value | attrs | style |
|------|------|-------|-------|-------|
| text | kicker | AI Native | | eyebrow |
| title | title | Marqdo | | title |
| link | action | Read More | /docs | button |
**html = > web.render nodes=`nodes` title="smoke"**
1. `html`
**ok = > text.contains text=`html` sub="Marqdo"**
1. `ok`
> print text=render-nodes-ok
2. *
> print text=render-nodes-fail
2. *
> print text=render-nodes-fail
**doc = > web.render body="# Hello\n\nWorld" title="Doc"**
**ok2 = > text.contains text=`doc` sub="Hello"**
1. `ok2`
> print text=render-doc-ok
2. *
> print text=render-doc-fail
**insp = > web.inspect**
1. `insp`
> print text=inspect-ok
2. *
> print text=inspect-fail
+10
View File
@@ -0,0 +1,10 @@
---
类型: 网页
路由: /zh
方法: GET
标题: 中文文档金样
---
# 中文网页 Artifact
核心识别 `类型: 网页`。
+30
View File
@@ -0,0 +1,30 @@
---
title: ext/data db smoke
description: DB Resource lives in ext/data (ADR 0007).
import data:ext/data/db.mq.md
import fs:lib/fs.mq.md
---
# main
**store = > data.db url="sqlite:web-fixtures/data/artifact-db.db"**
`fields` =
| 字段 | 类型 | 可空 |
|------|------|------|
| title | text | False |
| body | text | True |
> `store`.init name=notes fields=`fields`
`row` =
| title | body |
|-------|------|
| hello | world |
> `store`.insert table=notes rows=`row`
**got = > `store`.select table="notes" limit=1**
1. `got`
> print text=db-ok
2. *
> print text=db-fail