aireqlog

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2024 License: MIT Imports: 10 Imported by: 0

README

aireqlog

GoDoc Build Status Go Report Card

This project implements a structured logging system for monitoring and auditing requests, specifically tracking source code sent to AI agents. Initially created for EndpointElf, a tool designed to extract HTTP routes from Go source code, this AI Request Log ensures full transparency and accountability in handling source code with AI-driven processes.

Overview

In EndpointElf, AI tools assist in various code analysis and generation tasks, often involving (proprietary) source code. To ensure accountability and traceability of requests made to these AI agents, this logging system captures detailed metadata about each request.

Features

  • Project Metadata: Logs the closest parent project (identified by a .git directory) to contextualize the request.
  • File Information: Records the filename of the specific source file involved.
  • Git Commit: Logs the current git commit (HEAD) to provide version control context.
  • AI Engine and Endpoint: Captures the specific AI engine used and the URL of the endpoint the data was sent to.
  • Timestamping: Adds a timestamp for precise tracking of when requests are made.

How It Works

  1. Request Logging: When a request is sent, the log records project metadata, source file details, AI engine, endpoint URL, and a timestamp.
  2. Storage and Retrieval: Logs are stored in a structured format, allowing for easy querying and auditing of all requests made.

Contributing

Contributions are welcome! If you’d like to enhance this system, feel free to open an issue or submit a pull request.

License

This project is licensed under the MIT License.

Documentation

Index

Constants

View Source
const (
	BetaVersion = "v0.1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FileInfo

type FileInfo struct {
	Filename string `json:"filename"`
}

type Project

type Project struct {
	// Name is the full name of the project where data was sent from
	Name string `json:"name"`

	// GitCommit is the latest commit of the project
	GitCommit string `json:"git_commit"`
}

type RequestDetails

type RequestDetails struct {
	AIEngine  string `json:"ai_engine"`
	TargetURL string `json:"target_url"`
}

type RequestLog

type RequestLog struct {
	Version        string         `json:"version"`
	Project        Project        `json:"project"`
	File           FileInfo       `json:"file"`
	RequestDetails RequestDetails `json:"request_details"`
	SystemIdentity SystemIdentity `json:"system_identity"`
	Timestamp      time.Time      `json:"timestamp"`
}

func FromRequest

func FromRequest(req RequestDetails, file FileInfo) (RequestLog, error)

type SystemIdentity

type SystemIdentity struct {
	Username        string `json:"username"`
	Hostname        string `json:"hostname"`
	OperatingSystem string `json:"operating_system"`
	MACAddress      string `json:"mac_address"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL