算法艺术创作
algorithmic-art
通过代码和可调参数创作生成艺术与交互式视觉效果。
du-dum【设计与创意】Separate expensive observation from cheap decision-making in autonomous agent loops using a two-clock architecture. A fast clock accumulates data into a digest file; a slow clock reads the digest and acts only when something is pending. Idle cycles cost nothing because the action clock returns immediately after reading an empty digest. Use when build…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
以二鐘分觀於行。疾鐘(析)廉收數而書簡牘,緩鐘(行)讀牘而定行否。牘告無待,則行鐘即出——閒時無費也。
名取心跳之韻:咚、咚。首跳(du)觀之,次跳(dum)行之。多時唯首跳而已。
分所有工於觀(廉、頻)與行(昂、罕)。
| 鐘 | 費之概 | 頻 | 例 |
|---|---|---|---|
| 疾(析) | 廉:API 讀、解文件、無 LLM | 日 4-6 次 | 掃 GitHub 通知、解 RSS、讀日誌 |
| 緩(行) | 昂:LLM 推斷、寫操作 | 日 1 次 | 擬應、更面、送警 |
得: 二列之分,各操作歸一鐘。疾鐘無 LLM 呼,緩鐘無採數。
敗則: 若一操作兼讀與 LLM(如「摘新事」),分之:疾鐘收原事入牘,緩鐘摘之。牘者,界也。
牘者,通二鐘之低帶訊也。宜簡、可讀於人、可解於機。
pending: none 或空節)牘構之例:
# Digest — 2026-03-22T06:30:00Z
## Pending
- PR #42 needs review response (opened 2h ago, author requested feedback)
- Issue #99 has new comment from maintainer (action: reply)
## Status
- Last analyzed: 2026-03-22T06:30:00Z
- Sources checked: github-notifications, rss-feed, error-log
- Items scanned: 14
- Items pending: 2
無待之時:
# Digest — 2026-03-22T06:30:00Z
## Pending
(none)
## Status
- Last analyzed: 2026-03-22T06:30:00Z
- Sources checked: github-notifications, rss-feed, error-log
- Items scanned: 8
- Items pending: 0
得: 一牘模板,待空二態明。行鐘察一字或一節即可定行否。
敗則: 若牘過大(逾五十行),疾鐘含原數過多。移其詳至別文,牘為摘與指也。
建隨疾程而行之觀本。
# Pseudocode: analyze-notifications.sh
fetch_notifications()
filter_actionable(notifications)
format_as_digest_entries(filtered)
atomic_write(digest_path, entries)
log("analyzed {count} notifications, {pending} actionable")
cron 程例:
# Fast clock: analyze every 4 hours
30 */4 * * * /path/to/analyze-notifications.sh >> /var/log/analysis.log 2>&1
0 6 * * * /path/to/analyze-pr-status.sh >> /var/log/analysis.log 2>&1
得: 一或數析本,各生或更牘。本獨立而運——一敗,諸本之節猶更。
敗則: 若源暫不可達,本宜記誤而留舊牘。勿於源敗時清牘——陳數勝於無數,以供行鐘。
建讀牘定行之本。
# Pseudocode: heartbeat.sh (the slow clock)
digest = read_file(digest_path)
if digest.pending is empty:
log("heartbeat: nothing pending, exiting")
exit(0)
# Only reaches here if work exists
response = call_llm(digest.pending, system_prompt)
execute_actions(response)
archive_digest(digest_path)
log("heartbeat: processed {count} items, cost: {tokens} tokens")
cron 程例:
# Slow clock: act once per day at 7am
0 7 * * * /path/to/heartbeat.sh >> /var/log/heartbeat.log 2>&1
得: 閒循時,行本一秒內出(唯讀一文察空)。活循時,處諸待事並清牘。
敗則: 若 LLM 呼敗,勿清牘。待事留於下循。可於牘設重試計以防永敗之無限試。
費省在閒察——行鐘須以最小耗明辨「無事」與「有事」。
# Minimal idle check
if grep -q "^(none)quot; "$DIGEST_PATH" || grep -q "pending: 0" "$DIGEST_PATH"; then
echo "$(date -u +%FT%TZ) heartbeat: idle" >> "$LOG_PATH"
exit 0
fi
得: 閒徑唯一讀一對。無網呼,無本身以外之進程開。
敗則: 若閒察不穩(誤肯致漏工、誤否致無益 LLM 呼),簡化牘式。頭置一布爾(has_pending: true/false)最可靠。
算預期之費以確二鐘之節省。
fast_runs = 24 / fast_interval_hoursfast_runs * cost_per_analysis_run(無 LLM 則近零)active_days_fraction * cost_per_action_run(1 - active_days_fraction) * cost_per_idle_check(近零)費較之例:
| 架構 | 日費(活) | 日費(閒) | 月費(八成閒) |
|---|---|---|---|
| 單環(每半時一 LLM) | $13.74/37h | $13.74/37h | ~$400 |
| 咚咚(六析一行) | $0.30 | $0.00 | ~$6 |
得: 費模示咚咚架構於閒日至少十倍廉於原。
敗則: 若費模未示顯著節省,或為:(甲)疾鐘過頻;(乙)疾鐘含隱 LLM 呼;(丙)系鮮閒。咚咚益於高閒比之系。若常活,簡輪詢或更宜。
manage-token-budget — 費控之框,咚咚使之可行;咚咚為架構,token budget 為計之層circuit-breaker-pattern — 處敗(工具破);咚咚處常(無事)。並用:咚咚司閒察,斷路司敗復observe — 疾鐘之觀法;咚咚結其於牘何時可行forage-resources — 策略探層;咚咚乃其所運行之節奏coordinate-reasoning — 臭跡信之式;牘乃臭跡(藉環境物之間接協調)