WIP prompts

This commit is contained in:
cghislai 2025-06-09 17:06:06 +02:00
parent f2568707e9
commit 8b68159824
7 changed files with 240 additions and 25 deletions

View File

@ -13,6 +13,7 @@ import {
Tool, Tool,
VertexAI VertexAI
} from '@google-cloud/vertexai'; } from '@google-cloud/vertexai';
import {RepositoryService} from "./repository-service";
/** /**
* Interface for function arguments * Interface for function arguments
@ -24,6 +25,7 @@ export interface FunctionArgs {
searchString?: string; searchString?: string;
filePattern?: string; filePattern?: string;
step?: string; step?: string;
message?: string;
outcome?: string | 'end'; outcome?: string | 'end';
description?: string; description?: string;
} }
@ -125,7 +127,7 @@ export class GeminiFileSystemService {
}, },
{ {
name: "listFiles", name: "listFiles",
description: "List files in a directory in the project repository", description: "List files in a directory in the project repository, possibly with a pattern recursing into subdirectories",
parameters: { parameters: {
type: FunctionDeclarationSchemaType.OBJECT, type: FunctionDeclarationSchemaType.OBJECT,
properties: { properties: {
@ -135,15 +137,15 @@ export class GeminiFileSystemService {
}, },
filePattern: { filePattern: {
type: FunctionDeclarationSchemaType.STRING, type: FunctionDeclarationSchemaType.STRING,
description: "Optional glob pattern on file path to limit the search (e.g., '**/*.ts', 'nitro-it/src/java/**/*.java')" description: "Glob pattern on file path to limit the search (e.g., '**/*.ts', 'nitro-it/src/java/**/*.java')"
} }
}, },
required: ["dirPath"] required: ["dirPath", "filePattern"]
} }
}, },
{ {
name: "grepFiles", name: "grepFiles",
description: "Search for a string in project files", description: "Search for a string in project files. Max 500 lines are returned - use better searchString to narrow down",
parameters: { parameters: {
type: FunctionDeclarationSchemaType.OBJECT, type: FunctionDeclarationSchemaType.OBJECT,
properties: { properties: {
@ -153,10 +155,10 @@ export class GeminiFileSystemService {
}, },
filePattern: { filePattern: {
type: FunctionDeclarationSchemaType.STRING, type: FunctionDeclarationSchemaType.STRING,
description: "Optional glob pattern on file path to limit the search (e.g., '**/*.ts', 'nitro-it/src/java/**/*.java')" description: "Glob pattern on file path to limit the search (e.g., '**/*.ts', 'nitro-it/src/java/**/*.java')"
} }
}, },
required: ["searchString"] required: ["searchString", "filePattern"]
} }
}, },
{ {
@ -195,7 +197,21 @@ export class GeminiFileSystemService {
}, },
required: ["outcome", "description"] required: ["outcome", "description"]
} }
},
{
name: "commitFiles",
description: "Commit all changes in the git repository.",
parameters: {
type: FunctionDeclarationSchemaType.OBJECT,
properties: {
message: {
type: FunctionDeclarationSchemaType.STRING,
description: "The commit message"
} }
},
required: ["message"]
}
},
] ]
} }
]; ];
@ -261,6 +277,19 @@ export class GeminiFileSystemService {
return `File ${filePath} deleted successfully`; return `File ${filePath} deleted successfully`;
} }
/**
* Delete a file
* @param filePath Path to the file relative to the root path
* @returns Message indicating success or that the file didn't exist
*/
async commitFiles(rootPath: string, message: string): Promise<string> {
console.debug(" - commitFiles called with message: " + message);
const repoService = new RepositoryService(rootPath);
await repoService.commitChanges(rootPath, message);
return "Changes committed successfully";
}
/** /**
* List files in a directory, optionally with a glob pattern and recursion * List files in a directory, optionally with a glob pattern and recursion
* @param rootPath Root path of the filesystem * @param rootPath Root path of the filesystem
@ -492,10 +521,10 @@ ${additionalContent}`,
- grepFiles(searchString, filePattern): Search for a string in project files, optionally filtered by a file pattern (glob) - grepFiles(searchString, filePattern): Search for a string in project files, optionally filtered by a file pattern (glob)
use filePattern='path/**' to search recursively in all files under path. use filePattern='path/**' to search recursively in all files under path.
- deleteFile(filePath): Delete a file from the project repository - deleteFile(filePath): Delete a file from the project repository
- commitFiles(message): Create a git commit containing all changes in the project repository
`, `,
`Be throughout: `Ensure each file you create is entirely implemented, and that you changes are fully compliant with the guidelines.
Ensure each file you create is entirely implemented, and that you changes are fully compliant with the guidelines. Create a new work list when additional scanning / editing is required.
Create a new work list is additional scanning / editing is required.
`, `,
`Complete the session: `Complete the session:
Once you have completed all steps, call reportStepOutcome with outcome 'end'`, Once you have completed all steps, call reportStepOutcome with outcome 'end'`,
@ -539,7 +568,7 @@ Once you have completed all steps, call reportStepOutcome with outcome 'end'`,
{ {
text: `Re-evaluate compliance with all guidelines. text: `Re-evaluate compliance with all guidelines.
Create a new work list to comply if needed. Create a new work list to comply if needed.
Report a step with outcome 'end-confirmed' and a description detailling your confidence if you are completely done` Report a step with outcome 'end-confirmed' and a description with a short paragraph detailing your confidence level if you are completely done`
} }
] ]
} }
@ -577,11 +606,11 @@ Once you have completed all steps, call reportStepOutcome with outcome 'end'`,
]; ];
} }
private processFunctionCall(functionCall: FunctionCall, rootPath: string, callbacks: { private async processFunctionCall(functionCall: FunctionCall, rootPath: string, callbacks: {
onFileWritten: (file: string) => any; onFileWritten: (file: string) => any;
onFileDelete: (file: string) => any; onFileDelete: (file: string) => any;
onStepOutcome: (step: string | undefined, outcome: string | 'end' | 'end-confirmed', reason: string) => any onStepOutcome: (step: string | undefined, outcome: string | 'end' | 'end-confirmed', reason: string) => any
}): string | string[] | boolean | any { }): Promise<string | string[] | boolean | any> {
const functionName = functionCall.name; const functionName = functionCall.name;
try { try {
const functionArgs = (typeof functionCall.args === 'string' ? const functionArgs = (typeof functionCall.args === 'string' ?
@ -613,6 +642,9 @@ Once you have completed all steps, call reportStepOutcome with outcome 'end'`,
// Track the file deleted // Track the file deleted
callbacks.onFileDelete(functionArgs.filePath!); callbacks.onFileDelete(functionArgs.filePath!);
break; break;
case 'commitFiles':
functionResponse = await this.commitFiles(rootPath, functionArgs.message!);
break;
case 'reportStepOutcome': case 'reportStepOutcome':
console.debug(` - received reportStepOutcome: ${functionArgs.step} - ${functionArgs.outcome} - ${functionArgs.description}`); console.debug(` - received reportStepOutcome: ${functionArgs.step} - ${functionArgs.outcome} - ${functionArgs.description}`);
callbacks.onStepOutcome(functionArgs.step, functionArgs.outcome!, functionArgs.description!); callbacks.onStepOutcome(functionArgs.step, functionArgs.outcome!, functionArgs.description!);
@ -622,6 +654,8 @@ Once you have completed all steps, call reportStepOutcome with outcome 'end'`,
reason: functionArgs.description, reason: functionArgs.description,
}; };
break; break;
default: default:
throw new Error(`Unknown function: ${functionName}`); throw new Error(`Unknown function: ${functionName}`);
} }
@ -675,7 +709,9 @@ Once you have completed all steps, call reportStepOutcome with outcome 'end'`,
const responseCandidate = generateContentCandidates[0]; const responseCandidate = generateContentCandidates[0];
const responseContent = responseCandidate.content; const responseContent = responseCandidate.content;
const responseParts = responseContent.parts || []; const responseParts = responseContent.parts || [];
if (responseParts.length > 0) {
updatedRequestContents.push(responseContent); updatedRequestContents.push(responseContent);
}
if (responseParts.length === 0) { if (responseParts.length === 0) {
console.warn(`No parts found in streaming response`); console.warn(`No parts found in streaming response`);
@ -699,7 +735,7 @@ Once you have completed all steps, call reportStepOutcome with outcome 'end'`,
// Process any function calls that were detected // Process any function calls that were detected
if (pendingFunctionCalls.length > 0) { if (pendingFunctionCalls.length > 0) {
for (const functionCall of pendingFunctionCalls) { for (const functionCall of pendingFunctionCalls) {
const responseData = this.processFunctionCall(functionCall, rootPath, { const responseData = await this.processFunctionCall(functionCall, rootPath, {
onFileWritten: (f) => { onFileWritten: (f) => {
if (!geminiResponse.filesWritten.includes(f)) { if (!geminiResponse.filesWritten.includes(f)) {
geminiResponse.filesWritten.push(f); geminiResponse.filesWritten.push(f);
@ -732,9 +768,9 @@ Once you have completed all steps, call reportStepOutcome with outcome 'end'`,
} }
} else { } else {
console.debug("No function calls detected in response.") // console.debug("No function calls detected in response.")
const updatedContent = this.createReevaluationContrent(); // const updatedContent = this.createReevaluationContrent();
updatedRequestContents.push(...updatedContent); // updatedRequestContents.push(...updatedContent);
} }
if (endReceived) { if (endReceived) {

View File

@ -9,7 +9,32 @@
- Cumcumber spec should be succinct and deterministic. Avoid words like "should" and "should have", prefer "must" and " - Cumcumber spec should be succinct and deterministic. Avoid words like "should" and "should have", prefer "must" and "
must have". must have".
- Inactive work items should have their feature file deleted. - Inactive work items should have their feature file deleted.
- Updates should be committed to a new branch and a pull request should be created.s - Work items for which the implementation already exists should be checked
- The pull request should include a short description of the modified code - If the implementation appears consistent with the work item, it can be skipped
- The pull request description should include the list of work items that were added/updated/deleted - If the implementation appears uncomplete, it can be updated
- Avoid updating scenarios that are still consistent with the work item.
- Prefer adding new scenarios for features omitted in the current implementation.
- Updates should be committed before completing the work item. If no changes was required, commit should be skipped.
- This project contains the following modules:
- nitro-domain: contains the jpa domain entities
- nitro-domain-api: contains the api model, controller interfaces, and the openapi specification. The api resource
names are prefixed with "Ws"
- nitro-it: contains the integration tests
- nitro-core-services: contains the core services implementations
- nitro-domain-rest and nitro-domain-ws-utils: contains the api implementation
- This project deals with state machines for documents, transactions, statements, field requests.
- "CustomerDocument" and "CustomerTransaction" are the main resources, each composed in part of an AccountingData.
- The hierarchy of tenancy has two levels: Trustee and Customer
- Explore DocumentStatus, DocumentTransition enums to grasp the document state machine
- Explore TestDocumentSortingService, TestDocumentIndexingService for utilities for sorting and indexing documents
during tests
- Explore TransactionStatus enum, TransactionStatusUpdateSingleton to grasp the transaction state machine
- Explore FieldIdentificationRequestStatus enum, FieldIdentificationValueStatus enum,
FieldIdentificationRequestStatusUpdateSingleton to grasp the field request state machine
- Explore FinancialAccountStatementStatus enum to grasp the financial account statement state machine
- The cucumber feature will be implemented as integration tests
- Dont hardcode any value, but make sure that new resources creation in specific state are expected
- Dont make assumptions - be explicit about what matters, but omit what does not matter

View File

@ -13,11 +13,35 @@ Only users that are superAdmins may archive documents.
- [ ] Jira: NITRO-0003 - [ ] Jira: NITRO-0003
- [ ] Implementation: - [ ] Implementation:
- [ ] Pull Request: - [x] Pull Request: https://gitea.fteamdev.valuya.be/cghislai/nitro-back/pulls/61
- [x] Active - [x] Active
### Log ### Log
2025-06-09T15:03:06.151Z - Gemini updates
- started: Checking if the feature file already exists and reading its content.
- done: The feature file already exists. Reading its content to check consistency.
- started: Reading the content of the existing feature file.
- done: The feature file content has been retrieved. It covers the requirements but needs comment updates.
- started: Updating the comments in the feature file.
- done: Comments in the feature file have been updated.
- started: Committing the updated feature file.
- done: The feature file has been updated and committed.
- Added file nitro-it/src/test/resources/workitems/2025-06-08-document-archvigin.featurePR: https://gitea.fteamdev.valuya.be/cghislai/nitro-back/pulls/61
2025-06-09T14:50:01.049Z - Gemini updates
- Added file nitro-it/src/test/resources/workitems/2025-06-08-document-archvigin.featurePR: https://gitea.fteamdev.valuya.be/cghislai/nitro-back/pulls/61
2025-06-09T14:36:45.807Z - Gemini updates
- started: Creating the feature file: nitro-it/src/test/resources/workitems/2025-06-08-document-archvigin.feature
- done: Created the feature file: nitro-it/src/test/resources/workitems/2025-06-08-document-archvigin.feature
- started: Verifying the feature file content.
- done: Verified the feature file content.
- skip: Work item is active, skipping file deletion.
- Added file nitro-it/src/test/resources/workitems/2025-06-08-document-archvigin.feature
2025-06-08T09:58:06.287Z - Workitem has been implemented. 2025-06-08T09:58:06.287Z - Workitem has been implemented.
- Created nitro-it/src/test/resources/workitems/2025-06-08-document-archvigin.feature - Created nitro-it/src/test/resources/workitems/2025-06-08-document-archvigin.feature

View File

@ -6,11 +6,28 @@ The nitro-back backend should have a /test endpoint implemented returning the js
- [ ] Jira: NITRO-0001 - [ ] Jira: NITRO-0001
- [ ] Implementation: - [ ] Implementation:
- [x] Pull Request: https://gitea.fteamdev.valuya.be/cghislai/nitro-back/pulls/1 - [x] Pull Request: https://gitea.fteamdev.valuya.be/cghislai/nitro-back/pulls/61
- [x] Active - [x] Active
### Log ### Log
2025-06-09T15:03:48.681Z - Gemini updates
- started: Checking for existing feature file for the work item.
- done: Feature file does not exist. Creating the feature file.
- started: Creating the feature file for the work item.
- done: Feature file created successfully.
- started: Committing the new feature file.
- done: Feature file committed successfully.
- Added file nitro-it/src/test/resources/workitems/2025-06-08-test.featurePR: https://gitea.fteamdev.valuya.be/cghislai/nitro-back/pulls/61
2025-06-09T14:38:54.830Z - Gemini updates
- done: File does not exist.
- done: Created the feature file.
- done: Feature file created successfully.
- Added file nitro-it/src/test/resources/workitems/2025-06-08-test.featurePR: https://gitea.fteamdev.valuya.be/cghislai/nitro-back/pulls/1
2025-06-08T09:58:26.902Z - Workitem has been updated. 2025-06-08T09:58:26.902Z - Workitem has been updated.
- Created nitro-it/src/test/resources/workitems/test_workitem.feature - Created nitro-it/src/test/resources/workitems/test_workitem.feature
PR: https://gitea.fteamdev.valuya.be/cghislai/nitro-back/pulls/1 PR: https://gitea.fteamdev.valuya.be/cghislai/nitro-back/pulls/1

View File

@ -0,0 +1,55 @@
## NITRO-2957
Specific API resource like customer\<id>\configuration\nitro
Will only accessible to admin
Will contain further info like type of configutation (fullspeed, partialspeed, nospeed)
Later when the 3 configuration case will be displayed too in the table - (Fullspeed, partialspeed, nospeed)
---
This ticket asks to
- split the WsCustomerDocumentModel into different models with different permissions:
- The actual WsCustomerDocument should contain information accessible by the customer itself
- A new WsCustomerDocumentAdminConfiguration should contain information accessible by nitro admins
- Later, WsCustomerDocumentTrusteeConfiguration could contain information accessible by trustees
- WsCustomerDocumentAdminConfiguration could contain
- amount of validation required - already existing
- type of configuration - or configuration template (fullspeed, partialspeed, nospeed)
---
- [x] Jira:NITRO-2957 https://fiscalteam.atlassian.net/browse/NITRO-2957
- [ ] Implementation:
- [x] Pull Request: https://gitea.fteamdev.valuya.be/cghislai/nitro-back/pulls/61
- [x] Active
### Log
2025-06-09T15:04:40.589Z - Gemini updates
- started: Creating the feature file: nitro-it/src/test/resources/workitems/2025-06-09-NITRO-2957.feature
- done: Added feature description, comments, Jira ticket info and scenarios.
- done: Created the feature file: nitro-it/src/test/resources/workitems/2025-06-09-NITRO-2957.feature
- started: Reviewing and confirming the scenarios are correctly defined.
- done: Scenarios are correctly defined and reflect the requirements.
- started: Reviewing the feature file for correctness, clarity and adherence to the guidelines.
- done: Reviewed the feature file for correctness, clarity and adherence to the guidelines.
- Added file nitro-it/src/test/resources/workitems/2025-06-09-NITRO-2957.featurePR: https://gitea.fteamdev.valuya.be/cghislai/nitro-back/pulls/61
2025-06-09T14:42:33.556Z - Gemini updates
- started: Creating the feature file: nitro-it/src/test/resources/workitems/2025-06-09-NITRO-2957.feature
- done: Added feature description, comments, Jira ticket info and scenarios.
- done: Created the feature file: nitro-it/src/test/resources/workitems/2025-06-09-NITRO-2957.feature
- started: Reviewing and confirming the scenarios are correctly defined.
- done: Scenarios are correctly defined and reflect the requirements.
- started: Reviewing the feature file for correctness, clarity and adherence to the guidelines.
- done: Reviewed the feature file for correctness, clarity and adherence to the guidelines.
- done: Refined the scenarios and comments.
- Added file nitro-it/src/test/resources/workitems/2025-06-09-NITRO-2957.feature
2025-06-08T09:58:06.287Z - Workitem has been implemented.
- Created nitro-it/src/test/resources/workitems/2025-06-08-document-archvigin.feature

View File

@ -0,0 +1,38 @@
## NITRO-2973
Expose Endpoint to apply/clear a config template
POST \customer\123\document\configuration\(nospeed|partialspeed|fullspeed)
POST \customer\123\transaction\configuration\(nospeed|partialspeed|fullspeed)
Template with the following values
@Edouard Umbreit supply the flag value per conifg
add a tag to record which config has been clicked
Following frontend story
Buttons to apply a default config for document and/or transaction
---
This ticket asks to add new endpoints to apply/clear a config template
Once a template has been applied, WsConfigValue with specific keys should have specific values at the customer level.
---
- [x] Jira:NITRO-29723 https://fiscalteam.atlassian.net/browse/NITRO-2973
- [ ] Implementation:
- [ ] Pull Request:
- [x] Active
### Log
2025-06-08T09:58:06.287Z - Workitem has been implemented.
- Created nitro-it/src/test/resources/workitems/2025-06-08-document-archvigin.feature

View File

@ -7,8 +7,28 @@ Implement tests according to the cucumber ".feature" files.
- The code produced must be ready for test driven development without any adaptation required. - The code produced must be ready for test driven development without any adaptation required.
- The tests are business-driven integration tests - The tests are business-driven integration tests
- Implement services that perform actual http requests to the api. - Implement services that perform actual http requests to the api.
- IMPORTANT: Dont use mocks, stubs, fakes, simulation or any other technique to avoid implementing - IMPORTANT: Dont use mocks, stubs, fakes, placeholders, simulations, or any other technique to avoid complete
services performing real http requests. implementations
- This project contains the following modules:
- nitro-domain: contains the jpa domain entities
- nitro-domain-api: contains the api model, controller interfaces, and the openapi specification. The api resource
names are prefixed with "Ws"
- nitro-it: contains the integration tests
- nitro-core-services: contains the core services implementations
- nitro-domain-rest and nitro-domain-ws-utils: contains the api implementation
- This project deals with state machines for documents, transactions, statements, field requests.
- "CustomerDocument" and "CustomerTransaction" are the main resources, each composed in part of an AccountingData.
- The hierarchy of tenancy has two levels: Trustee and Customer
- Explore DocumentStatus, DocumentTransition enums to grasp the document state machine
- Explore TestDocumentSortingService, TestDocumentIndexingService for utilities for sorting and indexing documents
during tests
- Explore TransactionStatus enum, TransactionStatusUpdateSingleton to grasp the transaction state machine
- Explore FieldIdentificationRequestStatus enum, FieldIdentificationValueStatus enum,
FieldIdentificationRequestStatusUpdateSingleton to grasp the field request state machine
- Explore FinancialAccountStatementStatus enum to grasp the financial account statement state machine
- Explore "*StatusListener" in nitro-it for utilities for waiting for specific events or statuses
- Explore the openapi specification if provided to identify the relevant resources and endpoints. - Explore the openapi specification if provided to identify the relevant resources and endpoints.
- Explore the code base using the provided filesystem functions to search for existing resources, - Explore the code base using the provided filesystem functions to search for existing resources,