-
Notifications
You must be signed in to change notification settings - Fork 21
feat: add report header with repository metadata #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| """Assessment metadata model for execution context and reproducibility.""" | ||
|
|
||
| import getpass | ||
| import os | ||
| import socket | ||
| from dataclasses import dataclass | ||
| from datetime import datetime | ||
|
|
||
|
|
||
| @dataclass | ||
| class AssessmentMetadata: | ||
| """Metadata about the assessment execution context. | ||
| Captures who ran the assessment, when, with what version, and what command. | ||
| Critical for reproducibility, debugging, and multi-repository workflows. | ||
| Attributes: | ||
| agentready_version: Version of AgentReady used (e.g., "1.0.0") | ||
| assessment_timestamp: ISO 8601 timestamp of when assessment started | ||
| assessment_timestamp_human: Human-readable timestamp (e.g., "November 21, 2025 at 2:11 AM") | ||
| executed_by: Username and hostname (e.g., "jeder@macbook") | ||
| command: Full CLI command executed (e.g., "agentready assess . --verbose") | ||
| working_directory: Absolute path of current working directory when executed | ||
| """ | ||
|
|
||
| agentready_version: str | ||
| assessment_timestamp: str # ISO 8601 format | ||
| assessment_timestamp_human: str | ||
| executed_by: str | ||
| command: str | ||
| working_directory: str | ||
|
|
||
| def to_dict(self) -> dict: | ||
| """Convert to dictionary for JSON serialization.""" | ||
| return { | ||
| "agentready_version": self.agentready_version, | ||
| "assessment_timestamp": self.assessment_timestamp, | ||
| "assessment_timestamp_human": self.assessment_timestamp_human, | ||
| "executed_by": self.executed_by, | ||
| "command": self.command, | ||
| "working_directory": self.working_directory, | ||
| } | ||
|
|
||
| @classmethod | ||
| def create( | ||
| cls, version: str, timestamp: datetime, command: str | ||
| ) -> "AssessmentMetadata": | ||
| """Create metadata from execution context. | ||
| Args: | ||
| version: AgentReady version string | ||
| timestamp: Assessment start time | ||
| command: CLI command executed | ||
| Returns: | ||
| AssessmentMetadata instance | ||
| """ | ||
| # Get username and hostname | ||
| try: | ||
| username = getpass.getuser() | ||
| except Exception: | ||
| username = "unknown" | ||
|
|
||
| try: | ||
| hostname = socket.gethostname().split(".")[0] # Short hostname | ||
| except Exception: | ||
| hostname = "unknown" | ||
|
|
||
| executed_by = f"{username}@{hostname}" | ||
|
|
||
| # Format timestamps | ||
| iso_timestamp = timestamp.isoformat() | ||
| human_timestamp = timestamp.strftime("%B %d, %Y at %-I:%M %p") | ||
|
Comment on lines
+71
to
+73
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
AssessmentMetadata formats the human-readable timestamp with Useful? React with 👍 / 👎. |
||
|
|
||
| # Get current working directory | ||
| try: | ||
| working_dir = os.getcwd() | ||
| except Exception: | ||
| working_dir = "unknown" | ||
|
|
||
| return cls( | ||
| agentready_version=version, | ||
| assessment_timestamp=iso_timestamp, | ||
| assessment_timestamp_human=human_timestamp, | ||
| executed_by=executed_by, | ||
| command=command, | ||
| working_directory=working_dir, | ||
| ) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CLI module now imports
repomix_generatefrom.repomix, but there is nosrc/agentready/cli/repomix.pyin the package. Because the import is executed at module load time, anyagentreadyinvocation now raisesModuleNotFoundError: No module named 'agentready.cli.repomix'before parsing arguments, effectively breaking the CLI. Unless a repomix command is added, this import should be dropped or gated.Useful? React with 👍 / 👎.