Skip to content

Conversation

@kgilpin
Copy link
Contributor

@kgilpin kgilpin commented Jun 5, 2025

Other Navie capabilities such as @context are accessible via @ command string.

Because Navie performs special processing of the code diff, such as removal of binary files, having @diff available as a standalone command can be useful when building workflows using Navie.

Example

$ ./built/cli.js navie -d ~/source/appland/spring-petclinic \
  "@diff /base=main /format=jsonl" > ~/source/appland/spring-petclinic/diff.jsonl
$ llm -f diff.json "List URL routes impacted by the change"                    

Based on the changes in the code, here are the URL routes that were impacted:

Primary Authentication Routes:

  • /login - New login endpoint for form-based authentication
  • /logout - New logout endpoint

Routes with Added Security Requirements:

  1. /owners/** - Now requires ROLE_ADMIN
  2. /owners/new - Now requires CSRF token and ROLE_ADMIN
  3. /owners/{ownerId}/edit - Now requires CSRF token and ROLE_ADMIN
  4. /owners/{ownerId}/pets/new - Now requires CSRF token and ROLE_ADMIN
  5. /owners/{ownerId}/pets/{petId}/edit - Now requires CSRF token and ROLE_ADMIN
  6. /owners/{ownerId}/pets/{petId}/visits/new - Now requires CSRF token and ROLE_ADMIN

Public Routes (Explicitly Permitted):

  • / - Home page
  • /oups - Error trigger page
  • /error - Error page
  • /webjars/**
  • /css/**
  • /js/**
  • /images/**
  • /resources/**

The changes implement Spring Security with form-based authentication and require:

  1. Authentication for most routes
  2. ROLE_ADMIN specifically for owner-related operations
  3. CSRF tokens for all POST requests
  4. Public access maintained for static resources and error pages

The security configuration allows anonymous access to the home page and static resources while protecting sensitive operations behind authentication and proper authorization.

@kgilpin kgilpin requested review from Copilot and dustinbyrne June 5, 2025 18:01
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds a new standalone @diff command to Navie for retrieving code diffs in multiple formats.

  • Registers a DiffCommand in the command factory
  • Implements DiffCommand supporting text, json, and jsonl outputs
  • Introduces Diff in the CommandMode enum

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
packages/navie/src/navie.ts Imported and wired up DiffCommand in the command builder
packages/navie/src/commands/diff-command.ts Created DiffCommand implementation with output format logic
packages/navie/src/command.ts Added Diff mode to the CommandMode enum
Comments suppressed due to low confidence (3)

packages/navie/src/commands/diff-command.ts:21

  • [nitpick] Consider adding a doc comment above DiffCommand to explain its purpose, usage, and available user options like format and base.
export default class DiffCommand implements Command {

packages/navie/src/commands/diff-command.ts:1

  • No tests appear to cover DiffCommand. Add unit tests to verify the text, json, and jsonl output branches and invalid format handling.
import Command, { CommandRequest } from '../command';

packages/navie/src/commands/diff-command.ts:46

  • Add a default branch or input validation for unsupported format values so users receive a clear error when passing an invalid format.
  }

const buildDiffCommand = () =>
new DiffCommand(
projectInfoService
)
Copy link

Copilot AI Jun 5, 2025

Choose a reason for hiding this comment

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

[nitpick] Add a semicolon after the buildDiffCommand arrow function definition to stay consistent with the project’s coding style.

Suggested change
)
);

Copilot uses AI. Check for mistakes.
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.

3 participants