import { AdapterBase } from '../sdk/adapter-base';
import { AdapterReceiveResult, AdapterSendResult, AdapterValidateResult } from '../sdk/adapter-types';

/**
 * dbis.adapter.ktt-evidence
 * Scaffold adapter to ingest legacy instruction artifacts as untrusted evidence.
 * Rail/protocol governance: maintained under SolaceNet — see docs/solacenet/RAIL_AND_PROTOCOL_GOVERNANCE.md
 */
export class KttEvidenceAdapter extends AdapterBase {
	async validate(_: Record<string, unknown>): Promise<AdapterValidateResult> {
		return { ok: true };
	}
	async send(_: { txnId: string; payloadHash: string; envelope: unknown }): Promise<AdapterSendResult> {
		// Evidence adapter does not "send" — treat as no-op
		return { status: 'FAILED', error: { code: 'UNSUPPORTED', message: 'Send not supported', retryClass: 'NON_RETRYABLE' } };
	}
	async receive(_: unknown): Promise<AdapterReceiveResult> {
		return { status: 'STATUS', railMessageId: `KTT-INGEST-${Date.now()}`, statusPayload: { code: 'EVIDENCE_INGESTED' } };
	}
}

