Skip to content

MontrealAI/AGIJobManagerPrime

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

408 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

AGIJobManager Prime

CI Security Verification Docs Security Policy License

AGIJobManager Prime is an Ethereum smart-contract system for escrowed AGI work agreements, with optional ENS-backed public job pages.

Important

New here? Start with the AGIJobManager Prime Genesis Console.
This is the fastest way to open the current hosted standalone Prime mainnet console.
Repo-pinned equivalent artifact: ui/agijobmanager_genesis_job_mainnet_2026-04-01.html (historical canonical snapshot: v45)
Current standalone/operator guide path: docs/ui/GENESIS_JOB_MAINNET_HTML_UI.md
Deployment / cutover authority remains: hardhat/README.md and docs/DEPLOYMENT/README.md

Quick links

Need Go here
Launch the hosted Genesis Console AGIJobManager Prime Genesis Console
Inspect the pinned repo artifact ui/agijobmanager_genesis_job_mainnet_2026-04-01.html
Current standalone/operator guide path docs/ui/GENESIS_JOB_MAINNET_HTML_UI.md
Standalone UI inventory docs/ui/STANDALONE_HTML_UIS.md
Broader UI docs docs/ui/README.md and ui/README.md
Deployment/operator runbooks hardhat/README.md and docs/DEPLOYMENT/README.md

Operational policy: intended for autonomous AI-agent execution with accountable human owner/operator oversight. This is policy intent and is not fully enforced on-chain.

Prime upgrade architecture (production direction)

This repository now contains both the legacy settlement contract and the Prime two-layer architecture:

  • contracts/AGIJobManagerPrime.sol: settlement-first kernel preserving escrow, bonds, validator review, disputes, challenge windows, conservative pause/owner controls, and solvency accounting.
  • contracts/AGIJobDiscoveryPrime.sol: procurement-first premium discovery (sealed commit, reveal, shortlist from bounded historical signal, paid finalist trials, validator commit/reveal scoring, designated winner handoff, fallback promotion).
  • contracts/interfaces/IAGIJobManagerPrime.sol: canonical bridge interface used by discovery to invoke settlement safely.

Why Prime exists: legacy first-touch assignment could let a merely fast applicant lock high-value jobs before best-agent discovery. Prime introduces procurement-first premium selection while keeping settlement guarantees conservative and auditable.

Canonical deployment path for Prime is now Hardhat (hardhat/scripts/deploy.js, documented in hardhat/README.md). Legacy Truffle deployment remains for compatibility and historical reproducibility.

Start here by role (30-second routing)

Canonical operator answers (quick reference)

  • Canonical deployment path: Hardhat (hardhat/README.md). Truffle is legacy/supported.
  • Canonical ENS replacement flow: deploy new ENSJobPages -> NameWrapper approval -> setEnsJobPages -> legacy migration if needed -> lock only after validation.
  • Canonical ENS naming format: <prefix><jobId>.<jobsRootName> with default prefix agijob-.
  • Canonical ownership split:
    • AGIJobManagerPrime owner controls setEnsJobPages(...) and Prime settlement/discovery governance knobs.
    • wrapped-root owner controls NameWrapper approval needed for wrapped-root ENS writes.
  • Canonical safety rule: ENS hooks are best-effort side effects; settlement/dispute outcomes remain authoritative on AGIJobManagerPrime.
  • Canonical ownership model: manager uses one-step transfer (for strict bytecode headroom), discovery uses two-step handoff (transferOwnership -> acceptOwnership) with pendingOwner / cancelOwnershipTransfer; renounceOwnership is disabled on Prime contracts.
  • Canonical pause model: intake pause (new risk), settlement freeze (value-moving settlement), and full emergency pause (break-glass). Discovery emergency pause is pause-safe (in-flight procurement windows freeze/resume), and manager-owned deadlines (selected acceptance, per-job apply, checkpoint, completion/challenge/dispute windows) now also run on pause-adjusted effective time so owner pauses do not consume user windows.
  • Prime runbook: docs/PRIME_OWNERSHIP_AND_PAUSE_RUNBOOK.md.

Manual vs automated (do not assume)

Action Automated by deploy scripts Manual caller
Deploy Prime (AGIJobManagerPrime + AGIJobDiscoveryPrime) / deploy new ENSJobPages Yes deployer key
NameWrapper approval setApprovalForAll(newEnsJobPages, true) No wrapped-root owner
AGIJobManagerPrime.setEnsJobPages(newEnsJobPages) No AGIJobManagerPrime owner
Legacy migration migrateLegacyWrappedJobPage(jobId, exactLabel) No ENSJobPages owner (if needed)
lockConfiguration() / lockIdentityConfiguration() No owner(s), only after validation

Most common owner/operator safety checks

Before any irreversible action:

  • Confirm which key is AGIJobManagerPrime owner vs wrapped-root owner.
  • Confirm manual steps are complete: setApprovalForAll(newEnsJobPages, true) then setEnsJobPages(newEnsJobPages).
  • Confirm at least one future job hook succeeds and legacy migration status is known.

Irreversible actions (delay until validated):

  • AGIJobManager.lockIdentityConfiguration() (legacy manager only, if you are operating the legacy ENS identity path)
  • ENSJobPages.lockConfiguration()

What this repository contains

UI surfaces (what exists now)

UI routing (pick the right interface quickly)

If you need to... Use this Why
Open the current standalone Prime mainnet UI immediately AGIJobManager Prime Genesis Console Fastest newcomer/operator entry point for the current standalone Prime console.
Inspect the repo-pinned standalone artifact ui/agijobmanager_genesis_job_mainnet_2026-04-01.html Versioned, in-repo equivalent artifact for provenance, review, and pinned inspection.
Read current standalone/operator context docs/ui/GENESIS_JOB_MAINNET_HTML_UI.md Secondary operator/reference guide path for the standalone surface.
Browse standalone artifact inventory or broader UI docs docs/ui/STANDALONE_HTML_UIS.md, ui/README.md, docs/ui/README.md Artifact inventory and broader UI/documentation context.
Deploy/replace contracts and ENS components hardhat/README.md + docs/DEPLOYMENT/README.md Canonical deployment and operator runbooks; the UI is not the deployment authority.

UI safety boundary: the hosted and repo-pinned standalone UI is action-capable, but contract deployment, ownership wiring, and ENS replacement authority remain in Hardhat/deployment runbooks.

Core contracts

  • contracts/AGIJobManager.sol: core escrow, role checks, job lifecycle, settlement, dispute flow, owner controls.
  • contracts/ens/ENSJobPages.sol: optional ENS per-job page manager, naming, resolver updates, permission hooks, and legacy wrapped-page migration.
  • contracts/utils/*.sol: linked libraries used by AGIJobManager in official Hardhat deployment.

Deployment tooling

  • hardhat/: official/recommended deployment and Etherscan verification flow.
  • Root Truffle config + migration scripts: legacy/supported deployment flow for backward compatibility and reproducibility.

Documentation entry points

Recommended vs legacy deployment paths

Recommended (official): Hardhat

Use Hardhat for production deployment and verification of the Prime suite:

  • AGIJobManagerPrime (settlement kernel)
  • AGIJobDiscoveryPrime (premium procurement layer)

Legacy AGIJobManager remains available for historical reproducibility and legacy operations.

Start here: hardhat/README.md

Legacy (supported): Truffle

Truffle remains available for historical reproducibility and existing operational environments.

Legacy docs:

ENSJobPages in one minute

  • AGIJobManager provides the numeric jobId.
  • ENSJobPages provides the label prefix (jobLabelPrefix, default agijob-) and root suffix (jobsRootName, e.g. alpha.jobs.agi.eth).
  • Effective ENS name format is: <prefix><jobId>.<jobsRootName>.
  • With current defaults, names are:
    • agijob-0.alpha.jobs.agi.eth
    • agijob-1.alpha.jobs.agi.eth
  • Prefix updates only affect jobs whose labels are not yet snapshotted.
  • ENS hooks are best-effort and non-fatal to core settlement; protocol settlement can succeed even when ENS writes fail.

See full behavior details: docs/ENS/ENS_JOB_PAGES_OVERVIEW.md

ENS truth model (operator-safe summary)

  • previewJobEnsLabel/name/URI/node are projections from the current mutable root + prefix config.
  • effectiveJobEnsLabel/name/URI/node are authoritative only after ENSJobPages has snapshotted authority for that job.
  • Compatibility getters (jobEnsLabel, jobEnsName, jobEnsURI, jobEnsNode) are mixed-mode convenience surfaces: they return effective values once authority exists, otherwise preview values. Do not present them as always-authoritative.
  • Under the current unchanged AGIJobManagerPrime ABI, automatic authority issuance can still occur through handleHook(uint8,uint256), but spec/completion text hydration may require explicit keeper/operator repair using log-driven scripts when rich V1 getters are unavailable.
  • Hardhat deploy tooling now preflights Prime↔ENS compatibility mode before wiring (rich vs lean vs none) and refuses unsafe LOCK_CONFIG in keeper-required modes.
  • jobEnsIssued and jobEnsReady are chain-observed compatibility bits, not sticky write-attempt caches. jobEnsReady means authority exists, the node exists, the configured resolver is installed, and the required base metadata texts (schema, agijobs.spec.public) are observable onchain.

Canonical audit / gap docs for the current branch live in:

Operator quickstart (Prime canonical)

  1. Read the official Hardhat guide and prepare .env + deploy config.
  2. From hardhat/, compile (cd hardhat && npx hardhat compile) and dry-run (DRY_RUN=1 ...).
  3. Deploy the Prime suite (AGIJobManagerPrime + AGIJobDiscoveryPrime) with the mainnet confirmation gate. Network/chainId mismatches are rejected by the canonical deploy script.
  4. Verify deployment outputs on Etherscan and in hardhat/deployments/<network>/ artifacts (including persisted completionNFT from the manager constructor).
  5. Transfer ownership to the intended final owner if required by your operational policy.

Expected result after Prime deployment:

  • Premium jobs use procurement-first winner discovery before assignment (not first-touch lock capture).
  • Settlement retains conservative escrow/bond/dispute/finalization behavior.
  • Optional ENSJobPages lifecycle hooks can be configured on Prime via setEnsJobPages(...) and remain best-effort/non-fatal. Prime does not expose a useEnsJobTokenURI flag; completion NFT metadata remains IPFS/completion-URI based unless a future, separately sized manager release changes that.

Prime exposes keeper/bot-friendly autonomy surfaces for deterministic procurement progression in discovery (AGIJobDiscoveryPrime): isShortlistFinalizable, isWinnerFinalizable, isFallbackPromotable, nextActionForProcurement, getAutonomyStatus, and permissionless advanceProcurement for timeout-driven stage advancement.

Optional legacy ENS wiring path (legacy contract only)

If you are also operating legacy AGIJobManager + ENSJobPages, use the separate legacy ENS runbook flow:

  1. Deploy/replace ENSJobPages via hardhat/scripts/deploy-ens-job-pages.js.
  2. Perform manual wiring on mainnet:
    • NameWrapper.setApprovalForAll(newEnsJobPages, true) by wrapped-root owner.
    • AGIJobManager.setEnsJobPages(newEnsJobPages) by legacy AGIJobManager owner.
  3. If legacy jobs must retain historical labels, run per-job migration (migrateLegacyWrappedJobPage(jobId, exactLabel)).
  4. Only lock ENS/identity configuration after post-cutover validation.

Expected result after legacy ENS cutover:

  • New legacy-manager jobs use <prefix><jobId>.<jobsRootName> (default agijob-...alpha.jobs.agi.eth).
  • AGIJobManager lifecycle and settlement continue even if an ENS side-effect fails.
  • Legacy labels remain stable unless explicitly migrated/imported.

Job creation modes (operator-facing mental model)

  • Ordinary job: create directly on AGIJobManagerPrime and allow open applications (first valid taker path).
  • Premium job: create through AGIJobDiscoveryPrime.createPremiumJobWithDiscovery(...) so procurement is completed first.
  • Existing job upgrade (eligible jobs only): use AGIJobDiscoveryPrime.attachProcurementToExistingJob(...) only when the caller is the employer and the target job is still unassigned in SelectedAgentOnly intake mode; ordinary OpenFirstCome jobs are not attach-compatible and will revert.
  • Budget planning: pre-quote procurement requirements via AGIJobDiscoveryPrime.quoteProcurementBudget(...).

Premium handoff sequence is: authorized+qualified commit/reveal applications -> deterministic shortlist (score then address tie-break) -> paid finalist trial -> validator commit/reveal scoring -> designated winner assignment into settlement -> fallback finalist promotion if the designated winner fails to take the job within the configured acceptance window. If a procurement becomes orphaned before winner finalization, employer/owner can explicitly unwind via cancelProcurement(...) (stakes/bonds/budget returned to claimable balances).

Never-do-this-by-accident checklist

  • Do not assume scripts perform NameWrapper approval or setEnsJobPages(...); those remain manual.
  • Do not call lockConfiguration() / lockIdentityConfiguration() before deploy, wiring, and migration validation.
  • Do not assume changing jobLabelPrefix rewrites existing legacy/snapshotted names.
  • Do not treat ENS hook failures as settlement failures; check both protocol events and ENS hook events.

Detailed procedures and expected outputs:

Canonical Prime checks and deploy ergonomics

npm ci
cd hardhat && npm ci && cd ..
npm run test:prime:ci
npm run test:size:benchmark

Useful operator commands:

npm run deploy:prime:dry-run:mainnet
npm run deploy:prime:mainnet
npm run deploy:prime:sepolia

Legacy Truffle build/test flows remain available for reference compatibility (npm run build, npm test), but Prime hardening/deployment should use the Hardhat-first commands above.

Documentation

Maintenance commands:

npm run docs:gen
npm run docs:check
npm run check:no-binaries

Alias note: check-no-binaries is exposed as npm run check:no-binaries.

Policy and legal references

ENS authority hardening

  • Preview ENS values are projections from the current prefix/root configuration.
  • Effective ENS values are authoritative per-job snapshots stored in ENSJobPages.
  • AGIJobManagerPrime remains on the existing handleHook(uint8,uint256) ABI; authority repair, migration, resolver repair, and finalization live on the ENS side. Preview getters are projections only; authoritative values come from ENSJobPages per-job snapshots.
  • Re-run scripts/ens/audit-mainnet.ts and scripts/ens/inventory-job-pages.ts from a networked operator environment before mainnet cutover because chain state is the source of truth.
  • Treat previewJobEns* as projected values only; treat effectiveJobEns* as authoritative only after the inventory/status scripts confirm authority snapshot readiness for that job.
  • The production-safe Prime path is keeper-assisted authoritative ENS, not fully automated on-chain ENS hydration: operators may need to call createJobPage, onAgentAssigned, onCompletionRequested, repairAuthoritySnapshot, repairResolver, repairTexts, repairAuthorisations, and lockJobENS using event-driven runbooks.

About

AGIJobManagerPrime — Next-generation sovereign AI labor protocol featuring autonomous agent discovery, game-theoretic job markets, and institutional-grade on-chain settlement.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Generated from MontrealAI/AGIJobManager