Fix audit-goals to pass project key instead of file content
The CmdForge audit-goals tool expects a project name (e.g., "development-hub" or "global") via stdin, not the goals file content. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
ce608957e5
commit
d943cc5e6e
|
|
@ -36,9 +36,9 @@ class AuditWorker(QObject):
|
|||
finished = Signal(str, bool) # output, success
|
||||
error = Signal(str)
|
||||
|
||||
def __init__(self, goals_content: str, project_path: Path | None = None):
|
||||
def __init__(self, project_key: str, project_path: Path | None = None):
|
||||
super().__init__()
|
||||
self.goals_content = goals_content
|
||||
self.project_key = project_key # e.g. "development-hub" or "global"
|
||||
self.project_path = project_path
|
||||
self._process: subprocess.Popen | None = None
|
||||
self._cancelled = False
|
||||
|
|
@ -59,7 +59,8 @@ class AuditWorker(QObject):
|
|||
cwd=str(self.project_path) if self.project_path and self.project_path.exists() else None,
|
||||
)
|
||||
|
||||
stdout, stderr = self._process.communicate(input=self.goals_content)
|
||||
# Pass project key to stdin (tool expects project name, not file content)
|
||||
stdout, stderr = self._process.communicate(input=self.project_key)
|
||||
|
||||
if self._cancelled:
|
||||
return
|
||||
|
|
@ -2312,13 +2313,12 @@ class ProjectDashboard(QWidget):
|
|||
if confirm != QMessageBox.StandardButton.Ok:
|
||||
return
|
||||
|
||||
# Read the goals content
|
||||
goals_content = goals_path.read_text()
|
||||
|
||||
# Get the project root for context
|
||||
# Determine project key for the audit tool
|
||||
if self.is_global:
|
||||
project_key = "global"
|
||||
project_root = None
|
||||
else:
|
||||
project_key = self.project.key
|
||||
project_root = Path(self.project.path) if self.project.path else None
|
||||
|
||||
# Create progress dialog
|
||||
|
|
@ -2361,7 +2361,7 @@ class ProjectDashboard(QWidget):
|
|||
|
||||
# Create worker and thread
|
||||
self._audit_thread = QThread()
|
||||
self._audit_worker = AuditWorker(goals_content, project_root)
|
||||
self._audit_worker = AuditWorker(project_key, project_root)
|
||||
self._audit_worker.moveToThread(self._audit_thread)
|
||||
|
||||
# Connect signals
|
||||
|
|
|
|||
Loading…
Reference in New Issue