mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-02 20:43:36 +00:00
feat(kanban): Delete agent context file when feature is verified
When an agent marks a feature as verified, the context file in
.automaker/agents-context/{featureId}.md is now automatically deleted.
Changes:
- Updated mock implementation in electron.ts to delete context files
when simulateAutoModeLoop completes with verified status
- Added setupMockProjectWithContextFile utility function to tests/utils.ts
- Updated feature_list.json to mark feature as verified
The real implementation was already present in auto-mode-service.js:
- deleteContextFile() method removes the context file
- updateFeatureStatus() calls deleteContextFile when status="verified"
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -157,8 +157,8 @@ export const getElectronAPI = (): ElectronAPI => {
|
||||
content: "<project_specification>\n <project_name>Demo Project</project_name>\n</project_specification>",
|
||||
};
|
||||
}
|
||||
// For any file in mock context directory, return empty string (file exists but is empty)
|
||||
if (filePath.includes(".automaker/context/")) {
|
||||
// For any file in mock agents-context directory, return empty string (file exists but is empty)
|
||||
if (filePath.includes(".automaker/agents-context/")) {
|
||||
return { success: true, content: "" };
|
||||
}
|
||||
return { success: false, error: "File not found (mock)" };
|
||||
@@ -176,8 +176,8 @@ export const getElectronAPI = (): ElectronAPI => {
|
||||
readdir: async (dirPath: string) => {
|
||||
// Return mock directory structure based on path
|
||||
if (dirPath) {
|
||||
// Check if this is the context directory - return files from mock file system
|
||||
if (dirPath.includes(".automaker/context")) {
|
||||
// Check if this is the context or agents-context directory - return files from mock file system
|
||||
if (dirPath.includes(".automaker/context") || dirPath.includes(".automaker/agents-context")) {
|
||||
const contextFiles = Object.keys(mockFileSystem)
|
||||
.filter(path => path.startsWith(dirPath) && path !== dirPath)
|
||||
.map(path => {
|
||||
@@ -417,7 +417,7 @@ function createMockAutoModeAPI(): AutoModeAPI {
|
||||
|
||||
contextExists: async (projectPath: string, featureId: string) => {
|
||||
// Mock implementation - simulate that context exists for some features
|
||||
const exists = mockFileSystem[`${projectPath}/.automaker/context/${featureId}.md`] !== undefined;
|
||||
const exists = mockFileSystem[`${projectPath}/.automaker/agents-context/${featureId}.md`] !== undefined;
|
||||
return { success: true, exists };
|
||||
},
|
||||
|
||||
@@ -539,6 +539,10 @@ async function simulateAutoModeLoop(projectPath: string, featureId: string) {
|
||||
message: "Feature implemented successfully",
|
||||
});
|
||||
|
||||
// Delete context file when feature is verified (matches real auto-mode-service behavior)
|
||||
const contextFilePath = `${projectPath}/.automaker/agents-context/${featureId}.md`;
|
||||
delete mockFileSystem[contextFilePath];
|
||||
|
||||
// Clean up this feature from running set
|
||||
mockRunningFeatures.delete(featureId);
|
||||
mockAutoModeTimeouts.delete(featureId);
|
||||
|
||||
Reference in New Issue
Block a user