Skip to content

kernel: IngestFailure.name leaks a full server path for a directory ingest #317

Description

@JArmandoAnaya

The inconsistency

IngestFailure.name is meant to be the item that failed. For a directory ingest it is the full absolute path on the server — because it is whatever the run's own loop happened to be holding — while for a single-file ingest it is the basename.

It travels: IngestFailureOut publishes it on the wire, so REST, the CLI and MCP all report the same string, and the browser renders it in the ingest run's failure table.

Why it is a leak rather than only an inconsistency

Source.path and Asset.uri are deliberately unpublished — server-side absolute paths are useless to a client and needlessly disclosive, which is why SourceOut.name carries Path(source.path).name and reaching bytes goes through a download route keyed on an asset id. IngestFailure.name is the one place a server path reaches a client anyway, and it does so by accident rather than by decision.

For a hosted workspace that is somebody else's directory layout in a table. The frontend already renders it defensively — the ingest screen keeps the full string in a title attribute and shows a shortened form in the cell — which is a mitigation for a wire problem rather than a fix.

The decision to take

Either:

  1. Normalize at the sourceIngestService records Path(item).name for a directory walk, matching the single-file path and SourceOut.name's precedent. Simple, and it makes the field mean one thing. The cost: two files with the same basename in one directory become indistinguishable in the failure report.
  2. Keep the path but publish a basename — add the split to IngestFailure (name + something like location) and let the wire model publish only the first. More faithful, one more field, and a migration if it is stored rather than derived.

Option 1 is the smaller change and matches every neighbouring decision; option 2 preserves more information for a directory of similarly-named files. Worth ten minutes rather than a guess.

Notes

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    apivisionset.server — REST API and OpenAPI contractkernelvisionset.kernel — domain, ports, adapters, services

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions