Skip to content

v27: ENSJobPages preview hardening + FreeTrialSubdomainRegistrar alpha-agent mint flow#1468

Open
MontrealAI wants to merge 3 commits intomainfrom
codex/upgrade-agijobmanager-html-to-v27-oc10pc
Open

v27: ENSJobPages preview hardening + FreeTrialSubdomainRegistrar alpha-agent mint flow#1468
MontrealAI wants to merge 3 commits intomainfrom
codex/upgrade-agijobmanager-html-to-v27-oc10pc

Conversation

@MontrealAI
Copy link
Copy Markdown
Owner

Motivation

  • Finish correctness and honesty work for the ENS Job Page preview so it reflects the live AGIJobManager.ensJobPages() wiring and clearly shows a labeled degraded fallback when needed.
  • Add a polished, single-file, mobile-first flow so operators can mint a free-trial *.alpha.agent.agi.eth ENS subname via the on-chain FreeTrialSubdomainRegistrar while preserving write gating and accurate disclosure.
  • Remove synthetic/inferred active-job IDs that could be presented as authoritative when event indexing is degraded.

Description

  • ENS preview: resolution now calls AGIJobManager.ensJobPages() first and displays the resolved address and source (AGIJobManager getter / verified fallback / unavailable), reads live ENSJobPages fields, and shows clear public-prerequisite honesty and tokenURI-mode distinctions.
  • Free-trial registrar: added FreeTrialSubdomainRegistrarABI and supporting NameWrapper reads, new constants for the registrar and parent node, and a dedicated alphaAgentMintSection UI (preview card, registrar state table, recent names, and expert admin accordion).
  • Mint flow: implemented client-side label validation matching contract rules (lowercase a-z0-9, 8–63 chars, no dots/hyphens/spaces), live availability checks via available(childNode), validateLabel(...) cross-checks, child node/namehash preview, and an in-page transaction review modal which submits registerSimple(parentNode, label, newOwner) with value: 0.
  • Post-mint UX: successful mint parses NameRegistered when present, stores recent names locally, auto-fills agentSub, triggers the existing verifySubdomain('agent', true) flow, and updates mission readiness and badges.
  • Admin & expert controls: added an authorized parent-manager surface that reveals setupDomain, activateParent, deactivateParent, and removeParent when wrapper.canModifyName(parentNode, wallet) returns true, and integrated expert register(...) affordance in an advanced section.
  • Safety & UX fixes: removed synthetic active-job inference (degraded mode now shows no fabricated IDs), improved mobile integration (dock/sheet and command palette entries for minting and registrar refresh), added CSS and accessibility-friendly review modal, and ensured no raw alert()/confirm()/prompt() are used.

Testing

  • Ran static JS syntax checks with node --check on the extracted inline script blocks and they passed.
  • Captured a mobile rendering screenshot of the new alphaAgentMintSection using a headless browser against a local HTTP server to validate layout on small viewports (screenshot captured successfully).
  • Scanned the single-file artifact for raw browser dialogs (alert() / confirm() / prompt()) and found none.
  • Performed live-integration smoke wiring in the client initialization paths: resolveEnsJobPagesContract, updateEnsJobPagePreview, and refreshFreeTrialRegistrarState are invoked from the normal refresh/connect flows and were exercised during local UI load (no fatal errors from those reads in the environment used for 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: 1f1955018e

ℹ️ 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".

if(local.ok && freeTrialRegistrar){
const available = await freeTrialRegistrar.methods.available(node).call().catch(()=>null);
availableText = available === null ? 'unavailable (read failed)' : (available ? 'available' : 'unavailable');
await freeTrialRegistrar.methods.validateLabel(local.label).call().catch(()=>{ availableText = 'invalid by contract'; });
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Treat false validateLabel responses as invalid

The contract label cross-check only updates state on exceptions, so if validateLabel(...) returns false instead of reverting (which matches the previous ABI shape), availableText can remain available and the mint button is enabled. In that scenario, users can submit registerSimple for an invalid label and spend gas on a transaction that will predictably revert; the returned value needs to be checked and treated as invalid when false.

Useful? React with 👍 / 👎.

const ms = n > 1e12 ? n : n * 1000;
return new Date(ms).toLocaleString();
}
function normalizeAlphaLabel(raw){ return String(raw || '').trim().toLowerCase().replace(/[^a-z0-9]/g, ''); }
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 Reject illegal label characters instead of stripping them

This normalization removes disallowed characters before validation, so a user input like alpha-agent01 is silently converted to alphaagent01 and can be minted under a different label than the user originally typed. Because the UI now mutates invalid input rather than failing validation, operators can accidentally register unintended names; illegal characters should be rejected explicitly.

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: 04dda1996e

ℹ️ 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 +3639 to +3643
if(parentStatus){
const active = !!(Array.isArray(parentStatus) ? parentStatus[0] : parentStatus.active);
const parentLocked = !!(Array.isArray(parentStatus) ? parentStatus[1] : parentStatus.parentLocked);
const registrarAuthorised = !!(Array.isArray(parentStatus) ? parentStatus[2] : parentStatus.registrarAuthorised);
const parentUsable = !!(Array.isArray(parentStatus) ? parentStatus[3] : parentStatus.parentUsable);
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 registrar readiness flags on failed status reads

refreshFreeTrialRegistrarState only writes registrar readiness inside the if (parentStatus) success path, so when getParentStatus(...) fails the previous APP_STATE.registrar.parentUsable value is retained; updateAlphaMintPreview then gates minting with stale state and can re-enable minting/admin flows even though registrar posture is unknown. This is a regression from the previous reset behavior and can lead users to send transactions that predictably revert and waste gas after transient RPC/read failures.

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