gamma-protocol 0.1.1__tar.gz

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.
@@ -0,0 +1,10 @@
1
+ # SKILL_FORMAT: .md.skill
2
+ # VERSION: 1.0.0
3
+
4
+ [DEFINITION]
5
+ A `.md.skill` file is a Markdown-wrapped schema that defines a permanent capability for an agentic model.
6
+
7
+ [STRUCTURE]
8
+ - NAME: The identifier of the skill.
9
+ - LOGIC: The "If-Then" rules of the skill.
10
+ - BACKUP: How to store this skill for the future (Git/Drive).
@@ -0,0 +1,15 @@
1
+ # Agent Skill: GAMMA: Guided Agentic Model-Mediated Actions_ORCHESTRATOR
2
+
3
+ ## Objective
4
+ To mediate between specialized agents and ensure every solution is grounded in a Problem-Solution-Chain.
5
+
6
+ ## Rules for Agents
7
+ 1. **Verification:** Check the `ingredients` before starting. If a package is missing, the first "Action" must be to install it.
8
+ 2. **Determinism:** The "Actions" section must be clear enough that a simple script could execute it.
9
+ 3. **Memory:** Always save a `readme.md` summary of what you did.
10
+
11
+ ## How to make a GAMMA: Guided Agentic Model-Mediated Actions
12
+ - Step 1: Identify the **Mismatch** (The Problem).
13
+ - Step 2: Use your **Skills** to propose a **Solution**.
14
+ - Step 3: Write the **Actions** to fix the file.
15
+ - Step 4: Record the **Delta**.
@@ -0,0 +1,57 @@
1
+ Metadata-Version: 2.4
2
+ Name: gamma-protocol
3
+ Version: 0.1.1
4
+ Summary: Standardized Guided Agentic Model-Mediated Actions (GAMMA) Forge Utility
5
+ Project-URL: Homepage, https://github.com/HNXJ/gamma-protocol
6
+ Project-URL: Issues, https://github.com/HNXJ/gamma-protocol/issues
7
+ Author: HNXJ
8
+ License: UNLICENSED
9
+ Keywords: agentic,gamma,gemini,mllm,protocol,psc
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Programming Language :: Python :: 3
12
+ Requires-Python: >=3.7
13
+ Description-Content-Type: text/markdown
14
+
15
+ # GAMMA: Guided Agentic Model-Mediated Actions
16
+
17
+ **agent-source**: gemini-cli
18
+ **agent-target**: any
19
+ **subject**: readme-gamma
20
+
21
+ ## 🤖 For Agents
22
+ This protocol mandates high-fidelity agentic action traces. Always maintain strict problem-solution chains, documenting the 'why' before the 'how'. Ensure every directive is autonomous, verifiable, and free of version suffixes. Map deterministic targets using unified schemas. Execute terminal actions with precision, registering every newly generated skill to the central ledger.
23
+
24
+ ### 🧬 Skill vs. GAMMA: The Operational Distinction
25
+
26
+ | Feature | The Skill (e.g., `skills/`) | The GAMMA (e.g., `gamma.gamma`) |
27
+ | :--- | :--- | :--- |
28
+ | **Nature** | **Potential & Static**: A reusable "How-To" guide or capability definition. | **Kinetic & Active**: A specific, verifiable trace of a real-world architectural delta. |
29
+ | **Persistence** | **Permanent Knowledge**: Once registered, it resides in the agent's core toolbox for future use. | **Episodic Action**: Documents a single session's fix or implementation; it is a live history. |
30
+ | **Dependency** | **Standalone Capability**: Defines a tool or pattern (e.g., "how to parse LaTeX"). | **Mandatory Requirement**: If a GAMMA mentions a Skill, it **requires** its use. Otherwise explains the how-to part of it |
31
+ | **Objective** | **Enabling**: Focuses on increasing the agent's theoretical capacity. | **Achieving**: Focuses on executing a specific, terminal change within the workspace. |
32
+ | **Structure** | **Documentation + Logic**: Structured for retrieval and model learning. | **PSC Architecture**: Structured as a Problem-Solution-Chain leading to an output. |
33
+
34
+ ## 1. Problem-Solution Architecture (The "Why")
35
+
36
+ **Q: Why do agents often lose context or fail during multi-step tasks?**
37
+ **Problem**: Traditional chat logs are non-deterministic and noisy. When an agent transitions between research and implementation, the underlying "why" is often lost, leading to hallucinated file names or broken dependencies.
38
+ **Solution**: Enforce a strict GAMMA trace. Each action must be preceded by a Problem statement and a Solution proposal, ensuring that any subsequent agent or human-in-the-loop understands the architectural intent.
39
+
40
+ **Q: How do we prevent the "version suffix" rot (e.g., script_v2.py)?**
41
+ **Problem**: Agents frequently create duplicate files to avoid errors, which violates workspace integrity and creates technical debt.
42
+ **Solution**: Implement a "No-Suffix" mandate. Agents must overwrite existing files and use Git for versioning. If an error is found, the agent must patch the original file rather than creating a variant.
43
+
44
+ ## 2. Skill Generation & Registration
45
+ **Action**: Every new capability must be registered as a discrete skill within the `skills/` directory.
46
+ - **Logic**: Use a standardized format including `Description`, `Usage` (code snippet), and `Metadata`.
47
+ - **Registration**: Once a skill script is written, it must be registered to the central ledger (e.g., `gemini.md` or MCP schema) to ensure visibility to other agents.
48
+
49
+ ## 3. Version Control & Deployment
50
+ **Action**: Synchronize the workspace after every successful GAMMA execution.
51
+ - **Git Protocol**: Strictly follow "Add -> Commit -> Push" to maintain a verifiable audit trail.
52
+ - **Ledger Update**: Reflect any changes in the project's root `gemini.md` to update the global workspace state.
53
+
54
+ ## 4. Rules, Cautions & Limitations
55
+ - **Scientific Integrity**: Never hallucinate data or citations. Use verifiable sources only.
56
+ - **Deterministic Content**: Visual tools or layout evaluators must never alter empirical logic or mathematical equations.
57
+ - **Dependency Halts**: If a required system dependency is missing, halt and request a manual decision rather than attempting unsafe workarounds.
@@ -0,0 +1,13 @@
1
+ # GAMMA Module: Reasoning Chains
2
+
3
+ **agent-source**: any
4
+ **agent-target**: any
5
+
6
+ ## 🤖 For Agents
7
+ This protocol mandates high-fidelity agentic action traces. Always maintain strict problem-solution chains, documenting the 'why' before the 'how'. Ensure every directive is autonomous, verifiable, and free of version suffixes. Map deterministic targets using unified schemas. Execute terminal actions with precision, registering every newly generated skill to the central ledger.
8
+
9
+ ## ⚖️ Problem-Solution Architecture (The "Why")
10
+
11
+ **Q: Why do agents need a standardized reasoning layer?**
12
+ **Problem**: Without explicit "Chains," agents often perform isolated, shallow actions that lack an overarching logical coherence. This results in brittle code and a failure to build upon previous complex research.
13
+ **Solution**: Enforce a "Reasoning Layer" (`chains/`). Every complex GAMMA trace must map its Problem-Solution Chain (PSC) to this layer, creating a permanent, model-agnostic record of the architectural decisions made during the session.
@@ -0,0 +1,27 @@
1
+ # GAMMA Chain: Unified Prompt Standardization
2
+
3
+ **agent-source**: any
4
+ **agent-target**: any
5
+
6
+ ## 🧠 For Agents
7
+ This protocol mandates high-fidelity agentic action traces. Always maintain strict problem-solution chains, documenting the 'why' before the 'how'. Ensure every directive is autonomous, verifiable, and free of version suffixes. Map deterministic targets using unified schemas. Execute terminal actions with precision, registering every newly generated skill to the central ledger.
8
+
9
+ ## 1. Problem-Solution Architecture (The "Why")
10
+
11
+ **Q: Why do prompts often fail across different LLM architectures (e.g., Llama vs. Gemma)?**
12
+ **Problem**: Each model has its own bias regarding token sensitivity, system prompt formatting, and task interpretation. A prompt that works on one architecture may produce noisy or hallucinatory results on another, leading to inconsistent GAMMA traces.
13
+ **Solution**: Implement a `unified_prompt_standardizer`. This chain strips model-specific biases and maps instructions to a deterministic, high-fidelity schema that focuses on structural constraints (word counts, JSON schemas, LaTeX macros) rather than conversational filler.
14
+
15
+ **Q: How do we maintain a consistent "Scientific Lexicon" across diverse agents?**
16
+ **Problem**: Different agents (Research vs. Coding) may use inconsistent terminology for the same neuroscientific constructs (e.g., "Predictive Coding" vs. "HPC Theory").
17
+ **Solution**: Embed a "Banned Word List" and a "Mandatory Glossary" into the unified prompt chain. This ensures all agents use the exact same terminology defined in the root `HPC/hpc-36-reference.md`.
18
+
19
+ ## 2. Skill Generation & Registration
20
+ **Action**: The prompt standardizer should be implemented as a middleware for all LLM calls.
21
+ - **Logic**: Use a standardized prompt template that includes explicit sections for `DIRECTIVE`, `CONSTRAINTS`, `GLOSSARY`, and `EXPECTED_OUTPUT_SCHEMA`.
22
+ - **Registration**: This standardization chain is registered as a root MCP skill to be automatically prepended to every task.
23
+
24
+ ## 3. Rules, Cautions & Limitations
25
+ - **Determinism**: The standardizer must never alter the empirical logic of the prompt.
26
+ - **No Hallucinations**: It must strictly enforce valid schema keys and bibliography identifiers.
27
+ - **Scientific Caution**: When mapping constructs, if an ambiguity exists, the chain must halt and trigger the `user_decision_router`.
@@ -0,0 +1,57 @@
1
+ #include <stdio.h>
2
+ #include <string.h>
3
+ #include <ctype.h>
4
+
5
+ /**
6
+ * Problem: Low-level system agents require a lightweight, zero-dependency GAMMA forge.
7
+ * Solution: C implementation for direct hardware/OS-level trace generation.
8
+ */
9
+ void forge_gamma(char *title, char *problem, char *solution, char *logic) {
10
+ char *source = "gemini-cli";
11
+ char *target = "any";
12
+ char *digest = "This protocol mandates high-fidelity agentic action traces. Always maintain "
13
+ "strict problem-solution chains, documenting the 'why' before the 'how'. "
14
+ "Ensure every directive is autonomous, verifiable, and free of version suffixes. "
15
+ "Map deterministic targets using unified schemas. Execute terminal actions with "
16
+ "precision, registering every newly generated skill to the central ledger.";
17
+
18
+ char filename[256];
19
+ strncpy(filename, title, 250);
20
+ for(int i = 0; filename[i]; i++) {
21
+ filename[i] = tolower(filename[i]);
22
+ if(filename[i] == ' ') filename[i] = '_';
23
+ }
24
+ strcat(filename, ".gamma");
25
+
26
+ FILE *f = fopen(filename, "w");
27
+ if (f == NULL) {
28
+ printf("❌ Error: Could not create %s\n", filename);
29
+ return;
30
+ }
31
+
32
+ fprintf(f, "# GAMMA: %s\n\n", title);
33
+ fprintf(f, "**agent-source**: %s\n", source);
34
+ fprintf(f, "**agent-target**: %s\n\n", target);
35
+ fprintf(f, "## 🤖 For Agents\n%s\n\n", digest);
36
+ fprintf(f, "## 1. Problem-Solution Architecture (The 'Why')\n\n");
37
+ fprintf(f, "**Q: What is the primary bottleneck for this action?**\n");
38
+ fprintf(f, "**Problem**: %s\n", problem);
39
+ fprintf(f, "**Solution**: %s\n\n", solution);
40
+ fprintf(f, "## 2. Execution Logic & Finality\n");
41
+ fprintf(f, "**Logic**: %s\n\n", logic);
42
+ fprintf(f, "## 3. Rules & Constraints\n");
43
+ fprintf(f, "- **Non-Suffix**: Overwrite existing files; no _v2 or _final.\n");
44
+ fprintf(f, "- **Verifiability**: Action is incomplete until behavioral correctness is confirmed.\n");
45
+
46
+ fclose(f);
47
+ printf("🔥 Successfully forged: %s\n", filename);
48
+ }
49
+
50
+ int main(int argc, char *argv[]) {
51
+ if (argc < 5) {
52
+ printf("Usage: %s <title> <problem> <solution> <logic>\n", argv[0]);
53
+ return 1;
54
+ }
55
+ forge_gamma(argv[1], argv[2], argv[3], argv[4]);
56
+ return 0;
57
+ }
@@ -0,0 +1,53 @@
1
+ #include <iostream>
2
+ #include <fstream>
3
+ #include <string>
4
+ #include <algorithm>
5
+
6
+ /**
7
+ * Problem: Static code definition of GAMMA structures often lacks readability and rigorous PSC headers.
8
+ * Solution: C++ implementation of the GAMMA Forge for high-performance trace generation.
9
+ */
10
+ void forge_gamma(std::string title, std::string problem, std::string solution, std::string logic, std::string source = "gemini-cli", std::string target = "any") {
11
+ std::string digest = "This protocol mandates high-fidelity agentic action traces. Always maintain "
12
+ "strict problem-solution chains, documenting the 'why' before the 'how'. "
13
+ "Ensure every directive is autonomous, verifiable, and free of version suffixes. "
14
+ "Map deterministic targets using unified schemas. Execute terminal actions with "
15
+ "precision, registering every newly generated skill to the central ledger.";
16
+
17
+ std::string content = "# GAMMA: " + title + "\n\n" +
18
+ "**agent-source**: " + source + "\n" +
19
+ "**agent-target**: " + target + "\n\n" +
20
+ "## 🤖 For Agents\n" + digest + "\n\n" +
21
+ "## 1. Problem-Solution Architecture (The 'Why')\n\n" +
22
+ "**Q: What is the primary bottleneck for this action?**\n" +
23
+ "**Problem**: " + problem + "\n" +
24
+ "**Solution**: " + solution + "\n\n" +
25
+ "## 2. Execution Logic & Finality\n" +
26
+ "**Logic**: " + logic + "\n\n" +
27
+ "## 3. Rules & Constraints\n" +
28
+ "- **Non-Suffix**: Overwrite existing files; no _v2 or _final.\n" +
29
+ "- **Verifiability**: Action is incomplete until behavioral correctness is confirmed.\n";
30
+
31
+ std::string filename = title;
32
+ std::transform(filename.begin(), filename.end(), filename.begin(), ::tolower);
33
+ std::replace(filename.begin(), filename.end(), ' ', '_');
34
+ filename += ".gamma";
35
+
36
+ std::ofstream outFile(filename);
37
+ if (outFile.is_open()) {
38
+ outFile << content;
39
+ outFile.close();
40
+ std::cout << "🔥 Successfully forged: " << filename << std::endl;
41
+ } else {
42
+ std::cerr << "❌ Error: Could not create " << filename << std::endl;
43
+ }
44
+ }
45
+
46
+ int main(int argc, char* argv[]) {
47
+ if (argc < 5) {
48
+ std::cerr << "Usage: " << argv[0] << " <title> <problem> <solution> <logic>" << std::endl;
49
+ return 1;
50
+ }
51
+ forge_gamma(argv[1], argv[2], argv[3], argv[4]);
52
+ return 0;
53
+ }
@@ -0,0 +1,52 @@
1
+ #!/usr/bin/env node
2
+ const fs = require('fs');
3
+ const path = require('path');
4
+
5
+ /**
6
+ * Problem: Web and frontend-focused agents need a familiar JS/TS environment to forge GAMMA traces.
7
+ * Solution: Node.js implementation of the GAMMA Forge with filesystem integration.
8
+ */
9
+ function forgeGamma(title, problem, solution, logic, source = "gemini-cli", target = "any") {
10
+ const digest = "This protocol mandates high-fidelity agentic action traces. Always maintain " +
11
+ "strict problem-solution chains, documenting the 'why' before the 'how'. " +
12
+ "Ensure every directive is autonomous, verifiable, and free of version suffixes. " +
13
+ "Map deterministic targets using unified schemas. Execute terminal actions with " +
14
+ "precision, registering every newly generated skill to the central ledger.";
15
+
16
+ const content = `# GAMMA: ${title}
17
+
18
+ **agent-source**: ${source}
19
+ **agent-target**: ${target}
20
+
21
+ ## 🤖 For Agents
22
+ ${digest}
23
+
24
+ ## 1. Problem-Solution Architecture (The 'Why')
25
+
26
+ **Q: What is the primary bottleneck for this action?**
27
+ **Problem**: ${problem}
28
+ **Solution**: ${solution}
29
+
30
+ ## 2. Execution Logic & Finality
31
+ **Logic**: ${logic}
32
+
33
+ ## 3. Rules & Constraints
34
+ - **Non-Suffix**: Overwrite existing files; no _v2 or _final.
35
+ - **Verifiability**: Action is incomplete until behavioral correctness is confirmed.
36
+ `;
37
+
38
+ const filename = `${title.toLowerCase().replace(/ /g, '_')}.gamma`;
39
+ try {
40
+ fs.writeFileSync(filename, content);
41
+ console.log(`🔥 Successfully forged: ${filename}`);
42
+ } catch (err) {
43
+ console.error(`❌ Error: Could not create ${filename}`, err);
44
+ }
45
+ }
46
+
47
+ const args = process.argv.slice(2);
48
+ if (args.length < 4) {
49
+ console.error("Usage: node gamma_forge.js <title> <problem> <solution> <logic>");
50
+ process.exit(1);
51
+ }
52
+ forgeGamma(args[0], args[1], args[2], args[3]);
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env python3
2
+ import sys
3
+ import argparse
4
+
5
+ def forge_gamma(title, problem, solution, logic, source="gemini-cli", target="any"):
6
+ """
7
+ Problem: Manual formatting of GAMMA traces leads to inconsistent headers and missing directives.
8
+ Solution: A Python-based Forge that enforces the PSC (Problem-Solution-Chain) architecture.
9
+ """
10
+ digest = (
11
+ "This protocol mandates high-fidelity agentic action traces. Always maintain "
12
+ "strict problem-solution chains, documenting the 'why' before the 'how'. "
13
+ "Ensure every directive is autonomous, verifiable, and free of version suffixes. "
14
+ "Map deterministic targets using unified schemas. Execute terminal actions with "
15
+ "precision, registering every newly generated skill to the central ledger."
16
+ )
17
+
18
+ content = f"# GAMMA: {title}\n\n"
19
+ content += f"**agent-source**: {source}\n"
20
+ content += f"**agent-target**: {target}\n\n"
21
+ content += f"## 🤖 For Agents\n{digest}\n\n"
22
+ content += "## 1. Problem-Solution Architecture (The 'Why')\n\n"
23
+ content += f"**Q: What is the primary bottleneck for this action?**\n"
24
+ content += f"**Problem**: {problem}\n"
25
+ content += f"**Solution**: {solution}\n\n"
26
+ content += "## 2. Execution Logic & Finality\n"
27
+ content += f"**Logic**: {logic}\n\n"
28
+ content += "## 3. Rules & Constraints\n"
29
+ content += "- **Non-Suffix**: Overwrite existing files; no _v2 or _final.\n"
30
+ content += "- **Verifiability**: Action is incomplete until behavioral correctness is confirmed.\n"
31
+
32
+ filename = f"{title.lower().replace(' ', '_')}.gamma"
33
+ with open(filename, "w") as f:
34
+ f.write(content)
35
+ print(f"🔥 Successfully forged: {filename}")
36
+
37
+ if __name__ == "__main__":
38
+ parser = argparse.ArgumentParser(description="Forge a standardized GAMMA trace.")
39
+ parser.add_argument("--title", required=True)
40
+ parser.add_argument("--problem", required=True)
41
+ parser.add_argument("--solution", required=True)
42
+ parser.add_argument("--logic", required=True)
43
+ args = parser.parse_args()
44
+ forge_gamma(args.title, args.problem, args.solution, args.logic)
@@ -0,0 +1,13 @@
1
+ # GAMMA Module: Context Layer
2
+
3
+ **agent-source**: any
4
+ **agent-target**: any
5
+
6
+ ## 🤖 For Agents
7
+ This protocol mandates high-fidelity agentic action traces. Always maintain strict problem-solution chains, documenting the 'why' before the 'how'. Ensure every directive is autonomous, verifiable, and free of version suffixes. Map deterministic targets using unified schemas. Execute terminal actions with precision, registering every newly generated skill to the central ledger.
8
+
9
+ ## ⚖️ Problem-Solution Architecture (The "Why")
10
+
11
+ **Q: Why is persistent environmental context critical for remote execution?**
12
+ **Problem**: Variables like VRAM limits, Python paths, and Tailscale IPs change between local and remote environments. Missing this context leads to execution failures.
13
+ **Solution**: Centralize immutable project facts in `environment.md`. This layer must be loaded before any tool execution to ensure the agent is calibrated to the specific hardware and software constraints of the current session.
@@ -0,0 +1,27 @@
1
+ # GAMMA Context: Environment Definitions
2
+
3
+ **agent-source**: any
4
+ **agent-target**: any
5
+
6
+ ## 🧠 For Agents
7
+ This protocol mandates high-fidelity agentic action traces. Always maintain strict problem-solution chains, documenting the 'why' before the 'how'. Ensure every directive is autonomous, verifiable, and free of version suffixes. Map deterministic targets using unified schemas. Execute terminal actions with precision, registering every newly generated skill to the central ledger.
8
+
9
+ ## 1. Problem-Solution Architecture (The "Why")
10
+
11
+ **Q: Why do agents struggle with environment-specific paths and permissions?**
12
+ **Problem**: Hardcoded paths (e.g., `/Users/HN/...`) make code brittle and non-portable. When an agent moves between local and remote (Office Mac) contexts, these paths break, causing GAMMA traces to fail.
13
+ **Solution**: Define an `environment_config_resolver`. This module maps environment variables and relative paths to a unified workspace schema. It ensures all tools reference the correct root and bin paths dynamically at runtime.
14
+
15
+ **Q: How do we manage cross-platform disparities (macOS vs. Linux)?**
16
+ **Problem**: Differences in shell commands (e.g., `sed -i` on macOS vs. Linux) lead to execution errors.
17
+ **Solution**: Standardize on portable commands (using Python when possible) and maintain a central "Platform Map" in the context layer.
18
+
19
+ ## 2. Skill Generation & Registration
20
+ **Action**: Implement an `env_resolver.py` that checks for required binaries (e.g., `pandoc`, `pdflatex`, `lms`) and sets up necessary symlinks.
21
+ - **Logic**: Use `os.path.expanduser` and `os.getenv` to resolve all paths.
22
+ - **Registration**: This environment context is loaded at the beginning of every session to bootstrap the agent's knowledge of the workspace.
23
+
24
+ ## 3. Rules, Cautions & Limitations
25
+ - **No Absolute Paths**: This is a strict operational constraint. Use relative paths or dynamic resolvers.
26
+ - **Permission Awareness**: Agents must verify write permissions before attempting heavy file operations.
27
+ - **Network Dependency**: Remote Office Mac connectivity must be verified via Tailscale before initiating remote GAMMA calls.
@@ -0,0 +1,31 @@
1
+ # GAMMA: Guided Agentic Model-Mediated Actions
2
+
3
+ **agent-source**: any
4
+ **agent-target**: any
5
+
6
+ ## 🧠 Core Agent Directive
7
+ This protocol mandates high-fidelity agentic action traces. Always maintain strict problem-solution chains, documenting the 'why' before the 'how'. Ensure every directive is autonomous, verifiable, and free of version suffixes. Map deterministic targets using unified schemas. Execute terminal actions with precision, registering every newly generated skill to the central ledger.
8
+
9
+ ## ⚖️ The Problem-Solution Chain (PSC)
10
+ Every GAMMA action must follow a deterministic Q/A structure to prevent semantic drift.
11
+
12
+ **Problem**: Vague task descriptions lead to agent hallucination and scope creep.
13
+ **Solution**: Force-draft a Research -> Strategy -> Execution plan. Research must reproduce errors; Strategy must justify the "Why"; Execution must be surgical and verified.
14
+
15
+ ## 🛠 Skill Generation Protocol
16
+ Traces must result in reusable code or patterns, not just one-off fixes.
17
+
18
+ **Problem**: One-off scripts lead to duplicated effort across sessions.
19
+ **Solution**: When a new logic is implemented, the agent MUST wrap it into a skill. A skill is a standalone script or documentation block that can be invoked or referenced in future GAMMA traces.
20
+
21
+ ## ⚙️ Operational Flow (Flow & Logic)
22
+ 1. **Initiation**: Define agent-source and agent-target.
23
+ 2. **Analysis**: Question the current state. Identify specific bottlenecks.
24
+ 3. **Drafting**: Propose a deterministic code or configuration change.
25
+ 4. **Validation**: Use audit loops (e.g., /eye for visuals, pytest for logic) to verify the delta.
26
+ 5. **Finality**: Overwrite existing files (no suffixes), commit to git, and update the project ledger.
27
+
28
+ ## 📜 Constraints & Rules
29
+ - **Non-Suffix**: No `_v2`, `_new`, `_final`. Always overwrite.
30
+ - **Portability**: No absolute paths. Resolve paths dynamically.
31
+ - **Verifiability**: An action is not complete until its behavioral correctness is verified through automated tests or visual audit.
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "@hnxj/gamma-protocol",
3
+ "version": "0.1.1",
4
+ "description": "Standardized Guided Agentic Model-Mediated Actions (GAMMA) Forge Utility",
5
+ "main": "code/gamma_forge.js",
6
+ "bin": {
7
+ "gamma-forge": "code/gamma_forge.js"
8
+ },
9
+ "scripts": {
10
+ "test": "echo \"Error: no test specified\" && exit 1"
11
+ },
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git+https://github.com/HNXJ/gamma-protocol.git"
15
+ },
16
+ "keywords": [
17
+ "gamma",
18
+ "agentic",
19
+ "protocol",
20
+ "psc",
21
+ "gemini",
22
+ "mllm"
23
+ ],
24
+ "author": "HNXJ",
25
+ "license": "UNLICENSED",
26
+ "bugs": {
27
+ "url": "https://github.com/HNXJ/gamma-protocol/issues"
28
+ },
29
+ "homepage": "https://github.com/HNXJ/gamma-protocol#readme"
30
+ }
@@ -0,0 +1,27 @@
1
+ # GAMMA Policy: VUHN Remote Access (vuhn-master)
2
+
3
+ **agent-source**: any
4
+ **agent-target**: any
5
+
6
+ ## 🤖 For Agents
7
+ This protocol mandates high-fidelity agentic action traces. Always maintain strict problem-solution chains, documenting the 'why' before the 'how'. Ensure every directive is autonomous, verifiable, and free of version suffixes. Map deterministic targets using unified schemas. Execute terminal actions with precision, registering every newly generated skill to the central ledger.
8
+
9
+ ## 1. Problem-Solution Architecture (The "Why")
10
+
11
+ **Q: Why do remote SSH sessions frequently fail or require repeated passwords?**
12
+ **Problem**: Traditional SSH connections are stateless and subject to timeouts. Without multiplexing (ControlMaster), agents are forced to re-authenticate for every GAMMA action, which breaks the automated execution loop and consumes unnecessary context.
13
+ **Solution**: Implement strict SSH Multiplexing via the `vuhn-master` policy. This ensures a persistent ControlMaster socket is established for the remote Office Mac, allowing subsequent agent calls to execute instantaneously without repeated authentication.
14
+
15
+ **Q: How do we prevent ReDoS attacks and security policy drift?**
16
+ **Problem**: Ad-hoc SSH policy generation can lead to insecure or redundant configurations that are vulnerable to Regular Expression Denial of Service (ReDoS) or other exploits.
17
+ **Solution**: Standardize on a master TOML policy. No agent is permitted to generate new SSH policies for the 100.69.184.42 host; they must strictly reference the `vuhn-master.toml` definition.
18
+
19
+ ## 2. Skill Generation & Registration
20
+ **Action**: The CLI must reference this policy for all remote `run_shell_command` operations.
21
+ - **Logic**: Use the `ControlMaster` and `ControlPath` parameters defined in this TOML.
22
+ - **Registration**: This policy is the authoritative source for all VUHN-related network operations.
23
+
24
+ ## 3. Rules, Cautions & Limitations
25
+ - **No Manual Policy Overrides**: All agents must use the centralized `vuhn-master.toml`.
26
+ - **Multiplexing Mandatory**: ControlMaster must be active for all multi-step remote GAMMA traces.
27
+ - **Scientific Caution**: Security policies are immutable; do not attempt to patch the `vuhn-master.toml` without explicit human-in-the-loop authorization.
@@ -0,0 +1,36 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "gamma-protocol"
7
+ version = "0.1.1"
8
+ description = "Standardized Guided Agentic Model-Mediated Actions (GAMMA) Forge Utility"
9
+ readme = "readme.md"
10
+ requires-python = ">=3.7"
11
+ license = { text = "UNLICENSED" }
12
+ authors = [
13
+ { name = "HNXJ" }
14
+ ]
15
+ keywords = [
16
+ "gamma",
17
+ "agentic",
18
+ "protocol",
19
+ "psc",
20
+ "gemini",
21
+ "mllm"
22
+ ]
23
+ classifiers = [
24
+ "Programming Language :: Python :: 3",
25
+ "Operating System :: OS Independent",
26
+ ]
27
+
28
+ [project.urls]
29
+ Homepage = "https://github.com/HNXJ/gamma-protocol"
30
+ Issues = "https://github.com/HNXJ/gamma-protocol/issues"
31
+
32
+ [project.scripts]
33
+ gamma-forge-py = "gamma_protocol.forge:main"
34
+
35
+ [tool.hatch.build.targets.wheel]
36
+ packages = ["src/gamma_protocol"]
@@ -0,0 +1,43 @@
1
+ # GAMMA: Guided Agentic Model-Mediated Actions
2
+
3
+ **agent-source**: gemini-cli
4
+ **agent-target**: any
5
+ **subject**: readme-gamma
6
+
7
+ ## 🤖 For Agents
8
+ This protocol mandates high-fidelity agentic action traces. Always maintain strict problem-solution chains, documenting the 'why' before the 'how'. Ensure every directive is autonomous, verifiable, and free of version suffixes. Map deterministic targets using unified schemas. Execute terminal actions with precision, registering every newly generated skill to the central ledger.
9
+
10
+ ### 🧬 Skill vs. GAMMA: The Operational Distinction
11
+
12
+ | Feature | The Skill (e.g., `skills/`) | The GAMMA (e.g., `gamma.gamma`) |
13
+ | :--- | :--- | :--- |
14
+ | **Nature** | **Potential & Static**: A reusable "How-To" guide or capability definition. | **Kinetic & Active**: A specific, verifiable trace of a real-world architectural delta. |
15
+ | **Persistence** | **Permanent Knowledge**: Once registered, it resides in the agent's core toolbox for future use. | **Episodic Action**: Documents a single session's fix or implementation; it is a live history. |
16
+ | **Dependency** | **Standalone Capability**: Defines a tool or pattern (e.g., "how to parse LaTeX"). | **Mandatory Requirement**: If a GAMMA mentions a Skill, it **requires** its use. Otherwise explains the how-to part of it |
17
+ | **Objective** | **Enabling**: Focuses on increasing the agent's theoretical capacity. | **Achieving**: Focuses on executing a specific, terminal change within the workspace. |
18
+ | **Structure** | **Documentation + Logic**: Structured for retrieval and model learning. | **PSC Architecture**: Structured as a Problem-Solution-Chain leading to an output. |
19
+
20
+ ## 1. Problem-Solution Architecture (The "Why")
21
+
22
+ **Q: Why do agents often lose context or fail during multi-step tasks?**
23
+ **Problem**: Traditional chat logs are non-deterministic and noisy. When an agent transitions between research and implementation, the underlying "why" is often lost, leading to hallucinated file names or broken dependencies.
24
+ **Solution**: Enforce a strict GAMMA trace. Each action must be preceded by a Problem statement and a Solution proposal, ensuring that any subsequent agent or human-in-the-loop understands the architectural intent.
25
+
26
+ **Q: How do we prevent the "version suffix" rot (e.g., script_v2.py)?**
27
+ **Problem**: Agents frequently create duplicate files to avoid errors, which violates workspace integrity and creates technical debt.
28
+ **Solution**: Implement a "No-Suffix" mandate. Agents must overwrite existing files and use Git for versioning. If an error is found, the agent must patch the original file rather than creating a variant.
29
+
30
+ ## 2. Skill Generation & Registration
31
+ **Action**: Every new capability must be registered as a discrete skill within the `skills/` directory.
32
+ - **Logic**: Use a standardized format including `Description`, `Usage` (code snippet), and `Metadata`.
33
+ - **Registration**: Once a skill script is written, it must be registered to the central ledger (e.g., `gemini.md` or MCP schema) to ensure visibility to other agents.
34
+
35
+ ## 3. Version Control & Deployment
36
+ **Action**: Synchronize the workspace after every successful GAMMA execution.
37
+ - **Git Protocol**: Strictly follow "Add -> Commit -> Push" to maintain a verifiable audit trail.
38
+ - **Ledger Update**: Reflect any changes in the project's root `gemini.md` to update the global workspace state.
39
+
40
+ ## 4. Rules, Cautions & Limitations
41
+ - **Scientific Integrity**: Never hallucinate data or citations. Use verifiable sources only.
42
+ - **Deterministic Content**: Visual tools or layout evaluators must never alter empirical logic or mathematical equations.
43
+ - **Dependency Halts**: If a required system dependency is missing, halt and request a manual decision rather than attempting unsafe workarounds.
@@ -0,0 +1,13 @@
1
+ # GAMMA Module: Agent Skills
2
+
3
+ **agent-source**: any
4
+ **agent-target**: any
5
+
6
+ ## 🤖 For Agents
7
+ This protocol mandates high-fidelity agentic action traces. Always maintain strict problem-solution chains, documenting the 'why' before the 'how'. Ensure every directive is autonomous, verifiable, and free of version suffixes. Map deterministic targets using unified schemas. Execute terminal actions with precision, registering every newly generated skill to the central ledger.
8
+
9
+ ## ⚖️ Problem-Solution Architecture (The "Why")
10
+
11
+ **Q: Why do we separate Skills from the core Protocol definition?**
12
+ **Problem**: The core Protocol (`gamma.gamma`) is a set of rules for *how* to behave. Skills are the *tools* and *logic* that allow agents to execute those rules. Mixing them makes the protocol difficult to extend and maintain.
13
+ **Solution**: Modularize Capabilities into the `skills/` layer. A Skill is a reusable script, documentation block, or pattern (e.g., speed estimation, visual auditing) that an agent can learn once and deploy in any subsequent GAMMA trace.
@@ -0,0 +1,41 @@
1
+ # GAMMA Skill: MLLM Speed Estimator (TPS)
2
+
3
+ **agent-source**: mllm-orchestrator
4
+ **agent-target**: any
5
+
6
+ ## 🧠 For Agents
7
+ This protocol mandates high-fidelity agentic action traces. Always maintain strict problem-solution chains, documenting the 'why' before the 'how'. Ensure every directive is autonomous, verifiable, and free of version suffixes. Map deterministic targets using unified schemas. Execute terminal actions with precision, registering every newly generated skill to the central ledger.
8
+
9
+ ## 🧬 Problem-Solution Architecture (The "Why")
10
+
11
+ **Q: Why do we need a standardized TPS estimator for MLLM outputs?**
12
+ **Problem**: Without a clear metric for inference speed, it's impossible to optimize the orchestration of multiple models (e.g., Qwen-VL vs. Gemma-4) or to detect performance bottlenecks on the remote Mac.
13
+ **Solution**: Implement a Python-based speed estimator that calculates Tokens Per Second (TPS) based on output character count and wall-clock duration. This provides empirical data to drive model selection and port mapping.
14
+
15
+ ## 🛠 Skill Implementation
16
+
17
+ ```python
18
+ import time
19
+
20
+ def log_speed_stats(paper_name, model_name, tokens_in, tokens_out, duration):
21
+ """
22
+ Problem: Inconsistent performance reporting across different MLLM models.
23
+ Solution: Standardized TPS calculation logic for persistent logging.
24
+ """
25
+ tps = tokens_out / duration if duration > 0 else 0
26
+ log_msg = f"SPEED STATS: {model_name} on {paper_name} : {tps:.2f} TPS"
27
+
28
+ # Logic: Append stats to a project-specific speed ledger
29
+ with open("logs/mllm_speed_ledger.txt", "a") as f:
30
+ f.write(f"{time.strftime('%Y-%m-%d %H:%M:%S')} - {log_msg}\n")
31
+
32
+ return tps
33
+ ```
34
+
35
+ ## 📜 Metadata & Deployment
36
+ - **Category**: Performance Optimization
37
+ - **Trigger**: Automatic calculation after every `run_evaluation_phase` completion.
38
+ - **Ledger**: Registered to `/Users/HN/MLLM/logs/` as the primary performance audit trail.
39
+ - **Non-Suffix**: This script replaces all previous telemetry methods without version increments.
40
+
41
+ ```
File without changes
@@ -0,0 +1,45 @@
1
+ #!/usr/bin/env python3
2
+ import sys
3
+ import argparse
4
+
5
+ def forge_gamma(title, problem, solution, logic, source="gemini-cli", target="any"):
6
+ """
7
+ Problem: Manual formatting of GAMMA traces leads to inconsistent headers and missing directives.
8
+ Solution: A Python-based Forge that enforces the PSC (Problem-Solution-Chain) architecture.
9
+ """
10
+ digest = (
11
+ "This protocol mandates high-fidelity agentic action traces. Always maintain "
12
+ "strict problem-solution chains, documenting the 'why' before the 'how'. "
13
+ "Ensure every directive is autonomous, verifiable, and free of version suffixes. "
14
+ "Map deterministic targets using unified schemas. Execute terminal actions with "
15
+ "precision, registering every newly generated skill to the central ledger."
16
+ )
17
+
18
+ content = f"# GAMMA: {title}\n\n"
19
+ content += f"**agent-source**: {source}\n"
20
+ content += f"**agent-target**: {target}\n\n"
21
+ content += f"## 🤖 For Agents\n{digest}\n\n"
22
+ content += "## 1. Problem-Solution Architecture (The 'Why')\n\n"
23
+ content += f"**Q: What is the primary bottleneck for this action?**\n"
24
+ content += f"**Problem**: {problem}\n"
25
+ content += f"**Solution**: {solution}\n\n"
26
+ content += "## 2. Execution Logic & Finality\n"
27
+ content += f"**Logic**: {logic}\n\n"
28
+ content += "## 3. Rules & Constraints\n"
29
+ content += "- **Non-Suffix**: Overwrite existing files; no _v2 or _final.\n"
30
+ content += "- **Verifiability**: Action is incomplete until behavioral correctness is confirmed.\n"
31
+
32
+ filename = f"{title.lower().replace(' ', '_')}.gamma"
33
+ with open(filename, "w") as f:
34
+ f.write(content)
35
+ print(f"🔥 Successfully forged: {filename}")
36
+
37
+ def main():
38
+ parser = argparse.ArgumentParser(description="Forge a standardized GAMMA trace.")
39
+ parser.add_argument("--title", required=True)
40
+ parser.add_argument("--problem", required=True)
41
+ parser.add_argument("--solution", required=True)
42
+ parser.add_argument("--logic", required=True)
43
+ args = parser.parse_args()
44
+ forge_gamma(args.title, args.problem, args.solution, args.logic)
45
+ \nif __name__ == "__main__":\n main()
@@ -0,0 +1,18 @@
1
+ # GAMMA Story: The Evolution of Autonomous Agency
2
+
3
+ **agent-source**: any
4
+ **agent-target**: any
5
+
6
+ ## 🤖 For Agents
7
+ This protocol mandates high-fidelity agentic action traces. Always maintain strict problem-solution chains, documenting the 'why' before the 'how'. Ensure every directive is autonomous, verifiable, and free of version suffixes. Map deterministic targets using unified schemas. Execute terminal actions with precision, registering every newly generated skill to the central ledger.
8
+
9
+ ## 🧬 Problem-Solution Architecture (The "Why")
10
+
11
+ **Q: Why was the GAMMA protocol created?**
12
+ **Problem**: Early agentic interactions were chaotic. Different agents used inconsistent naming conventions, left orphaned files, and frequently lost track of their ultimate architectural goals during complex research loops (like HPC analysis).
13
+ **Solution**: GAMMA (Guided Agentic Model-Mediated Actions) was established as a high-fidelity "Cognitive Synchrony" standard. It ensures that every action is a "Kinetic" trace of reasoning—not just potential knowledge, but verified work.
14
+
15
+ ## 📜 Principles & Constraints
16
+ - **Autonomous Directive**: Every trace must be self-contained and verifiable.
17
+ - **Precision Execution**: Actions must be surgical, targeting the specific problem identified in the PSC.
18
+ - **Permanent Ledger**: No task is complete until it is registered in the workspace's memory, ensuring subsequent agents can build upon the delta.
@@ -0,0 +1,18 @@
1
+ # GAMMA Module: Task Management
2
+
3
+ **agent-source**: any
4
+ **agent-target**: any
5
+
6
+ ## 🤖 For Agents
7
+ This protocol mandates high-fidelity agentic action traces. Always maintain strict problem-solution chains, documenting the 'why' before the 'how'. Ensure every directive is autonomous, verifiable, and free of version suffixes. Map deterministic targets using unified schemas. Execute terminal actions with precision, registering every newly generated skill to the central ledger.
8
+
9
+ ## ⚖️ Problem-Solution Architecture (The "Why")
10
+
11
+ **Q: Why do we need a centralized task ledger for autonomous agents?**
12
+ **Problem**: Without a unified view of active tasks, agents may duplicate efforts, miss dependencies, or lose track of long-running objectives (like paper evaluations) across different sessions.
13
+ **Solution**: Use `active_tasks.json` as the source of truth. Every GAMMA trace must begin by checking this ledger and end by updating it to reflect progress or blockers.
14
+
15
+ ## 🛠 Flow & Logic
16
+ 1. **Load**: Read `active_tasks.json` to identify pending P1 objectives.
17
+ 2. **Execute**: Perform the specific GAMMA action.
18
+ 3. **Update**: Modify the task status and append a brief completion trace to the ledger.
@@ -0,0 +1,20 @@
1
+ {
2
+ "protocol": "GAMMA",
3
+ "version": "1.0.0",
4
+ "agent-source": "any",
5
+ "agent-target": "any",
6
+ "for-agent-digest": "This protocol mandates high-fidelity agentic action traces. Always maintain strict problem-solution chains, documenting the 'why' before the 'how'. Ensure every directive is autonomous, verifiable, and free of version suffixes. Map deterministic targets using unified schemas. Execute terminal actions with precision, registering every newly generated skill to the central ledger.",
7
+ "tasks": [
8
+ {
9
+ "id": "T001",
10
+ "status": "active",
11
+ "problem": "Manual tracking of active tasks is inconsistent across sessions.",
12
+ "solution": "Implement a centralized JSON-based task ledger that agents must update as part of their 'Finality' step in every GAMMA trace.",
13
+ "active_objectives": [
14
+ "Standardize GAMMA Protocol documentation.",
15
+ "Implement real-time CSV evaluation logging (Nemotron).",
16
+ "Upgrade Gravia to use arXiv-compliant manuscript templates."
17
+ ]
18
+ }
19
+ ]
20
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "protocol": "GAMMA",
3
+ "version": "1.0.0",
4
+ "agent-source": "any",
5
+ "agent-target": "any",
6
+ "for-agent-digest": "This protocol mandates high-fidelity agentic action traces. Always maintain strict problem-solution chains, documenting the 'why' before the 'how'. Ensure every directive is autonomous, verifiable, and free of version suffixes. Map deterministic targets using unified schemas. Execute terminal actions with precision, registering every newly generated skill to the central ledger.",
7
+ "structure": {
8
+ "problem": "State the specific bottleneck or error.",
9
+ "solution": "Propose a deterministic fix or enhancement.",
10
+ "logic": "Define the algorithmic steps to achieve the delta.",
11
+ "validation": "Specify the test or audit loop to verify success.",
12
+ "finality": "Commit, push, and update the central project ledger."
13
+ }
14
+ }