Skip to content

Instantly share code, notes, and snippets.

View sunfmin's full-sized avatar

Felix Sun sunfmin

View GitHub Profile

description: AI Self-Correction Loop - A universal pattern where AI owns the full feedback loop: writing automated checks first, implementing to satisfy them, and iterating until all validations pass.

Goal

Transition from "AI as autocomplete" to "AI as owner" by enforcing a closed feedback loop across any domain. The AI must verify its own work through automated checks before presenting results.

Core Principles

All Available Tools with Arguments

File Operations

read_file

Parameter Type Required Description
file_path string Yes Absolute path to the file to read
offset integer No 1-indexed line number to start reading from (for files >1000 lines)
limit integer No Number of lines to read (use with offset)
@sunfmin
sunfmin / iam-architecture.md
Created December 24, 2025 09:55
iam-architecture.md

IAM Architecture for Admin Consoles

This document describes the Identity and Access Management (IAM) architecture for our suite of admin consoles (CMS, OMS, PIM, etc.). The architecture centralizes authentication and authorization through an API Gateway, allowing individual services to focus on business logic.

Table of Contents

  1. Overview
  2. Architecture
  3. Components
  4. Authentication Flows
@sunfmin
sunfmin / spec.md
Last active December 23, 2025 00:53

Feature Specification: Qortex IAM Console

Feature Branch: 001-iam-console
Created: 2025-12-18
Status: Draft
Input: Qortex IAM System Architecture Design

Overview

Qortex IAM is an independently deployable authentication and access management service providing unified capabilities for the Qortex product family (PIM, OIM, CIAM, Loyalty Console, Marketing Console):

import type {
FullConfig,
FullResult,
Reporter,
Suite,
TestCase,
TestResult,
} from '@playwright/test/reporter';
import * as path from 'path';
export default defineConfig({
maxFailures: 3,
reporter: './tests/e2e/utils/ai-reporter.ts', // Custom AI-friendly reporter
timeout: 5000, // 5s max per test - fail fast
expect: { timeout: 1000 }, // 1s for assertions
use: {
actionTimeout: 1000, // 1s for actions
baseURL: process.env.E2E_TARGET_URL || 'http://localhost:5173',
},
webServer: undefined, // NEVER let Playwright start the server
import type {
FullConfig,
FullResult,
Reporter,
Suite,
TestCase,
TestResult,
TestError,
} from '@playwright/test/reporter';
import * as path from 'path';
@sunfmin
sunfmin / QOR5.md
Last active October 4, 2021 14:54
  • It all starts with https://github.com/theplant/htmlgo

    • Typesafe, Compiled
    • Extract a go func become a component natually
    • Refactor very easy
    • Looks very html
  • It's crazy that we have all these backend template languages around: go template, mustache, jinja2, Laravel Blade...

    • Normally interpreted, Not type safe, error only appear on runtime
    • File based, your program/parser have to know the path of these template files, enormous amout of bugs created because of this.
  • Yet another language to learn, you forgot how to use it after a few months

@sunfmin
sunfmin / README.md
Created June 28, 2021 07:41
在Go里调用chiapos的静态库
mkdir build
cd build
cmake ../
cmake --build . --config=Release

在build/Release生成了 chiapos.libgochiapos.lib等文件

main.go

VAULT_ADDR=https://vault.theplant.dev vault login -method=oidc role=staff
VAULT_ADDR=https://vault.theplant.dev vault write -field=signed_key ssh-client-signer/sign/dev public_key=@$HOME/.ssh/id_rsa.pub > ~/.ssh/id_rsa-cert.pub -<< EOH
{
"valid_principals": "ubuntu,dev"
}
EOH
ssh-keygen -Lf ~/.ssh/id_rsa-cert.pub