Skip to content

Commit fea04a1

Browse files
author
John Dickerson
committed
Merge branch '33-implement-disapprove-method' into 'main'
Implement disapprove method for endorsement system Closes #33 See merge request ututrust/utu-trust-token-solidity!60
2 parents 6ad7189 + 4a1e353 commit fea04a1

30 files changed

Lines changed: 2153 additions & 50 deletions

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,10 @@ env.toml
2424

2525

2626

27+
28+
# Dolt database files (added by bd init)
29+
.dolt/
30+
*.db
31+
32+
# beads issue tracker — kept local; synced to a separate private Dolt remote, not this shared repo
33+
.beads/

AGENTS.md

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
# Agent Instructions
2+
3+
This project uses **bd** (beads) for issue tracking. Run `bd onboard` to get started.
4+
5+
## Quick Reference
6+
7+
```bash
8+
bd ready # Find available work
9+
bd show <id> # View issue details
10+
bd update <id> --claim # Claim work atomically
11+
bd close <id> # Complete work
12+
bd sync # Sync with git
13+
```
14+
15+
## Non-Interactive Shell Commands
16+
17+
**ALWAYS use non-interactive flags** with file operations to avoid hanging on confirmation prompts.
18+
19+
Shell commands like `cp`, `mv`, and `rm` may be aliased to include `-i` (interactive) mode on some systems, causing the agent to hang indefinitely waiting for y/n input.
20+
21+
**Use these forms instead:**
22+
```bash
23+
# Force overwrite without prompting
24+
cp -f source dest # NOT: cp source dest
25+
mv -f source dest # NOT: mv source dest
26+
rm -f file # NOT: rm file
27+
28+
# For recursive operations
29+
rm -rf directory # NOT: rm -r directory
30+
cp -rf source dest # NOT: cp -r source dest
31+
```
32+
33+
**Other commands that may prompt:**
34+
- `scp` - use `-o BatchMode=yes` for non-interactive
35+
- `ssh` - use `-o BatchMode=yes` to fail instead of prompting
36+
- `apt-get` - use `-y` flag
37+
- `brew` - use `HOMEBREW_NO_AUTO_UPDATE=1` env var
38+
39+
<!-- BEGIN BEADS INTEGRATION -->
40+
## Issue Tracking with bd (beads)
41+
42+
**IMPORTANT**: This project uses **bd (beads)** for ALL issue tracking. Do NOT use markdown TODOs, task lists, or other tracking methods.
43+
44+
### Why bd?
45+
46+
- Dependency-aware: Track blockers and relationships between issues
47+
- Version-controlled: Built on Dolt with cell-level merge
48+
- Agent-optimized: JSON output, ready work detection, discovered-from links
49+
- Prevents duplicate tracking systems and confusion
50+
51+
### Quick Start
52+
53+
**Check for ready work:**
54+
55+
```bash
56+
bd ready --json
57+
```
58+
59+
**Create new issues:**
60+
61+
```bash
62+
bd create "Issue title" --description="Detailed context" -t bug|feature|task -p 0-4 --json
63+
bd create "Issue title" --description="What this issue is about" -p 1 --deps discovered-from:bd-123 --json
64+
```
65+
66+
**Claim and update:**
67+
68+
```bash
69+
bd update <id> --claim --json
70+
bd update bd-42 --priority 1 --json
71+
```
72+
73+
**Complete work:**
74+
75+
```bash
76+
bd close bd-42 --reason "Completed" --json
77+
```
78+
79+
### Issue Types
80+
81+
- `bug` - Something broken
82+
- `feature` - New functionality
83+
- `task` - Work item (tests, docs, refactoring)
84+
- `epic` - Large feature with subtasks
85+
- `chore` - Maintenance (dependencies, tooling)
86+
87+
### Priorities
88+
89+
- `0` - Critical (security, data loss, broken builds)
90+
- `1` - High (major features, important bugs)
91+
- `2` - Medium (default, nice-to-have)
92+
- `3` - Low (polish, optimization)
93+
- `4` - Backlog (future ideas)
94+
95+
### Workflow for AI Agents
96+
97+
1. **Check ready work**: `bd ready` shows unblocked issues
98+
2. **Claim your task atomically**: `bd update <id> --claim`
99+
3. **Work on it**: Implement, test, document
100+
4. **Discover new work?** Create linked issue:
101+
- `bd create "Found bug" --description="Details about what was found" -p 1 --deps discovered-from:<parent-id>`
102+
5. **Complete**: `bd close <id> --reason "Done"`
103+
104+
### Auto-Sync
105+
106+
bd automatically syncs with git:
107+
108+
- Exports to `.beads/issues.jsonl` after changes (5s debounce)
109+
- Imports from JSONL when newer (e.g., after `git pull`)
110+
- No manual export/import needed!
111+
112+
### Important Rules
113+
114+
- ✅ Use bd for ALL task tracking
115+
- ✅ Always use `--json` flag for programmatic use
116+
- ✅ Link discovered work with `discovered-from` dependencies
117+
- ✅ Check `bd ready` before asking "what should I work on?"
118+
- ❌ Do NOT create markdown TODO lists
119+
- ❌ Do NOT use external issue trackers
120+
- ❌ Do NOT duplicate tracking systems
121+
122+
For more details, see README.md and docs/QUICKSTART.md.
123+
124+
## Landing the Plane (Session Completion)
125+
126+
**When ending a work session**, you MUST complete ALL steps below. Work is NOT complete until `git push` succeeds.
127+
128+
**MANDATORY WORKFLOW:**
129+
130+
1. **File issues for remaining work** - Create issues for anything that needs follow-up
131+
2. **Run quality gates** (if code changed) - Tests, linters, builds
132+
3. **Update issue status** - Close finished work, update in-progress items
133+
4. **PUSH TO REMOTE** - This is MANDATORY:
134+
```bash
135+
git pull --rebase
136+
bd sync
137+
git push
138+
git status # MUST show "up to date with origin"
139+
```
140+
5. **Clean up** - Clear stashes, prune remote branches
141+
6. **Verify** - All changes committed AND pushed
142+
7. **Hand off** - Provide context for next session
143+
144+
**CRITICAL RULES:**
145+
- Work is NOT complete until `git push` succeeds
146+
- NEVER stop before pushing - that leaves work stranded locally
147+
- NEVER say "ready to push when you are" - YOU must push
148+
- If push fails, resolve and retry until it succeeds
149+
150+
<!-- END BEADS INTEGRATION -->

chainlink-node/Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@ FROM --platform=linux/amd64 smartcontract/chainlink:2.12.0
33

44
USER root
55

6-
# Install gettext for envsubst command
7-
RUN apt-get update && apt-get install -y gettext
6+
# Install gettext for envsubst command (needed by entrypoint.sh)
7+
# The base image has a broken PostgreSQL apt repository, so we allow unauthenticated access
8+
# and suppress those errors while still succeeding in installing from available repositories
9+
RUN apt-get update -o APT::Get::AllowUnauthenticated=true 2>&1 | grep -v postgresql || true && \
10+
apt-get install -y gettext && \
11+
rm -rf /var/lib/apt/lists/*
812

913
# Create a directory for configuration files
1014
RUN mkdir -p /etc/chainlink/config

chainlink-node/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ services:
1313
- chainlink-data:/chainlink
1414

1515
postgres:
16-
image: postgres:16.3
16+
image: postgres:16-alpine
1717
container_name: trust-api-chainlink-node-db
1818
env_file:
1919
- .env
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
type = "directrequest"
2+
schemaVersion = 1
3+
4+
# Unified proxy action job: forwards endorse, disapprove, and withdrawStake calls
5+
# from UTTProxy on this chain to proxyAction() on the main UTT contract. The
6+
# specific action is read from the request payload's `actionType` field
7+
# (0=ENDORSE, 1=DISAPPROVE, 2=WITHDRAW_STAKE).
8+
name = "UTT Proxy Action ${__PROXY_JOB_VALUE_NETWORK}"
9+
10+
evmChainID = "${__PROXY_JOB_VALUE_PROXY_NETWORK_ID}"
11+
contractAddress = "${__PROXY_JOB_VALUE_PROXY_ORACLE_OPERATOR_ADDRESS}"
12+
13+
externalJobID = "${__PROXY_JOB_VALUE_UTT_PROXY_ACTION_EXTERNAL_JOB_ID}"
14+
15+
observationSource = """
16+
decode_log [type="ethabidecodelog"
17+
abi="OracleRequest(bytes32 indexed specId, address requester, bytes32 requestId, uint256 payment, address callbackAddr, bytes4 callbackFunctionId, uint256 cancelExpiration, uint256 dataVersion, bytes data)"
18+
data="$(jobRun.logData)"
19+
topics="$(jobRun.logTopics)"]
20+
21+
decode_cbor [type="cborparse" data="$(decode_log.data)"]
22+
23+
# Surface the action type in the run graph for at-a-glance visibility in the
24+
# Chainlink dashboard. Per-run inspection shows this memo alongside the
25+
# other decoded fields.
26+
action_label [type="memo" value="actionType=$(decode_cbor.actionType)"]
27+
28+
action_tx [type="ethabiencode" abi="proxyAction(address source, address target, uint256 amount, string transactionId, uint8 actionType)" data="{\\"source\\": $(decode_cbor.sourceAddress), \\"target\\": $(decode_cbor.targetAddress), \\"amount\\": $(decode_cbor.amount), \\"transactionId\\": $(decode_cbor.transactionId), \\"actionType\\": $(decode_cbor.actionType) }"]
29+
30+
submit_action_tx [type="ethtx"
31+
evmChainID="${UTT_NETWORK_ID}"
32+
to="${UTT_MAIN_CONTRACT_ADDRESS}"
33+
data="$(action_tx)" minConfirmations="1" failOnRevert="true"]
34+
35+
decode_log -> decode_cbor -> action_label
36+
decode_cbor -> action_tx -> submit_action_tx
37+
"""

chainlink-node/jobs/network-specific/values-11155111/testnet_aurora.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ export __PROXY_JOB_VALUE_PROXY_NETWORK_ID="1313161555"
33
export __PROXY_JOB_VALUE_PROXY_ORACLE_OPERATOR_ADDRESS="0xbeF02f42F30b1233977DF88986DbB4D27D9c5b09"
44
export __PROXY_JOB_VALUE_UTT_PROXY_ENDORSE_EXTERNAL_JOB_ID="ce9c161d576e41598b5599f7e111c808"
55
export __PROXY_JOB_VALUE_UTT_PROXY_CLAIM_REWARD_EXTERNAL_JOB_ID="d38e785276534600ba42401e4bad0156"
6+
export __PROXY_JOB_VALUE_UTT_PROXY_ACTION_EXTERNAL_JOB_ID=""

chainlink-node/jobs/network-specific/values-11155111/testnet_base.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ export __PROXY_JOB_VALUE_PROXY_NETWORK_ID="84532"
33
export __PROXY_JOB_VALUE_PROXY_ORACLE_OPERATOR_ADDRESS="0x1380FD912C44F3860D17EB6221F861F9c4611D97"
44
export __PROXY_JOB_VALUE_UTT_PROXY_ENDORSE_EXTERNAL_JOB_ID="89c86d27881e4854a61a87070363d7d7"
55
export __PROXY_JOB_VALUE_UTT_PROXY_CLAIM_REWARD_EXTERNAL_JOB_ID="6cdee6e7c62b43469926f7dc7bc8ffae"
6+
export __PROXY_JOB_VALUE_UTT_PROXY_ACTION_EXTERNAL_JOB_ID="a9ffd71b7f674f14bc71f78063204450"

chainlink-node/jobs/network-specific/values-11155111/testnet_lisk.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ export __PROXY_JOB_VALUE_PROXY_NETWORK_ID="4202"
33
export __PROXY_JOB_VALUE_PROXY_ORACLE_OPERATOR_ADDRESS="0xC3586558ddb1Cc6C7c5338691842b8d5F47D253d"
44
export __PROXY_JOB_VALUE_UTT_PROXY_ENDORSE_EXTERNAL_JOB_ID="30d3f168-244f-4078-8be3-5c05f6c5924f"
55
export __PROXY_JOB_VALUE_UTT_PROXY_CLAIM_REWARD_EXTERNAL_JOB_ID="2d308672-0bcd-4847-bf08-8ffb976d9508"
6+
export __PROXY_JOB_VALUE_UTT_PROXY_ACTION_EXTERNAL_JOB_ID=""

chainlink-node/jobs/network-specific/values-11155111/testnet_optimism.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ export __PROXY_JOB_VALUE_PROXY_NETWORK_ID="11155420"
33
export __PROXY_JOB_VALUE_PROXY_ORACLE_OPERATOR_ADDRESS="0x6934c1F62a6d28a573E2b4071a754DDd29B81E54"
44
export __PROXY_JOB_VALUE_UTT_PROXY_ENDORSE_EXTERNAL_JOB_ID="18cb4a46-518e-48c9-b753-446386b16bac"
55
export __PROXY_JOB_VALUE_UTT_PROXY_CLAIM_REWARD_EXTERNAL_JOB_ID="cdf5d5ac-b468-435e-a51a-d2798e80f15e"
6+
export __PROXY_JOB_VALUE_UTT_PROXY_ACTION_EXTERNAL_JOB_ID="318c8baf-0670-4465-8e98-9266895105be"

chainlink-node/jobs/network-specific/values-137/aurora.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ export __PROXY_JOB_VALUE_PROXY_NETWORK_ID="1313161554"
33
export __PROXY_JOB_VALUE_PROXY_ORACLE_OPERATOR_ADDRESS="0xC17985dfBF775aB5DAA9F9328423481d3Bb76f37"
44
export __PROXY_JOB_VALUE_UTT_PROXY_ENDORSE_EXTERNAL_JOB_ID="ce9c161d576e41598b5599f7e111c808"
55
export __PROXY_JOB_VALUE_UTT_PROXY_CLAIM_REWARD_EXTERNAL_JOB_ID="d38e785276534600ba42401e4bad0156"
6+
export __PROXY_JOB_VALUE_UTT_PROXY_ACTION_EXTERNAL_JOB_ID=""

0 commit comments

Comments
 (0)