integerstats

package module
v0.1.0-preview.1 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

README

Spice Agent Integer Tool

github.com/spice-framework/spice-agent-tool-integer is a separately versioned clean-room extension for Spice Agent. It contributes the deterministic, read-only integer.stats tool.

The extension accepts between 1 and 1,024 integers in the inclusive range [-1,000,000,000,000, 1,000,000,000,000]. It returns exact count, minimum, maximum, sum, and a reduced rational mean. It performs no I/O, uses no floating-point arithmetic, and declares no Agent capabilities.

Configure

Import the extension explicitly in a Spice application:

import _ "github.com/spice-framework/spice-agent-tool-integer/autoconfigure"

Run the released Spice generator. The generated application receives integer.stats through the ordinary map[string]tool.Tool; importing the module alone never activates it.

Verify

make fast
make check
make verify
make benchmark
make cleanroom

All normal verification runs with GOWORK=off, the committed vendor tree, and no module proxy. make cleanroom exercises install, configure, debug, test, package, and delete boundaries in repository-external temporary directories.

Documentation

Overview

Package integerstats provides the deterministic integer.stats Spice Agent tool.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Manifest

func Manifest() spicestarter.Manifest

Manifest returns exact compatibility and review metadata.

Types

type IntegerStatistics

type IntegerStatistics struct {
	Count           int   `json:"count"`
	Minimum         int64 `json:"minimum"`
	Maximum         int64 `json:"maximum"`
	Sum             int64 `json:"sum"`
	MeanNumerator   int64 `json:"mean_numerator"`
	MeanDenominator int64 `json:"mean_denominator"`
}

IntegerStatistics is an exact, immutable summary of bounded integers.

func NewIntegerStatistics

func NewIntegerStatistics(values []int64) (IntegerStatistics, error)

NewIntegerStatistics computes exact aggregate values and a reduced rational mean.

type IntegerStatisticsRequest

type IntegerStatisticsRequest struct {
	Values []int64 `json:"values"`
}

IntegerStatisticsRequest is the strict model-visible input for integer.stats.

type IntegerStatisticsTool

type IntegerStatisticsTool struct {
	// contains filtered or unexported fields
}

IntegerStatisticsTool implements the deterministic read-only integer.stats tool.

func NewIntegerStatisticsTool

func NewIntegerStatisticsTool() (*IntegerStatisticsTool, error)

NewIntegerStatisticsTool constructs the extension tool and validates its public definition.

func (*IntegerStatisticsTool) Definition

func (statisticsTool *IntegerStatisticsTool) Definition() tool.Definition

Definition returns a defensive copy of the model-visible contract.

func (*IntegerStatisticsTool) Execute

func (statisticsTool *IntegerStatisticsTool) Execute(
	ctx context.Context,
	call tool.Call,
	_ tool.Reporter,
) (tool.Result, error)

Execute validates one call and returns deterministic exact statistics.

Directories

Path Synopsis
Package autoconfigure contributes the fallback tool only through an explicit blank import.
Package autoconfigure contributes the fallback tool only through an explicit blank import.
internal
qualitygate command

Jump to

Keyboard shortcuts

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