Skip to content

Identity: add unlisted list commands for saved artifacts - #353

Open
drapeau-stripe wants to merge 8 commits into
raubrey/aap-credential-walletfrom
drapeau/identity-list-show
Open

drapeau-stripe wants to merge 8 commits into
raubrey/aap-credential-walletfrom
drapeau/identity-list-show

Conversation

@drapeau-stripe

@drapeau-stripe drapeau-stripe commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Agents currently have to retain paths returned by issuance or inspect storage files themselves. Add identity credentials list and identity attestations list so agents can find saved artifacts, check credential expiry and key location, and see per-batch and total stored AAT counts before requesting more.

Both commands are Unlisted, enabled with LINK_IDENTITY_COMMANDS=1, and excluded from MCP. Stacked on #339.

Usage and sample output excerpts (home paths abbreviated):

LINK_IDENTITY_COMMANDS=1 link-cli identity credentials list --format json
{
  "credentials": [{
    "output_file": "~/.link-cli/credentials/current.json",
    "expires_at": "2026-09-20T01:00:00Z",
    "expired": false,
    "holder": {"path": "~/.link/holder-key.jwk"},
    "claim_names": ["email", "name"]
  }],
  "errors": []
}
LINK_IDENTITY_COMMANDS=1 link-cli identity attestations list --format json
{
  "attestations": [
    {"output_file": "~/.link-cli/attestations/batch-1.json", "stored_token_count": 10},
    {"output_file": "~/.link-cli/attestations/batch-2.json", "stored_token_count": 5}
  ],
  "total_token_count": 15,
  "errors": []
}

Lists expose metadata, preserve saved files, and report corrupt entries alongside valid ones. Counts describe stored tokens. Documentation updates stay in the existing identity sections.

Validation: 21 focused tests and 29 usage checks passed, including real terminals. Build, typecheck, and lint passed; independent review found no actionable issues.

r? @drapeau-stripe

-- Written by Codex

Let agents discover local identity artifacts without issuing more credentials or needing an authenticated Link session. Expose paths, cached expiry, holder metadata, and stored token counts while keeping credential bytes and claim values out of command output.

Report malformed files alongside valid inventory and distinguish stored AAT counts from untracked external use. Preserve the existing identity feature gate and MCP exclusion.

Committed-By-Agent: codex
Co-authored-by: codex <noreply@openai.com>
@drapeau-stripe
drapeau-stripe requested a review from a team as a code owner September 18, 2026 22:46
@drapeau-stripe drapeau-stripe self-assigned this Sep 18, 2026
drapeau-stripe and others added 2 commits September 18, 2026 15:59
Limit identity documentation updates to README and CLAUDE, which already describe the gated identity commands on the parent branch. Keep the payment skill at the parent's content until identity is ready to be exposed there.

Committed-By-Agent: codex
Co-authored-by: codex <noreply@openai.com>
Committed-By-Agent: codex
Co-authored-by: codex <noreply@openai.com>
@drapeau-stripe drapeau-stripe changed the title Identity: list and show saved credentials and attestations Identity: add unlisted list/show for saved artifacts Sep 18, 2026
drapeau-stripe and others added 3 commits September 18, 2026 16:11
Read known artifacts without listing their parent directory so show works with execute-only directory permissions. Keep saved-file validation beside the metadata projection and use standard errors instead of a separate error hierarchy.

Consolidate inspection coverage into one suite with a built-CLI regression and shorten the existing unlisted identity documentation.

Committed-By-Agent: codex
Co-authored-by: codex <noreply@openai.com>
The consolidated smoke test starts five CLI processes. CI process startup exceeds the default five-second test budget, so allow thirty seconds for this test while preserving its assertions.

Committed-By-Agent: codex
Co-authored-by: codex <noreply@openai.com>
Both lists already return the metadata needed to discover saved credentials and attestation batches. Remove the redundant show commands and file selector, and keep documentation and tests focused on listing.

Committed-By-Agent: codex
Co-authored-by: codex <noreply@openai.com>
@drapeau-stripe drapeau-stripe changed the title Identity: add unlisted list/show for saved artifacts Identity: add unlisted list commands for saved artifacts Sep 18, 2026
drapeau-stripe and others added 2 commits September 18, 2026 16:33
Committed-By-Agent: codex
Co-authored-by: codex <noreply@openai.com>
Use total_token_count for the aggregate and retain stored_token_count for each batch. Remove the static usage field because the list note already explains that external token use is untracked.

Committed-By-Agent: codex
Co-authored-by: codex <noreply@openai.com>
cli.command('list', {
description: 'List saved attestation files and stored token counts.',
mcp: false,
outputPolicy: 'all' as const,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hmm i think our output policy is different for attestation request and list. Can follow up / align these once we ship it forreal

});
}

export async function listAttestations() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit should we name this file list.ts? inspect took me a sec to grok

const file = path.join(getOutputDirectory(), 'current.json');
try {
const artifact = await readArtifact(file, savedCredentialSchema);
return {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same here I think we rename this file to list.ts

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants