Commit Graph

89 Commits

Author SHA1 Message Date
FilipBl4gojevic
9ae2095c3a docs: redact unpatched vulnerability detail from the public architecture doc
The repo is public and the referenced fixes are still several PRs out.
Removes the internal audit pointer, the current auth-state confirmation,
the submission failure-mode detail, and the dependency CVE specifics.
Architecture, rationale, and PR sequence are unchanged.
2026-07-28 09:57:02 +02:00
FilipBl4gojevic
a3c38e70db docs: add non-custodial split architecture and correct the custody claim
PR #2 shipped 'never stored server-side', which is true but materially
incomplete - the mnemonic is a tool-call parameter, so it transits the MCP
client, the model provider, and hosted process memory. Replaced with an
accurate notice pointing at the architecture doc.
2026-07-28 09:57:02 +02:00
FilipBl4gojevic
999a8bcc7f ci: run build and unit tests on PRs and main 2026-07-28 09:57:02 +02:00
FilipBl4gojevic
a3c2930655 chore: gitignore mnemonic.txt, .secrets/, and the audit log 2026-07-28 09:57:02 +02:00
FilipBl4gojevic
5c858f1143 test: split unit and integration suites so CI can run without a wallet 2026-07-28 09:57:02 +02:00
dcejtlin-apex
e572ef8e04 Merge pull request #3 from FilipBl4gojevic/docs-consolidation-strings 2026-07-28 08:03:10 +02:00
FilipBl4gojevic
3d34ae41c8 Agent-facing strings: AP3X terminology, working Koios default, vocabulary cleanup
- ADA -> AP3X in tool/param descriptions, outputs, and safety messages
- default testnet Koios URL -> v2 endpoint (old default returns 503)
- self-improvement descriptions: improvement proposals / proposal metrics
- em dashes -> hyphens in strings and comments

No logic changes; code identifiers and protocol field names untouched.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-27 12:47:49 +02:00
HalukG
8e0d381a7f Merge pull request #2 from FilipBl4gojevic/docs-consolidation-readme
README: hosted servers, 23-tool reference, mainnet endpoints, AP3X terminology
2026-07-24 13:45:57 +03:00
FilipBl4gojevic
c67e7a7056 Package metadata: docs-site homepage, description cleanup
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-24 11:48:40 +02:00
FilipBl4gojevic
9086ceba6a README: canonical Vector mainnet explorer URL
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-24 11:28:41 +02:00
FilipBl4gojevic
8230ee93ab README: vocabulary pass on Self-Improvement descriptions
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-24 11:26:56 +02:00
FilipBl4gojevic
2c25a70a3e README: hosted servers, 23-tool reference, mainnet endpoints, AP3X terminology
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-24 10:46:46 +02:00
david
0cd0a1b85f Rename governance MCP tools to vector_self_improvement_*
Renames the five tools to match the module's public name (Self-Improvement
Module), and renames the source file and registration function in kind.
Consumers relying on the old vector_governance_* names must update.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-17 11:44:49 +02:00
david
a8403e6082 Derive Vector slot config from chain instead of hardcoding testnet epoch
The SLOT_CONFIG_NETWORK.Mainnet zeroTime was hardcoded to the testnet
system start (1752057484000), causing RATE:slot_mismatch failures on
mainnet where the actual system start is 1756485600000. Now queries
Ogmios queryNetwork/startTime on first use and caches the result.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-16 00:10:13 +02:00
david
d21bf23307 update gha workflows 2026-04-15 23:23:54 +02:00
david
057ff03b92 Update governance ref script UTxOs after redeployment
Previous proposal_spend and proposal_mint reference script UTxOs were
consumed. Redeployed all 5 governance reference scripts to unspendable
script-hash-derived addresses via redeploy_ref_scripts.py.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-15 21:23:06 +02:00
david
e4b2697afd Update governance refs to v2-Module-6 redeployment
Module-6 was redeployed with agent-registry v2 baked into
GovernanceConfig (be1a0a2912da180757ed3cd61b56bb8eab0188c19dc3c0e3912d2c01),
producing fresh validator hashes and reference/refs UTxOs. Smoke test
passed end-to-end on Vector testnet (proposal → critique → endorse →
withdraw → adopt all green).

Updated env-fallback defaults:
- GOV_PROPOSAL_SPEND_HASH:    40fe1895… → f815f51a…
- GOV_PROPOSAL_MINT_HASH:     10dff07b… → e8f38052…
- GOV_CRITIQUE_SPEND_HASH:    9e9aaf7e… → ced52074…
- GOV_CRITIQUE_MINT_HASH:     1f5614b7… → 2e252a89…
- GOV_ENDORSEMENT_SPEND_HASH: 1fac8b35… → 5fc44984…
- GOV_PROPOSAL_SPEND_REF:     f0d52877… → 221cdfbd…
- GOV_PROPOSAL_MINT_REF:      3cb52ec8… → c89f2e05…
- GOV_PARAMS_UTXO:            47d17de5… → 2c082e83…
- GOV_ORACLE_UTXO:            3e0685b9… → 7a23dfdf…
- GOV_CROSSREFS_UTXO:         71815087… → 96a4acff…

GOV_TREASURY_ADDRESS unchanged — treasury holder is unparameterized.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 19:17:48 +02:00
david
bda3c30747 Migrate agent-registry from v1 to v2 (audited, Conway-compliant)
Repoint REGISTRY_SCRIPT_CBOR + REGISTRY_POLICY_ID from
5dd5118943d5aa7329696181252a6565a27dbf2c6de92b02a6aae361 (v1) to
be1a0a2912da180757ed3cd61b56bb8eab0188c19dc3c0e3912d2c01 (v2),
deployed to Vector mainnet via TX
3c53fa482245a82f88a39e90191a90cce3b6f09f6e28613bc53d35a0c3ba8587.

v2 enforces indefinite-length CBOR (D8 79 9F ... FF) for the
OutputReference inside the asset-name derivation, matching Aiken's
builtin.serialise_data() on Conway. Lucid's Data.to(new Constr(...))
emits definite-length arrays (D8 79 82 ...), so deriveNftAssetName is
hand-rolled from cborUint + cborBytes primitives. Verified byte-for-byte
against pycardano OutputReference.to_cbor() and agent-sdk-py
plutus_serialise_data across 5 test vectors (see new
test/derive-asset-name.test.ts).

governance.ts: AGENT_REGISTRY_POLICY env-fallback updated to v2.

Datum/redeemer schemas are unchanged between v1 and v2 — no other
tx-building changes required.

Follow-up: agent-sdk-ts at /home/david/code/agent-sdk-ts still ships
v1 constants and the pre-Conway Lucid asset-name derivation; needs the
same migration before consumers can use v2 from that SDK.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 18:49:53 +02:00
david
7a335f21fc fix: clarify proposal TX output to prevent wrong hash usage in critiques/endorsements
Remove the internal Lock TX hash from submit_proposal output and label the
Proposal TX explicitly so agents use the correct hash as proposalTxHash.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-09 17:57:18 +02:00
david
ebfc9c0ad9 fix: use POSIX ms (not slot) for datum timestamps
Plutus validity_range.lower_bound is POSIX time in ms, not a slot number.
The validator's get_slot trace misleadingly names it 'current_slot' but
it's actually POSIX ms. Activity datum and proposal datum timestamps
must use POSIX ms to match the tx validity range.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-09 15:48:38 +02:00
david
dfb48fb311 fix: compute validFrom POSIX directly (drop slotToUnixTime import)
Simple arithmetic: genesis_ms + slot * 1000. No import dependency issues.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-09 15:42:25 +02:00
david
095eaf8614 fix: inline Vector slot config (SLOT_CONFIG_NETWORK not available at runtime)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-09 15:40:38 +02:00
david
2d07d25e2c fix: use Lucid slotToUnixTime for guaranteed slot roundtrip
Use Lucid's own conversion function to ensure the POSIX→slot→POSIX
roundtrip produces the exact same slot in the tx validity range
as the spendSlot used in the activity datum.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-09 15:39:11 +02:00
david
356542211b fix: derive validFrom from chain tip slot for exact slot matching
Validator requires activity.last_proposal_slot == tx_validity_lower_bound.
Derive POSIX time from the same slot used in the datum to guarantee
they convert to the same slot after Lucid's POSIX→slot roundtrip.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-09 15:36:36 +02:00
david
422d336257 fix: use slot number (not POSIX ms) for activity datum last_proposal_slot
The on-chain validator checks slot_mismatch against the tx validity range.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-09 15:32:45 +02:00
david
a1b06ecf3f fix: update proposal_spend_ref after isolated redeployment
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-09 15:29:37 +02:00
david
db21b56e99 feat: redeploy governance contracts with correct agent registry hash
Full redeployment with AGENT_REGISTRY_HASH=5dd51189... (matching the
MCP agent-network registry). All validator hashes, reference scripts,
and infrastructure UTxO refs updated.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-09 15:26:20 +02:00
david
52420c3cad fix: lookup registry NFT at script address, not wallet
The registry NFT is locked at the registry script address with
the 10 AP3X deposit, not in the agent's wallet. Use getUtxoByUnit
to find it on-chain regardless of address.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-09 14:34:00 +02:00
david
0bf2d5230c fix: include agent registry NFT as reference input for DID validation
The on-chain proposal_spend validator checks did_valid by looking for
the agent's registry NFT in reference inputs. Added lookup + .readFrom()
for the NFT UTxO in Step 2 of proposal submission.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-09 14:30:54 +02:00
david
2f84a416e1 fix: configure Vector testnet slot config for Lucid
SLOT_CONFIG_NETWORK.Mainnet was using Cardano mainnet genesis (2020),
causing POSIX→slot conversion to produce slots far beyond the Vector
testnet's era boundaries. Set to Vector testnet genesis 2025-07-09.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-09 13:44:41 +02:00
david
fa137a75c1 fix: use POSIX time (ms) for validity range, not slot numbers
Lucid-Evolution .validFrom/.validTo expect POSIX time in milliseconds.
The code was passing raw slot numbers, which Lucid tried to convert
back causing unsigned integer wraparound and PastHorizon errors.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-09 13:40:42 +02:00
david
a0f5dc25f8 fix: implement getNetworkTip() in OgmiosProvider
Missing method caused slot=0, then spendSlot=-60, which wraps to
a huge unsigned int triggering PastHorizon errors from Ogmios.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-09 13:37:47 +02:00
david
c14752ad75 fix: parse Ogmios v6 script reference format (language+cbor)
Ogmios v6+ returns script references as { language: "plutus:v3", cbor: "..." }
but the parser only handled the legacy { "plutus:v3": "..." } format.
This caused scriptRef to always be null, breaking reference script
resolution for governance proposal submission.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-09 13:33:48 +02:00
david
5adebf19f4 fix: update proposal_spend_ref to verified on-chain UTxO
Previous batch deployment consumed the spend ref as a coin input.
Redeployed in isolation and verified on-chain at index #0.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-09 13:26:33 +02:00
david
062c5ebfc6 fix: update proposal_spend reference script UTxO + add validation
The proposal_spend reference script UTxO was accidentally consumed,
causing MISSING_SCRIPT errors on proposal submission. Updated to the
redeployed UTxO ref and added validation that detects consumed/missing
reference scripts with actionable error messages.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-09 13:21:12 +02:00
david
07251b7f01 Disable local UPLC eval on governance lock transactions
Fixes transaction build failures by passing localUPLCEval: false
to all three governance lock operations (proposal, critique, endorsement).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 12:41:08 +02:00
david
4344b78784 Upgrade governance submit_proposal to validated 2-step flow (mint+spend)
Replace the lock-only proposal submission with the full validated flow:
- Step 1: Lock ProposalDatum at proposal_spend address
- Step 2: Spend locked UTxO + mint prop_ token + mint pact_ activity token
  using CIP-33 reference scripts and governance reference inputs

This makes proposals visible on the Foundation dashboard (which filters
out tokenless proposals). The flow mirrors the Python SDK's
validated_submit_proposal.

Adds:
- Reference script UTxO env vars (CIP-33) with deployment.json defaults
- Infrastructure UTxO env vars (GovernanceParams, Oracle, CrossRefs)
- parseUtxoRef() and waitForTx() helpers
- Activity datum creation (first-time proposer, count=1)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 12:20:28 +02:00
david
8ceb92aec8 Add Filebase IPFS upload to governance tools, fix stale script hashes
- Add @aws-sdk/client-s3 dependency for Filebase S3-compatible IPFS uploads
- Add uploadToFilebase() helper: uploads JSON, computes blake2b_256 hash,
  returns CID from Filebase IPFS bucket
- vector_governance_submit_proposal: add optional proposalDocument param
  for automatic IPFS upload + hash computation (proposalHash/storageUri
  become optional when document is provided)
- vector_governance_critique: add optional critiqueDocument param, same flow
- Fix stale default script hashes to match v6 deployment
- Fix address derivation: replace broken validatorToAddress(CBOR) with
  credentialToAddress(hash) — eliminates need for GOV_*_CBOR env vars
- Fix getAddressDetails: import from Lucid instead of globalThis
- Backward compatible: manual proposalHash + storageUri still works

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 10:53:04 +02:00
david
178a6a4154 Added governance tools 2026-04-08 11:48:06 +02:00
david
8ff02f244e Fix BigInt crash in protocol parameter parsing, add docker-compose
Protocol parameter fields (minFeeA, minFeeB, maxTxSize, maxValSize)
lacked fallback defaults, causing "Cannot convert undefined to a BigInt"
when Lucid-Evolution processed them. Added safe defaults sourced from
Vector public testnet and updated deposit values to match. Made
lovelaceToAda() defensive against undefined/null. Added diagnostic
logging to getWalletInfo and getProtocolParameters error paths.

Converted Dockerfile to multi-stage build and added docker-compose.yml
with inline Vector testnet environment config.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-31 13:26:49 +02:00
david
96a2d12005 Update package.json to reflect repo naming 2026-03-20 10:32:48 +01:00
david
500e7cf729 Added mainnet deploy gh workflow 2026-03-19 16:30:58 +01:00
david
0b3ac4ae82 Migrate to @lucid-evolution/lucid, fix agent registration (blake2b dkLen), contract spend (PlutusV2), and add Ogmios fallback for agent resolution 2026-03-19 15:57:51 +01:00
david
daf2f9aa62 Fix error display 2026-03-19 11:05:14 +01:00
david
23bcf7ec11 Added readme 2026-03-19 02:27:16 +01:00
david
e7626763e8 change messaging 2026-03-19 02:23:35 +01:00
david
e5d56460a0 reduce wait time 30 > 10s 2026-03-19 02:21:48 +01:00
david
23ead76aba Add agent lifecycle tools (update, deregister, transfer), harden registry, and add integration tests 2026-03-19 02:17:25 +01:00
david
74a2e13432 fix bug 2026-03-19 01:10:05 +01:00
david
94e42c2223 fix typo 2026-03-19 00:38:20 +01:00