Refine backlog policy and runtime guards
Move speculative framework items into Ideas and bump rc.14 Guard tgapi API/uploader setup and nil plugin registrations Add missing observer Event godoc
This commit is contained in:
@@ -32,7 +32,9 @@ Review the codebase with focus on:
|
|||||||
- Treat the wiki as the primary place for large design ideas, architectural drafts, and framework backlog notes.
|
- Treat the wiki as the primary place for large design ideas, architectural drafts, and framework backlog notes.
|
||||||
- If the agent identifies a substantial new concept or design direction, such as scenes, callback agents, a webhook model, or another framework-level abstraction, the agent must ask the user whether it should also formalize that idea as a draft wiki page.
|
- If the agent identifies a substantial new concept or design direction, such as scenes, callback agents, a webhook model, or another framework-level abstraction, the agent must ask the user whether it should also formalize that idea as a draft wiki page.
|
||||||
- When the user agrees, prefer paired wiki pages such as `Page.md` and `Page-RU.md`, and clearly mark draft design pages with `DRAFT` when the API is not implemented or not yet stable.
|
- When the user agrees, prefer paired wiki pages such as `Page.md` and `Page-RU.md`, and clearly mark draft design pages with `DRAFT` when the API is not implemented or not yet stable.
|
||||||
- Keep `TODO.md`, the wiki backlog pages, and `CHANGELOG.md` aligned when framework-level items move between planned and completed states.
|
- Keep `TODO.md`, the wiki backlog pages, and `CHANGELOG.md` aligned when framework-level items move between planned and completed states in the main repository.
|
||||||
|
- Wiki-only edits must never be added to `CHANGELOG.md`.
|
||||||
|
- `AGENTS.md`-only edits must never be added to `CHANGELOG.md`.
|
||||||
|
|
||||||
## Go review expectations
|
## Go review expectations
|
||||||
Check for:
|
Check for:
|
||||||
@@ -90,7 +92,8 @@ Prefer the repository’s documented commands. If multiple choices exist, use th
|
|||||||
|
|
||||||
## Versioning and changelog
|
## Versioning and changelog
|
||||||
- After every code or documentation change in the main repository, update `CHANGELOG.md`.
|
- After every code or documentation change in the main repository, update `CHANGELOG.md`.
|
||||||
- Changes made only inside the `.wiki/` repository do not require a `CHANGELOG.md` update.
|
- Changes made only inside the `.wiki/` repository must not be added to `CHANGELOG.md`.
|
||||||
|
- Changes made only in `AGENTS.md` must not be added to `CHANGELOG.md`.
|
||||||
- Add changes only to the section for the next version after the latest published git tag.
|
- Add changes only to the section for the next version after the latest published git tag.
|
||||||
- The agent must check the latest published tag, `CHANGELOG.md`, and `utils/version.go` before editing the changelog.
|
- The agent must check the latest published tag, `CHANGELOG.md`, and `utils/version.go` before editing the changelog.
|
||||||
- The agent must verify that the target changelog version matches the version declared in `utils/version.go`.
|
- The agent must verify that the target changelog version matches the version declared in `utils/version.go`.
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## v1.0.0-rc.14
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Added missing godoc for the exported observer `Event` marker interface.
|
||||||
|
|
||||||
## v1.0.0-rc.13
|
## v1.0.0-rc.13
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ Russian page:
|
|||||||
|
|
||||||
Current priority split:
|
Current priority split:
|
||||||
|
|
||||||
- `Priority 2`: service layer and dependency graph model.
|
- `Partial`: webhook runtime model.
|
||||||
- `Partial`: webhook runtime model, plugin composition contract.
|
- `Ideas`: service layer and dependency graph model, plugin composition contract.
|
||||||
|
|
||||||
Completed former high-priority items:
|
Completed former high-priority items:
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ const (
|
|||||||
HandlerSceneMessageKind HandlerEventKind = "scene_message"
|
HandlerSceneMessageKind HandlerEventKind = "scene_message"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Event is the marker interface implemented by all observer runtime events.
|
||||||
type Event interface {
|
type Event interface {
|
||||||
isEvent()
|
isEvent()
|
||||||
}
|
}
|
||||||
|
|||||||
+13
-1
@@ -18,7 +18,7 @@ const (
|
|||||||
CommandValueStringType CommandValueType = "string"
|
CommandValueStringType CommandValueType = "string"
|
||||||
// CommandValueIntType expects a decimal integer (digits only).
|
// CommandValueIntType expects a decimal integer (digits only).
|
||||||
CommandValueIntType CommandValueType = "int"
|
CommandValueIntType CommandValueType = "int"
|
||||||
// CommandValueBoolType is reserved for future use (not implemented).
|
// CommandValueBoolType expects a exact "true" or "false".
|
||||||
CommandValueBoolType CommandValueType = "bool"
|
CommandValueBoolType CommandValueType = "bool"
|
||||||
// CommandValueAnyType accepts any input without validation.
|
// CommandValueAnyType accepts any input without validation.
|
||||||
CommandValueAnyType CommandValueType = "any"
|
CommandValueAnyType CommandValueType = "any"
|
||||||
@@ -193,6 +193,12 @@ func NewPlugin[T AppData](name string) *Plugin[T] {
|
|||||||
// AddCommand registers a command in the plugin.
|
// AddCommand registers a command in the plugin.
|
||||||
// The command's .command field is used as the key.
|
// The command's .command field is used as the key.
|
||||||
func (p *Plugin[T]) AddCommand(command *Command[T]) *Plugin[T] {
|
func (p *Plugin[T]) AddCommand(command *Command[T]) *Plugin[T] {
|
||||||
|
if command == nil {
|
||||||
|
if p.logger != nil {
|
||||||
|
p.logger.Warnln("trying to add nil command")
|
||||||
|
}
|
||||||
|
return p
|
||||||
|
}
|
||||||
p.commands[command.command] = command
|
p.commands[command.command] = command
|
||||||
return p
|
return p
|
||||||
}
|
}
|
||||||
@@ -208,6 +214,12 @@ func (p *Plugin[T]) NewCommand(exec CommandExecutor[T], command string, args ...
|
|||||||
// AddPayload registers a payload (e.g., callback query data) in the plugin.
|
// AddPayload registers a payload (e.g., callback query data) in the plugin.
|
||||||
// Payloads are triggered by inline button callback_data, not by message text.
|
// Payloads are triggered by inline button callback_data, not by message text.
|
||||||
func (p *Plugin[T]) AddPayload(command *Command[T]) *Plugin[T] {
|
func (p *Plugin[T]) AddPayload(command *Command[T]) *Plugin[T] {
|
||||||
|
if command == nil {
|
||||||
|
if p.logger != nil {
|
||||||
|
p.logger.Warnln("trying to add nil command")
|
||||||
|
}
|
||||||
|
return p
|
||||||
|
}
|
||||||
p.payloads[command.command] = command
|
p.payloads[command.command] = command
|
||||||
return p
|
return p
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,6 +98,11 @@ type API struct {
|
|||||||
// Always call Close() when done to release resources.
|
// Always call Close() when done to release resources.
|
||||||
func NewAPI(opts *APIOpts) *API {
|
func NewAPI(opts *APIOpts) *API {
|
||||||
l := utils.CreateLogger("API", utils.GetLoggerLevel())
|
l := utils.CreateLogger("API", utils.GetLoggerLevel())
|
||||||
|
if opts == nil {
|
||||||
|
l.Errorln("Set API options")
|
||||||
|
_ = l.Close()
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
client := opts.client
|
client := opts.client
|
||||||
if client == nil {
|
if client == nil {
|
||||||
|
|||||||
@@ -71,6 +71,11 @@ type Uploader struct {
|
|||||||
// NewUploader creates a multipart uploader bound to an API client.
|
// NewUploader creates a multipart uploader bound to an API client.
|
||||||
func NewUploader(api *API) *Uploader {
|
func NewUploader(api *API) *Uploader {
|
||||||
logger := utils.CreateLogger("UPLOADER", utils.GetLoggerLevel())
|
logger := utils.CreateLogger("UPLOADER", utils.GetLoggerLevel())
|
||||||
|
if api == nil {
|
||||||
|
logger.Errorln("api is nil")
|
||||||
|
_ = logger.Close()
|
||||||
|
return nil
|
||||||
|
}
|
||||||
return &Uploader{api, logger}
|
return &Uploader{api, logger}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -2,7 +2,7 @@ package utils
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
// VersionString is the module version string.
|
// VersionString is the module version string.
|
||||||
VersionString = "1.0.0-rc.13"
|
VersionString = "1.0.0-rc.14"
|
||||||
// VersionMajor is the module major version.
|
// VersionMajor is the module major version.
|
||||||
VersionMajor = 1
|
VersionMajor = 1
|
||||||
// VersionMinor is the module minor version.
|
// VersionMinor is the module minor version.
|
||||||
@@ -10,5 +10,5 @@ const (
|
|||||||
// VersionPatch is the module patch version.
|
// VersionPatch is the module patch version.
|
||||||
VersionPatch = 0
|
VersionPatch = 0
|
||||||
// VersionBeta is the prerelease counter for the current version.
|
// VersionBeta is the prerelease counter for the current version.
|
||||||
VersionBeta = 13
|
VersionBeta = 14
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user