Skip to content

abcd capture kebab-cases the home path before redaction, so the username still lands in the filename #485

Description

@jogrun

What

abcd capture still commits the caller's username in the issue filename.

iss-2608231025198888 / iss-2608231120121681 made capture redact inputs before normaliseSlug, so a home path no longer turns into a bracketed placeholder that fails kebab-case. That closed the refusal. It did not close the leak on the production path.

The CLI derives the slug from the raw text, then core redacts that already-normalised slug:

  • internal/surface/cli/cli.go:2178-2180sl = deriveSlug(text) on the unredacted body
  • internal/surface/cli/cli.go:2402-2410deriveSlug lowercases and replaces every non-[a-z0-9] run with -
  • internal/core/capture/workflow.go:61-62redactCaptureInputs then sees the kebab slug
  • internal/adapter/scanner/identity.go:232-248home_path_self / generic home-path matchers look for /Users/… or /home/…

After deriveSlug, /Users/alice/.local/bin/abcd is users-alice-local-bin-abcd. Nothing left looks like a path, so redaction leaves the username in slug and in open/iss-N-users-alice-….md.

Reproduction

The regression that was supposed to cover this does not call the CLI (or deriveSlug):

internal/core/capture/redact_test.go:87-102TestCaptureWithHomePathInDerivedSlugStillFiles passes Slug: body (the raw path). Core then redacts that slug as a path and the test goes green.

On main, a CLI-shaped call is:

slug := deriveSlug(body) // kebab-case of "/Users/alice/..."
Capture(CaptureRequest{Text: body, Slug: slug, ...})

res.Slug / res.Path still contain alice.

abcd capture "the PATH entry is $HOME/.local/bin/abcd and it moved"

Suggested fix

Derive the slug in core from the already-redacted body (intent already keeps slug derivation in core: deriveIntentSlug), or run deriveSlug on redacted text only.

Change TestCaptureWithHomePathInDerivedSlugStillFiles so Slug is the kebab-case of the body, matching cli.deriveSlug. Assert the committed filename does not contain the username. Watch that test fail on main before the change.

Happy to send a PR once this is accepted.

Related: iss-2608231120121681 (refusal, not this leak), iss-2608231025198888 (redact committed prose).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions