Skip to content

stuck-inadream/coherence-vault

Repository files navigation

Coherence Vault

Coherence Vault is a compact registry for AI runs on the aeternity testnet. Each record stores a content hash plus IPFS CIDs for graph facts summary and prompts together with model name version seed evaluation metrics and latency. The Sophia contract provides a public timeline and tamper resistant provenance.

What is included

  1. Sophia contract CoherenceVaultV2 deployed on the aeternity testnet
    ct_AuoNBNN1GXBKx4YaQio9RG3gSoXQez1NpQu4aJiNG6NsxRESn
  2. Vite React UI that connects with Superhero Wallet and exposes three actions
    get next id
    submit record
    get record
  3. AE Studio notes used to sanity test the contract
    submit record
    get record
    get next id

Run locally

  1. Install Node and npm
  2. Open the frontend folder
  3. Create a file named .env with the three values below

VITE_CONTRACT_ADDR=ct_AuoNBNN1GXBKx4YaQio9RG3gSoXQez1NpQu4aJiNG6NsxRESn VITE_NODE_URL=https://testnet.aeternity.io VITE_COMPILER_URL=https://v7.compiler.aepps.com

markdown Copy code

  1. Install and start

npm install npm run dev

pgsql Copy code

  1. Open the site in the browser at http colon slash slash localhost colon 5173

Wallet setup

  1. Install Superhero Wallet in the browser
  2. Switch to the aeternity testnet
  3. In Superhero open Settings then Permissions and add http colon slash slash localhost colon 5173
  4. In the browser allow popups for localhost

Using the UI

The interface shows
Connect Wallet
Grant address
Contract address
Submit record form
Read section with id field and actions

Current status in this build
The UI renders correctly and connects to the wallet transport
On some wallet builds the address requires an extra confirmation in the extension window
If an address is not shown click Grant address then approve in Superhero

Known limits at submission time

  1. Some wallet builds do not push the address to the page after transport connect
  2. When the address is not provided by the wallet the three actions can remain pending
  3. The contract itself is healthy and callable from AE Studio which we will show in the demo

Contract interface

entrypoint submit_record( content_hash : string, graph_cid : string, facts_cid : string, summary_cid : string, prompts_cid : string, model_name : string, model_ver : string, seed : int, precision_e : int, recall_e : int, precision_r : int, recall_r : int, cite_cov : int, latency_ms : int, redactions : int) : int

entrypoint get_record(id : int) : record_meta entrypoint get_next_id() : int

pgsql Copy code

Troubleshooting

  1. If status says connected and no address appears open the Superhero popup and approve address share for localhost
  2. Ensure network in Superhero is Testnet
  3. Remove localhost from Superhero Permissions then add it again

Roadmap

  1. Deterministic ACI based contract calls in the UI
  2. Public read only dashboard
  3. Mainnet deploy and pinning to IPFS from the UI

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published