google-agents-cli-scaffold
Project scaffolding, deployment configuration, and CI/CD setup for Google ADK agents.
> Formal oracle verifying GF(3) trit conservation across skill triads. Triggers: verify trit conservation, check GF(3) invariant, pre-commit trit check, triad validation, conservation law enforcement, sum mod 3 check. >>>>>>> origin/main
Full skill instructions
<<<<<<< HEAD
ConservationOracle : SkillGraph → ConservationResult
ConservationResult =
| CONSERVED { certificate: list[ValidTriad] } -- all triads sum to 0 mod 3
| VIOLATED { witness: ViolatingTriad } -- explicit counterexample
| UNKNOWN { reason: string } -- trit not defined for some skill
ValidTriad = (s₁, s₂, s₃, trits) where trit(s₁) + trit(s₂) + trit(s₃) ≡ 0 mod 3
ViolatingTriad = (s₁, s₂, s₃, trits) where trit(s₁) + trit(s₂) + trit(s₃) ≢ 0 mod 3
=======
ConservationOracle : SkillGraph -> ConservationResult
ConservationResult =
| CONSERVED { certificate: list[ValidTriad] }
| VIOLATED { witness: ViolatingTriad }
| UNKNOWN { reason: string }
ValidTriad = (s1, s2, s3, trits) where trit(s1) + trit(s2) + trit(s3) = 0 mod 3
ViolatingTriad = (s1, s2, s3, trits) where trit(s1) + trit(s2) + trit(s3) != 0 mod 3
>>>>>>> origin/main
skills.json registry with trit fields populated
=======origin/main
CONSERVED | VIOLATED | UNKNOWN
<<<<<<< HEADCONSERVED is witnessed by an explicit list of checked triads (never "all triads ok")VIOLATED provides the FIRST violating triad found (witness, not just count)UNKNOWN only if a skill in the checked graph has CellValue.nothing from gf3-trit-oracle# GF(3) = ℤ/3ℤ with representatives {-1, 0, +1} ≡ {2, 0, 1} (mod 3)
def gf3_rep(x: int) -> int:
"""Map any integer to canonical GF(3) representative in {-1, 0, +1}."""
r = x % 3
return r if r <= 1 else r - 3 # {0,1,2} → {0,1,-1}
def gf3_add(a: int, b: int) -> int:
"""Precondition: a, b ∈ {-1, 0, +1}. Postcondition: result ∈ {-1, 0, +1}."""
return gf3_rep(a + b)
def gf3_sum(*args: int) -> int:
"""Sum of any number of trits in GF(3)."""
=======
2. `CONSERVED` is witnessed by an explicit list of checked triads
3. `VIOLATED` provides the FIRST violating triad found
4. `UNKNOWN` only if a skill has undefined trit
5. Deterministic: same graph state -> same result
## GF(3) Arithmetic
```python
def gf3_rep(x: int) -> int:
"""Map any integer to canonical GF(3) representative in {-1, 0, +1}."""
r = x % 3
return r if r <= 1 else r - 3
def gf3_add(a: int, b: int) -> int:
return gf3_rep(a + b)
def gf3_sum(*args: int) -> int:
>>>>>>> origin/main
result = 0
for a in args:
result = gf3_add(result, a)
return result
def is_valid_triad(t1: int, t2: int, t3: int) -> bool:
<<<<<<< HEAD
"""Conservation law: t1 + t2 + t3 ≡ 0 (mod 3)."""
return gf3_sum(t1, t2, t3) == 0
def third_trit(t1: int, t2: int) -> int:
"""Given two trits, compute the unique third conserving GF(3).
Postcondition: is_valid_triad(t1, t2, result) == True
"""
return gf3_rep(-(t1 + t2))
# Cayley table for GF(3) addition (trits as {-1, 0, +1}):
# + | -1 0 +1
# ---|------------
# -1 | 1 -1 0
# 0 | -1 0 +1
# +1 | 0 +1 -1
======= """Conservation law: t1 + t2 + t3 = 0 (mod 3).""" return gf3_sum(t1, t2, t3) == 0
def third_trit(t1: int, t2: int) -> int: """Given two trits, compute the unique third conserving GF(3).""" return gf3_rep(-(t1 + t2))
>>>>>>> origin/main
## Oracle Implementation
```python
from dataclasses import dataclass
<<<<<<< HEAD
from typing import Optional
=======
>>>>>>> origin/main
import json
@dataclass
class SkillNode:
name: str
<<<<<<< HEAD
trit: int # -1, 0, +1 — from gf3-trit-oracle (NOT guessed)
role: str # VALIDATOR | ERGODIC | BRIDGE | GENERATOR
=======
trit: int
role: str
>>>>>>> origin/main
@dataclass
class Triad:
s1: SkillNode
s2: SkillNode
s3: SkillNode
@property
def trit_sum(self) -> int:
return gf3_sum(self.s1.trit, self.s2.trit, self.s3.trit)
@property
def is_valid(self) -> bool:
return self.trit_sum == 0
def conservation_oracle(
skills: list[SkillNode],
<<<<<<< HEAD
edges: list[tuple[str, str]], # skill graph edges
check_all: bool = False, # if False, return on first violation
) -> dict:
"""
Requirement: all skills have trit ∈ {-1, 0, +1} (not None)
Postcondition: returns CONSERVED | VIOLATED | UNKNOWN
Triad selection: connected triples only (s1-s2 edge AND s2-s3 edge AND s1-s3 edge)
OR hub triples: (hub, s1, s2) where hub connects to both s1 and s2
"""
# Check for UNKNOWN (any skill has undefined trit)
skill_map = {s.name: s for s in skills}
for skill in skills:
if skill.trit not in (-1, 0, 1):
return {
"result": "UNKNOWN",
"reason": f"Skill '{skill.name}' has undefined trit: {skill.trit}"
}
# Build adjacency for connected triple enumeration
=======
edges: list[tuple[str, str]],
check_all: bool = False,
) -> dict:
"""
Requirement: all skills have trit in {-1, 0, +1}
Postcondition: returns CONSERVED | VIOLATED | UNKNOWN
"""
skill_map = {s.name: s for s in skills}
for skill in skills:
if skill.trit not in (-1, 0, 1):
return {"result": "UNKNOWN", "reason": f"Skill '{skill.name}' has undefined trit"}
>>>>>>> origin/main
adj = {s.name: set() for s in skills}
for (a, b) in edges:
adj[a].add(b)
adj[b].add(a)
violations = []
valid_triads = []
<<<<<<< HEAD
# Check all connected triples
=======
>>>>>>> origin/main
skill_names = list(skill_map.keys())
for i, n1 in enumerate(skill_names):
for n2 in skill_names[i+1:]:
if n2 not in adj[n1]:
<<<<<<< HEAD
continue # not connected — skip
=======
continue
>>>>>>> origin/main
for n3 in skill_names:
if n3 == n1 or n3 == n2:
continue
if n3 not in adj[n1] and n3 not in adj[n2]:
<<<<<<< HEAD
continue # n3 not connected to either — skip
=======
continue
>>>>>>> origin/main
s1, s2, s3 = skill_map[n1], skill_map[n2], skill_map[n3]
triad = Triad(s1, s2, s3)
if triad.is_valid:
valid_triads.append({
"skills": [n1, n2, n3],
"trits": [s1.trit, s2.trit, s3.trit],
<<<<<<< HEAD
"sum_mod3": 0
=======
>>>>>>> origin/main
})
else:
violations.append({
"skills": [n1, n2, n3],
"trits": [s1.trit, s2.trit, s3.trit],
"sum_mod3": triad.trit_sum
})
if not check_all:
<<<<<<< HEAD
# Return immediately on first violation
return {
"result": "VIOLATED",
"witness": violations[0]
}
if violations:
return {
"result": "VIOLATED",
"witness": violations[0],
"all_violations": violations if check_all else None,
}
return {
"result": "CONSERVED",
"certificate": valid_triads,
"triads_checked": len(valid_triads),
}
======= return {"result": "VIOLATED", "witness": violations[0]}
if violations:
return {"result": "VIOLATED", "witness": violations[0],
"all_violations": violations if check_all else None}
return {"result": "CONSERVED", "certificate": valid_triads,
"triads_checked": len(valid_triads)}
## Pre-Commit Hook
>>>>>>> origin/main
```bash
#!/usr/bin/env bash
# .git/hooks/pre-commit
<<<<<<< HEAD
# Requirement: gf3-trit-oracle is accessible (jq + skills.json)
# Postcondition: blocks commit if GF(3) conservation violated
=======
>>>>>>> origin/main
set -euo pipefail
SKILLS_JSON="$HOME/i/asi/skills.json"
ORACLE_SCRIPT="$HOME/i/asi/skills/gf3-conservation-oracle/check.py"
<<<<<<< HEAD
# Get changed skill directories
CHANGED_SKILLS=$(git diff --cached --name-only | grep 'skills/' | cut -d/ -f1-3 | sort -u)
if [ -z "$CHANGED_SKILLS" ]; then
exit 0 # No skill changes — no conservation check needed
=======
CHANGED_SKILLS=$(git diff --cached --name-only | grep 'skills/' | cut -d/ -f1-3 | sort -u)
if [ -z "$CHANGED_SKILLS" ]; then
exit 0
>>>>>>> origin/main
fi
echo "GF(3) Conservation Oracle: checking changed skills..."
<<<<<<< HEAD
# Extract full skill graph from registry
=======
>>>>>>> origin/main
python3 "$ORACLE_SCRIPT" \
--skills-json "$SKILLS_JSON" \
--changed-skills "$CHANGED_SKILLS" \
--mode "pre-commit"
STATUS=$?
if [ $STATUS -ne 0 ]; then
echo "BLOCKED: GF(3) conservation violated."
<<<<<<< HEAD
echo "Fix the trit assignment before committing."
=======
>>>>>>> origin/main
echo "Use: third_trit(t1, t2) to compute the required third trit."
exit 1
fi
echo "GF(3) conservation: CONSERVED. Commit allowed."
<<<<<<< HEAD
exit 0
# Requirement: skills.json has a "count" field or is countable
# Postcondition: new count >= old count (MONOTONIC_SKILL_INVARIANT)
def monotonic_oracle(old_skills_json: str, new_skills_json: str) -> dict:
"""
Precondition: both JSON files are valid ASI skill registries
Postcondition: returns CONSERVED if new_count >= old_count, VIOLATED otherwise
This is SEPARATE from GF(3) conservation — both must hold.
=======
def monotonic_oracle(old_skills_json: str, new_skills_json: str) -> dict:
"""
Separate from GF(3) conservation -- both must hold.
Postcondition: CONSERVED if new_count >= old_count, VIOLATED otherwise.
>>>>>>> origin/main
"""
old_count = len(json.load(open(old_skills_json))["skills"])
new_count = len(json.load(open(new_skills_json))["skills"])
if new_count >= old_count:
<<<<<<< HEAD
return {
"result": "CONSERVED",
"old_count": old_count,
"new_count": new_count,
"delta": new_count - old_count,
}
else:
return {
"result": "VIOLATED",
"witness": {
"old_count": old_count,
"new_count": new_count,
"deleted_count": old_count - new_count,
}
}
Conservation oracle checks: STATIC invariant (graph structure)
Trit oracle provides: ATOMIC classification per skill
Abductive oracle uses: DYNAMIC classification per evidence
Bisimulation oracle uses: BEHAVIORAL equivalence per trit class
Neurofeedback oracle provides: REAL-TIME trit from EEG signal
All five must agree (no contradiction across layers):
CellValue.nothing → oracle not yet run
CellValue.value(t) → oracle returned definite trit t
CellValue.contradiction → two authoritative sources disagree → HALT
// Requirement: Dafny 4.x installed
// Postcondition: conservation law formally verified for up to N triad checks
=======
return {"result": "CONSERVED", "old_count": old_count,
"new_count": new_count, "delta": new_count - old_count}
else:
return {"result": "VIOLATED", "witness": {
"old_count": old_count, "new_count": new_count}}
>>>>>>> origin/main
lemma GF3Conservation(t1: int, t2: int, t3: int)
requires t1 in {-1, 0, 1} && t2 in {-1, 0, 1} && t3 in {-1, 0, 1}
requires (t1 + t2 + t3) % 3 == 0
ensures third_trit(t1, t2) == t3
{
<<<<<<< HEAD
// Proof: by exhaustive case analysis (27 cases)
// Dafny verifies this automatically via SAT
=======
// Proof by exhaustive case analysis (27 cases) -- Dafny verifies via SAT
>>>>>>> origin/main
}
function third_trit(t1: int, t2: int): int
requires t1 in {-1, 0, 1} && t2 in {-1, 0, 1}
ensures third_trit(t1, t2) in {-1, 0, 1}
ensures (t1 + t2 + third_trit(t1, t2)) % 3 == 0
{
var sum := t1 + t2;
var raw := (-sum) % 3;
if raw == 2 then -1 else raw
}
--no-verify in a correctly configured git repogf3-trit-oracle — provides the trit values this oracle checksgf3-pr-verify — pre-commit hook that invokes this oraclegf3-tripartite — composition invariant checker (same algebra, different scope)belief-revision-log — beliefs must also satisfy GF(3) conservation at each timestampskill-validation-gf3 — validates individual skills against registryformal-verification / dafny-formal-verification — Dafny proof of the lemmas abovebisimulation-oracle — uses trit class to gate bisimulation queries
=======origin/main
Part of: para-mensch-commons.
Project scaffolding, deployment configuration, and CI/CD setup for Google ADK agents.
Set up tracing, logging, and monitoring for deployed ADK agents across Cloud Trace, BigQuery, and third-party platforms.
Enterprise Azure infrastructure architect generating Bicep or Terraform from workload descriptions.
Plan and configure production-ready Azure Kubernetes Service clusters with Day-0 and Day-1 best practices.
Raw mechanical interfaces fusing Swiss typographic print with military terminal aesthetics. Rigid grids, extreme type scale contrast, utilitarian color, analog degradation effects. For data-heavy dashboards, portfolios, or editorial sites that need to feel like declassified blueprints.
Web search, scraping, extraction, crawling, and monitoring via ScrapeGraph AI CLI.
Skill for working with Firebase Hosting (Classic). Use this when you want to deploy static web apps, Single Page Apps (SPAs), or simple microservices. Do NOT use for Firebase App Hosting.
Deploy and manage web apps with Firebase App Hosting. Use this skill when deploying Next.js/Angular apps with backends.
Deploy applications and websites to Vercel. Use when the user requests deployment actions like "deploy my app", "deploy and give me the link", "push this live", or "create a preview deployment".
Build SEO-optimized pages at scale using templates, data, and proven playbook patterns.
Design and build isolated, reusable Convex backend components with clear boundaries and app-facing wrappers.
Deploy and manage projects on Vercel using token-based authentication. Use when working with Vercel CLI using access tokens rather than interactive login — e.g. "deploy to vercel", "set up vercel", "add environment variables to vercel".
Opus.ai: Revolutionize Your Web Experience
Build a no-code AI app in minutes.
An IDE for code migration from legacy to modern frameworks through coding agents.
Automate CGI animation in live-action scenes
Branded artistic QR-code concepts
Launch a website in seconds with AI.
Streamline Your Coding Experience with AI Code Helper
Convert any screenshot or design to clean code.