Use case: publish the JTBD DSPy agent to Modaic Hub, confirm the revision landed, and sanity-check the hosted build from a clean cache. Format matches our gist shipments (narrative + copy/paste snippets).
- Python 3.10+ with the repo installed editable.
- Export the Modaic + LLM secrets (keep them out of git):
python -m venv .venv && source .venv/bin/activate
pip install -e .
set -a && source .env && set +a # or export the keys manuallyRequired variables:
MODAIC_TOKEN=... # personal access token
MODAIC_AGENT_ID=straughterguthrie/jtbd-agent
RETRIEVER_KIND=notes
RETRIEVER_NOTES=$'JTBD primer\nMoat checklist\nValidation plan quickstart'
JTBD_DSPY_MODEL=claude-3-5-sonnet-20240620
OPENAI_API_KEY=sk-...The helper script wraps JTBDDSPyAgent.push_to_hub(...) and uploads both weights and code.
flowchart LR
Env[Load .env secrets] --> Build[Instantiate JTBDDSPyAgent]
Build --> Push["push_to_hub(repo=MODAIC_AGENT_ID)"]
Push --> Modaic[(Modaic Hub)]
Modaic --> Log["CLI prints success message"]
python tools/push_modaic_agent.pyExpected output:
Agent pushed to Modaic Hub: straughterguthrie/jtbd-agent
If either MODAIC_TOKEN or MODAIC_AGENT_ID is missing, the script exits with a warningβno partial state is created.
Force the runtime to pull the remote revision and exercise each tool using the fixture payload.
sequenceDiagram
participant Dev Shell
participant Loader as reload_agent
participant Hub as Modaic Hub
participant Demo as dogfood_remote_agent
Dev Shell->>Loader: reload_agent
Loader->>Hub: fetch latest revision
Hub-->>Loader: cached repo at ~/.cache/modaic/agents/...
Dev Shell->>Demo: run dogfood_remote_agent.py
Demo->>Hub: call_agent_envelope
Hub-->>Demo: JSON payloads
Demo-->>Dev Shell: print structured output
python tools/dogfood_remote_agent.py | jqYou should see JSON blobs for deconstruct, jobs, moat, and judge. Use DEMO_IDEA_PATH=/path/to/custom.json to override the sample.
Modaic caches hub repos under ~/.cache/modaic/agents/<slug>. Run the snippet below to ensure we can instantiate directly from Modaic and to print the commit that was fetched.
python - <<'PY'
from pathlib import Path
from service.modaic_agent import JTBDDSPyAgent, JTBDConfig
# Work around upstream typing bug so from_precompiled sees JTBDConfig
JTBDDSPyAgent.__annotations__["config"] = JTBDConfig
agent = JTBDDSPyAgent.from_precompiled("straughterguthrie/jtbd-agent")
repo_dir = Path.home() / ".cache/modaic/agents/straughterguthrie/jtbd-agent"
commit = (repo_dir / ".git" / "HEAD").read_text().strip()
print("Loaded agent:", type(agent).__name__)
print("Modaic cache:", repo_dir)
print("HEAD ref:", commit)
PYTo inspect the cached repo directly:
cd ~/.cache/modaic/agents/straughterguthrie/jtbd-agent
git log -1 --onelinegh auth status
gh gist create docs/modaic_push_verification_gist.md \
-d "Modaic JTBD agent push & verification flow" \
-pAttach supporting scripts (tools/push_modaic_agent.py, tools/dogfood_remote_agent.py) if readers need turnkey copies outside the repo.
| Step | Command | Result |
|---|---|---|
| Setup | pip install -e . & load .env |
Environment ready |
| Push | python tools/push_modaic_agent.py |
Agent revision published |
| Smoke | python tools/dogfood_remote_agent.py |
Remote tools return JSON |
| Verify | JTBDDSPyAgent.from_precompiled(...) |
Confirms Modaic repo + commit |