# Packing Displacement Analysis

> Packing Displacement Analysis is a paid API for AI agents from www.mahastrategies.com, paid per call via x402, $0.075/call, status unknown (last checked 2026-10-16).

Compares three context-packing strategies (rank-prefix, rank-order greedy-fit, score-density greedy-fit) for up to 64 passages under a token budget, reporting evidence displacement and selection violations.

## Facts

- Endpoint: POST https://www.mahastrategies.com/api/v1/context/retrieval/packing-displacement?utm_source=zero.xyz
- Price: $0.075/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-16
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/packing-displacement-analysis-29f8cd58
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_ZHppkbVqJ-Ya2xsWOm8qC

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability packing-displacement-analysis-29f8cd58 -d '<json body>'
```

Example prompt: Can you run a packing displacement analysis on my 12 candidate passages with a 512-token budget, marking passage IDs P1, P3, and P7 as required evidence, and using synthetic data class — I want to see which packing strategy displaces my required passages the least?

## When to prefer this

Choose this endpoint when you need to analytically compare how different context-packing algorithms handle evidence retention under a fixed token budget — specifically when you have declared integer costs and scores and want to audit displacement without tokenization or causal attribution. Prefer this over generic ranking or retrieval endpoints when the goal is to understand packing strategy trade-offs and detect selection violations in an existing retrieval pipeline.

## Known failure modes

- Budget out of range (must be 1–2048): returns validation error
- More than 64 candidates or required evidence IDs supplied: returns schema validation error
- Invalid dataClass value (must be 'public' or 'synthetic'): returns enum validation error
- Missing required candidates array: returns 400 bad request
- Required evidence IDs not present in candidates list: may return displacement report showing 100% displacement or an error

## How this service works

Compare strict rank-prefix packing with rank-order greedy-fit and score-density greedy-fit for up to 64 passages under a 1–2048 token budget. Report evidence displacement and optional observed selection violations. Uses declared integer costs/scores; no tokenization or causal attribution. New modular adapter: retained result recovery for 24 hours, minimal receipt metadata for 90 days. Existing live route unchanged.

## Output

Returns a comparison of three packing strategies (rank-prefix, rank-order greedy-fit, score-density greedy-fit) showing which passages are displaced under the given token budget, evidence displacement metrics for required passages, and optional selection violation flags if observed selections are provided. Results are retained for 24 hours; receipt metadata retained for 90 days.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "budget": {
   "type": "integer",
   "maximum": 2048,
   "minimum": 1
  },
  "dataClass": {
   "enum": [
    "public",
    "synthetic"
   ],
   "type": "string"
  },
  "candidates": {
   "type": "array",
   "maxItems": 64,
   "minItems": 1
  },
  "requiredEvidenceIds": {
   "type": "array",
   "maxItems": 64,
   "minItems": 1
  },
  "observedSelectedPassageIds": {
   "anyOf": [
    {
     "type": "array",
     "maxItems": 64,
     "minItems": 0
    },
    {
     "type": "null"
    }
   ]
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/packing-displacement-analysis-29f8cd58/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from www.mahastrategies.com](https://www.zero.xyz/host/www.mahastrategies.com/llms.txt)
