Skip to content

feat(profile): safely edit non-secret account labels - #251

Merged
mohanagy merged 2 commits into
developmentfrom
feat/204-profile-description
Jul 26, 2026
Merged

feat(profile): safely edit non-secret account labels#251
mohanagy merged 2 commits into
developmentfrom
feat/204-profile-description

Conversation

@mohanagy

@mohanagy mohanagy commented Jul 26, 2026

Copy link
Copy Markdown
Owner

Part of #204.

Summary

  • add an audited CLI and local Console flow to set or explicitly clear one existing profile description
  • preserve every unrelated profile field, durable default, routing, OAuth binding, credential reference, and provider cache owner
  • keep submitted labels and configuration bytes out of public results and lifecycle audit records
  • document the returning-user workflow and exercise the actual packed tarball command

Validation

  • focused profile/CLI/Console/docs tests
  • npm run typecheck
  • npm run lint
  • npm run build
  • npm run smoke:cli
  • npm run check:pack
  • npm run test:package (24/24, real installed tarball)

npm run test:coverage was attempted twice locally. It hit existing timing-sensitive failures under severe macOS Storage Management CPU saturation; no feature source, test assertion, or timeout was changed. The exact cancellation case passed in isolation. Evidence is recorded on #122; current-head CI remains the required full-suite gate.

Summary by CodeRabbit

  • New Features

    • Added the ability to set or clear non-secret account labels after setup.
    • Added profile set-description CLI support with validation, reviewable results, and clear-label functionality.
    • Added Console dashboard controls for editing or clearing profile labels.
  • Bug Fixes

    • Profile label changes preserve credentials, OAuth bindings, routing, defaults, and other profile settings.
    • Added guarded recovery and auditing for configuration updates.
  • Documentation

    • Updated CLI and README guidance for managing account labels.

@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds guarded profile description set/clear support for CLI and Console workflows, including validation, auditing, recovery, persistence, UI/API wiring, documentation, and integration coverage.

Changes

Profile description editing

Layer / File(s) Summary
Guarded mutation engine
src/setup/profile-description-onboarding.ts, src/utils/errors.ts, tests/profile-description-onboarding.test.ts, CHANGELOG.md
Validates and plans isolated description changes, preserves other profile fields, performs audited replacements, and restores the original configuration when audit finalization fails.
CLI set-description command
src/cli/*, docs/cli.md, README.md, tests/cli-*.test.ts, tests/package-contract.test.ts, tests/readme-product-contract.test.ts
Adds profile set-description with mutually exclusive set/clear options, JSON reporting, exit-code handling, help text, documentation, and packed-artifact coverage.
Console description editor
src/console/*, tests/console-*.test.ts
Adds the dashboard editor, CSRF-protected API route, request validation, selected-configuration handling, audit integration, and persistence tests for setting and clearing descriptions.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related issues

Possibly related PRs

  • mohanagy/miftah#183 — Introduces the Console control API scaffolding extended here with profile-description mutations.
  • mohanagy/miftah#206 — Provides the trusted configuration and active-selection plumbing reused by this Console operation.
  • mohanagy/miftah#249 — Touches the same CLI profile command catalog and dispatch paths.

Sequence Diagram(s)

sequenceDiagram
  participant ConsoleDashboard
  participant ConsoleServer
  participant ConsoleApplicationService
  participant ProfileDescriptionChange
  participant ConfigFile
  ConsoleDashboard->>ConsoleServer: POST /api/v1/profiles/description
  ConsoleServer->>ConsoleApplicationService: validate and dispatch request
  ConsoleApplicationService->>ProfileDescriptionChange: set or clear profile description
  ProfileDescriptionChange->>ConfigFile: apply guarded replacement
  ConfigFile-->>ConsoleDashboard: changed/write/actions report
Loading

Poem

A rabbit labels profiles bright,
Then clears the tag by moonlit night.
Audits hop and backups stay,
While secrets safely hide away.
CLI and Console dance in flight.


Caution

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

  • Ignore

❌ Failed checks (1 error)

Check name Status Explanation Resolution
Docstring Coverage ❌ Error Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately reflects the main change: safely editing non-secret profile labels/descriptions.
Description check ✅ Passed It includes the required Summary and Validation sections and is specific to the change; only the dedicated Security impact section/checklist is missing.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/204-profile-description

Comment @coderabbitai help to get the list of available commands.

coderabbitai[bot]
coderabbitai Bot previously requested changes Jul 26, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/console/console-assets.ts`:
- Around line 817-841: Update renderProfileDescriptionEditor to capture the
current profile.value before setOptions(profile, names), then restore that
selection after rebuilding the options when it still exists; otherwise retain
the normal default selection behavior. Ensure updateDescription runs after
restoration so the input reflects the preserved profile.

In `@src/console/console-server.ts`:
- Around line 71-88: Loosen profileDescriptionTextSchema to perform only basic
string validation and a protective maximum-size check, removing the trim and
control-character refine so invalid formatting reaches
setProfileDescription/runProfileDescriptionChange. Preserve the existing
description/clearDescription validation in profileDescriptionChangeSchema and
let the engine’s PROFILE_DESCRIPTION_INPUT_INVALID handling provide the specific
user-facing message.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d5c8d119-5988-4124-ad32-41d3638e93b2

📥 Commits

Reviewing files that changed from the base of the PR and between 15d8b49 and be289b9.

📒 Files selected for processing (20)
  • CHANGELOG.md
  • README.md
  • docs/cli.md
  • src/cli/exit-codes.ts
  • src/cli/main.ts
  • src/cli/parse.ts
  • src/console/console-application-service.ts
  • src/console/console-assets.ts
  • src/console/console-dashboard-application-service.ts
  • src/console/console-server.ts
  • src/setup/profile-description-onboarding.ts
  • src/utils/errors.ts
  • tests/cli-exit-codes.test.ts
  • tests/cli-parse.test.ts
  • tests/console-application-service.test.ts
  • tests/console-dashboard-application-service.test.ts
  • tests/console-server.test.ts
  • tests/package-contract.test.ts
  • tests/profile-description-onboarding.test.ts
  • tests/readme-product-contract.test.ts

Comment thread src/console/console-assets.ts
Comment thread src/console/console-server.ts Outdated
@mohanagy
mohanagy dismissed coderabbitai[bot]’s stale review July 26, 2026 05:37

Both actionable threads were fixed and are resolved in 175ffa5 with focused regression tests. CodeRabbit follow-up is rate-limited; a safe-mode Claude Code Fable review of be289b9..175ffa5 returned no findings. Dismissing this stale bot request only; current-head CI remains required before merge.

@mohanagy
mohanagy merged commit 4f0f0f2 into development Jul 26, 2026
21 of 23 checks passed
@mohanagy
mohanagy deleted the feat/204-profile-description branch July 26, 2026 05:48
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.

1 participant