Deploy the Autonet jurisdiction (DAO on werule + RPB contract) and wire the agent framework so users can flip a switch to start training and earning rewards. Each step is independently observable.
- RPB = Recursive Principled Body (the system/pattern)
- Autonet = the first jurisdiction deploying an RPB
- The contract stays named
Autonet.solfor now (rename is cosmetic, do later) - In code comments and docs, refer to it as "the RPB contract"
Codebase: c:\code\dao\trustless-contracts
Write scripts/deploy-autonet-jurisdiction.js that does the full 3-step
TrustlessFactory flow + RPB deployment in one shot:
Step 1 -- Infrastructure:
trustlessFactory.deployInfrastructure(timelockDelay=1, arbitrationFee=250)
Deploys: Economy, Timelock, Registry
Step 2 -- DAO Token:
trustlessFactory.deployDAOToken(registry, timelock, tokenParams, govParams)
Deploys: RepToken ("Autonet Rep", "AREP"), HomebaseDAO ("Autonet DAO")
Initial members: [deployer] with 1000 AREP
Step 3 -- Configure & Finalize:
trustlessFactory.configureAndFinalize(addresses, economyParams, registryKeys, registryValues)
Links all contracts, transfers control to Timelock.
Include in registryKeys: "jurisdiction.rpb" (will be populated after RPB deploy)
Step 4 -- Deploy RPB (Autonet.sol):
Deploy AutonetFactory with fresh Autonet implementation.
Call factory.createAutonet(economy, registry, repToken, timelock, "Autonet Credits", "ATN")
Note: deployer must hold RepToken (satisfied by Step 2 initial distribution).
Step 5 -- Configure RPB:
autonet.configureEmission(1000e18, 9900, 300)(1000 ATN/epoch, 1% decay, 5min epochs for testing)- Register training service:
autonet.registerService(serviceId, economyAddress, gitHash) - Activate service:
autonet.activateService(serviceId)
Step 6 -- Store RPB address in Registry:
Since Registry is now owned by Timelock, either:
(a) Include RPB address registration in Step 3's registryKeys (before finalize), or
(b) Use Timelock to execute registry.editRegistry("jurisdiction.rpb", rpbAddress) post-deploy.
Option (a) requires deploying RPB before finalize. Reorder: Steps 1,2,4,3,5.
Option (b) requires a governance proposal. For local testing, deployer IS timelock, so direct call works.
Output: Save all addresses to deployments/autonet-jurisdiction-{network}.json
and copy relevant addresses to c:\code\autonet\deployment-addresses.json.
Observable: DAO deployed, RPB deployed, epoch running, service active.
Can verify via hardhat console: autonet.currentEpoch() returns 1.
Codebase: c:\code\autonet
The Python ContractRegistry in nodes/common/contracts.py loads ABIs from
artifacts/contracts/governance/AutonetEconomy.sol/Autonet.json.
Create the directory structure and copy the compiled ABI from
c:\code\dao\trustless-contracts\artifacts\contracts\Autonet.sol\Autonet.json.
Add a helper script scripts/copy-abis.sh (or .ps1) that does this copy.
File: c:\code\autonet\nodes\service.py
Add _init_governance() method that:
- Reads blockchain config (rpc_url, private_key, chain_id)
- Creates
BlockchainInterface - Creates
ContractRegistrywith deployment addresses - Creates
GovernanceBridge - Returns it (or None if config missing)
Change _init_training_feed() to pass governance:
governance = self._init_governance()
self._training_feed = TrainingDataFeed(feed_config, governance=governance)If governance is None, training still works (offline mode -- already supported).
After Phase 1 deployment, the addresses file needs:
{
"AutonetEconomy": "0x...", // RPB contract address
"AutonetDAO": "0x...", // HomebaseDAO address
...
}The Phase 1 script handles this.
Ensure the config dataclass supports:
blockchain:
rpc_url: "http://127.0.0.1:8545"
private_key: "0xac0974..."
chain_id: 31337Check existing nodes/common/config.py for the config structure.
Observable: Start AutonetService with blockchain config. Training runs.
Hardhat console shows attestUsage transactions. Epoch usage increments.
Codebase: c:\code\autonet\atn\
File: atn/autonet_service.py line ~169
Add alongside existing rpc_url/chain_id passthrough:
if self.config.private_key:
self._autonet_config.blockchain.private_key = self.config.private_keyIn ATN config, set default rpc_url and chain_id for Shadownet (or local). Users who flip the training switch don't need to configure anything. The private_key comes from their wallet connection or env var.
Observable: User starts ATN, flips training switch. Training begins. On-chain attestations flow automatically. No manual config needed.
Create tests/test_governance_integration.py:
- Mock BlockchainInterface (don't need real chain for unit tests)
- Verify GovernanceBridge created when config has rpc_url + private_key
- Verify TrainingDataFeed receives governance bridge
- Verify
attest_task_completion()callsregistry.attest_usage()
- Start hardhat node
- Run Phase 1 deploy script
- Start AutonetService with blockchain config
- Generate synthetic agent data (JSONL files)
- Trigger training cycle
- Check hardhat console for attestUsage transaction
- Fast-forward time:
await network.provider.send("evm_increaseTime", [300]) - Trigger another attestation (auto-advances epoch)
- Call
claimParticipantReward()from hardhat console - Verify ATN balance > 0
- Phase 1:
scripts/deploy-autonet-jurisdiction.jsin trustless-contracts - Phase 2.1: Copy ABI artifacts
- Phase 2.2: Wire GovernanceBridge in
nodes/service.py - Phase 2.4: Verify/update config structure
- Phase 3.1: Pass private_key in
atn/autonet_service.py - Phase 4.1: Integration test
- Phase 4.2: Manual smoke test
- Renaming Autonet.sol to RPB.sol (cosmetic)
- EvolutionProposal deployment (not needed until architecture changes)
- Alignment-weighted rewards (add via CapabilityScorecard later)
- Multi-jurisdiction support (single jurisdiction first)
- Earn-only token constraint (governance decision, token contract change)
- Deploy to Shadownet (do after local hardhat verification)