-- ApiVault v1.0 stable release polish metadata.
local addonName, ApiVault = ...

ApiVault.StableRelease = ApiVault.StableRelease or {}
local Stable = ApiVault.StableRelease

Stable.metadata = {
	version = "1.2.0",
	interface = 120007,
	label = "ApiVault Complete Developer Release",
	policy = "metadata-first developer tool; no runtime source reads; no protected/secure auto-execution; no full Blizzard source display in-game",
	liveValidated = false,
	sourceArchive = "Interface.zip",
}

Stable.checks = {
	{ name = "Documented API browser", status = "present" },
	{ name = "Source Usage Index", status = "present" },
	{ name = "Interface Resource Catalog", status = "present" },
	{ name = "XML Template Catalog", status = "present" },
	{ name = "TOC Module Browser", status = "present" },
	{ name = "Source Example Index", status = "present" },
	{ name = "Secure Pattern Reference Index", status = "present" },
	{ name = "Unified Search / Cross-links", status = "present" },
	{ name = "Developer Checklists / Export Panels", status = "present" },
	{ name = "Favorites / Recent Items", status = "present" },
	{ name = "Runtime Test Lab Hardening", status = "present" },
	{ name = "Complete Symbol Coverage", status = "present" },
	{ name = "Catalogs / Widget Explorer", status = "present" },
	{ name = "Addon Audit Mode", status = "present" },
	{ name = "Loaded Addon Runtime Inspector", status = "present" },
	{ name = "Event Lab / Payload Recorder", status = "present" },
	{ name = "Build Diff Support", status = "present; second-build manifests required for real diffs" },
	{ name = "Live WoW validation", status = "not performed in this environment" },
}

function Stable:GetStats()
	return #(self.checks or {}), self.metadata and self.metadata.version or "unknown"
end

function Stable:Format()
	local lines = {}
	table.insert(lines, tostring(self.metadata.label or "ApiVault"))
	table.insert(lines, "version: " .. tostring(self.metadata.version))
	table.insert(lines, "interface: " .. tostring(self.metadata.interface))
	table.insert(lines, "policy: " .. tostring(self.metadata.policy))
	table.insert(lines, "liveValidated: " .. tostring(self.metadata.liveValidated))
	table.insert(lines, "")
	table.insert(lines, "Release checklist:")
	for _, item in ipairs(self.checks or {}) do
		table.insert(lines, "- " .. tostring(item.name) .. ": " .. tostring(item.status))
	end
	table.insert(lines, "")
	table.insert(lines, "UNCERTAIN: final stability must be confirmed in a live WoW client with BugSack/BugGrabber or Blizzard Lua error display enabled.")
	return table.concat(lines, "\n")
end
