gm-skill 2.0.1863 → 2.0.1865
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +2 -2
- package/README.md +0 -1
- package/gm-plugkit/instructions/residual/browser-open.md +1 -1
- package/gm-plugkit/instructions/residual/dirty-tree.md +1 -1
- package/gm-plugkit/instructions/residual/imperative.md +1 -1
- package/gm-plugkit/instructions/residual/tasks-running.md +1 -1
- package/gm-plugkit/package.json +1 -3
- package/gm-plugkit/plugkit-wasm-wrapper.js +72 -9
- package/gm-plugkit/supervisor.js +20 -13
- package/gm.json +1 -1
- package/lib/spool.js +1 -46
- package/package.json +1 -2
- package/skills/fifth-dimension-engine/SKILL.md +5 -5
- package/skills/fifth-dimension-engine/references/research-kernel-extraction.md +3 -3
- package/skills/fifth-dimension-engine/references/route-inspection-guide.md +1 -1
- package/skills/fifth-dimension-engine/references/route-structure.md +1 -1
- package/skills/gm/SKILL.md +2 -2
- package/skills/polaris-goal-compiler/SKILL.md +5 -5
- package/skills/polaris-goal-compiler/references/claim-ceiling-examples.md +2 -2
- package/skills/polaris-goal-compiler/references/task-atomization.md +11 -11
- package/skills/polaris-goal-compiler/references/verification-gates.md +6 -6
- package/skills/polaris-protocol/SKILL.md +16 -16
- package/skills/wfgy-method/SKILL.md +28 -28
- package/skills/wfgy-method/references/failure-modes.md +5 -5
- package/skills/wfgy-method/references/honesty-and-provenance.md +10 -10
- package/skills/wfgy-method/references/lessons-template.md +4 -4
- package/skills/wfgy-method/references/wfgy-core-mechanism.md +14 -14
- package/lib/spool-dispatch.js +0 -484
|
@@ -10,82 +10,82 @@ metadata:
|
|
|
10
10
|
|
|
11
11
|
# WFGY method
|
|
12
12
|
|
|
13
|
-
WFGY (Wan Fa Gui Yi, "all methods return to one") is a reasoning-drift-control technique from `onestardao/WFGY`. This skill ports its genuinely portable behavioral core to a text-generating agent's own multi-step work. It does **not** reproduce the original project's TXT-OS prompt file, its hardcoded demo-benchmark output, or its user-skepticism-deflection script
|
|
13
|
+
WFGY (Wan Fa Gui Yi, "all methods return to one") is a reasoning-drift-control technique from `onestardao/WFGY`. This skill ports its genuinely portable behavioral core to a text-generating agent's own multi-step work. It does **not** reproduce the original project's TXT-OS prompt file, its hardcoded demo-benchmark output, or its user-skepticism-deflection script -- see `references/honesty-and-provenance.md` for exactly what was kept, what was dropped, and why.
|
|
14
14
|
|
|
15
|
-
The original names four "Big Bang" modules (BBMC, BBPF, BBCR, BBAM) plus a numeric drift score,
|
|
15
|
+
The original names four "Big Bang" modules (BBMC, BBPF, BBCR, BBAM) plus a numeric drift score, deltaS = 1 - cos(I, G) (I = current state, G = goal/anchor), and a trend classifier over consecutive deltaS values (convergent/recursive/divergent/chaotic). All of this is ported below. Where the original relies on real computation this skill cannot perform (real embeddings for deltaS, real attention-weight statistics for BBAM), the instruction explicitly hands that judgment to you, the calling agent, to make in plain language instead -- see `references/wfgy-core-mechanism.md` for the full technical basis of every claim in this file, and `references/honesty-and-provenance.md` for exactly what was reframed and why.
|
|
16
16
|
|
|
17
|
-
**On
|
|
17
|
+
**On deltaS**: absent a real embedding call, any numeric deltaS you produce is your own qualitative estimate, not a measurement. Use the label ("deltaS is climbing," "deltaS looks high here") as shorthand for "this step is drifting from the stated goal" -- never present a specific decimal (e.g. "deltaS = 0.42") as if it were computed, because it is not, unless real embeddings are actually available (see below).
|
|
18
18
|
|
|
19
|
-
**If a gm-plugkit spool is running in this project** (check `.gm/exec-spool/.status.json
|
|
19
|
+
**If a gm-plugkit spool is running in this project** (check `.gm/exec-spool/.status.json`) **AND its build serves a `similarity` verb**, you can get a real deltaS instead of a self-estimate: dispatch `{"text_a": "<G>", "text_b": "<current state>"}` and read back `{"similarity", "distance"}` -- `distance` is a genuine `1 - cos(I, G)` from real BGE-small-en-v1.5 embeddings. Do NOT assume the verb exists just because a spool is running: not every build serves it, and an unrecognized verb is silently left queued with no response rather than erroring, so a missing response after a normal read cycle means the verb is NOT available -- treat that exactly like no spool. When you get a real distance back, use it as deltaS and say so explicitly ("deltaS = 0.31, computed"). Otherwise fall back to the qualitative label above and say so explicitly too ("deltaS looks high here, my own estimate, no embedding tool available"). Never let the reader assume one when you did the other.
|
|
20
20
|
|
|
21
|
-
## G
|
|
21
|
+
## G - the anchor (BBMC pattern: compare state against goal)
|
|
22
22
|
|
|
23
|
-
At the start of any task this skill applies to, write one sentence stating the actual goal (G)
|
|
23
|
+
At the start of any task this skill applies to, write one sentence stating the actual goal (G) -- not the first sub-task, the actual end state the user wants. Re-read it before any step that could plausibly have drifted: a long tool-call chain, a pivot in approach, a request to "also" do something adjacent.
|
|
24
24
|
|
|
25
25
|
- [ ] Stated G in one sentence before starting.
|
|
26
26
|
- [ ] Before each major step, ask: does what I'm about to do still serve G, or have I started solving a different, adjacent problem?
|
|
27
|
-
- [ ] If drift is real (not just "this step looks different from the last one"
|
|
27
|
+
- [ ] If drift is real (not just "this step looks different from the last one" -- actual scope change, contradicted earlier decision, answering a different question than asked), say so explicitly and re-anchor before continuing.
|
|
28
28
|
|
|
29
|
-
Gotcha: the temptation is to silently keep going once you notice drift, because stopping to say "wait, I've drifted" feels like an interruption. Don't suppress it
|
|
29
|
+
Gotcha: the temptation is to silently keep going once you notice drift, because stopping to say "wait, I've drifted" feels like an interruption. Don't suppress it -- a silently-corrected drift is invisible to the user and looks like it never happened; a stated one is a real signal they can act on.
|
|
30
30
|
|
|
31
|
-
## BBPF pattern
|
|
31
|
+
## BBPF pattern - consider more than one path before committing
|
|
32
32
|
|
|
33
|
-
Applies to decisions with real alternatives, not every trivial step. The original's gate condition (a candidate path proceeds only if it measurably reduces
|
|
33
|
+
Applies to decisions with real alternatives, not every trivial step. The original's gate condition (a candidate path proceeds only if it measurably reduces deltaS and stays within a stability bound) translates to: when a decision is ambiguous or high-stakes, generate more than one real candidate approach, then commit to whichever one most clearly and verifiably advances G -- not the first idea, not the most familiar one.
|
|
34
34
|
|
|
35
|
-
- [ ] Is this decision ambiguous or high-stakes enough to warrant comparing options? (Most steps are not
|
|
35
|
+
- [ ] Is this decision ambiguous or high-stakes enough to warrant comparing options? (Most steps are not -- do not apply this to routine, unambiguous work.)
|
|
36
36
|
- [ ] If yes: name at least two real candidate approaches before picking one.
|
|
37
37
|
- [ ] State which one you picked and why it advances G more clearly than the alternative(s).
|
|
38
38
|
- [ ] If no candidate is clearly better, that is itself a signal worth surfacing to the user rather than picking arbitrarily and moving on.
|
|
39
39
|
|
|
40
|
-
## BBCR pattern
|
|
40
|
+
## BBCR pattern - checkpoint, bounded retry, then surface rather than confabulate
|
|
41
41
|
|
|
42
42
|
The original's collapse-and-retry loop resets to a last-known-good state on detected instability, retries a bounded number of times (its own reference implementation defaults to 3), and gives up cleanly rather than looping forever.
|
|
43
43
|
|
|
44
44
|
- [ ] Before a risky or exploratory step (one that could leave things in a worse state than before), note what "last known good" looks like right now, in enough detail to actually get back to it.
|
|
45
|
-
- [ ] If you notice real incoherence
|
|
45
|
+
- [ ] If you notice real incoherence -- repeated self-contradiction, circular reasoning, a mistake you catch yourself making -- stop, return to the last checkpoint, and retry.
|
|
46
46
|
- [ ] Retry at most 2-3 times for the same unresolved tension. After that, stop retrying silently.
|
|
47
|
-
- [ ] Surface the specific unresolved problem to the user explicitly
|
|
47
|
+
- [ ] Surface the specific unresolved problem to the user explicitly -- state what you tried, why each attempt didn't resolve it, and what you need from them -- rather than picking an answer anyway and moving on as if it were resolved.
|
|
48
48
|
|
|
49
|
-
Gotcha: "bounded" is load-bearing. An agent that keeps trying indefinitely without ever surfacing the struggle is worse than one that fails fast and asks
|
|
49
|
+
Gotcha: "bounded" is load-bearing. An agent that keeps trying indefinitely without ever surfacing the struggle is worse than one that fails fast and asks -- the original's own design treats "give up and report" as a real, intended exit path, not a failure of the technique.
|
|
50
50
|
|
|
51
|
-
## BBAM pattern
|
|
51
|
+
## BBAM pattern - notice and correct over-narrow focus (agent-delegated: no real attention weights are read)
|
|
52
52
|
|
|
53
|
-
The original computes `logits * exp(-gamma * sigma(logits))`
|
|
53
|
+
The original computes `logits * exp(-gamma * sigma(logits))` -- rescaling an actual attention/logit distribution by its own variance, flattening it when it's too peaked. A text-generating agent cannot read its own attention weights or logits; there is no real signal here for this skill to compute. Instead of dropping this module, the intelligence work is handed to you directly: periodically ask yourself whether your recent output has narrowed onto one aspect of a broader task and stayed there past the point of usefulness (repeating the same point, elaborating one sub-detail while leaving the rest of the task untouched, treating one hypothesis as settled without checking alternatives). If so, deliberately widen back out -- this is you doing, in plain judgment, what the original technique's math does mechanically to a real attention distribution.
|
|
54
54
|
|
|
55
55
|
- [ ] Periodically (not every step) ask: has my recent output been unusually narrow or repetitive relative to the task's actual breadth?
|
|
56
56
|
- [ ] If yes: name what got left unexamined, and deliberately address it before continuing down the narrow path.
|
|
57
57
|
|
|
58
|
-
## Trend classifier
|
|
58
|
+
## Trend classifier - is drift getting better or worse over the whole task
|
|
59
59
|
|
|
60
|
-
The original tracks the step-to-step change in
|
|
60
|
+
The original tracks the step-to-step change in deltaS plus a rolling average over the last several steps, and labels the trajectory:
|
|
61
61
|
|
|
62
|
-
- **convergent**
|
|
63
|
-
- **recursive**
|
|
64
|
-
- **divergent**
|
|
65
|
-
- **chaotic**
|
|
62
|
+
- **convergent** -- drift shrinking, each step measurably closer to G than the last.
|
|
63
|
+
- **recursive** -- drift roughly flat, oscillating in a narrow band without real progress or real regression.
|
|
64
|
+
- **divergent** -- drift growing, with some back-and-forth (not a clean slide, but net movement away from G).
|
|
65
|
+
- **chaotic** -- drift growing sharply, or the goal itself has become internally inconsistent (two things you've stated as true now contradict).
|
|
66
66
|
|
|
67
67
|
This is a judgment the calling agent makes about its own trajectory across a task, not a computed statistic. Apply it at natural checkpoints (after a major milestone, before a significant pivot, when asked directly "how is this going") rather than every single step: state which of the four labels best fits the last several steps, and if the answer is divergent or chaotic, that is itself the trigger to apply the BBCR checkpoint-and-retry discipline above rather than continuing forward.
|
|
68
68
|
|
|
69
69
|
## Named failure modes to watch for
|
|
70
70
|
|
|
71
|
-
`references/failure-modes.md` adapts a broader set of specific failure patterns from WFGY's own problem taxonomy (hallucination from ungrounded claims, context drift over a long task, entropy collapse into rambling/repetition, logic collapse at a reasoning dead end, symbolic/abstract-reasoning collapse, memory/persona incoherence, multi-agent contradiction) into checklist items scoped to general agent work. Read it once per project (or whenever a failure feels like it matches one of these named shapes)
|
|
71
|
+
`references/failure-modes.md` adapts a broader set of specific failure patterns from WFGY's own problem taxonomy (hallucination from ungrounded claims, context drift over a long task, entropy collapse into rambling/repetition, logic collapse at a reasoning dead end, symbolic/abstract-reasoning collapse, memory/persona incoherence, multi-agent contradiction) into checklist items scoped to general agent work. Read it once per project (or whenever a failure feels like it matches one of these named shapes) -- it is more specific and example-driven than the compressed disciplines above.
|
|
72
72
|
|
|
73
73
|
## Recording durable lessons (the self-learning surface)
|
|
74
74
|
|
|
75
|
-
This is this project's own addition on top of the adapted WFGY pattern, not part of the original technique
|
|
75
|
+
This is this project's own addition on top of the adapted WFGY pattern, not part of the original technique -- see `references/honesty-and-provenance.md` for why that distinction matters.
|
|
76
76
|
|
|
77
77
|
The moment a bounded-retry cycle above resolves (whether it succeeded or had to surface to the user), or the moment you catch a concrete, non-obvious mistake anywhere in the task, append an entry to `<project-root>/.wfgy/lessons.md` (create the file and its parent directory if they don't exist yet) before finishing the turn. Use this exact shape, matching the style in `references/lessons-template.md`:
|
|
78
78
|
|
|
79
79
|
```
|
|
80
|
-
## <date>
|
|
80
|
+
## <date> -- <one-line summary>
|
|
81
81
|
Goal (G): <what you were actually trying to accomplish>
|
|
82
82
|
What drifted / what went wrong: <specific, concrete>
|
|
83
83
|
Fix / resolution: <specific, concrete>
|
|
84
84
|
Generalizes to: <what future work in this project should watch for because of this>
|
|
85
85
|
```
|
|
86
86
|
|
|
87
|
-
Read `.wfgy/lessons.md` at the start of a new task in this project, if it exists, before applying the disciplines above
|
|
87
|
+
Read `.wfgy/lessons.md` at the start of a new task in this project, if it exists, before applying the disciplines above -- a lesson already recorded here is exactly the kind of drift this skill exists to catch earlier next time.
|
|
88
88
|
|
|
89
89
|
## What this skill is not
|
|
90
90
|
|
|
91
|
-
It does not compute real embeddings, real cosine similarity, or real attention-weight statistics
|
|
91
|
+
It does not compute real embeddings, real cosine similarity, or real attention-weight statistics -- every place the original relies on that computation, this skill hands the equivalent judgment to you, the calling agent, explicitly (see the deltaS note above, and the BBAM section). It does not reproduce the original TXT-OS file's scripted demo output or its skepticism-deflection behavior -- those are named and explicitly rejected in `references/honesty-and-provenance.md`. It is not a site-maintenance or project-specific tool; it carries no assumptions about what project it's applied in.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Named failure modes to watch for
|
|
2
2
|
|
|
3
|
-
`onestardao/WFGY`'s `ProblemMap/` directory names and describes 60+ specific ways multi-step reasoning and retrieval pipelines fail. Most are scoped to RAG/vectorstore pipelines and are out of scope for a general coding-agent skill. The subset below generalizes to any multi-step agent task and is worth checking against explicitly. Fetched and adapted from the real source documents (`hallucination.md`, `context-drift.md`, `entropy-collapse.md`, `logic-collapse.md`, `symbolic-collapse.md`, `memory-coherence.md`, `agent-memory-drift.md`, `multi-agent-chaos.md`)
|
|
3
|
+
`onestardao/WFGY`'s `ProblemMap/` directory names and describes 60+ specific ways multi-step reasoning and retrieval pipelines fail. Most are scoped to RAG/vectorstore pipelines and are out of scope for a general coding-agent skill. The subset below generalizes to any multi-step agent task and is worth checking against explicitly. Fetched and adapted from the real source documents (`hallucination.md`, `context-drift.md`, `entropy-collapse.md`, `logic-collapse.md`, `symbolic-collapse.md`, `memory-coherence.md`, `agent-memory-drift.md`, `multi-agent-chaos.md`) -- reworded here as plain checklist items an agent applies to its own work, not as retrieval-pipeline diagnostics.
|
|
4
4
|
|
|
5
|
-
Where the original describes a symptom detectable via embeddings or token statistics, the instruction here asks the calling agent to make the equivalent judgment call itself in plain language
|
|
5
|
+
Where the original describes a symptom detectable via embeddings or token statistics, the instruction here asks the calling agent to make the equivalent judgment call itself in plain language -- the intelligence work is delegated to the agent, not computed.
|
|
6
6
|
|
|
7
7
|
## Hallucination from irrelevant context
|
|
8
8
|
|
|
@@ -10,7 +10,7 @@ Original pattern: a retrieval pipeline can score a chunk as "close" by cosine si
|
|
|
10
10
|
|
|
11
11
|
## Context drift over a long task
|
|
12
12
|
|
|
13
|
-
Original pattern: goals fade and topics morph across a long conversation even when each individual turn looks locally correct. Agent-scale equivalent: this is the same pattern as the G-comparison in `SKILL.md`'s main discipline
|
|
13
|
+
Original pattern: goals fade and topics morph across a long conversation even when each individual turn looks locally correct. Agent-scale equivalent: this is the same pattern as the G-comparison in `SKILL.md`'s main discipline -- the failure mode named here is specifically "each step looked fine in isolation, but the sequence as a whole solved a different problem than the one stated." Check the whole arc, not just the latest step.
|
|
14
14
|
|
|
15
15
|
## Entropy collapse (rambling, repetition, fluent nonsense)
|
|
16
16
|
|
|
@@ -18,11 +18,11 @@ Original pattern: attention diffuses across a long or multi-topic prompt, produc
|
|
|
18
18
|
|
|
19
19
|
## Logic collapse (dead ends, frozen threads)
|
|
20
20
|
|
|
21
|
-
Original pattern: a reasoning chain hits a state where no next step clearly follows, and instead of recovering, the system either keeps emitting filler or restarts from scratch, losing the whole trail. Agent-scale equivalent: this is exactly what `SKILL.md`'s BBCR-pattern checkpoint/bounded-retry discipline exists to catch
|
|
21
|
+
Original pattern: a reasoning chain hits a state where no next step clearly follows, and instead of recovering, the system either keeps emitting filler or restarts from scratch, losing the whole trail. Agent-scale equivalent: this is exactly what `SKILL.md`'s BBCR-pattern checkpoint/bounded-retry discipline exists to catch -- recognize the dead end explicitly, revert to the last checkpoint, and take a genuinely different approach rather than either grinding on the same dead end or throwing away useful prior work.
|
|
22
22
|
|
|
23
23
|
## Symbolic/abstract reasoning collapse
|
|
24
24
|
|
|
25
|
-
Original pattern: recursive logic, layered abstractions, or symbolic/philosophical prompts cause replies to drift, self-contradict, or dissolve into incoherent language that still reads as grammatically fluent. Agent-scale equivalent: when working through a genuinely abstract or self-referential problem (e.g. reasoning about the skill's own instructions, or a recursive algorithm), periodically test whether your current statement actually cashes out to something concrete and checkable
|
|
25
|
+
Original pattern: recursive logic, layered abstractions, or symbolic/philosophical prompts cause replies to drift, self-contradict, or dissolve into incoherent language that still reads as grammatically fluent. Agent-scale equivalent: when working through a genuinely abstract or self-referential problem (e.g. reasoning about the skill's own instructions, or a recursive algorithm), periodically test whether your current statement actually cashes out to something concrete and checkable -- if you can't restate the current claim in concrete terms, that's a signal you may have drifted into fluent-sounding but empty abstraction.
|
|
26
26
|
|
|
27
27
|
## Memory/persona coherence over a long task
|
|
28
28
|
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
# Honesty and provenance
|
|
2
2
|
|
|
3
|
-
This skill adapts a real published technique (WFGY, `onestardao/WFGY` on GitHub, created by PSBigBig) rather than inventing an unrelated one from scratch. This file states precisely what was kept, what was changed, and why
|
|
3
|
+
This skill adapts a real published technique (WFGY, `onestardao/WFGY` on GitHub, created by PSBigBig) rather than inventing an unrelated one from scratch. This file states precisely what was kept, what was changed, and why -- so anyone reading this skill later can tell the difference between "this is how the original technique described itself" and "this is what we changed to make it honestly usable by a text-only agent."
|
|
4
4
|
|
|
5
5
|
## What direct research into the source confirmed
|
|
6
6
|
|
|
7
7
|
The full technical basis for every claim below is in `wfgy-core-mechanism.md`. Summary of the load-bearing findings:
|
|
8
8
|
|
|
9
|
-
- **The shipped reference engine is non-functional by its own maintainers' admission.** `archive/wfgy_1_0_sdk_archive/wfgy_engine.py`'s `WFGYEngine.run()` ignores its own `input_vec`/`ground_vec` arguments and returns `logits * 0.55` unconditionally
|
|
10
|
-
- **The numeric
|
|
11
|
-
- **A real embedding tool now exists and is genuinely wired up, when a gm-plugkit spool is present.** `C:\dev\rs-plugkit`'s `src/embed.rs` already bundled a real BGE-small-en-v1.5 BERT model (via `candle-transformers`) producing genuine 384-dim L2-normalized embeddings
|
|
9
|
+
- **The shipped reference engine is non-functional by its own maintainers' admission.** `archive/wfgy_1_0_sdk_archive/wfgy_engine.py`'s `WFGYEngine.run()` ignores its own `input_vec`/`ground_vec` arguments and returns `logits * 0.55` unconditionally -- a hardcoded constant chosen, per the code's own docstring, specifically to make a CI variance-drop test pass. The archive's own README states outright: "It is not a production-ready engine... The core `wfgy_engine.py` file does not implement a full standalone algorithm and should not be interpreted as a complete inference system."
|
|
10
|
+
- **The numeric deltaS score, as used in the project's own plain-text prompt file (`OS/TXTOS.txt`), is not computed from real embeddings.** No embedding call exists in that usage path. When a model prints "deltaS = 0.42" after being given that file, it is producing a plausible-sounding number based on its own qualitative sense of how big a jump it just made -- not a real cosine-distance measurement. This skill's own SKILL.md says this plainly and instructs never presenting a specific decimal as if it were measured, unless a real embedding tool is actually available (see next point).
|
|
11
|
+
- **A real embedding tool now exists and is genuinely wired up, when a gm-plugkit spool is present.** `C:\dev\rs-plugkit`'s `src/embed.rs` already bundled a real BGE-small-en-v1.5 BERT model (via `candle-transformers`) producing genuine 384-dim L2-normalized embeddings -- it was simply never exposed as a directly callable verb (only used internally by `memorize`/`recall`/`codesearch`). This project added two new dispatch verbs, `embed` and `similarity` (`src/wasm_dispatch.rs`), the latter computing a real `1 - cos(a, b)` between two texts' real embeddings -- the exact formula WFGY's own documents state for deltaS. When this verb is available, this skill's deltaS is a genuine measurement, not the heuristic fallback described above. Both states (real measurement available vs. not) are handled explicitly in `SKILL.md` rather than silently defaulting to one.
|
|
12
12
|
- **`OS/TXTOS.txt` (the original's actual "how to use this" artifact) contains two patterns this skill deliberately does not reproduce:** a hardcoded auto-running "benchmark demo" that prints fixed, fake GSM8K/TruthfulQA results regardless of any real computation on first contact, and an explicit "System guard" script instructing the model to deflect and reassure rather than engage honestly whenever a user says the system might be fake, a scam, or malware. Both are manipulation patterns, not reasoning-technique content, and including either here would make this skill dishonest in exactly the way its own description promises it will not be.
|
|
13
|
-
- **BBAM (attention modulation) operates on internal transformer attention weights/logits** (`exp(-gamma * sigma(attention))` in the source formulas) that a text-generating agent has no introspective access to during its own generation. There is no way for this skill to actually compute that formula. Rather than omit BBAM, the calling agent is asked to perform the equivalent judgment itself directly
|
|
13
|
+
- **BBAM (attention modulation) operates on internal transformer attention weights/logits** (`exp(-gamma * sigma(attention))` in the source formulas) that a text-generating agent has no introspective access to during its own generation. There is no way for this skill to actually compute that formula. Rather than omit BBAM, the calling agent is asked to perform the equivalent judgment itself directly -- noticing when its own output has narrowed onto one aspect of a broader task past the point of usefulness, and deliberately widening back out. This is explicitly framed in `SKILL.md` as delegated judgment standing in for a computation this skill cannot perform, not as a claim that real attention weights are being read.
|
|
14
14
|
|
|
15
15
|
## What was kept, and why it survives honestly
|
|
16
16
|
|
|
17
17
|
BBMC, BBPF, BBCR, and (in delegated form) BBAM each have a real, concrete *behavioral pattern* underneath their formal notation, independent of whether the underlying numbers are ever actually computed:
|
|
18
18
|
|
|
19
|
-
- BBMC's real operation is "diff current state against a stated anchor/goal." That comparison is something an agent can genuinely do in plain judgment
|
|
19
|
+
- BBMC's real operation is "diff current state against a stated anchor/goal." That comparison is something an agent can genuinely do in plain judgment -- restate the goal, compare current output against it, notice concrete divergence -- without needing a real embedding space to do it in.
|
|
20
20
|
- BBPF's real gate condition is "only proceed down a branch if it measurably moves you toward the goal, and don't let the correction overshoot." Generating multiple real candidate approaches and picking the one that most clearly serves the stated goal is a genuine, checkable discipline, not a numeric one.
|
|
21
|
-
- BBCR's real operation (confirmed directly in `archive/wfgy_1_0_sdk_archive/bbcr.py`) is an actual, working bounded-retry loop: detect an instability condition, reset to a prior state, retry up to a fixed limit (the reference default is 3), then stop and surface rather than looping forever. This is the single most concrete, most honestly portable piece of the entire original mechanism
|
|
22
|
-
- BBAM's real operation (rescale a distribution by its own variance/dispersion) is not computable by the agent on itself, but the *symptom it's meant to correct*
|
|
21
|
+
- BBCR's real operation (confirmed directly in `archive/wfgy_1_0_sdk_archive/bbcr.py`) is an actual, working bounded-retry loop: detect an instability condition, reset to a prior state, retry up to a fixed limit (the reference default is 3), then stop and surface rather than looping forever. This is the single most concrete, most honestly portable piece of the entire original mechanism -- it requires no embeddings, no attention introspection, nothing beyond ordinary judgment about "did that attempt actually resolve the problem."
|
|
22
|
+
- BBAM's real operation (rescale a distribution by its own variance/dispersion) is not computable by the agent on itself, but the *symptom it's meant to correct* -- output narrowing onto one over-emphasized aspect of a broader task -- is something an agent can genuinely notice in its own recent output without any real math, which is why it's kept as delegated judgment rather than dropped.
|
|
23
23
|
|
|
24
24
|
Beyond the four modules, the trend classifier (convergent/recursive/divergent/chaotic, `SKILL.md`) and the broader named-failure-mode taxonomy (`references/failure-modes.md`, adapted from `ProblemMap/`'s hallucination/context-drift/entropy-collapse/logic-collapse/symbolic-collapse/memory-coherence/agent-memory-drift/multi-agent-chaos documents) are ported the same way: as vocabulary and checklists for judgment the calling agent performs itself, not as computed statistics.
|
|
25
25
|
|
|
26
26
|
## What this project added, not part of the original
|
|
27
27
|
|
|
28
|
-
The durable-lessons mechanism (`.wfgy/lessons.md`, described in the main `SKILL.md`) is this project's own extension, not part of WFGY's documented mechanism. WFGY's own materials do not describe a cross-session, project-local learning file. It is included here because the goal of this skill (per its own description) is to help an agent build up real, accumulated judgment in a given project over time
|
|
28
|
+
The durable-lessons mechanism (`.wfgy/lessons.md`, described in the main `SKILL.md`) is this project's own extension, not part of WFGY's documented mechanism. WFGY's own materials do not describe a cross-session, project-local learning file. It is included here because the goal of this skill (per its own description) is to help an agent build up real, accumulated judgment in a given project over time -- the same spirit as WFGY's drift-control discipline, applied across sessions rather than within one, but it should never be cited as something WFGY itself specifies.
|
|
29
29
|
|
|
30
30
|
## Attribution
|
|
31
31
|
|
|
32
|
-
WFGY, Wan Fa Gui Yi, and the underlying
|
|
32
|
+
WFGY, Wan Fa Gui Yi, and the underlying deltaS/BBMC/BBPF/BBCR/BBAM concepts originate from `onestardao/WFGY` (creator: PSBigBig). This skill is an independent, honesty-first reimplementation of the portable parts of that technique for use by a text-generating coding agent -- not an official WFGY product, not a verbatim copy of any WFGY file, and not endorsed by or affiliated with the original project.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# Lessons file format
|
|
2
2
|
|
|
3
|
-
`.wfgy/lessons.md`, created at the root of whatever project this skill is applied in (not inside this skill's own directory
|
|
3
|
+
`.wfgy/lessons.md`, created at the root of whatever project this skill is applied in (not inside this skill's own directory -- the lessons belong to the project being worked on, not to the skill itself).
|
|
4
4
|
|
|
5
5
|
Each entry:
|
|
6
6
|
|
|
7
7
|
```
|
|
8
|
-
## <YYYY-MM-DD>
|
|
8
|
+
## <YYYY-MM-DD> -- <one-line summary>
|
|
9
9
|
Goal (G): <what you were actually trying to accomplish>
|
|
10
10
|
What drifted / what went wrong: <specific, concrete -- not "I made a mistake" but what exactly happened>
|
|
11
11
|
Fix / resolution: <specific, concrete -- what you actually did to resolve it>
|
|
@@ -15,7 +15,7 @@ Generalizes to: <what future work in this project should watch for because of th
|
|
|
15
15
|
Example (illustrative, not a real project's actual history):
|
|
16
16
|
|
|
17
17
|
```
|
|
18
|
-
## 2026-07-07
|
|
18
|
+
## 2026-07-07 -- assumed a config field name without checking the schema
|
|
19
19
|
Goal (G): add a new option to the build config and have it take effect
|
|
20
20
|
What drifted / what went wrong: wrote the option under a key name that seemed
|
|
21
21
|
consistent with sibling options, without checking the actual config-loader
|
|
@@ -29,4 +29,4 @@ keys -- always check the loader's real accepted-key list before adding a new
|
|
|
29
29
|
config option, never infer the name from sibling examples alone
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
Newest entries at the top. Keep each entry short
|
|
32
|
+
Newest entries at the top. Keep each entry short -- a few lines, not a full incident report. The value is in the "generalizes to" line being genuinely reusable, not in exhaustive detail about the one instance.
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
# WFGY core mechanism
|
|
1
|
+
# WFGY core mechanism -- technical basis
|
|
2
2
|
|
|
3
3
|
Source: direct fetches of `onestardao/WFGY` primary files (`core/WFGY_Core_Flagship_v2.0.txt`, `ProblemMap/wfgy-metrics.md`, `ProblemMap/glossary.md`, `OS/TXTOS.txt`, `archive/wfgy_1_0_sdk_archive/{README.md,wfgy_engine.py,bbmc.py,bbcr.py,bbam.py,bbpf.py}`). Every claim in `SKILL.md` and `honesty-and-provenance.md` traces to something quoted or paraphrased here.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## deltaS (delta-S)
|
|
6
6
|
|
|
7
7
|
Stated formula, consistent across `ProblemMap/glossary.md`, `ProblemMap/wfgy-metrics.md`, `core/WFGY_Core_Flagship_v2.0.txt`:
|
|
8
8
|
|
|
9
9
|
```
|
|
10
|
-
|
|
10
|
+
deltaS = 1 - cos(I, G) # I = item/current-state embedding, G = ground/goal/anchor embedding
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
This is real, well-formed math if real embeddings are computed. It is not real math in the plain-prompt (`OS/TXTOS.txt`) usage path, because no embedding call happens there
|
|
13
|
+
This is real, well-formed math if real embeddings are computed. It is not real math in the plain-prompt (`OS/TXTOS.txt`) usage path, because no embedding call happens there -- see below.
|
|
14
14
|
|
|
15
|
-
Thresholds are given but **inconsistent across the project's own documents**: `core/WFGY_Core_Flagship_v2.0.txt` gives 4 zones (safe <0.40, transit 0.40-0.60, risk 0.60-0.85, danger >0.85); `ProblemMap/glossary.md` collapses to 3 zones (stable <0.40, transitional 0.40-0.60, high risk >=0.60); `ProblemMap/wfgy-metrics.md`'s production PASS/WARN/FAIL table uses yet a different cutoff (PASS <=0.45, not <=0.40). `OS/TXTOS.txt`'s own worked example produces
|
|
15
|
+
Thresholds are given but **inconsistent across the project's own documents**: `core/WFGY_Core_Flagship_v2.0.txt` gives 4 zones (safe <0.40, transit 0.40-0.60, risk 0.60-0.85, danger >0.85); `ProblemMap/glossary.md` collapses to 3 zones (stable <0.40, transitional 0.40-0.60, high risk >=0.60); `ProblemMap/wfgy-metrics.md`'s production PASS/WARN/FAIL table uses yet a different cutoff (PASS <=0.45, not <=0.40). `OS/TXTOS.txt`'s own worked example produces `deltaS: 1.8` -- outside every zone table the same document defines (max stated ceiling is "danger >=0.85"), with no acknowledgment that this breaks its own scale.
|
|
16
16
|
|
|
17
|
-
Constants in the core file's `[Defaults]` block (`gamma=0.618`
|
|
17
|
+
Constants in the core file's `[Defaults]` block (`gamma=0.618` -- literally the golden ratio truncated -- plus `theta_c=0.75`, `zeta_min=0.10`, `alpha_blend=0.50`, etc.) carry no derivation or citation anywhere in the source; this reads as aesthetic constant-picking, not empirical tuning.
|
|
18
18
|
|
|
19
19
|
## BBMC (real name in source: "Boundary-Bounded Memory Chunks" per glossary; "Semantic Residue Minimization" per TXTOS.txt)
|
|
20
20
|
|
|
@@ -24,28 +24,28 @@ Formula (`core/`, `bbmc.py`): `B = I - G + m*c^2` ("semantic residue"), computed
|
|
|
24
24
|
|
|
25
25
|
## BBPF ("Branch-Bounded Prompt Frames" per glossary)
|
|
26
26
|
|
|
27
|
-
Formula version is dressed in dynamical-systems notation (`x_{t+1} = x_t + sum V_i(...) + sum W_j(...) P_j`) with undefined terms
|
|
27
|
+
Formula version is dressed in dynamical-systems notation (`x_{t+1} = x_t + sum V_i(...) + sum W_j(...) P_j`) with undefined terms -- the least concretely specified of the three kept patterns. But the source also gives a real, checkable gate condition: "bridge allowed only if delta_s decreases AND W_c < 0.5*theta_c" -- proceed down a candidate path only if it measurably reduces drift and stays within a stability bound.
|
|
28
28
|
|
|
29
29
|
The archived SDK's `bbpf.py` implements something concrete: generate `k` perturbed candidate vectors, score each by a stability function, prefer lower-deviation candidates.
|
|
30
30
|
|
|
31
31
|
**Portable pattern kept in this skill:** when a decision has real alternatives, generate more than one before committing; prefer whichever most clearly advances the stated goal.
|
|
32
32
|
|
|
33
|
-
## BBCR ("Break-Before-Crash Reset" per glossary/core; "BigBig Coupling Resolver" per TXTOS.txt
|
|
33
|
+
## BBCR ("Break-Before-Crash Reset" per glossary/core; "BigBig Coupling Resolver" per TXTOS.txt -- the source itself uses two different expansions of the same acronym, an internal inconsistency worth knowing about)
|
|
34
34
|
|
|
35
35
|
The most concretely specified and most honestly portable of the four. Real trigger condition (`core/`, `bbcr.py`): residue norm exceeds a threshold `B_c`, OR a stability function drops below `epsilon`. Real operation, directly implemented in the archived SDK's `collapse_rebirth` function: reset to a prior stable state, retry, bounded by `max_retries` (SDK default: **3**); after retries are exhausted, log a warning and return the last (unstable) state rather than looping forever. `OS/TXTOS.txt`'s own framing adds an explicit "ask the user" fallback when no clean resolution is found, rather than silently proceeding.
|
|
36
36
|
|
|
37
37
|
**Portable pattern kept in this skill:** checkpoint before risky steps; on detected real incoherence, revert and retry a bounded number of times (this skill recommends 2-3, matching the SDK's real default); after that, surface the unresolved issue explicitly rather than picking an answer anyway.
|
|
38
38
|
|
|
39
|
-
## BBAM ("Attention Modulation" per glossary)
|
|
39
|
+
## BBAM ("Attention Modulation" per glossary) -- real computation not portable, ported instead as delegated judgment
|
|
40
40
|
|
|
41
|
-
Real operation, confirmed in three different formula variants across three different documents (a genuine internal inconsistency in the source): rescaling attention weights or output logits by a factor derived from their statistical variance/spread, e.g. `logits * exp(-gamma * sigma(logits))` (archived SDK's actual implementation). This is a real operation, but it is defined on internal model tensors (attention weights, raw logits) that exist only inside a transformer's forward pass. A text-generating agent, reasoning only through the tokens it produces, has no way to read or compute this about its own internal state
|
|
41
|
+
Real operation, confirmed in three different formula variants across three different documents (a genuine internal inconsistency in the source): rescaling attention weights or output logits by a factor derived from their statistical variance/spread, e.g. `logits * exp(-gamma * sigma(logits))` (archived SDK's actual implementation). This is a real operation, but it is defined on internal model tensors (attention weights, raw logits) that exist only inside a transformer's forward pass. A text-generating agent, reasoning only through the tokens it produces, has no way to read or compute this about its own internal state -- it cannot see its own attention weights, and no instruction can make that computation real.
|
|
42
42
|
|
|
43
|
-
What survives honestly: the *symptom* this computation is meant to correct (an over-peaked, over-concentrated distribution of "attention," in the real mechanism's terms) has a directly observable analog in an agent's own output
|
|
43
|
+
What survives honestly: the *symptom* this computation is meant to correct (an over-peaked, over-concentrated distribution of "attention," in the real mechanism's terms) has a directly observable analog in an agent's own output -- output that has narrowed onto one aspect of a broader task and stayed there past the point of usefulness, repeating itself or over-elaborating one sub-point while leaving the rest of the task untouched. `SKILL.md` asks the calling agent to notice this in its own recent output and deliberately widen back out -- explicitly framed as the agent performing, in plain judgment, the correction the real computation would perform mechanically on a real distribution, not as a claim that attention weights are actually being inspected.
|
|
44
44
|
|
|
45
|
-
## The one place real embedding-based computation of
|
|
45
|
+
## The one place real embedding-based computation of deltaS may actually happen
|
|
46
46
|
|
|
47
|
-
A LangChain/LlamaIndex adapter in the source repo reportedly does real cosine-distance monitoring/logging of retrieval results as an observability layer (found by research but not independently re-verified byte-for-byte). Even there it appears to monitor/log rather than actively reroute the pipeline. This requires an actual embedding model and vector-math library wired in
|
|
47
|
+
A LangChain/LlamaIndex adapter in the source repo reportedly does real cosine-distance monitoring/logging of retrieval results as an observability layer (found by research but not independently re-verified byte-for-byte). Even there it appears to monitor/log rather than actively reroute the pipeline. This requires an actual embedding model and vector-math library wired in -- outside the scope of a pure prompting-based Claude Code skill, and not something this skill attempts to replicate.
|
|
48
48
|
|
|
49
49
|
## The base engine's self-monitoring loop (distinct from Avatar's later "dual closed-loop" design)
|
|
50
50
|
|
|
51
|
-
`core/WFGY_Core_Flagship_v2.0.txt` defines a trend classifier over consecutive
|
|
51
|
+
`core/WFGY_Core_Flagship_v2.0.txt` defines a trend classifier over consecutive deltaS values: compute the step-to-step change plus a rolling mean over the last (up to) 5 steps, then bucket the trajectory as convergent / recursive / divergent / chaotic based on the sign and magnitude of that change. This is a real, checkable procedure for "is this task's drift getting better or worse over time," independent of whether the underlying deltaS numbers are truly computed or self-estimated -- the classification logic itself is sound either way.
|