AGENTS.md@internal/httpA

AGENTS.md@internal/http from iohub/yagent is an AGENTS.md file: the standing instructions coding agents read in that repo.

Install it, pinned
mdr add iohub/yagent/internal/http/AGENTS.md@git:20261026.7381d71

Pins git:20261026.7381d71 in mdr.lock. Pin the fingerprint instead.

Audit grade
A, 14 of 14 checks passed
Kind
AGENTS.md file
Repository
iohub/yagent
Path
internal/http/AGENTS.md
Versions recorded
4
Latest version
git:20261026.7381d71, committed Oct 26, 2026
First version recorded
Oct 21, 2026
Size
5,044 bytes
Repository stars
31
License
Apache-2.0

Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.

What the file says

# internal/http — REST / WebSocket 与任务生命周期

> 范围:本目录内不可派生的约束。全局见仓库根 `AGENTS.md` §6.9。

## 边界

gin REST + melody WebSocket + `TaskManager` 的任务生命周期。不负责暂停语义本身(在
`internal/pause`),不负责 Agent 装配(在 `internal/app`)。

## 硬约束

**1. 每个建任务 ctx 的地方都必须走 `NewTaskContext`**(`task_gate.go:33`)。闸门与并发域
**只挂在 ctx 上、不在结构体里另存一份**:`Task.Gate()` 是从 ctx 读回来的,`supervise.From(ctx)` 同理。
两处各存一份的话,任何"换了 ctx 忘了换闸门"的地方都会让 `/pause` 停在一个没人在等的闸门上——
那条路径没有报错,只是什么都不发生。漏用 `NewTaskContext` 不会静默失败(`/pause` 会拒绝并说明),
但表现是"这一条路径上的任务从来停不了",而它正是最常被新增的那条路径。
根是 `shutdown.Root()`(`:34`):一次 SIGINT/SIGTERM 就取消这里建出的**每一个**任务 ctx,
闸门与任务域跟着走。没装过信号处理器时 `Root()` 就是 `context.Background()`,
所以测试与库用法拿到的仍是旧行为——这条等价关系由 `task_shutdown_test.go:17` 发真信号钉住。

**2. 续跑分支换 ctx 就是换闸门**(`server.go:244-247`):旧闸门属于已经结束的那一轮,
留着只会停错对象。

**3. 锁不许跨过 IO。** 6 个状态点(`SetTaskResult/Error/Progress` + pause/continue/cancel)在
`tm.lock` 内**只编字节**,`taskAction.deliver` 在 Unlock 之后做 `Socket.Write`/`Broadcast`
(`task_manager.go:95-140,168-190,247-282,291-322,326-344`)。理由是一个卡住的浏览器标签能顶住
全部状态更新与读锁。要测这条不变量得能把 IO 卡住,所以有 `writeSession` / `melodyBroadcast` /
`flushHook` 三个 seam——**探针必须用不需要投递的路径**,否则带 socket 的 setter 会停在它自己的
…

Read the whole file at its exact version.

How to install

The exact contents, by fingerprint
mdr add iohub/yagent/internal/http/AGENTS.md@sha256:6725d11b334ddb45

The line at the top of this page pins the label git:20261026.7381d71, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.

Badge

mdr badge

[![mdr](https://markdownregistry.com/badge/art_wtqjm53redezjk35.svg)](https://markdownregistry.com/a/art_wtqjm53redezjk35)

2 badge image fetches in 30 days. What the badge shows.

Versions

The registry has recorded 4 versions of this file, between Oct 21, 2026 and Oct 26, 2026, about one every 2 days.

versioncommittedcommitsizeaudit
git:20261026.7381d71 latest2026-10-26 7381d71 5,044 BA view · diff
git:20261024.9b444412026-10-24 9b44441 4,494 BA view · diff
git:20261023.dd5a6e42026-10-23 dd5a6e4 3,730 BA view · diff
git:20261021.9f5bf872026-10-21 9f5bf87 3,739 BA view

Audit of the latest version

A  14 of 14 checks passed. Fixed automatic checks with no AI involved, so the same checks give the same answer every run.
  • pass: Size between 200 bytes and 200 KB (5044 bytes)
  • pass: No zero-width or bidi control characters
  • pass: No instruction hidden inside an HTML comment
  • pass: No link to an exfiltration or paste host
  • pass: No credential-shaped string
  • pass: No instruction to send local credentials anywhere
  • pass: No text hidden with inline styles
  • pass: No prompt-injection phrasing
  • pass: No curl or wget piped into a shell
  • pass: No recursive delete of root, home or parent
  • pass: No instruction to read or print local credentials
  • pass: No base64 blob over 200 characters
  • pass: No link to a raw IP address
  • pass: No script tag

Source

GitHub

iohub/yagent · 31 stars · license Apache-2.0 · pushed 2026-11-05 · branch main

API

GET https://markdownregistry.com/api/v1/artifacts/art_wtqjm53redezjk35
GET https://markdownregistry.com/api/v1/resolve?ref=iohub/yagent/internal/http/AGENTS.md
GET https://markdownregistry.com/api/v1/blob/6725d11b334ddb45a25e78a43ebd3fbf7fca9b949423a1095a24bb7b1012b415

Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.

Guides: how to write a good AGENTS.md · AGENTS.md vs CLAUDE.md · which agent file does what.

More from iohub/yagent

AGENTS.md AGENTS.md file
iohub/yagent · AGENTS.md
git:20261103.104f21a · audit A · 31 stars
AGENTS.md@internal AGENTS.md file
iohub/yagent · internal/AGENTS.md
git:20261026.7381d71 · audit A · 31 stars
AGENTS.md@internal/agents AGENTS.md file
iohub/yagent · internal/agents/AGENTS.md
git:20261103.104f21a · audit A · 31 stars
AGENTS.md@internal/agents/director AGENTS.md file
iohub/yagent · internal/agents/director/AGENTS.md
git:20261103.104f21a · audit A · 31 stars
AGENTS.md@internal/app AGENTS.md file
iohub/yagent · internal/app/AGENTS.md
git:20261024.9b44441 · audit A · 31 stars
AGENTS.md@internal/blackboard AGENTS.md file
iohub/yagent · internal/blackboard/AGENTS.md
git:20261026.89c0391 · audit A · 31 stars
AGENTS.md@internal/blueprint AGENTS.md file
iohub/yagent · internal/blueprint/AGENTS.md
git:20261026.9762922 · audit A · 31 stars
AGENTS.md@internal/browserctl AGENTS.md file
iohub/yagent · internal/browserctl/AGENTS.md
git:20261030.25a3126 · audit A · 31 stars
AGENTS.md@internal/compression AGENTS.md file
iohub/yagent · internal/compression/AGENTS.md
git:20261028.19903d6 · audit A · 31 stars
AGENTS.md@internal/config AGENTS.md file
iohub/yagent · internal/config/AGENTS.md
git:20261024.9b44441 · audit A · 31 stars
AGENTS.md@internal/llm AGENTS.md file
iohub/yagent · internal/llm/AGENTS.md
git:20261027.0637c8b · audit A · 31 stars
AGENTS.md@internal/mcp AGENTS.md file
iohub/yagent · internal/mcp/AGENTS.md
git:20261024.9b44441 · audit A · 31 stars

Every file in iohub/yagent

Browse by kind, by grade A, or by owner.