Skip to content

v29: Harden ENSJobPages preview + contract-faithful Alpha Agent Identity flow#1478

Open
MontrealAI wants to merge 3 commits into
mainfrom
codex/upgrade-agijobmanager-html-to-v29
Open

v29: Harden ENSJobPages preview + contract-faithful Alpha Agent Identity flow#1478
MontrealAI wants to merge 3 commits into
mainfrom
codex/upgrade-agijobmanager-html-to-v29

Conversation

@MontrealAI
Copy link
Copy Markdown
Owner

Motivation

  • Finish the ENS Job Page Preview so it reflects the live ENSJobPages contract address and public state (prefer AGIJobManager.ensJobPages() and fall back to the verified 0x06188e77... only when required).
  • Fix the broken FreeTrialSubdomainRegistrarIdentity integration by replacing truncated ABI shapes and rebuilding the identity state machine around preview(label) and rootHealth() so the identity path is contract-faithful and robust.
  • Keep the ENS-only registrar path available as the expert fallback while making the register(label) identity path the recommended UX and enforce soulbound semantics.
  • No external session skills were used for the patch (local edits only).

Description

  • ENS preview resolution: resolveEnsJobPagesContract() now reads agiJobManager.methods.ensJobPages() first, records the address source explicitly (AGIJobManager getter / verified fallback / unavailable), and updateEnsJobPagePreview() populates preview rows from live jobLabelSnapshot, jobEnsLabel, jobEnsName, jobEnsURI, and jobEnsNode.
  • Identity ABI and parsing: replaced the incorrect v28 ABI fragments with contract-faithful ABI shapes for rootHealth(), preview(string), and labelData(uint256), and rewrote parseIdentityPreviewResult() to map the full tuple and status codes into APP_STATE.identity.preview.
  • Identity state & UX: refreshIdentityState() now uses preview(label) as the primary state machine, decodes rootHealth() correctly, enforces label validation rules, blocks writes on ROOT_NODE mismatch, shows cross-contract mismatch warnings, gates register/claim/sync buttons by preview-driven rules, and decodes tokenURI (base64 JSON) into the token card.
  • Mission control & verification: updated updateMissionControl() CTA precedence so claimable > repair (desynced/expired+exists) > registrable > generic prompts; verifySubdomain() now uses live AGIJobManager.nameWrapper() and AGIJobManager.ens() reads and degrades explicitly when those getters are unavailable.
  • ENS-only path preserved: kept FreeTrialSubdomainRegistrar.registerSimple(parentNode,label,newOwner) path as the secondary/expert flow and preserved recipient override only for the ENS-only path; the identity path (register(label)) never exposes a recipient override and always mints to msg.sender.
  • Misc hardening: updated recent-name keying to v29, tightened post-success behavior to auto-refresh preview/root-health/mission/jobs/insights and surface tx/tokenId in the success toast, removed stale predicted job-<id> assumptions, and updated visible version copy to v29.

Testing

  • Extracted inline script and ran node --check /tmp/v29.js to validate the updated JS syntax, which passed successfully.
  • Served the standalone file with python -m http.server 8000 and captured a Playwright screenshot of http://127.0.0.1:8000/ui/agijobmanager_genesis_job_mainnet_2026-03-05-v29.html, producing the artifact for visual inspection (artifact available).
  • Ran a local smoke validation by loading the page and exercising HUD refresh hooks (refreshIdentityState(), updateEnsJobPagePreview() flow) in-browser; the contract-read code paths and preview rendering executed without syntax/runtime errors in the checked environment.
  • All automated checks performed (syntax check + headless render) succeeded; deeper on-chain integration requires a connected mainnet wallet and live RPC and was intentionally left to live verification during operator-led testing.

Codex Task

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e7ab9741fd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

const [ownerOf, labelData, tokenURI] = await Promise.all([
freeTrialRegistrarIdentity.methods.ownerOf(preview.tokenId).call().catch(()=>''),

if(preview?.tokenId && (preview?.identityExists || preview?.tokenOwner)){
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Clear token card fields when preview has no identity token

In refreshIdentityState(), token card fields are now only updated inside this if block, but there is no fallback path to reset them when the selected label has no identity token. If an operator first views a minted label and then switches to an unminted/invalid one, stale owner/mintedAt/metadata/image values from the previous label remain visible, which misrepresents the current preview state and can lead to incorrect operator decisions.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0f9d678c13

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +4023 to +4025
if(preview?.tokenId && (preview?.identityExists || preview?.tokenOwner)){
const [ownerOf, labelData, tokenURI, lockedState] = await Promise.all([
freeTrialRegistrarIdentity.methods.ownerOf(preview.tokenId).call().catch(()=> preview?.tokenOwner || ''),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Skip token-card reads when preview has no minted identity

The new guard if(preview?.tokenId && (preview?.identityExists || preview?.tokenOwner)) treats any non-empty tokenOwner string as proof of an identity token, but preview.tokenOwner is typically the zero address (0x000…000) when identityExists is false. In that common claimable/available case, this branch still runs, ownerOf/locked revert and fall back values are shown, so the UI reports a zero-address owner and soulbound locked: true for a token that does not exist. This regresses preview accuracy and can mislead operators about current identity state.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant