cflmy a604405908
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
test: add a real HTTP-over-TCP loopback domain test
Implement marqdo-ext-http#3: the explicit @http package now owns a real
loopback domain test instead of only pure encode/parse cases.

- tests/loopback.mq.md performs two real HTTP/1.1 exchanges in one program
  through the CLI's generic resource.open("tcp")/read/write/close, building
  requests with http.构建请求字节 and parsing responses with
  http.解析响应字节; non-ASCII bodies, explicit --allow-net 127.0.0.1 and
  --allow-env HTTP_TEST_PORT only.
- scripts/loopback_server.py is a deterministic one-request-per-connection
  server that records method/path/body and returns fixed status/bodies.
- scripts/run_cases.py supports kind=loopback (server lifecycle, port env,
  grants, request-record assertions) without changing the pure case path.
- tests/cases/loopback.json asserts GET /one -> 200 第一个 and
  POST /two -> 201 第二个 plus the request records.
- Evidence: docs/evidence-2026-11-30-loopback-domain-test.md (real CLI rc.6
  candidate + Bundle 0.3.0: 2 cases PASS).

No CLI/Host/other-component change, no new Host request, no release.
2026-11-30 16:10:35 +08:00

marqdo-ext-http

本仓负责HTTP 报文编解码(显式 Package)。当前处于标准库源码归位迁移阶段:领域模块已迁入本仓作为显式 Package,等待父仓候选组合验收(父仓工单 marqdo#9,本仓工单 #1)。

现行形态:显式 Package,不进入默认 Bundle

  • 入口:index.mq.md(marqdo.yaml 声明 package)。
  • 消费者声明依赖并用公开 @alias 导入:
# consumer/marqdo.yaml
dependencies:
  http:
    git: https://git.cflmy.cn/cflmy/marqdo-ext-http
    rev: <精确提交>
---
import:
  http: "@http"
---

## @exec main

`return http.<函数>(...)`
  • 不再以 std:http 提供,不保留隐藏 fallback;默认标准库 Bundle 不包含本模块。
  • 测试:scripts/test.sh 只接受 MARQDO_BIN + MARQDO_STDLIB_DIR,用临时消费者工程经 marqdo lock 与 @alias 公开导入执行。

index.mq.md:原 net/http.mq.md 的报文/响应解析与请求构建函数,公开为 Package 入口(消费者通过 @http 导入)

边界

不进入默认 Bundle,不提供 std:net/http;不实现完整 HTTP Client/Server、SSE、HTTP/2(另行开发);不新增 Host 请求,底层仍使用现行通用资源/字流能力。

目录

  • index.mq.md:Package 入口与唯一公开入口。
  • tests/:迁入的领域测试源与期望。
  • scripts/:独立验收入口。

生态迁移台账 · 开发流程

S
Description
Marqdo extension component for http
Readme
77 KiB
0 Stars 1 Watchers 0 Forks
Languages
Python 96.8%
Shell 3.2%