pyroduct

    把《伽达默尔与哈贝马斯真理观比较》与《通往宁静之路》建模为可运行、可测试的 MoonBit 状态机族(主体/多主体/群体/双层次社会交往),外加 Agent 状态机(进化层:变异/闸门/只追加账本)与科研 Agent 协调器。

    state-machine
    hermeneutics
    multi-agent
    causal-inference
    research-coordinator
    语料建模
    科研协调
    驱动槽
    执行契约
    Download zip
    Author
    Version
    0.1.13
    License
    MIT
    Last updated
    7 hours ago
    Downloads
    22

    #Pyroduct

    A runnable, tested MoonBit state-machine family modelled from two Chinese philosophy texts — 《通往宁静之路:个体道德发生论纲要》 (The Road to Tranquility: An Outline of the Genesis of Individual Morality) and its parent thesis 《伽达默尔与哈贝马斯真理观比较》 (Gadamer and Habermas on Truth: A Comparison, Shanghai Academy of Social Sciences, 2008) — plus a gated agent state machine and a research-agent coordinator.

    One subject: 34 positions · 53 transitions · 11 phases. One group: 20 · 42 · 9. One society: 13 · 26 · 8. Two subjects: 14 normative rules.

    #Features

    • Paper-executable, not paraphrased

      Every state, transition and phase is literal data with a page citation: gloss() ends in P.xx, and each construct is tagged 原文直述 (verbatim from the source) or 模型整理 (model reconstruction).

    • One language, four units

      Subject (主体) / group (群体) / society (社会) share the same state + trigger + transition vocabulary at three scales: src (34·53·11), group (20·42·9, member config → emergence with R7 write-back), society (13·26·8, lifeworld vs. system). multi is the normative face: rules R1–R14 for two subjects — regime precedence, validity-claim timing, the two-sincerity distinction (两诚区分), unconcealment–concealment (解蔽—遮蔽) — each rule citing the thesis.

    • Two-character names only

      Position and phase designations name a structural relation — nothing else. The discipline is locked by tests and printed by render_naming_table().

    • Drive slots and a step contract

      Trigger::slot sorts all 49 triggers into eight slots (Occasion 处境 / Orientation 取向 / Antecedent 先行 / Act 行动 / Feedback 反馈 / Hold 持存 / CoBeing 共在 / Unveil 揭蔽) with an exhaustive match — an unplaced trigger fails the build. step(position, slot) answers only Moved (迁) / Held (守) / Undecided (未定) / No-way (无路); of 272 position × slot combinations, 228 honestly answer No-way. The machine never invents a move.

    • An agent whose updates must clear a gate

      evolution treats an agent's config as Genome, enumerates single-step candidates (prompt / strategy / memory / code), writes "better" as an Objective, fences off constitutional invariants, and records every accept / reject / revert with its reason in an append-only, serializable Ledger. Gates come in two grades: hand-written weights, or a DoubleML causal effect (θ̂ > 0 and the 95% lower bound > 0). The subject cycle run_cycle drives real positions by drive slot and puts Cultivation (修习) and Opening (开放) through the same gate — no evidence, no advance (没有证据就不前进).

    • A coordinator that refuses to close

      coordinator adds what a research agent needs beyond a state machine: tasks and artifacts, planning over a dependency graph, external evidence judged by confidence interval (not by votes), content memory that keeps superseded findings, credit with IP provenance, and a deliberation / decision split — deliverables carry revision marks, residue ownership and reopen conditions. The runtime is replayable and persists to disk. (The "think" step is still a deterministic stand-in, no LLM yet.)

    • Dependency isolation

      Four named third-party dependencies, each confined to its consumer: moonbitlang/async@0.22.4 → cmd/coord (native disk I/O); riantr/moonbit_doubleML@0.75.0 → dmlref / causal; riantr/snn_mbt@0.84.0 → snnref (native); riantr/moonbit_static_analysis@0.1.0 → audit. Every other package uses official moonbitlang/* only.

    #Terminology

    Every construct carries a two-character Chinese designation, an English enum identifier, and the original wording (原文) it designates. The tables below are the complete English rendering of the vocabulary across the three scales (subject / group / society) and the normative layer.

    #Phases — subject (11)

    DesignationEnglishOriginal
    立位Natural本然
    自决Release自由的发生
    自成Becoming自身与拣选
    遭遇Otherness与他者相遇
    归责Bondage恶感·耻感·罪感·自缚
    受创Anguish痛苦与失落
    奠基Idolatry偶像与根基
    献身Glory崇高·激情·荣誉·敬畏
    反顾Recollection反思
    范导Upbringing修养之路
    安位Serenity宁静

    #Positions — subject (34)

    DesignationEnglishOriginal
    无忆NoPast失忆
    无筹NoFuture浑噩
    立位Standing站立
    自由Freedom自由
    紧迫Urgency紧迫感
    疏离Alienation疏离感
    空虚Emptiness空虚
    忙碌Busyness忙碌
    自身Selfhood独立的自身
    交织Weaving图画
    择取Choosing拣选
    相遇Encounter相遇
    敞开Opening敞开
    受挫Evil恶感
    自归Shame耻感
    失权Guilt罪感
    自缚Binding束缚
    隐没Secret秘密
    痛苦Suffering痛苦
    沉落Loss失落
    投射Idol偶像
    立序Ordered秩序
    崇奉Sublime崇高感
    激情Passion激情
    受赏Honor荣誉
    畏怖Awe敬畏
    惯习Habit习惯
    反顾Reflection审视
    眩晕Dizziness眩晕
    平衡Harmony和谐
    范型Model榜样
    图绘Marking标记
    修习Discipline修养
    宁静Tranquility宁静

    #Drive slots (8) and the 49 triggers

    EnglishDesignationCountTriggers
    Occasion处境6TakeStand, FeelFinitude, FeelBoundlessness, FuseFeelings, MustBeBusy, ColdHard
    Orientation取向6ChooseMoreLasting, Complexify, SeekMoreJoy, SeekBalance, SeekGoal, TakeModel
    Antecedent先行4TouchFuture, TryMethods, Approximate, WaitNext
    Act行动9ActInFreedom, BindSelf, Avoid, CutPast, SummonIdol, MarkGoodBad, RedrawMap, Endure, RemoveReefs
    Feedback反馈8Sting, BlameSelf, EnactOrder, AbsorbGlory, Reward, Dread, WidenFrontier, Ascend
    Hold持存8KeepContinuity, Deposit, TurnToResidue, Interweave, Surprise, Doubt, Linger, Habituate
    CoBeing共在3MeetOther, GoodFaith, OpenArms
    Unveil揭蔽5AttributeSelf, FillEmptiness, CoolDown, DoubtOneself, ReopenByHorizon

    #Step contract (4 outcomes)

    迁 Moved · 守 Held · 未定 Undecided · 无路 No-way

    #Group — phases (9)

    DesignationEnglishGloss
    聚散Gatheringa crowd with no bonds yet — the group is not yet a subject
    成体Bodiedcommon tongue and discourse give the group a body
    立序Orderingnorms raised from reason or tradition
    分歧Divergingdifference acknowledged, regimes clash, horizons close
    失度Excessthe third party handed to the absolute — projection, one voice
    自缚SelfBoundthe group binds itself and its members; the hidden becomes forbidden
    受损Impairedcollective wounds, dispersal
    修习Cultivatingreturn, endure, widen
    宁定Restingevery pair complete in the two sincerities; nothing absolutized

    #Group — states (20)

    DesignationEnglishPhase
    散在ScatteredGathering
    趋同ConvergingGathering
    共语CommonTongueBodied
    商谈DiscourseBodied
    规范NormedOrdering
    共识ConsensusOrdering
    歧见DissensusDiverging
    对峙ConfrontingDiverging
    割据PartitionedDiverging
    投射ProjectedExcess
    独白MonologicExcess
    规训DisciplinedSelfBound
    遮蔽ConcealedSelfBound
    创伤WoundedImpaired
    离散DispersedImpaired
    复归ReturningCultivating
    修习PracticingCultivating
    扩界WideningCultivating
    相契AttunedResting
    宁定SettledResting

    Group triggers (22): Appear, Attention, SharedMedium, RaiseClaims, NormFromTradition, NormFromReason, Agree, Differ, Clash, CloseHorizon, Absolutize, OneVoice, Bind, Suppress, Reopen, BreakUp, TurnBack, RemoveReefs, Widen, MutualCheng, Settle, Reenter.

    #Society — phases (8)

    DesignationEnglishGloss
    生活Lifethe lifeworld, organized by language
    语言Languagesupra-subjective (Gadamer) vs. intersubjective (Habermas)
    商谈Speechclaims raised, filtered, justified, turned into consensus
    规范Rulenorms set by practical discourse carry a "past tense" label
    缺口Aporiathe third party is impossible in reality — the utopian fate
    系统Instrumentthe system, mediated by money and power
    殖民Dominationinner colonization of the lifeworld; distorted communication
    复建Rebuildrebuild the distorted communicative realm

    #Society — states (13)

    DesignationEnglishPhase
    世界WorldLife
    超体SuprasubjectiveLanguage
    间性IntersubjectiveLanguage
    主张ClaimSpeech
    商谈DiscourseSpeech
    辩护JustificationSpeech
    共识ConsensusSpeech
    规范NormRule
    缺口GapAporia
    系统SystemInstrument
    殖民ColonyDomination
    扭曲DistortionDomination
    重建ReconstructionRebuild

    Society triggers (18): SpeakLanguage, BuildIntersubjective, RaiseClaims, EnterDiscourse, Filter, Justify, Subsume, Store, EnactNorm, LabelPast, DemandThird, Serve, Expand, Colonize, Distort, Hinder, Reconstruct, Circulate.

    #Truth regimes (5) · discourse types (4) · validity claims (4)

    DesignationEnglishGloss
    内在秩序Immanenttruth as an eternal order already in the world (ancient Egypt)
    逻各斯Logostruth as eternal speech, guaranteed by the rational soul (ancient Greece)
    超主体性SuperSubjectiveGadamer: understanding and language are supra-subjective events
    主体间性InterSubjectiveHabermas: truth is intersubjective validity claims, woven into a net
    诚然ChengRanthe author's own scheme: a hermeneutics of sincerity, unified in self-illumination

    DesignationEnglish
    理论商谈Theoretical
    实践商谈Practical
    表达性商谈Aesthetic
    信仰商谈Faith

    DesignationEnglishClaim
    真实性Truthfulnesspropositional truth — objective world
    正当性Legitimacynormative rightness — social world
    他之诚Authenticityspeech-content congruence (other-sincerity)
    己之诚Sincerityact–intention congruence (self-sincerity)

    Claim phases: 事前 Before · 事中 During · 事后 After.

    #Normative rules R1–R14

    CodeDesignationEnglish
    R1体制优先Regime precedence
    R2不独断No dogmatism
    R3解蔽—遮蔽Unconcealment–concealment
    R4有效性时序Validity-claim timing
    R5两诚区分Two-sincerity distinction
    R6弃符合论、存方法Drop correspondence, keep method
    R7构成性Constitutivity
    R8第三者The third party
    R9商谈类型Discourse types
    R10谬误残余Error residue
    R11不可闭合Never closed
    R12诚然相契ChengRan resonance
    R13横检纵共Horizontal review, vertical commonality
    R14共识即建议Consensus as suggestion

    #Packages

    src (subject machine) · multi (normative rules) · group (group emergence) · society (two-level social model) · ml (from-scratch DoubleML) · evolution (agent state machine) · coordinator (research-agent runtime) · dmlref (external cross-check) · causal (causal diagnostics) · audit (three-mirror static audit) · snnref (spike-sediment experiment).

    #Discipline terms

    原文直述 verbatim from the source · 模型整理 model reconstruction · 两诚 two sincerities · 解蔽—遮蔽 unconcealment–concealment · 没有证据就不前进 no evidence, no advance · 双诚之比 two-sincerity ratio · 同判·不重裁 same verdict, not re-adjudicated · 三鉴 three mirrors (structure / type / behavior) · 往返一致 round-trips identically.

    #Quick Start

    Add the module, then run the suite:

    moon add riantr/pyroduct moon test # Total tests: 105, passed: 105, failed: 0.

    From this repository, every layer prints a report:

    moon run cmd/main -- report # subject state machine moon run cmd/main -- slots # drive slots: 49 triggers → 8 slots moon run cmd/main -- multi # normative rules R1–R14 + scenarios moon run cmd/main -- group # group state machine moon run cmd/main -- society # two-level social model moon run cmd/main -- evolution # mutation / fitness / gate / persistence / heredity moon run cmd/main -- cycle # subject cycle: position × slot × causal feedback moon run cmd/main -- coordinator # research-agent coordinator moon run --target native cmd/coord # real disk I/O: checkpoint round-trips identically

    #Example

    // Subject: positions, main line, drive slots, step contract
    let states : Array[@src.SubjectState] = @src.all_states() // 34 of them
    let ok : Bool = @src.reachable(@src.initial(), @src.terminal())
    let moved : @src.Outcome = @src.step(@src.Standing, @src.Occasion) // Moved

    // One encounter of two subjects: regime, two sincerities, and claim timing all adjudicate
    let me = @multi.subject(1, @multi.rendezvous(), @multi.InterSubjective, 70, 70, 9)
    let other = @multi.subject(2, @multi.rendezvous(), @multi.ChengRan, 80, 80, 9)
    let claim : @multi.ValidityClaim = { kind: @multi.Truthfulness, phase: @multi.During }
    let out = @multi.encounter(me, other, @multi.Theoretical, claim)

    // Society: two invariants locked by tests
    let never_closes : Bool = @society.no_final_closure()

    // Agent state machine: enumerate candidates → gate → append-only ledger
    let agent = @evolution.default_agent()
    let ledger = @evolution.evolve(agent, @evolution.default_world(),
    @evolution.Weighted(@evolution.truth_objective()), 3)

    // Coordinator: run a demo study, write / read back the checkpoint
    let rt = @coordinator.new_runtime()
    ignore(rt.step(@coordinator.demo_tasks(), @coordinator.demo_questions(),
    @coordinator.demo_workers(), @coordinator.demo_datasets(),
    @coordinator.demo_world(), @coordinator.demo_parent(),
    @coordinator.demo_candidate()))
    let restored = @coordinator.restore(rt.checkpoint())
    let same : Bool = restored.round_trips()

    #Used By

    • cmd/main — the report entry for every layer above: report / slots / multi / group / society / evolution / cycle / coordinator, plus mermaid / dot / genesis / course / naming / principle / all.
    • cmd/coord — a native binary that runs the coordinator and round-trips its checkpoint through real disk I/O (.openseek/, gitignored).

    #Attribution

    • Source text: 任勇祥《伽达默尔与哈贝马斯真理观比较》(Shanghai Academy of Social Sciences, 2008) and its appendix 《通往宁静之路:个体道德发生论纲要》. Every construct in the model cites the chapter / section / page of that text and explicitly distinguishes 原文直述 (verbatim from the source) from 模型整理 (model reconstruction).
    • License: MIT (see LICENSE).